Skip to content

Commit

Permalink
Single line comments can end in newline or EOF. Fixes #11815 (#11816) (
Browse files Browse the repository at this point in the history
…#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 <u64.cam@gmail.com>
Signed-off-by: Cameron Durham <u64.cam@gmail.com>
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>
  • Loading branch information
1 parent acef38e commit a41646e
Show file tree
Hide file tree
Showing 4 changed files with 427 additions and 375 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix Automatic addition of protocol broken in #11512 ([#11609](https://github.com/opensearch-project/OpenSearch/pull/11609))
- Fix issue when calling Delete PIT endpoint and no PITs exist ([#11711](https://github.com/opensearch-project/OpenSearch/pull/11711))
- Fix tracing context propagation for local transport instrumentation ([#11490](https://github.com/opensearch-project/OpenSearch/pull/11490))
- Fix parsing of single line comments in `lang-painless` ([#11815](https://github.com/opensearch-project/OpenSearch/issues/11815))

### Security

Expand Down
2 changes: 1 addition & 1 deletion modules/lang-painless/src/main/antlr/PainlessLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected abstract boolean isSlashRegex();
}

WS: [ \t\n\r]+ -> skip;
COMMENT: ( '//' .*? [\n\r] | '/*' .*? '*/' ) -> skip;
COMMENT: ( '//' ~[\n\r]* | '/*' .*? '*/' ) -> skip;

LBRACK: '{';
RBRACK: '}';
Expand Down
Loading

0 comments on commit a41646e

Please sign in to comment.