Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Proposal: Parser Context Struct #8

Open
mjbozo opened this issue Jun 13, 2024 · 0 comments
Open

Design Proposal: Parser Context Struct #8

mjbozo opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mjbozo
Copy link
Owner

mjbozo commented Jun 13, 2024

A problem faced when performing the parsing step is keeping track of the context the current component is being parsed in.

Currently the parser has access to previous, current, and next tokens, which is not always enough to understand the whole context.

Having some sort of context struct which can keep track of multiple aspects of the program could make a range of scenarios easier to handle and result in nicer code.

One idea could be to include a stack consisting of all the parent components, so we know the surrounding components.

This idea needs a bit more thought and analysis on whether this is the right approach.

@mjbozo mjbozo added the enhancement New feature or request label Jun 13, 2024
@mjbozo mjbozo self-assigned this Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant