Skip to content

Introduce 4-token lookahead buffer.#45

Merged
dvander merged 1 commit intomasterfrom
methodmaps-inline
Jun 22, 2014
Merged

Introduce 4-token lookahead buffer.#45
dvander merged 1 commit intomasterfrom
methodmaps-inline

Conversation

@dvander
Copy link
Member

@dvander dvander commented Jun 22, 2014

The grammar for the Transitional Syntax requires four tokens of lookahead. For example, when encountering the public keyword for a method definition, we need to look for <symbol>, (, ), and = to determine whether it's bind-to-existing-native syntax. If it's not, we have to rewind back to the ( to look for a constructor, or even all the way back to the symbol to check for a type expression.

This patch refactors the lexer to keep two buffers: one for preprocessor lexing, and one for normal lexing. Each buffer can remember four tokens.

dvander added a commit that referenced this pull request Jun 22, 2014
Introduce 4-token lookahead buffer.
@dvander dvander merged commit c4f2b83 into master Jun 22, 2014
@dvander dvander deleted the methodmaps-inline branch June 22, 2014 06:56
@dvander dvander restored the methodmaps-inline branch June 22, 2014 08:47
@dvander dvander deleted the methodmaps-inline branch June 22, 2014 08:47
dvander added a commit that referenced this pull request Nov 4, 2015
Hide symbol::addr access behind a getter.
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.

1 participant