Has anyone figured out how to detect errors when malformed input is given to Ruby\'s ripper library? ruby-1.9.2-p180 :002 > Ripper.sexp(\"array[1 2]\")
I\'开发者_JAVA技巧m using the Ruby 1.9 Ripper library to analyze specific parts of a source code by building it\'s sexp tree. From what I know, Ripper just uses a lexer / parser to do this.
Ripper is the the parsing library that ships with Ruby 1.9.It transforms Ruby code into an AST, like so:
小丫么小二郎么呀 2022-03-30 17:22 开发者_如何学C顺便说一下 我也姓吉duskshine