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