Sha256: 9eb62e668d3647a6566bdd1a2f714703cd0f2e4237616042a0792712d83a034d

Contents?: true

Size: 966 Bytes

Versions: 4

Compression:

Stored size: 966 Bytes

Contents

require 'sfrp/error'

module SFRP
  module Raw
    class NameError < CompileError
      def initialize(target_str, source_position)
        @target_str = target_str
        @source_position = source_position
      end

      def message
        "Cannot resolve '#{@target_str}'"
      end
    end

    class AmbiguousNameError < CompileError
      def initialize(target_str, selection_strs, source_position)
        @target_str = target_str
        @selection_strs = selection_strs
        @source_position = source_position
      end

      def message
        "Ambiguous name '#{@target_str}':\n" +
        @selection_strs.map { |s| '  ' + s }.join("\n")
      end
    end

    class IllegalSideEffectError < CompileError
      def initialize(target_str, source_position)
        @target_str = target_str
        @source_position = source_position
      end

      def message
        "Don't call side-effect function '#{@target_str}'"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sfrp-1.4.0 lib/sfrp/raw/exception.rb
sfrp-1.2.1 lib/sfrp/raw/exception.rb
sfrp-1.2.0 lib/sfrp/raw/exception.rb
sfrp-1.1.0 lib/sfrp/raw/exception.rb