Code Review: ParseTree5

tfpt review “/shelveset:ParseTree5;REDMOND\tomat”
Comment :
Bunch of tweaks to AST:

  • removes some nodes that are notneeded any more,
  • moves block argument out of Arguments to CallExpression,

Fixes several bugs:

  • order of evaluation in “(x,y) while z”,
  • passing parameters to a super method when a block is specified
    “super {}”,
  • yield should report an error when a block argument is given “yield

Implements ParseTree library

  • there are few nodes that are to be finished,
  • in some cases the generated parse tree deosn’t exactly match MRI
    (some of which I consider bugs in MRI),
  • adds ir_parse_tree.rb that implements the same API as parse_tree.rb
    calling to IronRuby for tree transformation,
  • only string parsing is supported now, getting AST from method/class
    at runtime is not yet implemented.


In ir_parse_tree.rb, there’s code near the bottom that’s ‘if
RUBY_VERSION > “1.9”’. Is that version check a typo or does it actually
reflect differences between 1.9 and 1.9.1?

Otherwise, changes look good. And exciting!

ir_parse_tree.rb is just a copy of parse_tree.rb from ParseTree gem with
C code replaced by a call to IronRuby. I haven’t modified anything other
than that.