Differences From Artifact [b58c67a065]:
- File bs/parse/resolver.h — part of check-in [1cdacffc17] at 2019-02-12 21:53:39 on branch trunk — Implemented function declarations. (user: achavasse size: 1478)
To Artifact [e6f981f04f]:
- File
bs/parse/resolver.h
— part of check-in
[23e0cd5dc7]
at
2019-02-18 21:54:23
on branch trunk
— Parser:
- Make the resolver skip newlines by default, and provide an additional "raw" api to retrieve unresolved tokens without skipping newlines.
- Parsing rules now only return a bool to indicate whether they were successful, and can push any number of values themselves as needed.
- Stop trying to shoehorn implicit separators in the pratt parser. Instead, use the pratt parser only for expressions, and use a different parsing loop for sequences of expressions (ie for brace blocks and top level).
| ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | + + + + + + + + |
m_context( c )
{}
const auto& context() const { return m_context; }
bool eos() const;
// Consume the next token. Bound identifiers are resolved, newlines are filtered.
optional< Term > consume();
// Consume the next token. No resolution is performed on identifiers, newlines are filtered.
optional< Term > consumeUnresolved();
// Consume the next token. No resolution is performed on identifiers, newlines are not filtered.
optional< Term > consumeRaw();
optional< Term > lookAhead( size_t distance = 0 );
optional< Term > lookAheadUnresolved( size_t distance = 0 );
optional< Term > 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
|
| ︙ |