# Code Review: ParseTree5

**URL:** <https://www.ruby-forum.com/t/code-review-parsetree5/151411>\
**Category:** IronRuby\
**Created:** [October 21, 2008, 5:07am UTC](https://www.ruby-forum.com/t/code-review-parsetree5/151411 "2008-10-21T05:07:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [October 21, 2008, 5:07am UTC](https://www.ruby-forum.com/t/code-review-parsetree5/151411/1 "2008-10-21T05:07:48Z")

</div>

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  
&p”

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.

Tomas

---

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [October 21, 2008, 5:51am UTC](https://www.ruby-forum.com/t/code-review-parsetree5/151411/2 "2008-10-21T05:51:04Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [October 22, 2008, 2:37am UTC](https://www.ruby-forum.com/t/code-review-parsetree5/151411/3 "2008-10-22T02:37:55Z")

</div>

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.

Tomas
