Sha256: 73fd0018ea94ee0db47243daeea71b4a1f07de763b43dab0a36e4d50219589fb

Contents?: true

Size: 349 Bytes

Versions: 6

Compression:

Stored size: 349 Bytes

Contents

module Lrama
  class Grammar
    # type: :dollar or :at
    # name: String (e.g. $$, $foo, $expr.right)
    # index: Integer (e.g. $1)
    # ex_tag: "$<tag>1" (Optional)
    class Reference < Struct.new(:type, :name, :index, :ex_tag, :first_column, :last_column, keyword_init: true)
      def value
        name || index
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lrama-0.6.2 lib/lrama/grammar/reference.rb
lrama-0.6.1 lib/lrama/grammar/reference.rb
lrama-0.6.0 lib/lrama/grammar/reference.rb
lrama-0.5.12 lib/lrama/grammar/reference.rb
lrama-0.5.11 lib/lrama/grammar/reference.rb
lrama-0.5.10 lib/lrama/grammar/reference.rb