-
Notifications
You must be signed in to change notification settings - Fork 37
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
KCL Boolean Logic (& and |) and keyword parsing fix #4194
base: main
Are you sure you want to change the base?
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/wasm-lib/tests/executor/inputs/no_visuals/boolean_logical_or.kcl
Outdated
Show resolved
Hide resolved
I just changed how AST nodes are serialized, could you please merge/rebase main and then rerun the parser snapshot tests? Your snapshots should be less verbose now. |
This will make our snapshots and JSON representations easier to read (making our tests less verbose).
* Add syntax highlighting for comparison operators * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * Confirm --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Neater code, and better error messages.
@adamchalmers I'll need you to carry this one |
// the start of a normal word. | ||
let keyword = terminated( | ||
keyword_candidates, | ||
peek(none_of(('a'..='z', 'A'..='Z', '-', '_', '0'..='9'))), | ||
not(peek(one_of(('a'..='z', 'A'..='Z', '-', '_', '0'..='9')))), |
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.
Since #4502, I think this change is no longer relevant. Characters that follow are no longer checked. inner_word()
consumes an entire word, and then if it's in the map, its token type is changed to a keyword or type.
It would be nice to keep the tests for this, though.
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.
Please move these to simulation tests. See #4487 for an example.
Implemented boolean logical and (&) and boolean logical or (|). Closes #4188
Fixed a bug in the parsing of keywords; the unambiguous_keywords function looks ahead after a possible keyword candidate for more characters (letters, numbers, -, or _) to see if its an identifier instead of a keyword. This parsing was causing incorrect behavior if there is no token after the word being parsed, e.g. "true" (with EOF afterwards) would be parsed as an identifier because there are no characters to look ahead. This is resolved now.