Classes
TokenNavigationMixin
8
▼
Mixin providing token stream navigation methods.
Required Host Attributes:
- _tokens: Sequence…
TokenNavigationMixin
8
▼
Mixin providing token stream navigation methods.
Required Host Attributes:
- _tokens: Sequence[Token]
- _pos: int
- _current: Token | None
Attributes
| Name | Type | Description |
|---|---|---|
_tokens |
Sequence[Token]
|
— |
_pos |
int
|
— |
_current |
Token | None
|
— |
Methods
Internal Methods 5 ▼
_at_end
0
bool
▼
Check if at end of token stream.
_at_end
0
bool
▼
def _at_end(self) -> bool
Returns
bool
_advance
0
Token | None
▼
Advance to next token and return it.
_advance
0
Token | None
▼
def _advance(self) -> Token | None
Returns
Token | None
_peek
1
Token | None
▼
Peek at token at offset from current position.
_peek
1
Token | None
▼
def _peek(self, offset: int = 1) -> Token | None
Parameters
| Name | Type | Description |
|---|---|---|
offset |
— |
Default:1
|
Returns
Token | None
_get_line_at
1
str
▼
Get the full line content containing the given source offset.
_get_line_at
1
str
▼
def _get_line_at(self, offset: int) -> str
Parameters
| Name | Type | Description |
|---|---|---|
offset |
— |
Returns
str
_strip_columns
2
str
▼
Strip up to 'count' columns of whitespace/tabs from start of text.
_strip_columns
2
str
▼
def _strip_columns(self, text: str, count: int) -> str
Parameters
| Name | Type | Description |
|---|---|---|
text |
— |
|
count |
— |
Returns
str