Skip to content

Commit

Permalink
Single line comments can end in newline or EOF. Fixes #11815
Browse files Browse the repository at this point in the history
Signed-off-by: Cameron Durham <[email protected]>
  • Loading branch information
camerondurham committed Jan 9, 2024
1 parent 0b30f30 commit b486a87
Show file tree
Hide file tree
Showing 7 changed files with 6,320 additions and 8,068 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix template setting override for replication type ([#11417](https://github.com/opensearch-project/OpenSearch/pull/11417))
- 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 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] | EOF) | '/*' .*? '*/' ) -> skip;

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

0 comments on commit b486a87

Please sign in to comment.