Examples of prettySourceString()


Examples of st.gravel.support.compiler.ast.ArrayLiteralNode.prettySourceString()

  @Test
  public void testParseLiteralArray() {
    final ArrayLiteralNode _node;
    _node = ((ArrayLiteralNode) Parser.factory.source_("#(#foo foo \'foo\' 1 (a b c) #( a b c) ((x)) () #[1 2 3])").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), ArrayLiteralNode.factory));
    assertEquals((String) "#(#foo #foo \'foo\' 1 #(#a #b #c) #(#a #b #c) #(#(#x)) #() #[1 2 3])", (String) _node.prettySourceString());
    assertTrue(st.gravel.support.jvm.IntegerExtensions.equals_(_node.value().length, 9));
  }

  @Test
  public void testParseMethodWithArgAndReturnType() {
View Full Code Here

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

Examples of st.gravel.support.compiler.ast.BinaryMethodNode.prettySourceString()

  @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

Examples of st.gravel.support.compiler.ast.BinaryMethodNode.prettySourceString()

  @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

Examples of st.gravel.support.compiler.ast.BinaryMethodNode.prettySourceString()

  @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

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

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

Examples of st.gravel.support.compiler.ast.BinaryMethodNode.prettySourceString()

  @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

Examples of st.gravel.support.compiler.ast.BlockNode.prettySourceString()

  @Test
  public void testParse2ArgBlockEmpty1() {
    final BlockNode _node;
    _node = ((BlockNode) Parser.factory.source_("[:a :b  | ]").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
    assertEquals((String) "[:a :b | ]", (String) _node.prettySourceString());
  }

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

Examples of st.gravel.support.compiler.ast.BlockNode.prettySourceString()

  @Test
  public void testParseVariableDot() {
    final BlockNode _node;
    _node = ((BlockNode) Parser.factory.source_(" [foo. bar] ").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
    assertEquals((String) "\n[\nfoo.\nbar]", (String) _node.prettySourceString());
  }
}
View Full Code Here

Examples of st.gravel.support.compiler.ast.ByteArrayLiteralNode.prettySourceString()

  @Test
  public void testParseByteArray() {
    final ByteArrayLiteralNode _node;
    _node = ((ByteArrayLiteralNode) Parser.factory.source_("#[1 2 3]").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), ByteArrayLiteralNode.factory));
    assertEquals((String) "#[1 2 3]", (String) _node.prettySourceString());
    assertTrue(st.gravel.support.jvm.ByteArrayExtensions.equals_(_node.value(), new byte[] { 1, 2, 3 }));
  }

  @Test
  public void testParseByteArrayHighValues() {
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.