diff options
author | Patrick Simianer <p@simianer.de> | 2014-05-25 14:32:43 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-05-25 14:32:43 +0200 |
commit | be7f27e84ae2e18e9843808b72c2627b7b999d16 (patch) | |
tree | 6709accfb1b78a90d0c5e03f6ec645073d018e41 /grammar.rb | |
parent | 117f3c7a8809277f236884f3a25ce514ec386eb7 (diff) |
faster self-fill, NT span
Diffstat (limited to 'grammar.rb')
-rw-r--r-- | grammar.rb | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -14,15 +14,16 @@ class T end class NT - attr_accessor :symbol, :index + attr_accessor :symbol, :index, :span def initialize symbol, index=0 @symbol = symbol @index = index + @span = Span.new end def to_s - "NT<#{@symbol},#{@index}>" + "NT(#{@span.left},#{@span.right})<#{@symbol},#{@index}>" end end |