-
Notifications
You must be signed in to change notification settings - Fork 9
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
parser: Add unused var check #24
Conversation
Visit the preview URL for this PR (updated for commit eb090bd): https://evy-lang--pr24-unused-decl-nux50pp5.web.app (expires Wed, 12 Oct 2022 12:13:51 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
8e75fdd
to
78fb9bf
Compare
Hi from GitHub CLI |
0450cdf
to
2237001
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. just a couple of nits but otherwise nice how short it is.
6da552f
to
0103456
Compare
Rename validateVar to validateVarDecl as it is more accurate and less confusing on revisit: validateVarDecl ensures that a declartion of a variable doesn't use a function name or an already declared variable name from same local scope.
Fix location for unknown variable error message so that it actually points to the column where the unknown variable starts and not to the next token after it.
Add unused var check reporting an error if declared variable is never used. This feature was yet again borrowed from go and piggy backed on the scope data structure.
0103456
to
928d849
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥗
Add unused var check reporting an error if declared variable is never
used. This feature was yet again borrowed from go and piggy backed on
the scope data structure.
Refactor
validateVar
tovalidateVarDecl
as it seems the moreappropriate name.