Package st.gravel.support.compiler.ast

Examples of st.gravel.support.compiler.ast.VariableNode


  public Statement produceBlock_arguments_(final BlockNode _block, final Expression[] _arguments) {
    final SequenceNode[] _body;
    final Statement[] _stmts;
    final Expression[] _argTemps;
    final VariableNode _result;
    final Statement _lastStatement;
    _body = new SequenceNode[1];
    _body[0] = _block.body();
    if (_body[0].statements().length == 0) {
      return NilLiteralNode.factory.basicNew();
    }
    for (final VariableDeclarationNode _temp : _block.body().temporaries()) {
      _body[0] = ((SequenceNode) VariableRenamer.factory.in_rename_to_(_body[0], _temp.name(), LiteralSendInliner.this.newTempSuggestion_(_temp.name()).name()));
    }
    _argTemps = st.gravel.support.jvm.ArrayExtensions.collect_(_arguments, ((st.gravel.support.jvm.Block1<Expression, Expression>) (new st.gravel.support.jvm.Block1<Expression, Expression>() {

      @Override
      public Expression value_(final Expression _each) {
        if (_each.isVariableNode()) {
          return _each;
        } else {
          final VariableNode _t;
          _t = LiteralSendInliner.this.newTempSuggestion_("extract");
          LiteralSendInliner.this.extraEmit_(LocalWriteNode.factory.name_value_(_t.name(), _each));
          return _t;
        }
      }
    })));
    _stmts = _body[0].statements();
View Full Code Here


    assertEquals((String) "foo\n\tself baz.\n\t^bar", (String) _node.prettySourceString());
  }

  @Test
  public void testParseVariable() {
    final VariableNode _node;
    _node = ((VariableNode) Parser.factory.source_(" foo ").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), VariableNode.factory));
    assertEquals((String) "foo", (String) _node.prettySourceString());
  }
View Full Code Here

TOP

Related Classes of st.gravel.support.compiler.ast.VariableNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.