summaryrefslogtreecommitdiff
path: root/grammar.rb
diff options
context:
space:
mode:
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