Package seph.lang.ast

Examples of seph.lang.ast.Message.arguments()


        assertEquals("foo ", ((Text)((Message)result.arguments().seq().first()).literal()).text());
        assertEquals("foo", ((Message)result.arguments().seq().more().first()).name());
        assertEquals("bar", ((Message)result.arguments().seq().more().first()).next().name());
        assertEquals("internal:concatenateText", ((Message)((Message)result.arguments().seq().more().first()).next().arguments().seq().first()).name());
        assertEquals("blarg", ((Text)((Message)((Message)((Message)result.arguments().seq().more().first()).next().arguments().seq().first()).arguments().seq().first()).literal()).text());
        assertEquals("bux", ((Message)((Message)((Message)result.arguments().seq().more().first()).next().arguments().seq().first()).arguments().seq().more().first()).name());
        assertEquals(" bar", ((Text)((Message)result.arguments().seq().more().more().first()).literal()).text());
    }

    @Test
    public void handles_unicode_escape_in_text() {
View Full Code Here


        assertEquals("foo", ((Message)result.arguments().seq().more().first()).name());
        assertEquals("bar", ((Message)result.arguments().seq().more().first()).next().name());
        assertEquals("internal:concatenateText", ((Message)((Message)result.arguments().seq().more().first()).next().arguments().seq().first()).name());
        assertEquals("blarg", ((Text)((Message)((Message)((Message)result.arguments().seq().more().first()).next().arguments().seq().first()).arguments().seq().first()).literal()).text());
        assertEquals("bux", ((Message)((Message)((Message)result.arguments().seq().more().first()).next().arguments().seq().first()).arguments().seq().more().first()).name());
        assertEquals(" bar", ((Text)((Message)result.arguments().seq().more().more().first()).literal()).text());
    }

    @Test
    public void handles_unicode_escape_in_text() {
        Message result = parse("\"foo \\uABCD\"");
View Full Code Here

    @Test
    public void simple_curly_bracket_application_with_arguments_should_work() {
        Message result = parse("{}(foo)");
        assertEquals("{}", result.name());
        assertEquals("foo", ((Message)result.arguments().seq().first()).name());
        assertNull(result.next());
    }

    @Test
    public void parse_curly_brackets_correctly_as_part_of_longer_message_chain() {
View Full Code Here

    @Test
    public void simple_curly_bracket_without_parenthesis_should_be_parsed_correctly() {
        Message result = parse("{}");
        assertEquals("{}", result.name());
        assertEquals(PersistentList.EMPTY, result.arguments());
        assertNull(result.next());
    }

    @Test
    public void simple_curly_bracket_without_parenthesis_with_spaces_inbetween_should_be_parsed_correctly() {
View Full Code Here

    @Test
    public void simple_curly_bracket_without_parenthesis_with_spaces_inbetween_should_be_parsed_correctly() {
        Message result = parse("{   }");
        assertEquals("{}", result.name());
        assertEquals(PersistentList.EMPTY, result.arguments());
        assertNull(result.next());
    }

    @Test
    public void simple_curly_bracket_without_parenthesis_with_argument_should_be_parsed_correctly() {
View Full Code Here

    @Test
    public void simple_curly_bracket_without_parenthesis_with_argument_should_be_parsed_correctly() {
        Message result = parse("{foo}");
        assertEquals("{}", result.name());
        assertEquals("foo", ((Message)result.arguments().seq().first()).name());
        assertNull(result.next());
    }

    @Test
    public void simple_curly_bracket_without_parenthesis_with_argument_and_spaces_should_be_parsed_correctly() {
View Full Code Here

    @Test
    public void simple_curly_bracket_without_parenthesis_with_argument_and_spaces_should_be_parsed_correctly() {
        Message result = parse("{   foo   }");
        assertEquals("{}", result.name());
        assertEquals("foo", ((Message)result.arguments().seq().first()).name());
        assertNull(result.next());
    }


    @Test
View Full Code Here

    @Test
    public void simple_curly_bracket_without_parenthesis_with_arguments_should_be_parsed_correctly() {
        Message result = parse("{foo, bar}");
        assertEquals("{}", result.name());
        assertEquals("foo", ((Message)result.arguments().seq().first()).name());
        assertEquals("bar", ((Message)result.arguments().seq().more().first()).name());
        assertNull(result.next());
    }

    @Test
View Full Code Here

    @Test
    public void simple_curly_bracket_without_parenthesis_with_arguments_should_be_parsed_correctly() {
        Message result = parse("{foo, bar}");
        assertEquals("{}", result.name());
        assertEquals("foo", ((Message)result.arguments().seq().first()).name());
        assertEquals("bar", ((Message)result.arguments().seq().more().first()).name());
        assertNull(result.next());
    }

    @Test
    public void simple_curly_bracket_can_be_parsed_with_terminators_inside() {
View Full Code Here

    @Test
    public void simple_curly_bracket_can_be_parsed_with_terminators_inside() {
        Message result = parse("{bar, \nfoo(quux)}");
        assertEquals("{}", result.name());
        assertEquals("bar", ((Message)result.arguments().seq().first()).name());
        assertEquals("foo", ((Message)result.arguments().seq().more().first()).name());
        assertEquals("quux", ((Message)((Message)result.arguments().seq().more().first()).arguments().seq().first()).name());
        assertNull(result.next());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.