Skip to content

Recognize reserved words in variable and constant declaration - #5

Open
blach wants to merge 3 commits into
aerobounce:mainfrom
blach:bugfix-4-variable-without-type-annotation
Open

Recognize reserved words in variable and constant declaration#5
blach wants to merge 3 commits into
aerobounce:mainfrom
blach:bugfix-4-variable-without-type-annotation

Conversation

@blach

@blach blach commented Sep 19, 2023

Copy link
Copy Markdown

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

blach commented Sep 19, 2023

Copy link
Copy Markdown
Author

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

blach commented Sep 19, 2023

Copy link
Copy Markdown
Author

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