summaryrefslogtreecommitdiff
path: root/grammar.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-05-25 14:32:43 +0200
committerPatrick Simianer <p@simianer.de>2014-05-25 14:32:43 +0200
commitbe7f27e84ae2e18e9843808b72c2627b7b999d16 (patch)
tree6709accfb1b78a90d0c5e03f6ec645073d018e41 /grammar.rb
parent117f3c7a8809277f236884f3a25ce514ec386eb7 (diff)
faster self-fill, NT span
Diffstat (limited to 'grammar.rb')
-rw-r--r--grammar.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/grammar.rb b/grammar.rb
index 52d0fba..a674a7b 100644
--- a/grammar.rb
+++ b/grammar.rb
@@ -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