Package seph.lang.ast

Examples of seph.lang.ast.Message


        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void minus_minus_parses_correctly_in_method_call_as_message_send_with_receiver() {
        Message m = parse("foo(--(a))");
        Message expected = msg("foo", PersistentList.create(Arrays.asList(msg("--", PersistentList.create(Arrays.asList(msg("a")))))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here


        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void minus_minus_parses_correctly_combined_with_assignment() {
        Message m = parse("foo x = a--");
        Message expected = msg("foo", msg("=", PersistentList.create(Arrays.asList(msg("x"), msg("--", PersistentList.create(Arrays.asList(msg("a"))))))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void minus_minus_parses_correctly_combined_with_assignment_and_receiver() {
        Message m = parse("foo x = fox a--");
        Message expected = msg("foo", msg("=", PersistentList.create(Arrays.asList(msg("x"), msg("fox", msg("--", PersistentList.create(Arrays.asList(msg("a")))))))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

        return Arrays.asList(data);
    }

    @Test
    public void operator_should_be_translated_correctly_as_argument() {
        Message m = parse("method(foo " + operator + " bar)");
        Message expected = msg("method", PersistentList.create(Arrays.asList(msg("foo", msg(operator, PersistentList.create(Arrays.asList(msg("bar"))))))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void operator_should_be_translated_correctly_as_nested_argument() {
        Message m = parse("method1(method2(foo " + operator + " bar))");
        Message expected = msg("method1", PersistentList.create(Arrays.asList(msg("method2", PersistentList.create(Arrays.asList(msg("foo", msg(operator, PersistentList.create(Arrays.asList(msg("bar")))))))))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void operator_should_be_translated_correctly_within_something_else() {
        Message m = parse("method(n, if(foo " + operator + " bar, n, n))");
        Message expected = msg("method", PersistentList.create(Arrays.asList(msg("n"), msg("if", PersistentList.create(Arrays.asList(msg("foo", msg(operator, PersistentList.create(Arrays.asList(msg("bar"))))), msg("n"), msg("n")))))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void operator_should_be_translated_correctly_in_simple_version() {
        Message m = parse("foo " + operator + " bar");
        Message expected = msg("foo", msg(operator, PersistentList.create(Arrays.asList(msg("bar")))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

        assertThat(m, is(equalTo(expected)));
    }

    @Test
    public void operator_should_not_be_translated_when_already_given_argument() {
        Message m = parse("foo " + operator + "(bar)");
        Message expected = msg("foo", msg(operator, PersistentList.create(Arrays.asList(msg("bar")))));
        assertThat(m, is(equalTo(expected)));
    }
View Full Code Here

        assertEquals(10, result.position());
    }

    @Test
    public void parsing_a_square_message_generates_a_correct_filename_line_and_position() {
        Message result = parse("\n\n    [foo]", "aab.sp");
        assertEquals("aab.sp", result.filename());
        assertEquals(3, result.line());
        assertEquals(4, result.position());
    }
View Full Code Here

        assertEquals(4, result.position());
    }

    @Test
    public void parsing_a_curly_message_generates_a_correct_filename_line_and_position() {
        Message result = parse("\n\n   {foo}", "aac.sp");
        assertEquals("aac.sp", result.filename());
        assertEquals(3, result.line());
        assertEquals(3, result.position());
    }
View Full Code Here

TOP

Related Classes of seph.lang.ast.Message

Copyright © 2018 www.massapicom. 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.