Package st.gravel.support.compiler.ast

Examples of st.gravel.support.compiler.ast.BinaryMethodNode.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());
  }

  @Test
  public void testParseBinaryUnaryExpression() {
    final Statement _node;
View Full Code Here


  @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);
  }

  @Test
View Full Code Here

  @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);
  }

  @Test
View Full Code Here

  @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());
  }

  @Test
  public void testParseMethodWithReturnTypeWithSpace() {
    final BinaryMethodNode _node;
View Full Code Here

  @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());
  }

  @Test
  public void testParseNamespacedVariable() {
    final NamespacedVariableNode _node;
View Full Code Here

  @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());
  }

  @Test
  public void testParseReturn() {
    final Statement _node;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.