Goose  Diff

Differences From Artifact [e159ab76e7]:

  • File bs/parse/resolver.h — part of check-in [b3aeaae2df] at 2020-01-11 18:28:15 on branch trunk —
    • Moved the cfg and lifetime management stuff into a CodeBuilder object owned by sema::Context. This is in preparation to allow alternative implementations of the builder, for instance to build classes.
    • Pass the context to intrinsic functions, which removes their dependency to the parser the need for the ugly "GetCurrentParser" static function.
    (user: achavasse size: 2531)

To Artifact [c11f2a4ff6]:

  • File bs/parse/resolver.h — part of check-in [568c366a36] at 2020-06-26 23:34:09 on branch trunk — Cleanup:
    • Removed the poorly thought out "domain" system that was intended to allow for different implementations of functions for runtime and for compilation time, which was adding an absurd amount of crap everywhere and should be unnecessary with the current planned approach for implementing data structures.
    • The using statement doesn't do lazy parsing anymore. Lazy parsing is better left to specific constructs that require them (such as function bodies and later on class/structs). This removes the only case of significant newline character in the language.
    (user: achavasse size: 2215)

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
            const auto& context() const { return m_context; }
            auto& context() { return m_context; }

            bool eos() const;

            uint32_t currentLocation() { return m_tokProvider->currentLocation(); }

            // Consume the next token. Bound identifiers are resolved, newlines are filtered.
            optional< TermLoc > consume();

            // Consume the next token. No resolution is performed on identifiers, newlines are filtered.
            optional< TermLoc > consumeUnresolved();

            // Consume the next token. No resolution is performed on identifiers, newlines are not filtered.
            optional< TermLoc > consumeRaw();

            optional< TermLoc > lookAhead( size_t distance = 0 );
            optional< TermLoc > lookAheadUnresolved( size_t distance = 0 );
            optional< TermLoc > lookAheadRaw( size_t distance = 0 );

            // Consume newlines until a non newline token or eos is reached.
            void consumeNewLines();

            // Consume the next unit from the provider and yield each token that it contains.
            // An unit is:
            //   - any brace, paren or bracket block and every unit they contain
            //   - any other token
            Generator< TermLoc > consumeUnit();

            void clearLookAheadCache() const;







|


|


<
<
<




<
<
<







21
22
23
24
25
26
27
28
29
30
31
32
33



34
35
36
37



38
39
40
41
42
43
44
            const auto& context() const { return m_context; }
            auto& context() { return m_context; }

            bool eos() const;

            uint32_t currentLocation() { return m_tokProvider->currentLocation(); }

            // Consume the next token. Bound identifiers are resolved.
            optional< TermLoc > consume();

            // Consume the next token. No resolution is performed on identifiers.
            optional< TermLoc > consumeUnresolved();




            optional< TermLoc > lookAhead( size_t distance = 0 );
            optional< TermLoc > lookAheadUnresolved( size_t distance = 0 );
            optional< TermLoc > lookAheadRaw( size_t distance = 0 );




            // Consume the next unit from the provider and yield each token that it contains.
            // An unit is:
            //   - any brace, paren or bracket block and every unit they contain
            //   - any other token
            Generator< TermLoc > consumeUnit();

            void clearLookAheadCache() const;