Classes
TokenNavigationMixin
6
▼
Mixin providing token stream navigation methods.
Host attributes accessed via inline TYPE_CHECKING…
TokenNavigationMixin
6
▼
Mixin providing token stream navigation methods.
Host attributes accessed via inline TYPE_CHECKING declarations.
Methods
Internal Methods 6 ▼
_current
0
Token
▼
Get current token.
property
_current
0
Token
▼
def _current(self) -> Token
Returns
Token
_peek
1
Token
▼
Peek at token at offset from current position.
_peek
1
Token
▼
def _peek(self, offset: int = 0) -> Token
Parameters
| Name | Type | Description |
|---|---|---|
offset |
— |
Default:0
|
Returns
Token
_advance
0
Token
▼
Advance to next token and return current.
_advance
0
Token
▼
def _advance(self) -> Token
Returns
Token
_expect
1
Token
▼
Expect current token to be of given type.
_expect
1
Token
▼
def _expect(self, token_type: TokenType) -> Token
Parameters
| Name | Type | Description |
|---|---|---|
token_type |
— |
Returns
Token
_match
0
bool
▼
Check if current token matches any of the types.
_match
0
bool
▼
def _match(self, *types: TokenType) -> bool
Returns
bool
_error
3
ParseError
▼
Create a ParseError with source context and block stack info.
_error
3
ParseError
▼
def _error(self, message: str, token: Token | None = None, suggestion: str | None = None) -> ParseError
Parameters
| Name | Type | Description |
|---|---|---|
message |
— |
|
token |
— |
Default:None
|
suggestion |
— |
Default:None
|
Returns
ParseError