-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Update painless antlr grammar for fields API $-syntax #125818
Update painless antlr grammar for fields API $-syntax #125818
Conversation
$('fieldname', <default>) was added in elasticsearch/elastic#80518. This updated the ANTLR grammar so that the syntax check passes. painless_lexer.g4 adapted from elasticsearch/modules/lang-painless/src/main/antlr/PainlessLexer.g4 painless_parser.g4 adapted from elasticsearch/modules/lang-painless/src/main/antlr/PainlessParser.g4 Generated by running `npm run build:antlr4ts` from `packages/kbn-monaco` Related to elastic#84695
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @stu-elastic! I think I found a regression, and left a couple comments about it. Let me know what you think. Thanks!
@@ -184,13 +185,9 @@ export class painless_lexer extends Lexer { | |||
// @Override | |||
public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { | |||
switch (ruleIndex) { | |||
// DO NOT CHANGE | |||
// This is a manual fix to handle slashes appropriately | |||
case 31: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to add this comment back in, and change it to 32
based on the addition of DOLLAR
. Otherwise, the slash is broken again.
Long term, it would be nice to figure out the root of this problem 😄 (briefly explained in the readme).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case 31: | ||
return this.DIV_sempred(_localctx, predIndex); | ||
|
||
// DO NOT CHANGE | ||
// This is a manual fix to handle regexes appropriately | ||
case 77: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to above - I think we need to add this comment back in, and change it to 78
based on the addition of DOLLAR
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes LGTM. Thanks for fixing this!
$('fieldname', <default>) was added in elasticsearch/elastic#80518. This updated the ANTLR grammar so that the syntax check passes. painless_lexer.g4 adapted from elasticsearch/modules/lang-painless/src/main/antlr/PainlessLexer.g4 painless_parser.g4 adapted from elasticsearch/modules/lang-painless/src/main/antlr/PainlessParser.g4 Generated by running `npm run build:antlr4ts` from `packages/kbn-monaco` (cherry picked from commit ea6be3c)
) $('fieldname', <default>) was added in elasticsearch/#80518. This updated the ANTLR grammar so that the syntax check passes. painless_lexer.g4 adapted from elasticsearch/modules/lang-painless/src/main/antlr/PainlessLexer.g4 painless_parser.g4 adapted from elasticsearch/modules/lang-painless/src/main/antlr/PainlessParser.g4 Generated by running `npm run build:antlr4ts` from `packages/kbn-monaco` (cherry picked from commit ea6be3c)
$('fieldname', <default>)
was added in elasticsearch/80518.This change updates the ANTLR grammar so that the syntax check
passes.
painless_lexer.g4
adapted fromelasticsearch/modules/lang-painless/src/main/antlr/PainlessLexer.g4
painless_parser.g4
adapted fromelasticsearch/modules/lang-painless/src/main/antlr/PainlessParser.g4
Generated by running
npm run build:antlr4ts
frompackages/kbn-monaco
Related to #84695