fixes/statement_list.rb
# This works quite different from other fixes.
# This is also why it is called make_ and not fix_.
# In the input Ruby AST, like classic Pascal
# you have either single statement or begin block.
# So if we get begin Node, we just replace it with
# StatementListNode, otherwise we consider Node as
# a single statement and wrap it inside StatementListNode
# which will have the original node as a single child.
This works quite different from other fixes.
This is also why it is called make_ and not fix_.
In the input Ruby AST, like classic Pascal
you have either single statement or begin block.
So if we get begin Node, we just replace it with
StatementListNode, otherwise we consider Node as
a single statement and wrap it inside StatementListNode
which will have the original node as a single child.
This works quite different from other fixes . This is also why it is called make_ and not fix_ . In the input Ruby AST like classic Pascal you have either single statement or begin block . So if we get begin Node we just replace it with StatementListNode otherwise we consider Node as a single statement and wrap it inside StatementListNode which will have the original node as a single child .
def make_statement_list
    if symbol? 'begin' or is_a? BeginNode or is_a? BeginKeywordNode
      children = @children
    else
      children = [self]
    end
    return StatementListNode.new ruby_node, children
  end
def make_statement_list if symbol? 'begin' or is_a? BeginNode or is_a? BeginKeywordNode children = @children else children = [ self ] end return StatementListNode . new ruby_node , children end
This works quite different from other fixes.
This works quite different from other fixes .