-
Notifications
You must be signed in to change notification settings - Fork 240
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
tests to verify parsers ignore whitespace and comments #430
tests to verify parsers ignore whitespace and comments #430
Conversation
test { | ||
name: "carriage_return_terminated" | ||
description: "Check that carriage-return-terminated comments are ignored." | ||
expr: "[// @\r.// @\rcel.// @\rexpr// @\r.conformance.// @\rproto3.// @\rTestAllTypes// @\r{// @\rsingle_int64// @\r:// @\rint// @\r(// @\r17// @\r)// @\r}// @\r.// @\rsingle_int64// @\r]// @\r[// @\r0// @\r]// @\r==// @\r(// @\r18// @\r-// @\r1// @\r)// @\r&&// @\r!// @\rfalse// @\r?// @\r1// @\r:// @\r2" | ||
value { int64_value: 1 } | ||
} |
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.
cel-go
currently fails this, but it is legal per the grammar. I did not check other implementations.
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.
I think the antlr grammars are specifically looking for LF '\n' to terminate the comment so this will fail for the implementations we maintain (Java/C++/Go). I'm not sure if we should update the cel-spec description of the grammar or the implementations for this case. I'll defer to @TristonianJones
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.
At the moment, it's probably best to update the grammar in cel-spec and revisit whether adding \r
termination is needed.
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.
Updated the grammar.
/gcbrun |
76b15cc
to
4998d59
Compare
/gcbrun |
Thanks for the contribution! |
No description provided.