Search in sources :

Example 1 with IntegerLiteralNode

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

the class ParserTest method testParseNegativeInteger.

@Test
public void testParseNegativeInteger() {
    final IntegerLiteralNode _node;
    _node = ((IntegerLiteralNode) Parser.factory.source_("-123").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) IntegerLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals(-123, (int) _node.value());
}
Also used : IntegerLiteralNode(st.gravel.support.compiler.ast.IntegerLiteralNode) Test(org.junit.Test)

Example 2 with IntegerLiteralNode

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

the class ParserTest method testParseIntegerSpace.

@Test
public void testParseIntegerSpace() {
    final IntegerLiteralNode _node;
    _node = ((IntegerLiteralNode) Parser.factory.source_("123 ").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) IntegerLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals(123, (int) _node.value());
}
Also used : IntegerLiteralNode(st.gravel.support.compiler.ast.IntegerLiteralNode) Test(org.junit.Test)

Example 3 with IntegerLiteralNode

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

the class ParserTest method testParseInteger.

@Test
public void testParseInteger() {
    final IntegerLiteralNode _node;
    _node = ((IntegerLiteralNode) Parser.factory.source_("123").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) IntegerLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals(123, (int) _node.value());
}
Also used : IntegerLiteralNode(st.gravel.support.compiler.ast.IntegerLiteralNode) Test(org.junit.Test)

Example 4 with IntegerLiteralNode

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

the class ParserTest method testParseHexInteger.

@Test
public void testParseHexInteger() {
    final IntegerLiteralNode _node;
    _node = ((IntegerLiteralNode) Parser.factory.source_("16rFF").parseExpression());
    assertEquals((st.gravel.support.jvm.SmalltalkFactory) IntegerLiteralNode.factory, (st.gravel.support.jvm.SmalltalkFactory) _node.factory());
    assertEquals(255, (int) _node.value());
}
Also used : IntegerLiteralNode(st.gravel.support.compiler.ast.IntegerLiteralNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 IntegerLiteralNode (st.gravel.support.compiler.ast.IntegerLiteralNode)4