use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class ParserTest method testParseNilaryBlockNoTemps.
@Test
public void testParseNilaryBlockNoTemps() {
final Statement _node;
_node = Parser.factory.source_("[1 foo. 2 bar]").parseExpression();
assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
assertEquals((String) "\n[\n1 foo.\n2 bar]", (String) _node.prettySourceString());
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class ParserTest method testParse2ArgBlockWithTemps.
@Test
public void testParse2ArgBlockWithTemps() {
final Statement _node;
_node = Parser.factory.source_("[:a :b | | c | a foo. b bar. c foo]").parseExpression();
assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
assertEquals((String) "\n[:a :b | \n| c |\na foo.\nb bar.\nc foo]", (String) _node.prettySourceString());
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class ParserTest method testParseBinaryUnaryExpression.
@Test
public void testParseBinaryUnaryExpression() {
final Statement _node;
_node = Parser.factory.source_(" 3 bar + 2 + 1 foo").parseExpression();
assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BinaryMessageNode.factory));
assertEquals((String) "3 bar + 2 + 1 foo", (String) _node.prettySourceString());
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class ParserTest method testParseEmptyBlock.
@Test
public void testParseEmptyBlock() {
final Statement _node;
_node = Parser.factory.source_("[]").parseExpression();
assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
assertEquals((String) "[]", (String) _node.prettySourceString());
}
use of st.gravel.support.compiler.ast.Statement in project gravel by gravel-st.
the class ParserTest method testParseNilaryBlockWithTemps.
@Test
public void testParseNilaryBlockWithTemps() {
final Statement _node;
_node = Parser.factory.source_("[| a b | a foo. b bar]").parseExpression();
assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), BlockNode.factory));
assertEquals((String) "\n[\n| a b |\na foo.\nb bar]", (String) _node.prettySourceString());
}
Aggregations