Sha256: a8110af886957c60f86009b28eb92a784daa5b8d9edbb56ac8f72d0b7d0e12ee

Contents?: true

Size: 545 Bytes

Versions: 7

Compression:

Stored size: 545 Bytes

Contents

# type: :dollar or :at
# ex_tag: "$<tag>1" (Optional)

module Lrama
  class Grammar
    class Reference < Struct.new(:type, :value, :ex_tag, :first_column, :last_column, :referring_symbol, :position_in_rhs, keyword_init: true)
      def tag
        if ex_tag
          ex_tag
        else
          # FIXME: Remove this class check
          if referring_symbol.is_a?(Symbol)
            referring_symbol.tag
          else
            # Lrama::Lexer::Token (User_code) case
            nil
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lrama-0.5.9 lib/lrama/grammar/reference.rb
lrama-0.5.8 lib/lrama/grammar/reference.rb
lrama-0.5.7 lib/lrama/grammar/reference.rb
lrama-0.5.6 lib/lrama/grammar/reference.rb
lrama-0.5.5 lib/lrama/grammar/reference.rb
lrama-0.5.4 lib/lrama/grammar/reference.rb
lrama-0.5.3 lib/lrama/grammar/reference.rb