Closed jhart-r7 closed 8 years ago
Thanks for the report.
Only one of these warning is caused by non-generated code (the one in lexer.rb:118). A fix for that one was just pushed to the dev branch. A new release will be made tomorrow.
For the rest, I couldn't find options that could fix the generated output, and I'm hesitant to add a post-processing step to do it. This is clearly an issue with ragel.
I will investigate a little more to see if others had to deal with this before.
So I took a look at whitequark/parser's ragel compilation and they just disable indentation warnings in their generated source code using the warn-indent
magic comment. I think regexp_parser should use this too
Fixed with the release of 0.3.6
In some situations (TBD), while running unit tests for https://github.com/rapid7/recog/, we get warnings like:
I also got these with 0.2.1.
You can reproduce most of these with
ruby -we 'require "regexp_parser"; Regexp::Scanner.scan(/(foo)/) do |token_parts| puts "capture" if token_parts.first == :group && ![:close, :passive].include?(token_parts[1]); end'