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
* Single line comments can end in newline or EOF. Fixes #11815

Signed-off-by: camerondurham <u64.cam@gmail.com>

* Re-add license to autogen parser files

Signed-off-by: camerondurham <u64.cam@gmail.com>

* Remove noise from changelog

Signed-off-by: Cameron Durham <u64.cam@gmail.com>

* Accept single-line comments until newline char

Signed-off-by: Cameron Durham <u64.cam@gmail.com>

---------

Signed-off-by: camerondurham <u64.cam@gmail.com>
Signed-off-by: Cameron Durham <u64.cam@gmail.com>
  • Loading branch information
camerondurham committed Jan 10, 2024
1 parent 439573b commit 8192488
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 @@ -218,6 +218,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 8192488

Please sign in to comment.