Package st.gravel.support.compiler.ast

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


    assertEquals((String) "3 + 7", (String) _node.prettySourceString());
  }

  @Test
  public void testParseBinaryMethod() {
    final BinaryMethodNode _node;
    _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg ^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory));
    assertEquals((String) "+ arg\n\t^bar", (String) _node.prettySourceString());
  }
View Full Code Here


    assertTrue(st.gravel.support.jvm.IntegerExtensions.equals_(_node.value().length, 9));
  }

  @Test
  public void testParseMethodWithArgAndReturnType() {
    final BinaryMethodNode _node;
    _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {String} {^String}^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory));
    assertEquals((String) "+ arg {String} {^String}\n\t^bar", (String) _node.prettySourceString());
    assertTrue(_node.argument().type() != null);
    assertTrue(_node.returnType() != null);
  }
View Full Code Here

    assertTrue(_node.returnType() != null);
  }

  @Test
  public void testParseMethodWithArgType() {
    final BinaryMethodNode _node;
    _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {String} ^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory));
    assertEquals((String) "+ arg {String}\n\t^bar", (String) _node.prettySourceString());
    assertTrue(_node.argument().type() != null);
    assertTrue(_node.returnType() == null);
  }
View Full Code Here

    assertTrue(_node.returnType() == null);
  }

  @Test
  public void testParseMethodWithReturnType() {
    final BinaryMethodNode _node;
    _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {^String} ^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory));
    assertEquals((String) "+ arg {^String}\n\t^bar", (String) _node.prettySourceString());
  }
View Full Code Here

    assertEquals((String) "+ arg {^String}\n\t^bar", (String) _node.prettySourceString());
  }

  @Test
  public void testParseMethodWithReturnTypeWithSpace() {
    final BinaryMethodNode _node;
    _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {^ String} ^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory));
    assertEquals((String) "+ arg {^String}\n\t^bar", (String) _node.prettySourceString());
  }
View Full Code Here

    assertEquals((Object) null, (Object) _node.value()[0]);
  }

  @Test
  public void testParseOrType() {
    final BinaryMethodNode _node;
    _node = ((BinaryMethodNode) Parser.factory.parseMethod_("+ arg {String | Nil} ^bar"));
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMethodNode.factory));
    assertEquals((String) "+ arg {String | Nil}\n\t^bar", (String) _node.prettySourceString());
  }
View Full Code Here

TOP

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

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.