Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add racc debugging ability.

  • Loading branch information...
commit 1c3b3287377f751171918e3daba90ef0fe9d0c75 1 parent b6ee8e6
@ntalbott ntalbott authored
View
2  Rakefile
@@ -15,7 +15,7 @@ task :regenerate do
if has_rex && has_racc
`rex lib/gherkin/parser/gherkin.rex -o lib/gherkin/parser/lexer.rb`
- `racc lib/gherkin/parser/gherkin.y -o lib/gherkin/parser/parser.rb`
+ `racc #{'--debug' if ENV['DEBUG_RACC']} lib/gherkin/parser/gherkin.y -o lib/gherkin/parser/parser.rb`
else
puts "You need both Rexical and Racc to do that. Install them by doing:"
puts
View
1  lib/gherkin/parser/gherkin.y
@@ -96,5 +96,6 @@ end
---- inner
def parse(input)
+ @yydebug = true if ENV['DEBUG_RACC']
scan_str(input)
end
View
1  lib/gherkin/parser/parser.rb
@@ -15,6 +15,7 @@ class Parser < Racc::Parser
module_eval(<<'...end gherkin.y/module_eval...', 'gherkin.y', 97)
def parse(input)
+ @yydebug = true if ENV['DEBUG_RACC']
scan_str(input)
end
...end gherkin.y/module_eval...
Please sign in to comment.
Something went wrong with that request. Please try again.