Search in sources :

Example 1 with BinaryMethodNode

use of st.gravel.support.compiler.ast.BinaryMethodNode in project gravel by gravel-st.

the class ParserTest method testParseOrType.

@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());
}
Also used : BinaryMethodNode(st.gravel.support.compiler.ast.BinaryMethodNode) Test(org.junit.Test)

Example 2 with BinaryMethodNode

use of st.gravel.support.compiler.ast.BinaryMethodNode in project gravel by gravel-st.

the class ParserTest method testParseBinaryMethod.

@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());
}
Also used : BinaryMethodNode(st.gravel.support.compiler.ast.BinaryMethodNode) Test(org.junit.Test)

Example 3 with BinaryMethodNode

use of st.gravel.support.compiler.ast.BinaryMethodNode in project gravel by gravel-st.

the class ParserTest method testParseMethodWithReturnType.

@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());
}
Also used : BinaryMethodNode(st.gravel.support.compiler.ast.BinaryMethodNode) Test(org.junit.Test)

Example 4 with BinaryMethodNode

use of st.gravel.support.compiler.ast.BinaryMethodNode in project gravel by gravel-st.

the class ParserTest method testParseMethodWithArgAndReturnType.

@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);
}
Also used : BinaryMethodNode(st.gravel.support.compiler.ast.BinaryMethodNode) Test(org.junit.Test)

Example 5 with BinaryMethodNode

use of st.gravel.support.compiler.ast.BinaryMethodNode in project gravel by gravel-st.

the class ParserTest method testParseMethodWithReturnTypeWithSpace.

@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());
}
Also used : BinaryMethodNode(st.gravel.support.compiler.ast.BinaryMethodNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 BinaryMethodNode (st.gravel.support.compiler.ast.BinaryMethodNode)6