summaryrefslogtreecommitdiff
path: root/parse.rb
diff options
context:
space:
mode:
Diffstat (limited to 'parse.rb')
-rw-r--r--parse.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.rb b/parse.rb
index 598aade..454bb14 100644
--- a/parse.rb
+++ b/parse.rb
@@ -33,7 +33,7 @@ end
Span = Struct.new(:left, :right)
class Item < Grammar::Rule
- attr_accessor :left, :right, :tail_spans, :dot
+ attr_accessor :left, :right, :tail_spans, :dot, :f
def initialize rule_or_item, left, right, dot
@lhs = Grammar::NT.new(rule_or_item.lhs.symbol, rule_or_item.lhs.index)
@@ -41,6 +41,7 @@ class Item < Grammar::Rule
@right = right
@rhs = []
@tail_spans = {}
+ @f = rule_or_item.f
@map = (rule_or_item.map ? rule_or_item.map.dup : [])
rule_or_item.rhs.each_with_index { |x,i|
if x.class == Grammar::T