Search in sources :

Example 1 with UnaryMessageNode

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

the class ParserTest method testParseUnaryExpression.

@Test
public void testParseUnaryExpression() {
    final UnaryMessageNode _node;
    _node = ((UnaryMessageNode) Parser.factory.source_(" 3 foo ").parseExpression());
    assertTrue(st.gravel.support.jvm.ObjectExtensions.equals_(_node.factory(), UnaryMessageNode.factory));
    assertEquals((String) "3 foo", (String) _node.prettySourceString());
}
Also used : UnaryMessageNode(st.gravel.support.compiler.ast.UnaryMessageNode) Test(org.junit.Test)

Example 2 with UnaryMessageNode

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

the class MessageSendRewriter method visitUnaryMessageNode_.

@Override
public Statement visitUnaryMessageNode_(final UnaryMessageNode _anObject) {
    final st.gravel.core.Symbol _selector;
    final st.gravel.support.jvm.Block1<Statement, MessageNode> _res;
    _selector = st.gravel.core.Symbol.value(_anObject.selector());
    st.gravel.support.jvm.Block1<Statement, MessageNode> _temp1 = _specialSelectors.get(_selector);
    _res = ((st.gravel.support.jvm.Block1<Statement, MessageNode>) _temp1);
    if (_res != null) {
        final Statement _trans;
        _trans = _res.value_(_anObject);
        if (_trans != null) {
            return _trans;
        }
    }
    return super.visitUnaryMessageNode_(_anObject);
}
Also used : BinaryMessageNode(st.gravel.support.compiler.ast.BinaryMessageNode) MessageNode(st.gravel.support.compiler.ast.MessageNode) UnaryMessageNode(st.gravel.support.compiler.ast.UnaryMessageNode) KeywordMessageNode(st.gravel.support.compiler.ast.KeywordMessageNode) Statement(st.gravel.support.compiler.ast.Statement)

Aggregations

UnaryMessageNode (st.gravel.support.compiler.ast.UnaryMessageNode)2 Test (org.junit.Test)1 BinaryMessageNode (st.gravel.support.compiler.ast.BinaryMessageNode)1 KeywordMessageNode (st.gravel.support.compiler.ast.KeywordMessageNode)1 MessageNode (st.gravel.support.compiler.ast.MessageNode)1 Statement (st.gravel.support.compiler.ast.Statement)1