Skip to content

Commit

Permalink
Single line comments can end in newline or EOF. Fixes opensearch-proj…
Browse files Browse the repository at this point in the history
…ect#11815

Signed-off-by: Cameron Durham <u64.cam@gmail.com>
  • Loading branch information
camerondurham committed Jan 9, 2024
1 parent 0b30f30 commit fe73ce0
Show file tree
Hide file tree
Showing 7 changed files with 6,335 additions and 8,095 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 fe73ce0

Please sign in to comment.