# Code Review: RubyAST

**URL:** <https://www.ruby-forum.com/t/code-review-rubyast/145975>\
**Category:** IronRuby\
**Created:** [August 15, 2008, 6:24pm UTC](https://www.ruby-forum.com/t/code-review-rubyast/145975 "2008-08-15T18:24:42Z")\
**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:** [August 15, 2008, 6:24pm UTC](https://www.ruby-forum.com/t/code-review-rubyast/145975/1 "2008-08-15T18:24:42Z")

</div>

tfpt review “/shelveset:RubyAST;REDMOND\tomat”

Merges Statement with Expression in AST. Gets rid of ExpressionStatement  
to make ASTs smaller.  
Any AST expression can be now emitted as statement (i.e. we don’t need  
its value) by Transform method and any statement can be emitted as  
expression by TransformRead method.

Notes:  
The grammar considers a construct a syntactic statement if the grammar  
doesn’t allow it to be read in an assignment rhs or pass it as an  
argument to a method call.  
For example,

a = return 1  
foo(return 1)  
foo(1 if false)

are not valid Ruby statements, therefore 'return ’ and ’ if  
’ are syntactic statements.

If a statement is used in begin … end or (…) block as the last  
statement its value becomes the value of the block. This way a value of  
some statements can be retrieved (e.g. alias foo bar, undef x, if  
, while ). Most of such statements have nil value,  
some of them however might evaluate to a non-nil value (e.g. if  
).

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:** [August 15, 2008, 6:48pm UTC](https://www.ruby-forum.com/t/code-review-rubyast/145975/2 "2008-08-15T18:48:43Z")

</div>

Finalizer.cs and Initializer.cs still contain empty //TODO: comments.  
It’s not obvious to me from the context what should be TODO.  
Otherwise looks great.

–  
Oleg

---

<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:** [August 15, 2008, 6:51pm UTC](https://www.ruby-forum.com/t/code-review-rubyast/145975/3 "2008-08-15T18:51:38Z")

</div>

The nodes are not implemented at all.

Tomas
