-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] Painless Script Single Line Comment at EOF Causes Parsing Error #11815
Comments
camerondurham
added a commit
to camerondurham/OpenSearch
that referenced
this issue
Jan 9, 2024
8 tasks
camerondurham
added a commit
to camerondurham/OpenSearch
that referenced
this issue
Jan 9, 2024
…ect#11815 Signed-off-by: Cameron Durham <[email protected]>
camerondurham
added a commit
to camerondurham/OpenSearch
that referenced
this issue
Jan 9, 2024
…ect#11815 Signed-off-by: Cameron Durham <[email protected]>
camerondurham
added a commit
to camerondurham/OpenSearch
that referenced
this issue
Jan 9, 2024
…ect#11815 Signed-off-by: Cameron Durham <[email protected]>
camerondurham
added a commit
to camerondurham/OpenSearch
that referenced
this issue
Jan 9, 2024
…ect#11815 Signed-off-by: camerondurham <[email protected]>
camerondurham
added a commit
to camerondurham/OpenSearch
that referenced
this issue
Jan 9, 2024
…ect#11815 Signed-off-by: camerondurham <[email protected]>
camerondurham
added a commit
to camerondurham/OpenSearch
that referenced
this issue
Jan 9, 2024
…ect#11815 Signed-off-by: camerondurham <[email protected]>
dblock
pushed a commit
that referenced
this issue
Jan 10, 2024
* Single line comments can end in newline or EOF. Fixes #11815 Signed-off-by: camerondurham <[email protected]> * Re-add license to autogen parser files Signed-off-by: camerondurham <[email protected]> * Remove noise from changelog Signed-off-by: Cameron Durham <[email protected]> * Accept single-line comments until newline char Signed-off-by: Cameron Durham <[email protected]> --------- Signed-off-by: camerondurham <[email protected]> Signed-off-by: Cameron Durham <[email protected]>
opensearch-trigger-bot bot
pushed a commit
that referenced
this issue
Jan 10, 2024
* Single line comments can end in newline or EOF. Fixes #11815 Signed-off-by: camerondurham <[email protected]> * Re-add license to autogen parser files Signed-off-by: camerondurham <[email protected]> * Remove noise from changelog Signed-off-by: Cameron Durham <[email protected]> * Accept single-line comments until newline char Signed-off-by: Cameron Durham <[email protected]> --------- Signed-off-by: camerondurham <[email protected]> Signed-off-by: Cameron Durham <[email protected]> (cherry picked from commit 8192488) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta
added
v3.0.0
Issues and PRs related to version 3.0.0
v2.12.0
Issues and PRs related to version 2.12.0
and removed
untriaged
labels
Jan 10, 2024
reta
pushed a commit
that referenced
this issue
Jan 10, 2024
…#11834) * Single line comments can end in newline or EOF. Fixes #11815 * Re-add license to autogen parser files * Remove noise from changelog * Accept single-line comments until newline char --------- (cherry picked from commit 8192488) Signed-off-by: camerondurham <[email protected]> Signed-off-by: Cameron Durham <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
rayshrey
pushed a commit
to rayshrey/OpenSearch
that referenced
this issue
Mar 18, 2024
…ect#11815 (opensearch-project#11816) * Single line comments can end in newline or EOF. Fixes opensearch-project#11815 Signed-off-by: camerondurham <[email protected]> * Re-add license to autogen parser files Signed-off-by: camerondurham <[email protected]> * Remove noise from changelog Signed-off-by: Cameron Durham <[email protected]> * Accept single-line comments until newline char Signed-off-by: Cameron Durham <[email protected]> --------- Signed-off-by: camerondurham <[email protected]> Signed-off-by: Cameron Durham <[email protected]>
shiv0408
pushed a commit
to Gaurav614/OpenSearch
that referenced
this issue
Apr 25, 2024
…ect#11815 (opensearch-project#11816) * Single line comments can end in newline or EOF. Fixes opensearch-project#11815 Signed-off-by: camerondurham <[email protected]> * Re-add license to autogen parser files Signed-off-by: camerondurham <[email protected]> * Remove noise from changelog Signed-off-by: Cameron Durham <[email protected]> * Accept single-line comments until newline char Signed-off-by: Cameron Durham <[email protected]> --------- Signed-off-by: camerondurham <[email protected]> Signed-off-by: Cameron Durham <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The Painless language as implemented has a papercut that scripts cannot end in a single-line comment without a newline/carriage-return.
Was there a specific motivation why EOF wasn't a valid end token for single-line comments?
If so, it could be helpful to document that as leaving a comment without newline leads to an un-intuitive error:
"type":"illegal_argument_exception","reason":"unexpected character [/ I am an unparsable comment].","caused_by":{"type":"lexer_no_viable_alt_exception","reason":null
If not, then suggesting a change to the lexer/grammar (like #11816)
Related component
Other
From my understanding, this is actually a bug from when this was forked from ElasticSearch, based on this definition of a comment: https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-comments.html
To Reproduce
Expected behavior
Comments at EOF without newline do not
Additional Details
Plugins
Please list all plugins currently enabled.:
N/A NONE
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: