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

Recognize reserved words in variable and constant declaration #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blach
Copy link

@blach blach commented Sep 19, 2023

If there was a variable declaration that was not followed by a type annotation and the next line started a function declaration, the function declaration was not recognized.

Fixed by including reserved-word-pop before matching the variable identifier.

Resolves #4

I hope this doesn't introduce new problems, but I visually checked it against the included test files and against my own code base and couldn't find a problem.

If there was a variable declaration that was not followed by a type annotation and the next lined started a function declaration, the function declaration was not recognized.

Fixed by including reserved-word-pop before matching the variable identifier.
@blach
Copy link
Author

blach commented Sep 19, 2023

Maybe the identifier match in declaration-variable and declaration-constant should also be changed from
- match: '{{identifier}}' to
- match: '{{non_reserved_identifier}}'.

Then - include: reserved-word-pop can be moved to the end before - include: else-pop.

@blach
Copy link
Author

blach commented Sep 19, 2023

I've updated the pull request with a new commit that uses - match: '{{non_reserved_identifier}}.

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.

[Syntax] Function is not recognized after variable declaration without type annotation
1 participant