Skip to content

Commit

Permalink
Switched the EBNF plus operator back to its old form.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswailes committed Apr 1, 2014
1 parent 2d46e92 commit 917c46c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rltk/cfg.rb
Expand Up @@ -339,7 +339,7 @@ def get_plus(symbol)
@callback.call(:+, :first, production)

# 2nd production
production = self.add_production(Production.new(self.next_id, new_symbol, [new_symbol, symbol]))
production = self.add_production(Production.new(self.next_id, new_symbol, [symbol, new_symbol]))
@callback.call(:+, :second, production)

# Add the new symbol to the list of nonterminals.
Expand Down
4 changes: 2 additions & 2 deletions lib/rltk/parser.rb
Expand Up @@ -129,8 +129,8 @@ def install_icvars

when :+
case num
when :first then ClauseProc.new { |o| [o] }
else ClauseProc.new { |os, o| os << o }
when :first then ClauseProc.new { |o| [o] }
else ClauseProc.new { |o, os| [o] + os }
end

when :'?'
Expand Down

0 comments on commit 917c46c

Please sign in to comment.