aerobounce / Swift-Next

Swift syntax package in async/await era, with extra features, for Sublime Text.
MIT License
37 stars 6 forks source link

Recognize reserved words in variable and constant declaration #5

Open blach opened 11 months ago

blach commented 11 months ago

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.

blach commented 11 months ago

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 commented 11 months ago

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