Package seph.lang.ast

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


    @Test
    public void simple_square_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_square_brackets_correctly_as_part_of_longer_message_chain() {
View Full Code Here


    @Test
    public void simple_square_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_square_bracket_without_parenthesis_with_spaces_inbetween_should_be_parsed_correctly() {
View Full Code Here

    @Test
    public void simple_square_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_square_bracket_without_parenthesis_with_argument_should_be_parsed_correctly() {
View Full Code Here

    @Test
    public void simple_square_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_square_bracket_without_parenthesis_with_argument_and_spaces_should_be_parsed_correctly() {
View Full Code Here

    @Test
    public void simple_square_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_square_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_square_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_square_bracket_can_be_parsed_with_terminators_inside() {
View Full Code Here

    @Test
    public void simple_square_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

    @Test
    public void simple_square_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());
    }

    @Test
View Full Code Here

    public void simple_square_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());
    }

    @Test
    public void parses_square_brackets_correctly_after_an_identifier() {
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.