ruby_parser version 3.0.0.a7 has been released!
- rdoc: http://docs.seattlerb.org/ruby_parser
- home: https://github.com/seattlerb/ruby_parser
- bugs: https://github.com/seattlerb/ruby_parser/issues
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
becomes:
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)))))
Changes:
3.0.0.a7 / 2012-09-21
-
3 minor enhancements:
- Reorganized ruby_parse_extract_error so it will start much faster
with a bunch of glob directories - RubyParserStuff#process takes optional time arg and raises
Timeout::Error if it goes too long. You should rescue that, ya know… - ruby_parse_extract_error now checks *.rake and Rakefile on dir scan.
- Reorganized ruby_parse_extract_error so it will start much faster
-
3 bug fixes:
- 1.9: Fixed ternary state tracking so {a:f{f()},b:nil} won’t trip up
the lexer. - Fixed optional values in block args (no20/no21)
- ruby_parse_extract_error skips non-files. Some asshats put .rb on
their dirs.
- 1.9: Fixed ternary state tracking so {a:f{f()},b:nil} won’t trip up