-
-
Notifications
You must be signed in to change notification settings - Fork 519
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
fix(grit): broaden GritQL parser support #4978
base: next
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #4978 will not alter performanceComparing Summary
|
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.
It seems we never construct the new node that was defined in this PR
// Comments inside the JS are not allowed | ||
let mut brace_count = 0; |
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.
If comments aren't allowed inside JS functions, maybe we should create a new lexer context, where we raise a parsing diagnostic every time we encounter a comment. At the moment it doesn't seem we do
p.expect(T!['}']); | ||
} else { | ||
parse_curly_predicate_list(p).ok(); | ||
} | ||
|
||
Present(m.complete(p, GRIT_FUNCTION_DEFINITION)) |
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.
Shouldn't we use the new JavaScript function node here?
node: &GritJavascriptFunctionDefinition, | ||
f: &mut GritFormatter, | ||
) -> FormatResult<()> { | ||
format_verbatim_node(node.syntax()).fmt(f) |
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.
We should implement the formatting while we're at it
Summary
Fix a few more issues with the GritQL parser/formatter that failed on complex patterns from https://github.com/getgrit/stdlib
Test Plan
Spec tests are included