ruby_parser version 3.0.0.a6 has been released!
Published 2012-08-20 @ 16:41
ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc–which does by default use a C extension). RP’s output is the same as ParseTree’s output: s-expressions using ruby’s arrays and base types.
As an example:
def conditional1(arg1) if arg1 == 0 then return 1 end return 0 end
s(:defn, :conditional1, s(:args, :arg1), s(:scope, s(:block, s(:if, s(:call, s(:lvar, :arg1), :==, s(:arglist, s(:lit, 0))), s(:return, s(:lit, 1)), nil), s(:return, s(:lit, 0)))))
3.0.0.a6 / 2012-08-20
2 minor enhancements:
- 1.8: Added basic encoding support to 1.8 parser. Assumes -Ku.
- 1.9: Added encoding magic comment support to 1.9 parser.
8 bug fixes:
- 1.9: Fixed lexing of -1 w/in conditionals. yeah… I dunno.
1.9: Fixed parsing of a do end.
- 1.9: Fixed parsing of not(x).
1.9: Fixed parsing of op_asgn + rescue: ‘a = b rescue nil’
- 1.9: added \r to the EOL backslash handler. dos files blow
- 1.9: hacked in a workaround for 1.9 specific regexps running in 1.8.
- Added #reset to RubyParser proxy class
- Fixed lexing of conditional w/ %() tokens
- bugs: https://github.com/seattlerb/ruby_parser/issues
- home: https://github.com/seattlerb/ruby_parser
- rdoc: http://docs.seattlerb.org/ruby_parser