Skip to content

Commit 3cbb526

Browse files
authored
ESQL: use this. prefix in grammar semantic predicate (#112291)
Fix #112285
1 parent 68b7b7f commit 3cbb526

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ options {
2929
*
3030
* Since the tokens/modes are in development, simply define them under the
3131
* "// in development section" and follow the section comments in that section.
32-
* That is use the DEV_ prefix and use the {isDevVersion()}? conditional.
32+
* That is use the DEV_ prefix and use the {this.isDevVersion()}? conditional.
3333
* They are defined at the end of the file, to minimize the impact on the existing
3434
* token types.
3535
*
@@ -80,15 +80,15 @@ WHERE : 'where' -> pushMode(EXPRESSION_MODE);
8080
// Before adding a new in-development command, to sandbox the behavior when running in production environments
8181
//
8282
// For example: to add myCommand use the following declaration:
83-
// DEV_MYCOMMAND : {isDevVersion()}? 'mycommand' -> ...
83+
// DEV_MYCOMMAND : {this.isDevVersion()}? 'mycommand' -> ...
8484
//
8585
// Once the command has been stabilized, remove the DEV_ prefix and the {}? conditional and move the command to the
8686
// main section while preserving alphabetical order:
8787
// MYCOMMAND : 'mycommand' -> ...
88-
DEV_INLINESTATS : {isDevVersion()}? 'inlinestats' -> pushMode(EXPRESSION_MODE);
89-
DEV_LOOKUP : {isDevVersion()}? 'lookup' -> pushMode(LOOKUP_MODE);
90-
DEV_MATCH : {isDevVersion()}? 'match' -> pushMode(EXPRESSION_MODE);
91-
DEV_METRICS : {isDevVersion()}? 'metrics' -> pushMode(METRICS_MODE);
88+
DEV_INLINESTATS : {this.isDevVersion()}? 'inlinestats' -> pushMode(EXPRESSION_MODE);
89+
DEV_LOOKUP : {this.isDevVersion()}? 'lookup' -> pushMode(LOOKUP_MODE);
90+
DEV_MATCH : {this.isDevVersion()}? 'match' -> pushMode(EXPRESSION_MODE);
91+
DEV_METRICS : {this.isDevVersion()}? 'metrics' -> pushMode(METRICS_MODE);
9292

9393
//
9494
// Catch-all for unrecognized commands - don't define any beyond this line
@@ -211,7 +211,7 @@ SLASH : '/';
211211
PERCENT : '%';
212212

213213
// move it in the main section if the feature gets promoted
214-
DEV_MATCH_OP : {isDevVersion()}? DEV_MATCH -> type(DEV_MATCH);
214+
DEV_MATCH_OP : {this.isDevVersion()}? DEV_MATCH -> type(DEV_MATCH);
215215

216216
NAMED_OR_POSITIONAL_PARAM
217217
: PARAM (LETTER | UNDERSCORE) UNQUOTED_ID_BODY*

x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sourceCommand
3636
| rowCommand
3737
| showCommand
3838
// in development
39-
| {isDevVersion()}? metricsCommand
39+
| {this.isDevVersion()}? metricsCommand
4040
;
4141

4242
processingCommand
@@ -53,9 +53,9 @@ processingCommand
5353
| enrichCommand
5454
| mvExpandCommand
5555
// in development
56-
| {isDevVersion()}? inlinestatsCommand
57-
| {isDevVersion()}? lookupCommand
58-
| {isDevVersion()}? matchCommand
56+
| {this.isDevVersion()}? inlinestatsCommand
57+
| {this.isDevVersion()}? lookupCommand
58+
| {this.isDevVersion()}? matchCommand
5959
;
6060

6161
whereCommand
@@ -70,7 +70,7 @@ booleanExpression
7070
| left=booleanExpression operator=OR right=booleanExpression #logicalBinary
7171
| valueExpression (NOT)? IN LP valueExpression (COMMA valueExpression)* RP #logicalIn
7272
| valueExpression IS NOT? NULL #isNull
73-
| {isDevVersion()}? matchBooleanExpression #matchExpression
73+
| {this.isDevVersion()}? matchBooleanExpression #matchExpression
7474
;
7575

7676
regexBooleanExpression

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)