Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Apr 25, 2024

The lexer currently lexes tokens eagerly and stores them in a Token variant
ahead of when they are actually requested by the parser. It is wasteful,
however, to classify tokens before they are requested by the parser because it
is likely that the next token will be precisely the kind the parser requests.
The work of checking and rejecting other possible classifications ahead of time
is not useful.

To make incremental progress toward removing Token completely, lex parentheses
on demand instead of eagerly.

@tlively tlively requested a review from kripken April 25, 2024 03:02
Copy link
Member Author

tlively commented Apr 25, 2024

tlively added 2 commits April 25, 2024 16:48
The lexer currently lexes tokens eagerly and stores them in a `Token` variant
ahead of when they are actually requested by the parser. It is wasteful,
however, to classify tokens before they are requested by the parser because it
is likely that the next token will be precisely the kind the parser requests.
The work of checking and rejecting other possible classifications ahead of time
is not useful.

To make incremental progress toward removing `Token` completely, lex parentheses
on demand instead of eagerly.
@tlively tlively force-pushed the parser-no-tok-parens branch from 45f9c5a to d1df91c Compare April 26, 2024 00:03
Copy link
Member Author

tlively commented Apr 26, 2024

Merge activity

  • Apr 25, 11:47 PM EDT: @tlively started a stack merge that includes this pull request via Graphite.
  • Apr 25, 11:48 PM EDT: @tlively merged this pull request with Graphite.

@tlively tlively merged commit 3556073 into main Apr 26, 2024
@tlively tlively deleted the parser-no-tok-parens branch April 26, 2024 03:48
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants