Package seph.lang.ast

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


    @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());
    }

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


    @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());
    }

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

    @Test
    public void parsing_a_set_message_generates_a_correct_filename_line_and_position() {
        Message result = parse("\n\n  #{foo}", "aad.sp");
        assertEquals("aad.sp", result.filename());
        assertEquals(3, result.line());
        assertEquals(2, result.position());
    }

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

    @Test
    public void parsing_a_vector_message_generates_a_correct_filename_line_and_position() {
        Message result = parse("\n\n  #[foo]", "aad.sp");
        assertEquals("aad.sp", result.filename());
        assertEquals(3, result.line());
        assertEquals(2, result.position());
    }

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

    @Test
    public void parsing_a_range_generates_a_correct_filename_line_and_position() {
        Message result = parse("\n\n        ...", "aae.sp");
        assertEquals("aae.sp", result.filename());
        assertEquals(3, result.line());
        assertEquals(8, result.position());
    }

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

    @Test
    public void parses_a_regular_expression_and_adds_correct_positioning_information() {
        Message result = parse("\n\n\n %/foxy/", "boxy.sp");
        assertEquals("boxy.sp", result.filename());
        assertEquals(4, result.line());
        assertEquals(1, result.position());
    }

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

    @Test
    public void parses_a_regular_expression_and_adds_correct_positioning_information_with_alternative_syntax() {
        Message result = parse("\n\n\n %r[foxy]", "boxy2.sp");
        assertEquals("boxy2.sp", result.filename());
        assertEquals(4, result.line());
        assertEquals(1, result.position());
    }

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

    @Test
    public void parsing_an_empty_thing_generates_a_correct_filename_line_and_position() {
        Message result = parse("", "foo.sp");
        assertEquals("foo.sp", result.filename());
        assertEquals(0, result.line());
        assertEquals(0, result.position());
    }

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

    @Test
    public void parsing_a_message_generates_a_correct_filename_line_and_position() {
        Message result = parse("\n\n blarg", "fox.sp");
        assertEquals("fox.sp", result.filename());
        assertEquals(3, result.line());
        assertEquals(1, result.position());
    }

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

    @Test
    public void parsing_a_terminator_generates_a_correct_filename_line_and_position() {
        Message result = parse("\nblarg\n\nbra", "fox.sp").next();
        assertEquals("fox.sp", result.filename());
        assertEquals(3, result.line());
        assertEquals(-1, result.position());
    }

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