Goose  Diff

Differences From Artifact [fb88cd47e9]:

  • File bs/parse/parser.cpp — part of check-in [f78ccdd8a8] at 2019-04-14 14:53:50 on branch trunk — Fixed a few bugs and started to turn the haphazard test code into proper, automated tests of the core language features. (user: achavasse size: 5405)

To Artifact [746f1fa0b1]:

  • File bs/parse/parser.cpp — part of check-in [105ba83ebf] at 2019-07-07 16:22:51 on branch trunk — Parser: parse function type modifiers. (user: achavasse size: 5515)

27
28
29
30
31
32
33






34

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47
48


49
50
51
52
53
54
55







+
+
+
+
+
+
-
+








-
-







    auto next = m_resolver->lookAhead();
    if( !next )
        return false;

    if( !parsePrefix( *next, precedence ) )
        return false;

    parsePostfixExpression( precedence );
    return true;
}

void Parser::parsePostfixExpression( uint32_t precedence )
{
    while( next = m_resolver->lookAhead() )
    while( auto next = m_resolver->lookAhead() )
    {
        auto prec = getPrecedence( *next );
        if( !prec || precedence > *prec )
            break;

        if( !parseInfix( *next, *prec ) )
            break;
    }

    return true;
}

void Parser::flushValue()
{
    // Flush the pending value's llr as a standalone instruction,
    // if any. If it is a constant, complain about discarding it.
    if( !m_lastValue )