From 6fc1a229770af82a1424eecca03faf57ccacd607 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 27 Jun 2016 09:55:16 -0400 Subject: [PATCH] cutover some docs to painless --- docs/java-api/indexed-scripts.asciidoc | 8 +- docs/java-api/query-dsl/script-query.asciidoc | 10 +- .../diversified-sampler-aggregation.asciidoc | 9 +- .../bucket/range-aggregation.asciidoc | 16 +- .../metrics/avg-aggregation.asciidoc | 14 +- .../metrics/cardinality-aggregation.asciidoc | 7 +- .../extendedstats-aggregation.asciidoc | 14 +- .../metrics/max-aggregation.asciidoc | 14 +- .../metrics/min-aggregation.asciidoc | 14 +- .../metrics/percentile-aggregation.asciidoc | 5 +- .../percentile-rank-aggregation.asciidoc | 5 +- .../metrics/stats-aggregation.asciidoc | 14 +- .../metrics/sum-aggregation.asciidoc | 16 +- .../metrics/tophits-aggregation.asciidoc | 5 +- .../metrics/valuecount-aggregation.asciidoc | 11 +- docs/reference/docs/bulk.asciidoc | 2 +- docs/reference/docs/reindex.asciidoc | 3 +- docs/reference/docs/update-by-query.asciidoc | 3 +- docs/reference/docs/update.asciidoc | 12 +- .../mapping/fields/field-names-field.asciidoc | 7 +- .../mapping/fields/id-field.asciidoc | 8 +- .../mapping/fields/index-field.asciidoc | 7 +- .../mapping/fields/parent-field.asciidoc | 7 +- .../mapping/fields/routing-field.asciidoc | 7 +- .../mapping/fields/type-field.asciidoc | 7 +- .../mapping/fields/uid-field.asciidoc | 8 +- docs/reference/mapping/types/boolean.asciidoc | 6 +- .../scripting/painless-syntax.asciidoc | 9 + .../query-dsl/function-score-query.asciidoc | 9 +- .../reference/query-dsl/script-query.asciidoc | 8 +- .../reference/search/request/rescore.asciidoc | 5 +- .../search/request/script-fields.asciidoc | 6 +- docs/reference/search/request/sort.asciidoc | 3 +- .../src/main/antlr/PainlessLexer.g4 | 1 + .../src/main/antlr/PainlessLexer.tokens | 258 ++-- .../src/main/antlr/PainlessParser.g4 | 1 + .../src/main/antlr/PainlessParser.tokens | 258 ++-- .../org/elasticsearch/painless/Locals.java | 6 +- .../painless/SimpleChecksAdapter.java | 60 + .../painless/WriterConstants.java | 2 + .../painless/antlr/PainlessLexer.java | 452 +++--- .../painless/antlr/PainlessParser.java | 1217 +++++++++-------- .../antlr/PainlessParserBaseVisitor.java | 7 + .../painless/antlr/PainlessParserVisitor.java | 7 + .../elasticsearch/painless/antlr/Walker.java | 12 + .../painless/node/SFunction.java | 1 + .../elasticsearch/painless/node/SSource.java | 10 +- .../painless/BasicStatementTests.java | 26 + .../elasticsearch/painless/LambdaTests.java | 3 +- 49 files changed, 1451 insertions(+), 1149 deletions(-) create mode 100644 modules/lang-painless/src/main/java/org/elasticsearch/painless/SimpleChecksAdapter.java diff --git a/docs/java-api/indexed-scripts.asciidoc b/docs/java-api/indexed-scripts.asciidoc index 45d19ae662d..a1259649a77 100644 --- a/docs/java-api/indexed-scripts.asciidoc +++ b/docs/java-api/indexed-scripts.asciidoc @@ -8,20 +8,20 @@ and delete indexed scripts and templates. [source,java] -------------------------------------------------- PutIndexedScriptResponse = client.preparePutIndexedScript() - .setScriptLang("groovy") + .setScriptLang("painless") .setId("script1") .setSource("script", "_score * doc['my_numeric_field'].value") .execute() .actionGet(); GetIndexedScriptResponse = client.prepareGetIndexedScript() - .setScriptLang("groovy") + .setScriptLang("painless") .setId("script1") .execute() .actionGet(); DeleteIndexedScriptResponse = client.prepareDeleteIndexedScript() - .setScriptLang("groovy") + .setScriptLang("painless") .setId("script1") .execute() .actionGet(); @@ -33,4 +33,4 @@ To store templates simply use "mustache" for the scriptLang. The API allows one to set the language of the indexed script being interacted with. If one is not provided the default scripting language -will be used. \ No newline at end of file +will be used. diff --git a/docs/java-api/query-dsl/script-query.asciidoc b/docs/java-api/query-dsl/script-query.asciidoc index 534c803ab08..33786b693d2 100644 --- a/docs/java-api/query-dsl/script-query.asciidoc +++ b/docs/java-api/query-dsl/script-query.asciidoc @@ -12,11 +12,11 @@ QueryBuilder qb = scriptQuery( <1> inlined script -If you have stored on each data node a script named `mygroovyscript.groovy` with: +If you have stored on each data node a script named `myscript.painless` with: -[source,groovy] +[source,js] -------------------------------------------------- -doc['num1'].value > param1 +doc['num1'].value > params.param1 -------------------------------------------------- You can use it then with: @@ -25,9 +25,9 @@ You can use it then with: -------------------------------------------------- QueryBuilder qb = scriptQuery( new Script( - "mygroovyscript", <1> + "myscript", <1> ScriptType.FILE, <2> - "groovy", <3> + "painless", <3> ImmutableMap.of("param1", 5)) <4> ); -------------------------------------------------- diff --git a/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc b/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc index 1a3180962b0..0307840d685 100644 --- a/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/diversified-sampler-aggregation.asciidoc @@ -115,8 +115,11 @@ Controlling diversity using a script: { "aggs" : { "sample" : { - "diverisfied_sampler" : { - "script" : "doc['author'].value + '/' + doc['genre'].value" + "diversified_sampler" : { + "script" : { + "lang" : "painless", + "inline" : "doc['author'].value + '/' + doc['genre'].value" + } } } } @@ -151,4 +154,4 @@ The de-duplication logic in the diversify settings applies only at a shard level ===== No specialized syntax for geo/date fields Currently the syntax for defining the diversifying values is defined by a choice of `field` or `script` - there is no added syntactical sugar for expressing geo or date units such as "1w" (1 week). -This support may be added in a later release and users will currently have to create these sorts of values using a script. \ No newline at end of file +This support may be added in a later release and users will currently have to create these sorts of values using a script. diff --git a/docs/reference/aggregations/bucket/range-aggregation.asciidoc b/docs/reference/aggregations/bucket/range-aggregation.asciidoc index 44760fc728f..efcbd9715e1 100644 --- a/docs/reference/aggregations/bucket/range-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/range-aggregation.asciidoc @@ -134,7 +134,10 @@ It is also possible to customize the key for each range: "aggs" : { "price_ranges" : { "range" : { - "script" : "doc['price'].value", + "script" : { + "lang": "painless", + "inline": "doc['price'].value" + }, "ranges" : [ { "to" : 50 }, { "from" : 50, "to" : 100 }, @@ -146,7 +149,7 @@ It is also possible to customize the key for each range: } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- @@ -184,9 +187,12 @@ Lets say the product prices are in USD but we would like to get the price ranges "price_ranges" : { "range" : { "field" : "price", - "script" : "_value * conversion_rate", - "params" : { - "conversion_rate" : 0.8 + "script" : { + "lang": "painless", + "inline": "_value * params.conversion_rate", + "params" : { + "conversion_rate" : 0.8 + } }, "ranges" : [ { "to" : 35 }, diff --git a/docs/reference/aggregations/metrics/avg-aggregation.asciidoc b/docs/reference/aggregations/metrics/avg-aggregation.asciidoc index f81cd3eee33..9967f4c9d9e 100644 --- a/docs/reference/aggregations/metrics/avg-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/avg-aggregation.asciidoc @@ -42,12 +42,19 @@ Computing the average grade based on a script: ..., "aggs" : { - "avg_grade" : { "avg" : { "script" : "doc['grade'].value" } } + "avg_grade" : { + "avg" : { + "script" : { + "inline" : "doc['grade'].value", + "lang" : "painless" + } + } + } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- @@ -86,7 +93,8 @@ It turned out that the exam was way above the level of the students and a grade "avg" : { "field" : "grade", "script" : { - "inline": "_value * correction", + "lang": "painless", + "inline": "_value * params.correction", "params" : { "correction" : 1.2 } diff --git a/docs/reference/aggregations/metrics/cardinality-aggregation.asciidoc b/docs/reference/aggregations/metrics/cardinality-aggregation.asciidoc index 1eb0c08772f..9c4ee59cccf 100644 --- a/docs/reference/aggregations/metrics/cardinality-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/cardinality-aggregation.asciidoc @@ -104,14 +104,17 @@ however since hashes need to be computed on the fly. "aggs" : { "author_count" : { "cardinality" : { - "script": "doc['author.first_name'].value + ' ' + doc['author.last_name'].value" + "script": { + "lang": "painless", + "inline": "doc['author.first_name'].value + ' ' + doc['author.last_name'].value" + } } } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- diff --git a/docs/reference/aggregations/metrics/extendedstats-aggregation.asciidoc b/docs/reference/aggregations/metrics/extendedstats-aggregation.asciidoc index 30a5acf6809..0e324089dc7 100644 --- a/docs/reference/aggregations/metrics/extendedstats-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/extendedstats-aggregation.asciidoc @@ -86,12 +86,19 @@ Computing the grades stats based on a script: ..., "aggs" : { - "grades_stats" : { "extended_stats" : { "script" : "doc['grade'].value" } } + "grades_stats" : { + "extended_stats" : { + "script" : { + "inline" : "doc['grade'].value", + "lang" : "painless" + } + } + } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- @@ -130,7 +137,8 @@ It turned out that the exam was way above the level of the students and a grade "extended_stats" : { "field" : "grade", "script" : { - "inline": "_value * correction", + "lang" : "painless", + "inline": "_value * params.correction", "params" : { "correction" : 1.2 } diff --git a/docs/reference/aggregations/metrics/max-aggregation.asciidoc b/docs/reference/aggregations/metrics/max-aggregation.asciidoc index 2a641fda5dc..8cfc0bd998e 100644 --- a/docs/reference/aggregations/metrics/max-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/max-aggregation.asciidoc @@ -39,12 +39,19 @@ Computing the max price value across all document, this time using a script: -------------------------------------------------- { "aggs" : { - "max_price" : { "max" : { "script" : "doc['price'].value" } } + "max_price" : { + "max" : { + "script" : { + "inline" : "doc['price'].value", + "lang" : "painless" + } + } + } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- @@ -78,7 +85,8 @@ Let's say that the prices of the documents in our index are in USD, but we would "max" : { "field" : "price", "script" : { - "inline": "_value * conversion_rate", + "lang": "painless", + "inline": "_value * params.conversion_rate", "params" : { "conversion_rate" : 1.2 } diff --git a/docs/reference/aggregations/metrics/min-aggregation.asciidoc b/docs/reference/aggregations/metrics/min-aggregation.asciidoc index 7698a41202c..819d70343fb 100644 --- a/docs/reference/aggregations/metrics/min-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/min-aggregation.asciidoc @@ -39,12 +39,19 @@ Computing the min price value across all document, this time using a script: -------------------------------------------------- { "aggs" : { - "min_price" : { "min" : { "script" : "doc['price'].value" } } + "min_price" : { + "min" : { + "script" : { + "inline" : "doc['price'].value", + "lang" : "painless" + } + } + } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- @@ -78,7 +85,8 @@ Let's say that the prices of the documents in our index are in USD, but we would "min" : { "field" : "price", "script" : - "inline": "_value * conversion_rate", + "lang" : "painless", + "inline": "_value * params.conversion_rate", "params" : { "conversion_rate" : 1.2 } diff --git a/docs/reference/aggregations/metrics/percentile-aggregation.asciidoc b/docs/reference/aggregations/metrics/percentile-aggregation.asciidoc index 5357d00461e..dc8c8837344 100644 --- a/docs/reference/aggregations/metrics/percentile-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/percentile-aggregation.asciidoc @@ -101,7 +101,8 @@ a script to convert them on-the-fly: "load_time_outlier" : { "percentiles" : { "script" : { - "inline": "doc['load_time'].value / timeUnit", <1> + "lang": "painless", + "inline": "doc['load_time'].value / params.timeUnit", <1> "params" : { "timeUnit" : 1000 <2> } @@ -115,7 +116,7 @@ a script to convert them on-the-fly: script to generate values which percentiles are calculated on <2> Scripting supports parameterized input just like any other script -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- diff --git a/docs/reference/aggregations/metrics/percentile-rank-aggregation.asciidoc b/docs/reference/aggregations/metrics/percentile-rank-aggregation.asciidoc index 759abb22be5..dcb953ae252 100644 --- a/docs/reference/aggregations/metrics/percentile-rank-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/percentile-rank-aggregation.asciidoc @@ -73,7 +73,8 @@ a script to convert them on-the-fly: "percentile_ranks" : { "values" : [3, 5], "script" : { - "inline": "doc['load_time'].value / timeUnit", <1> + "lang": "painless", + "inline": "doc['load_time'].value / params.timeUnit", <1> "params" : { "timeUnit" : 1000 <2> } @@ -87,7 +88,7 @@ a script to convert them on-the-fly: script to generate values which percentile ranks are calculated on <2> Scripting supports parameterized input just like any other script -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- diff --git a/docs/reference/aggregations/metrics/stats-aggregation.asciidoc b/docs/reference/aggregations/metrics/stats-aggregation.asciidoc index 852c1c3f7a9..a442fb12150 100644 --- a/docs/reference/aggregations/metrics/stats-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/stats-aggregation.asciidoc @@ -48,12 +48,19 @@ Computing the grades stats based on a script: ..., "aggs" : { - "grades_stats" : { "stats" : { "script" : "doc['grade'].value" } } + "grades_stats" : { + "stats" : { + "script" : { + "lang": "painless", + "inline": "doc['grade'].value" + } + } + } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- @@ -92,7 +99,8 @@ It turned out that the exam was way above the level of the students and a grade "stats" : { "field" : "grade", "script" : - "inline": "_value * correction", + "lang": "painless", + "inline": "_value * params.correction", "params" : { "correction" : 1.2 } diff --git a/docs/reference/aggregations/metrics/sum-aggregation.asciidoc b/docs/reference/aggregations/metrics/sum-aggregation.asciidoc index d55fcd01018..b9aee74b320 100644 --- a/docs/reference/aggregations/metrics/sum-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/sum-aggregation.asciidoc @@ -49,12 +49,19 @@ Computing the intraday return based on a script: ..., "aggs" : { - "intraday_return" : { "sum" : { "script" : "doc['change'].value" } } + "intraday_return" : { + "sum" : { + "script" : { + "lang": "painless", + "inline": "doc['change'].value" + } + } + } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- @@ -92,7 +99,10 @@ Computing the sum of squares over all stock tick changes: "daytime_return" : { "sum" : { "field" : "change", - "script" : "_value * _value" + "script" : { + "lang": "painless", + "inline": "_value * _value" + } } } } diff --git a/docs/reference/aggregations/metrics/tophits-aggregation.asciidoc b/docs/reference/aggregations/metrics/tophits-aggregation.asciidoc index 2bad60ba0ec..1b955d2a898 100644 --- a/docs/reference/aggregations/metrics/tophits-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/tophits-aggregation.asciidoc @@ -182,7 +182,10 @@ relevancy order of the most relevant document in a bucket. }, "top_hit" : { "max": { - "script": "_score" + "script": { + "lang": "painless", + "inline": "_score" + } } } } diff --git a/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc b/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc index fa2bfdbbb9d..925f5426187 100644 --- a/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc +++ b/docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc @@ -43,12 +43,19 @@ Counting the values generated by a script: ..., "aggs" : { - "grades_count" : { "value_count" : { "script" : "doc['grade'].value" } } + "grades_count" : { + "value_count" : { + "script" : { + "inline" : "doc['grade'].value", + "lang" : "painless" + } + } + } } } -------------------------------------------------- -This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a file script use the following syntax: +This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a file script use the following syntax: [source,js] -------------------------------------------------- diff --git a/docs/reference/docs/bulk.asciidoc b/docs/reference/docs/bulk.asciidoc index 1fbd0419e2e..c9189b57c01 100644 --- a/docs/reference/docs/bulk.asciidoc +++ b/docs/reference/docs/bulk.asciidoc @@ -168,7 +168,7 @@ the options. Curl example with update actions: { "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} } { "doc" : {"field" : "value"} } { "update" : { "_id" : "0", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} } -{ "script" : { "inline": "ctx._source.counter += param1", "lang" : "javascript", "params" : {"param1" : 1}}, "upsert" : {"counter" : 1}} +{ "script" : { "inline": "ctx._source.counter += params.param1", "lang" : "painless", "params" : {"param1" : 1}}, "upsert" : {"counter" : 1}} { "update" : {"_id" : "2", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} } { "doc" : {"field" : "value"}, "doc_as_upsert" : true } { "update" : {"_id" : "3", "_type" : "type1", "_index" : "index1", "fields" : ["_source"]} } diff --git a/docs/reference/docs/reindex.asciidoc b/docs/reference/docs/reindex.asciidoc index 525552ae85a..aac722e96a3 100644 --- a/docs/reference/docs/reindex.asciidoc +++ b/docs/reference/docs/reindex.asciidoc @@ -238,7 +238,8 @@ POST _reindex "version_type": "external" }, "script": { - "inline": "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}" + "inline": "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}", + "lang": "painless" } } -------------------------------------------------- diff --git a/docs/reference/docs/update-by-query.asciidoc b/docs/reference/docs/update-by-query.asciidoc index 6d6bfe64ecf..56ad1c7cd9a 100644 --- a/docs/reference/docs/update-by-query.asciidoc +++ b/docs/reference/docs/update-by-query.asciidoc @@ -104,7 +104,8 @@ will increment the `likes` field on all of kimchy's tweets: POST twitter/_update_by_query { "script": { - "inline": "ctx._source.likes++" + "inline": "ctx._source.likes++", + "lang": "painless" }, "query": { "term": { diff --git a/docs/reference/docs/update.asciidoc b/docs/reference/docs/update.asciidoc index 85e5bf2f67f..2edb0a71a3f 100644 --- a/docs/reference/docs/update.asciidoc +++ b/docs/reference/docs/update.asciidoc @@ -32,7 +32,8 @@ Now, we can execute a script that would increment the counter: -------------------------------------------------- curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{ "script" : { - "inline": "ctx._source.counter += count", + "inline": "ctx._source.counter += params.count", + "lang": "painless", "params" : { "count" : 4 } @@ -47,7 +48,8 @@ will still add it, since its a list): -------------------------------------------------- curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{ "script" : { - "inline": "ctx._source.tags += tag", + "inline": "ctx._source.tags += params.tag", + "lang": "painless", "params" : { "tag" : "blue" } @@ -85,7 +87,8 @@ the doc if the `tags` field contain `blue`, otherwise it does nothing -------------------------------------------------- curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{ "script" : { - "inline": "ctx._source.tags.contains(tag) ? ctx.op = \"delete\" : ctx.op = \"none\"", + "inline": "ctx._source.tags.contains(params.tag) ? ctx.op = \"delete\" : ctx.op = \"none\"", + "lang": "painless", "params" : { "tag" : "blue" } @@ -144,7 +147,8 @@ will be inserted as a new document. If the document does exist, then the -------------------------------------------------- curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{ "script" : { - "inline": "ctx._source.counter += count", + "inline": "ctx._source.counter += params.count", + "lang": "painless", "params" : { "count" : 4 } diff --git a/docs/reference/mapping/fields/field-names-field.asciidoc b/docs/reference/mapping/fields/field-names-field.asciidoc index a56a9081e88..cf8c6398d2e 100644 --- a/docs/reference/mapping/fields/field-names-field.asciidoc +++ b/docs/reference/mapping/fields/field-names-field.asciidoc @@ -31,7 +31,10 @@ GET my_index/_search }, "script_fields": { "Field names": { - "script": "doc['_field_names']" <2> + "script": { + "lang": "painless", + "inline": "doc['_field_names']" <2> + } } } } @@ -40,4 +43,4 @@ GET my_index/_search // CONSOLE <1> Querying on the `_field_names` field (also see the <> query) -<2> Accessing the `_field_names` field in scripts (inline scripts must be <> for this example to work) +<2> Accessing the `_field_names` field in scripts diff --git a/docs/reference/mapping/fields/id-field.asciidoc b/docs/reference/mapping/fields/id-field.asciidoc index a852f4f4770..f99f1ec9723 100644 --- a/docs/reference/mapping/fields/id-field.asciidoc +++ b/docs/reference/mapping/fields/id-field.asciidoc @@ -33,7 +33,10 @@ GET my_index/_search }, "script_fields": { "UID": { - "script": "doc['_id']" <2> + "script": { + "lang": "painless", + "inline": "doc['_id']" <2> + } } } } @@ -41,5 +44,4 @@ GET my_index/_search // CONSOLE <1> Querying on the `_id` field (also see the <>) -<2> Accessing the `_id` field in scripts (inline scripts must be <> for this example to work) - +<2> Accessing the `_id` field in scripts diff --git a/docs/reference/mapping/fields/index-field.asciidoc b/docs/reference/mapping/fields/index-field.asciidoc index c31b6f1d0f7..599fedba62c 100644 --- a/docs/reference/mapping/fields/index-field.asciidoc +++ b/docs/reference/mapping/fields/index-field.asciidoc @@ -50,7 +50,10 @@ GET index_1,index_2/_search ], "script_fields": { "index_name": { - "script": "doc['_index']" <4> + "script": { + "lang": "painless", + "inline": "doc['_index']" <4> + } } } } @@ -60,4 +63,4 @@ GET index_1,index_2/_search <1> Querying on the `_index` field <2> Aggregating on the `_index` field <3> Sorting on the `_index` field -<4> Accessing the `_index` field in scripts (inline scripts must be <> for this example to work) +<4> Accessing the `_index` field in scripts diff --git a/docs/reference/mapping/fields/parent-field.asciidoc b/docs/reference/mapping/fields/parent-field.asciidoc index 9dd8646172d..30b2e1a2086 100644 --- a/docs/reference/mapping/fields/parent-field.asciidoc +++ b/docs/reference/mapping/fields/parent-field.asciidoc @@ -81,7 +81,10 @@ GET my_index/_search }, "script_fields": { "parent": { - "script": "doc['_parent']" <3> + "script": { + "lang": "painless", + "inline": "doc['_parent']" <3> + } } } } @@ -91,7 +94,7 @@ GET my_index/_search <1> Querying on the `_parent` field (also see the <> and the <>) <2> Aggregating on the `_parent` field (also see the <> aggregation) -<3> Accessing the `_parent` field in scripts (inline scripts must be <> for this example to work) +<3> Accessing the `_parent` field in scripts ==== Parent-child restrictions diff --git a/docs/reference/mapping/fields/routing-field.asciidoc b/docs/reference/mapping/fields/routing-field.asciidoc index 49f269511dc..c8a92de1368 100644 --- a/docs/reference/mapping/fields/routing-field.asciidoc +++ b/docs/reference/mapping/fields/routing-field.asciidoc @@ -42,7 +42,10 @@ GET my_index/_search }, "script_fields": { "Routing value": { - "script": "doc['_routing']" <2> + "script": { + "lang": "painless", + "inline": "doc['_routing']" <2> + } } } } @@ -50,7 +53,7 @@ GET my_index/_search // CONSOLE <1> Querying on the `_routing` field (also see the <>) -<2> Accessing the `_routing` field in scripts (inline scripts must be <> for this example to work) +<2> Accessing the `_routing` field in scripts ==== Searching with custom routing diff --git a/docs/reference/mapping/fields/type-field.asciidoc b/docs/reference/mapping/fields/type-field.asciidoc index 703ee9930d2..fecc0143e94 100644 --- a/docs/reference/mapping/fields/type-field.asciidoc +++ b/docs/reference/mapping/fields/type-field.asciidoc @@ -45,7 +45,10 @@ GET my_index/type_*/_search ], "script_fields": { "type": { - "script": "doc['_type']" <4> + "script": { + "lang": "painless", + "inline": "doc['_type']" <4> + } } } } @@ -56,5 +59,5 @@ GET my_index/type_*/_search <1> Querying on the `_type` field <2> Aggregating on the `_type` field <3> Sorting on the `_type` field -<4> Accessing the `_type` field in scripts (inline scripts must be <> for this example to work) +<4> Accessing the `_type` field in scripts diff --git a/docs/reference/mapping/fields/uid-field.asciidoc b/docs/reference/mapping/fields/uid-field.asciidoc index 43d5751d426..82095160646 100644 --- a/docs/reference/mapping/fields/uid-field.asciidoc +++ b/docs/reference/mapping/fields/uid-field.asciidoc @@ -45,7 +45,10 @@ GET my_index/_search ], "script_fields": { "UID": { - "script": "doc['_uid']" <4> + "script": { + "lang": "painless", + "inline": "doc['_uid']" <4> + } } } } @@ -55,5 +58,4 @@ GET my_index/_search <1> Querying on the `_uid` field (also see the <>) <2> Aggregating on the `_uid` field <3> Sorting on the `_uid` field -<4> Accessing the `_uid` field in scripts (inline scripts must be <> for this example to work) - +<4> Accessing the `_uid` field in scripts diff --git a/docs/reference/mapping/types/boolean.asciidoc b/docs/reference/mapping/types/boolean.asciidoc index 914646a7220..a5f559facc2 100644 --- a/docs/reference/mapping/types/boolean.asciidoc +++ b/docs/reference/mapping/types/boolean.asciidoc @@ -76,13 +76,15 @@ GET my_index/_search }, "script_fields": { "is_published": { - "script": "doc['is_published'].value" <1> + "script": { + "lang": "painless", + "inline": "doc['is_published'].value" + } } } } -------------------------------------------------- // CONSOLE -<1> Inline scripts must be <> for this example to work. [[boolean-params]] ==== Parameters for `boolean` fields diff --git a/docs/reference/modules/scripting/painless-syntax.asciidoc b/docs/reference/modules/scripting/painless-syntax.asciidoc index 500a276c852..88c2cdb11a9 100644 --- a/docs/reference/modules/scripting/painless-syntax.asciidoc +++ b/docs/reference/modules/scripting/painless-syntax.asciidoc @@ -132,6 +132,15 @@ There are only a few minor differences and add-ons: Java's https://docs.oracle.com/javase/tutorial/java/nutsandbolts/flow.html[control flow statements] are supported, with the exception of the `switch` statement. +In addition to Java's `enhanced for` loop, the `for in` syntax from groovy can also be used: + +[source,js] +--------------------------------------------------------- +for (item : list) { + ... +} +--------------------------------------------------------- + [float] [[painless-functions]] === Functions diff --git a/docs/reference/query-dsl/function-score-query.asciidoc b/docs/reference/query-dsl/function-score-query.asciidoc index e7e4b8f5877..b6e4dedbc88 100644 --- a/docs/reference/query-dsl/function-score-query.asciidoc +++ b/docs/reference/query-dsl/function-score-query.asciidoc @@ -124,7 +124,10 @@ simple sample: [source,js] -------------------------------------------------- "script_score" : { - "script" : "_score * doc['my_numeric_field'].value" + "script" : { + "lang": "painless", + "inline": "_score * doc['my_numeric_field'].value" + } } -------------------------------------------------- @@ -140,12 +143,12 @@ script, and provide parameters to it: -------------------------------------------------- "script_score": { "script": { - "lang": "lang", + "lang": "painless", "params": { "param1": value1, "param2": value2 }, - "inline": "_score * doc['my_numeric_field'].value / pow(param1, param2)" + "inline": "_score * doc['my_numeric_field'].value / Math.pow(params.param1, params.param2)" } } -------------------------------------------------- diff --git a/docs/reference/query-dsl/script-query.asciidoc b/docs/reference/query-dsl/script-query.asciidoc index ee06a1b64bd..db82375abe0 100644 --- a/docs/reference/query-dsl/script-query.asciidoc +++ b/docs/reference/query-dsl/script-query.asciidoc @@ -13,7 +13,10 @@ GET /_search "bool" : { "must" : { "script" : { - "script" : "doc['num1'].value > 1" + "script" : { + "inline": "doc['num1'].value > 1", + "lang": "painless" + } } } } @@ -38,7 +41,8 @@ GET /_search "must" : { "script" : { "script" : { - "inline" : "doc['num1'].value > param1", + "inline" : "doc['num1'].value > params.param1", + "lang" : "painless", "params" : { "param1" : 5 } diff --git a/docs/reference/search/request/rescore.asciidoc b/docs/reference/search/request/rescore.asciidoc index 8bab1cf1f5c..488884ef8da 100644 --- a/docs/reference/search/request/rescore.asciidoc +++ b/docs/reference/search/request/rescore.asciidoc @@ -118,7 +118,10 @@ curl -s -XPOST 'localhost:9200/_search' -d '{ "rescore_query" : { "function_score" : { "script_score": { - "script": "log10(doc['numeric'].value + 2)" + "script": { + "lang": "painless", + "inline": "Math.log10(doc['numeric'].value + 2)" + } } } } diff --git a/docs/reference/search/request/script-fields.asciidoc b/docs/reference/search/request/script-fields.asciidoc index 6e054f02e1c..b544c79e4f2 100644 --- a/docs/reference/search/request/script-fields.asciidoc +++ b/docs/reference/search/request/script-fields.asciidoc @@ -13,10 +13,14 @@ GET /_search }, "script_fields" : { "test1" : { - "script" : "doc['my_field_name'].value * 2" + "script" : { + "lang": "painless", + "inline": "doc['my_field_name'].value * 2" + } }, "test2" : { "script" : { + "lang": "painless", "inline": "doc['my_field_name'].value * factor", "params" : { "factor" : 2.0 diff --git a/docs/reference/search/request/sort.asciidoc b/docs/reference/search/request/sort.asciidoc index fd3dbffc1d6..d0a50f0ebfd 100644 --- a/docs/reference/search/request/sort.asciidoc +++ b/docs/reference/search/request/sort.asciidoc @@ -378,7 +378,8 @@ GET /_search "_script" : { "type" : "number", "script" : { - "inline": "doc['field_name'].value * factor", + "lang": "painless", + "inline": "doc['field_name'].value * params.factor", "params" : { "factor" : 1.1 } diff --git a/modules/lang-painless/src/main/antlr/PainlessLexer.g4 b/modules/lang-painless/src/main/antlr/PainlessLexer.g4 index 027b1b370d1..a2e7b921300 100644 --- a/modules/lang-painless/src/main/antlr/PainlessLexer.g4 +++ b/modules/lang-painless/src/main/antlr/PainlessLexer.g4 @@ -40,6 +40,7 @@ DOT: '.' -> mode(AFTER_DOT); COMMA: ','; SEMICOLON: ';'; IF: 'if'; +IN: 'in'; ELSE: 'else'; WHILE: 'while'; DO: 'do'; diff --git a/modules/lang-painless/src/main/antlr/PainlessLexer.tokens b/modules/lang-painless/src/main/antlr/PainlessLexer.tokens index 8bb8c7e4448..dc62fe36b28 100644 --- a/modules/lang-painless/src/main/antlr/PainlessLexer.tokens +++ b/modules/lang-painless/src/main/antlr/PainlessLexer.tokens @@ -10,75 +10,76 @@ DOT=9 COMMA=10 SEMICOLON=11 IF=12 -ELSE=13 -WHILE=14 -DO=15 -FOR=16 -CONTINUE=17 -BREAK=18 -RETURN=19 -NEW=20 -TRY=21 -CATCH=22 -THROW=23 -THIS=24 -INSTANCEOF=25 -BOOLNOT=26 -BWNOT=27 -MUL=28 -DIV=29 -REM=30 -ADD=31 -SUB=32 -LSH=33 -RSH=34 -USH=35 -LT=36 -LTE=37 -GT=38 -GTE=39 -EQ=40 -EQR=41 -NE=42 -NER=43 -BWAND=44 -XOR=45 -BWOR=46 -BOOLAND=47 -BOOLOR=48 -COND=49 -COLON=50 -REF=51 -ARROW=52 -FIND=53 -MATCH=54 -INCR=55 -DECR=56 -ASSIGN=57 -AADD=58 -ASUB=59 -AMUL=60 -ADIV=61 -AREM=62 -AAND=63 -AXOR=64 -AOR=65 -ALSH=66 -ARSH=67 -AUSH=68 -OCTAL=69 -HEX=70 -INTEGER=71 -DECIMAL=72 -STRING=73 -REGEX=74 -TRUE=75 -FALSE=76 -NULL=77 -TYPE=78 -ID=79 -DOTINTEGER=80 -DOTID=81 +IN=13 +ELSE=14 +WHILE=15 +DO=16 +FOR=17 +CONTINUE=18 +BREAK=19 +RETURN=20 +NEW=21 +TRY=22 +CATCH=23 +THROW=24 +THIS=25 +INSTANCEOF=26 +BOOLNOT=27 +BWNOT=28 +MUL=29 +DIV=30 +REM=31 +ADD=32 +SUB=33 +LSH=34 +RSH=35 +USH=36 +LT=37 +LTE=38 +GT=39 +GTE=40 +EQ=41 +EQR=42 +NE=43 +NER=44 +BWAND=45 +XOR=46 +BWOR=47 +BOOLAND=48 +BOOLOR=49 +COND=50 +COLON=51 +REF=52 +ARROW=53 +FIND=54 +MATCH=55 +INCR=56 +DECR=57 +ASSIGN=58 +AADD=59 +ASUB=60 +AMUL=61 +ADIV=62 +AREM=63 +AAND=64 +AXOR=65 +AOR=66 +ALSH=67 +ARSH=68 +AUSH=69 +OCTAL=70 +HEX=71 +INTEGER=72 +DECIMAL=73 +STRING=74 +REGEX=75 +TRUE=76 +FALSE=77 +NULL=78 +TYPE=79 +ID=80 +DOTINTEGER=81 +DOTID=82 '{'=3 '}'=4 '['=5 @@ -89,62 +90,63 @@ DOTID=81 ','=10 ';'=11 'if'=12 -'else'=13 -'while'=14 -'do'=15 -'for'=16 -'continue'=17 -'break'=18 -'return'=19 -'new'=20 -'try'=21 -'catch'=22 -'throw'=23 -'this'=24 -'instanceof'=25 -'!'=26 -'~'=27 -'*'=28 -'/'=29 -'%'=30 -'+'=31 -'-'=32 -'<<'=33 -'>>'=34 -'>>>'=35 -'<'=36 -'<='=37 -'>'=38 -'>='=39 -'=='=40 -'==='=41 -'!='=42 -'!=='=43 -'&'=44 -'^'=45 -'|'=46 -'&&'=47 -'||'=48 -'?'=49 -':'=50 -'::'=51 -'->'=52 -'=~'=53 -'==~'=54 -'++'=55 -'--'=56 -'='=57 -'+='=58 -'-='=59 -'*='=60 -'/='=61 -'%='=62 -'&='=63 -'^='=64 -'|='=65 -'<<='=66 -'>>='=67 -'>>>='=68 -'true'=75 -'false'=76 -'null'=77 +'in'=13 +'else'=14 +'while'=15 +'do'=16 +'for'=17 +'continue'=18 +'break'=19 +'return'=20 +'new'=21 +'try'=22 +'catch'=23 +'throw'=24 +'this'=25 +'instanceof'=26 +'!'=27 +'~'=28 +'*'=29 +'/'=30 +'%'=31 +'+'=32 +'-'=33 +'<<'=34 +'>>'=35 +'>>>'=36 +'<'=37 +'<='=38 +'>'=39 +'>='=40 +'=='=41 +'==='=42 +'!='=43 +'!=='=44 +'&'=45 +'^'=46 +'|'=47 +'&&'=48 +'||'=49 +'?'=50 +':'=51 +'::'=52 +'->'=53 +'=~'=54 +'==~'=55 +'++'=56 +'--'=57 +'='=58 +'+='=59 +'-='=60 +'*='=61 +'/='=62 +'%='=63 +'&='=64 +'^='=65 +'|='=66 +'<<='=67 +'>>='=68 +'>>>='=69 +'true'=76 +'false'=77 +'null'=78 diff --git a/modules/lang-painless/src/main/antlr/PainlessParser.g4 b/modules/lang-painless/src/main/antlr/PainlessParser.g4 index 7e28b0ad258..b102734a4f4 100644 --- a/modules/lang-painless/src/main/antlr/PainlessParser.g4 +++ b/modules/lang-painless/src/main/antlr/PainlessParser.g4 @@ -42,6 +42,7 @@ statement | DO block WHILE LP expression RP delimiter # do | FOR LP initializer? SEMICOLON expression? SEMICOLON afterthought? RP ( trailer | empty ) # for | FOR LP decltype ID COLON expression RP trailer # each + | FOR LP ID IN expression RP trailer # ineach | declaration delimiter # decl | CONTINUE delimiter # continue | BREAK delimiter # break diff --git a/modules/lang-painless/src/main/antlr/PainlessParser.tokens b/modules/lang-painless/src/main/antlr/PainlessParser.tokens index 8bb8c7e4448..dc62fe36b28 100644 --- a/modules/lang-painless/src/main/antlr/PainlessParser.tokens +++ b/modules/lang-painless/src/main/antlr/PainlessParser.tokens @@ -10,75 +10,76 @@ DOT=9 COMMA=10 SEMICOLON=11 IF=12 -ELSE=13 -WHILE=14 -DO=15 -FOR=16 -CONTINUE=17 -BREAK=18 -RETURN=19 -NEW=20 -TRY=21 -CATCH=22 -THROW=23 -THIS=24 -INSTANCEOF=25 -BOOLNOT=26 -BWNOT=27 -MUL=28 -DIV=29 -REM=30 -ADD=31 -SUB=32 -LSH=33 -RSH=34 -USH=35 -LT=36 -LTE=37 -GT=38 -GTE=39 -EQ=40 -EQR=41 -NE=42 -NER=43 -BWAND=44 -XOR=45 -BWOR=46 -BOOLAND=47 -BOOLOR=48 -COND=49 -COLON=50 -REF=51 -ARROW=52 -FIND=53 -MATCH=54 -INCR=55 -DECR=56 -ASSIGN=57 -AADD=58 -ASUB=59 -AMUL=60 -ADIV=61 -AREM=62 -AAND=63 -AXOR=64 -AOR=65 -ALSH=66 -ARSH=67 -AUSH=68 -OCTAL=69 -HEX=70 -INTEGER=71 -DECIMAL=72 -STRING=73 -REGEX=74 -TRUE=75 -FALSE=76 -NULL=77 -TYPE=78 -ID=79 -DOTINTEGER=80 -DOTID=81 +IN=13 +ELSE=14 +WHILE=15 +DO=16 +FOR=17 +CONTINUE=18 +BREAK=19 +RETURN=20 +NEW=21 +TRY=22 +CATCH=23 +THROW=24 +THIS=25 +INSTANCEOF=26 +BOOLNOT=27 +BWNOT=28 +MUL=29 +DIV=30 +REM=31 +ADD=32 +SUB=33 +LSH=34 +RSH=35 +USH=36 +LT=37 +LTE=38 +GT=39 +GTE=40 +EQ=41 +EQR=42 +NE=43 +NER=44 +BWAND=45 +XOR=46 +BWOR=47 +BOOLAND=48 +BOOLOR=49 +COND=50 +COLON=51 +REF=52 +ARROW=53 +FIND=54 +MATCH=55 +INCR=56 +DECR=57 +ASSIGN=58 +AADD=59 +ASUB=60 +AMUL=61 +ADIV=62 +AREM=63 +AAND=64 +AXOR=65 +AOR=66 +ALSH=67 +ARSH=68 +AUSH=69 +OCTAL=70 +HEX=71 +INTEGER=72 +DECIMAL=73 +STRING=74 +REGEX=75 +TRUE=76 +FALSE=77 +NULL=78 +TYPE=79 +ID=80 +DOTINTEGER=81 +DOTID=82 '{'=3 '}'=4 '['=5 @@ -89,62 +90,63 @@ DOTID=81 ','=10 ';'=11 'if'=12 -'else'=13 -'while'=14 -'do'=15 -'for'=16 -'continue'=17 -'break'=18 -'return'=19 -'new'=20 -'try'=21 -'catch'=22 -'throw'=23 -'this'=24 -'instanceof'=25 -'!'=26 -'~'=27 -'*'=28 -'/'=29 -'%'=30 -'+'=31 -'-'=32 -'<<'=33 -'>>'=34 -'>>>'=35 -'<'=36 -'<='=37 -'>'=38 -'>='=39 -'=='=40 -'==='=41 -'!='=42 -'!=='=43 -'&'=44 -'^'=45 -'|'=46 -'&&'=47 -'||'=48 -'?'=49 -':'=50 -'::'=51 -'->'=52 -'=~'=53 -'==~'=54 -'++'=55 -'--'=56 -'='=57 -'+='=58 -'-='=59 -'*='=60 -'/='=61 -'%='=62 -'&='=63 -'^='=64 -'|='=65 -'<<='=66 -'>>='=67 -'>>>='=68 -'true'=75 -'false'=76 -'null'=77 +'in'=13 +'else'=14 +'while'=15 +'do'=16 +'for'=17 +'continue'=18 +'break'=19 +'return'=20 +'new'=21 +'try'=22 +'catch'=23 +'throw'=24 +'this'=25 +'instanceof'=26 +'!'=27 +'~'=28 +'*'=29 +'/'=30 +'%'=31 +'+'=32 +'-'=33 +'<<'=34 +'>>'=35 +'>>>'=36 +'<'=37 +'<='=38 +'>'=39 +'>='=40 +'=='=41 +'==='=42 +'!='=43 +'!=='=44 +'&'=45 +'^'=46 +'|'=47 +'&&'=48 +'||'=49 +'?'=50 +':'=51 +'::'=52 +'->'=53 +'=~'=54 +'==~'=55 +'++'=56 +'--'=57 +'='=58 +'+='=59 +'-='=60 +'*='=61 +'/='=62 +'%='=63 +'&='=64 +'^='=65 +'|='=66 +'<<='=67 +'>>='=68 +'>>>='=69 +'true'=76 +'false'=77 +'null'=78 diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Locals.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Locals.java index ae54b6e6271..b02ea085904 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Locals.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Locals.java @@ -74,7 +74,11 @@ public final class Locals { Locals locals = new Locals(programScope, returnType); for (int i = 0; i < parameters.size(); i++) { Parameter parameter = parameters.get(i); - boolean isCapture = i < captureCount; + // TODO: allow non-captures to be r/w: + // boolean isCapture = i < captureCount; + // currently, this cannot be allowed, as we swap in real types, + // but that can prevent a store of a different type... + boolean isCapture = true; locals.addVariable(parameter.location, parameter.type, parameter.name, isCapture); } // Loop counter to catch infinite loops. Internal use only. diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/SimpleChecksAdapter.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/SimpleChecksAdapter.java new file mode 100644 index 00000000000..aa6d121945b --- /dev/null +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/SimpleChecksAdapter.java @@ -0,0 +1,60 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.painless; + +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.util.CheckClassAdapter; +import org.objectweb.asm.util.CheckMethodAdapter; + +import java.util.HashMap; + +/** + * A CheckClassAdapter that does not use setAccessible to try to access private fields of Label! + *

+ * This means jump insns are not checked, but we still get all the other checking. + */ +// TODO: we should really try to get this fixed in ASM! +public class SimpleChecksAdapter extends CheckClassAdapter { + + public SimpleChecksAdapter(ClassVisitor cv) { + super(WriterConstants.ASM_VERSION, cv, false); + } + + @Override + public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { + MethodVisitor in = cv.visitMethod(access, name, desc, signature, exceptions); + CheckMethodAdapter checker = new CheckMethodAdapter(WriterConstants.ASM_VERSION, in, new HashMap()) { + @Override + public void visitJumpInsn(int opcode, Label label) { + mv.visitJumpInsn(opcode, label); + } + + @Override + public void visitTryCatchBlock(Label start, Label end, Label handler, String type) { + mv.visitTryCatchBlock(start, end, handler, type); + } + }; + checker.version = WriterConstants.CLASS_VERSION; + return checker; + } +} diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java index e2bf804c181..ca549522018 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java @@ -43,6 +43,8 @@ import java.util.regex.Pattern; */ public final class WriterConstants { + public final static int CLASS_VERSION = Opcodes.V1_8; + public final static int ASM_VERSION = Opcodes.ASM5; public final static String BASE_CLASS_NAME = Executable.class.getName(); public final static Type BASE_CLASS_TYPE = Type.getType(Executable.class); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessLexer.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessLexer.java index 6d791979243..eae7150b9be 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessLexer.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessLexer.java @@ -21,15 +21,16 @@ class PainlessLexer extends Lexer { new PredictionContextCache(); public static final int WS=1, COMMENT=2, LBRACK=3, RBRACK=4, LBRACE=5, RBRACE=6, LP=7, RP=8, DOT=9, - COMMA=10, SEMICOLON=11, IF=12, ELSE=13, WHILE=14, DO=15, FOR=16, CONTINUE=17, - BREAK=18, RETURN=19, NEW=20, TRY=21, CATCH=22, THROW=23, THIS=24, INSTANCEOF=25, - BOOLNOT=26, BWNOT=27, MUL=28, DIV=29, REM=30, ADD=31, SUB=32, LSH=33, - RSH=34, USH=35, LT=36, LTE=37, GT=38, GTE=39, EQ=40, EQR=41, NE=42, NER=43, - BWAND=44, XOR=45, BWOR=46, BOOLAND=47, BOOLOR=48, COND=49, COLON=50, REF=51, - ARROW=52, FIND=53, MATCH=54, INCR=55, DECR=56, ASSIGN=57, AADD=58, ASUB=59, - AMUL=60, ADIV=61, AREM=62, AAND=63, AXOR=64, AOR=65, ALSH=66, ARSH=67, - AUSH=68, OCTAL=69, HEX=70, INTEGER=71, DECIMAL=72, STRING=73, REGEX=74, - TRUE=75, FALSE=76, NULL=77, TYPE=78, ID=79, DOTINTEGER=80, DOTID=81; + COMMA=10, SEMICOLON=11, IF=12, IN=13, ELSE=14, WHILE=15, DO=16, FOR=17, + CONTINUE=18, BREAK=19, RETURN=20, NEW=21, TRY=22, CATCH=23, THROW=24, + THIS=25, INSTANCEOF=26, BOOLNOT=27, BWNOT=28, MUL=29, DIV=30, REM=31, + ADD=32, SUB=33, LSH=34, RSH=35, USH=36, LT=37, LTE=38, GT=39, GTE=40, + EQ=41, EQR=42, NE=43, NER=44, BWAND=45, XOR=46, BWOR=47, BOOLAND=48, BOOLOR=49, + COND=50, COLON=51, REF=52, ARROW=53, FIND=54, MATCH=55, INCR=56, DECR=57, + ASSIGN=58, AADD=59, ASUB=60, AMUL=61, ADIV=62, AREM=63, AAND=64, AXOR=65, + AOR=66, ALSH=67, ARSH=68, AUSH=69, OCTAL=70, HEX=71, INTEGER=72, DECIMAL=73, + STRING=74, REGEX=75, TRUE=76, FALSE=77, NULL=78, TYPE=79, ID=80, DOTINTEGER=81, + DOTID=82; public static final int AFTER_DOT = 1; public static String[] modeNames = { "DEFAULT_MODE", "AFTER_DOT" @@ -37,7 +38,7 @@ class PainlessLexer extends Lexer { public static final String[] ruleNames = { "WS", "COMMENT", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "LP", "RP", "DOT", - "COMMA", "SEMICOLON", "IF", "ELSE", "WHILE", "DO", "FOR", "CONTINUE", + "COMMA", "SEMICOLON", "IF", "IN", "ELSE", "WHILE", "DO", "FOR", "CONTINUE", "BREAK", "RETURN", "NEW", "TRY", "CATCH", "THROW", "THIS", "INSTANCEOF", "BOOLNOT", "BWNOT", "MUL", "DIV", "REM", "ADD", "SUB", "LSH", "RSH", "USH", "LT", "LTE", "GT", "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "XOR", "BWOR", @@ -50,25 +51,25 @@ class PainlessLexer extends Lexer { private static final String[] _LITERAL_NAMES = { null, null, null, "'{'", "'}'", "'['", "']'", "'('", "')'", "'.'", "','", - "';'", "'if'", "'else'", "'while'", "'do'", "'for'", "'continue'", "'break'", - "'return'", "'new'", "'try'", "'catch'", "'throw'", "'this'", "'instanceof'", - "'!'", "'~'", "'*'", "'/'", "'%'", "'+'", "'-'", "'<<'", "'>>'", "'>>>'", - "'<'", "'<='", "'>'", "'>='", "'=='", "'==='", "'!='", "'!=='", "'&'", - "'^'", "'|'", "'&&'", "'||'", "'?'", "':'", "'::'", "'->'", "'=~'", "'==~'", - "'++'", "'--'", "'='", "'+='", "'-='", "'*='", "'/='", "'%='", "'&='", - "'^='", "'|='", "'<<='", "'>>='", "'>>>='", null, null, null, null, null, - null, "'true'", "'false'", "'null'" + "';'", "'if'", "'in'", "'else'", "'while'", "'do'", "'for'", "'continue'", + "'break'", "'return'", "'new'", "'try'", "'catch'", "'throw'", "'this'", + "'instanceof'", "'!'", "'~'", "'*'", "'/'", "'%'", "'+'", "'-'", "'<<'", + "'>>'", "'>>>'", "'<'", "'<='", "'>'", "'>='", "'=='", "'==='", "'!='", + "'!=='", "'&'", "'^'", "'|'", "'&&'", "'||'", "'?'", "':'", "'::'", "'->'", + "'=~'", "'==~'", "'++'", "'--'", "'='", "'+='", "'-='", "'*='", "'/='", + "'%='", "'&='", "'^='", "'|='", "'<<='", "'>>='", "'>>>='", null, null, + null, null, null, null, "'true'", "'false'", "'null'" }; private static final String[] _SYMBOLIC_NAMES = { null, "WS", "COMMENT", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "LP", "RP", - "DOT", "COMMA", "SEMICOLON", "IF", "ELSE", "WHILE", "DO", "FOR", "CONTINUE", - "BREAK", "RETURN", "NEW", "TRY", "CATCH", "THROW", "THIS", "INSTANCEOF", - "BOOLNOT", "BWNOT", "MUL", "DIV", "REM", "ADD", "SUB", "LSH", "RSH", "USH", - "LT", "LTE", "GT", "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "XOR", "BWOR", - "BOOLAND", "BOOLOR", "COND", "COLON", "REF", "ARROW", "FIND", "MATCH", - "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", "AAND", - "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", "HEX", "INTEGER", "DECIMAL", - "STRING", "REGEX", "TRUE", "FALSE", "NULL", "TYPE", "ID", "DOTINTEGER", + "DOT", "COMMA", "SEMICOLON", "IF", "IN", "ELSE", "WHILE", "DO", "FOR", + "CONTINUE", "BREAK", "RETURN", "NEW", "TRY", "CATCH", "THROW", "THIS", + "INSTANCEOF", "BOOLNOT", "BWNOT", "MUL", "DIV", "REM", "ADD", "SUB", "LSH", + "RSH", "USH", "LT", "LTE", "GT", "GTE", "EQ", "EQR", "NE", "NER", "BWAND", + "XOR", "BWOR", "BOOLAND", "BOOLOR", "COND", "COLON", "REF", "ARROW", "FIND", + "MATCH", "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", + "AAND", "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", "HEX", "INTEGER", + "DECIMAL", "STRING", "REGEX", "TRUE", "FALSE", "NULL", "TYPE", "ID", "DOTINTEGER", "DOTID" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -128,11 +129,11 @@ class PainlessLexer extends Lexer { @Override public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { switch (ruleIndex) { - case 28: + case 29: return DIV_sempred((RuleContext)_localctx, predIndex); - case 73: + case 74: return REGEX_sempred((RuleContext)_localctx, predIndex); - case 77: + case 78: return TYPE_sempred((RuleContext)_localctx, predIndex); } return true; @@ -160,7 +161,7 @@ class PainlessLexer extends Lexer { } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2S\u0246\b\1\b\1\4"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2T\u024b\b\1\b\1\4"+ "\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n"+ "\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ @@ -169,201 +170,202 @@ class PainlessLexer extends Lexer { "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ "\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t"+ "=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4"+ - "I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\3\2\6\2\u00a8"+ - "\n\2\r\2\16\2\u00a9\3\2\3\2\3\3\3\3\3\3\3\3\7\3\u00b2\n\3\f\3\16\3\u00b5"+ - "\13\3\3\3\3\3\3\3\3\3\3\3\7\3\u00bc\n\3\f\3\16\3\u00bf\13\3\3\3\3\3\5"+ - "\3\u00c3\n\3\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b\3\t\3\t\3"+ - "\n\3\n\3\n\3\n\3\13\3\13\3\f\3\f\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16"+ - "\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\22"+ - "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23"+ - "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\26\3\26\3\26"+ - "\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\31"+ - "\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32"+ - "\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\36\3\37\3\37\3 \3 \3!"+ - "\3!\3\"\3\"\3\"\3#\3#\3#\3$\3$\3$\3$\3%\3%\3&\3&\3&\3\'\3\'\3(\3(\3(\3"+ - ")\3)\3)\3*\3*\3*\3*\3+\3+\3+\3,\3,\3,\3,\3-\3-\3.\3.\3/\3/\3\60\3\60\3"+ - "\60\3\61\3\61\3\61\3\62\3\62\3\63\3\63\3\64\3\64\3\64\3\65\3\65\3\65\3"+ - "\66\3\66\3\66\3\67\3\67\3\67\3\67\38\38\38\39\39\39\3:\3:\3;\3;\3;\3<"+ - "\3<\3<\3=\3=\3=\3>\3>\3>\3?\3?\3?\3@\3@\3@\3A\3A\3A\3B\3B\3B\3C\3C\3C"+ - "\3C\3D\3D\3D\3D\3E\3E\3E\3E\3E\3F\3F\6F\u01a7\nF\rF\16F\u01a8\3F\5F\u01ac"+ - "\nF\3G\3G\3G\6G\u01b1\nG\rG\16G\u01b2\3G\5G\u01b6\nG\3H\3H\3H\7H\u01bb"+ - "\nH\fH\16H\u01be\13H\5H\u01c0\nH\3H\5H\u01c3\nH\3I\3I\3I\7I\u01c8\nI\f"+ - "I\16I\u01cb\13I\5I\u01cd\nI\3I\3I\6I\u01d1\nI\rI\16I\u01d2\5I\u01d5\n"+ - "I\3I\3I\5I\u01d9\nI\3I\6I\u01dc\nI\rI\16I\u01dd\5I\u01e0\nI\3I\5I\u01e3"+ - "\nI\3J\3J\3J\3J\3J\3J\7J\u01eb\nJ\fJ\16J\u01ee\13J\3J\3J\3J\3J\3J\3J\3"+ - "J\7J\u01f7\nJ\fJ\16J\u01fa\13J\3J\5J\u01fd\nJ\3K\3K\3K\3K\6K\u0203\nK"+ - "\rK\16K\u0204\3K\3K\7K\u0209\nK\fK\16K\u020c\13K\3K\3K\3L\3L\3L\3L\3L"+ - "\3M\3M\3M\3M\3M\3M\3N\3N\3N\3N\3N\3O\3O\3O\3O\7O\u0224\nO\fO\16O\u0227"+ - "\13O\3O\3O\3P\3P\7P\u022d\nP\fP\16P\u0230\13P\3Q\3Q\3Q\7Q\u0235\nQ\fQ"+ - "\16Q\u0238\13Q\5Q\u023a\nQ\3Q\3Q\3R\3R\7R\u0240\nR\fR\16R\u0243\13R\3"+ - "R\3R\6\u00b3\u00bd\u01ec\u01f8\2S\4\3\6\4\b\5\n\6\f\7\16\b\20\t\22\n\24"+ - "\13\26\f\30\r\32\16\34\17\36\20 \21\"\22$\23&\24(\25*\26,\27.\30\60\31"+ - "\62\32\64\33\66\348\35:\36<\37> @!B\"D#F$H%J&L\'N(P)R*T+V,X-Z.\\/^\60"+ - "`\61b\62d\63f\64h\65j\66l\67n8p9r:t;v|?~@\u0080A\u0082B\u0084C\u0086"+ - "D\u0088E\u008aF\u008cG\u008eH\u0090I\u0092J\u0094K\u0096L\u0098M\u009a"+ - "N\u009cO\u009eP\u00a0Q\u00a2R\u00a4S\4\2\3\24\5\2\13\f\17\17\"\"\4\2\f"+ - "\f\17\17\3\2\629\4\2NNnn\4\2ZZzz\5\2\62;CHch\3\2\63;\3\2\62;\b\2FFHHN"+ - "Nffhhnn\4\2GGgg\4\2--//\4\2HHhh\4\2$$^^\4\2\f\f\61\61\3\2\f\f\t\2WWee"+ - "kknouuwwzz\5\2C\\aac|\6\2\62;C\\aac|\u0266\2\4\3\2\2\2\2\6\3\2\2\2\2\b"+ - "\3\2\2\2\2\n\3\2\2\2\2\f\3\2\2\2\2\16\3\2\2\2\2\20\3\2\2\2\2\22\3\2\2"+ - "\2\2\24\3\2\2\2\2\26\3\2\2\2\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2\2\2\2"+ - "\36\3\2\2\2\2 \3\2\2\2\2\"\3\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2\2\2\2"+ - "*\3\2\2\2\2,\3\2\2\2\2.\3\2\2\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3\2\2\2"+ - "\2\66\3\2\2\2\28\3\2\2\2\2:\3\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2\2\2"+ - "B\3\2\2\2\2D\3\2\2\2\2F\3\2\2\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2N\3"+ - "\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3\2\2"+ - "\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2\2\2"+ - "\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2\2t"+ - "\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080"+ - "\3\2\2\2\2\u0082\3\2\2\2\2\u0084\3\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2"+ - "\2\2\u008a\3\2\2\2\2\u008c\3\2\2\2\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092"+ - "\3\2\2\2\2\u0094\3\2\2\2\2\u0096\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2"+ - "\2\2\u009c\3\2\2\2\2\u009e\3\2\2\2\2\u00a0\3\2\2\2\3\u00a2\3\2\2\2\3\u00a4"+ - "\3\2\2\2\4\u00a7\3\2\2\2\6\u00c2\3\2\2\2\b\u00c6\3\2\2\2\n\u00c8\3\2\2"+ - "\2\f\u00ca\3\2\2\2\16\u00cc\3\2\2\2\20\u00ce\3\2\2\2\22\u00d0\3\2\2\2"+ - "\24\u00d2\3\2\2\2\26\u00d6\3\2\2\2\30\u00d8\3\2\2\2\32\u00da\3\2\2\2\34"+ - "\u00dd\3\2\2\2\36\u00e2\3\2\2\2 \u00e8\3\2\2\2\"\u00eb\3\2\2\2$\u00ef"+ - "\3\2\2\2&\u00f8\3\2\2\2(\u00fe\3\2\2\2*\u0105\3\2\2\2,\u0109\3\2\2\2."+ - "\u010d\3\2\2\2\60\u0113\3\2\2\2\62\u0119\3\2\2\2\64\u011e\3\2\2\2\66\u0129"+ - "\3\2\2\28\u012b\3\2\2\2:\u012d\3\2\2\2<\u012f\3\2\2\2>\u0132\3\2\2\2@"+ - "\u0134\3\2\2\2B\u0136\3\2\2\2D\u0138\3\2\2\2F\u013b\3\2\2\2H\u013e\3\2"+ - "\2\2J\u0142\3\2\2\2L\u0144\3\2\2\2N\u0147\3\2\2\2P\u0149\3\2\2\2R\u014c"+ - "\3\2\2\2T\u014f\3\2\2\2V\u0153\3\2\2\2X\u0156\3\2\2\2Z\u015a\3\2\2\2\\"+ - "\u015c\3\2\2\2^\u015e\3\2\2\2`\u0160\3\2\2\2b\u0163\3\2\2\2d\u0166\3\2"+ - "\2\2f\u0168\3\2\2\2h\u016a\3\2\2\2j\u016d\3\2\2\2l\u0170\3\2\2\2n\u0173"+ - "\3\2\2\2p\u0177\3\2\2\2r\u017a\3\2\2\2t\u017d\3\2\2\2v\u017f\3\2\2\2x"+ - "\u0182\3\2\2\2z\u0185\3\2\2\2|\u0188\3\2\2\2~\u018b\3\2\2\2\u0080\u018e"+ - "\3\2\2\2\u0082\u0191\3\2\2\2\u0084\u0194\3\2\2\2\u0086\u0197\3\2\2\2\u0088"+ - "\u019b\3\2\2\2\u008a\u019f\3\2\2\2\u008c\u01a4\3\2\2\2\u008e\u01ad\3\2"+ - "\2\2\u0090\u01bf\3\2\2\2\u0092\u01cc\3\2\2\2\u0094\u01fc\3\2\2\2\u0096"+ - "\u01fe\3\2\2\2\u0098\u020f\3\2\2\2\u009a\u0214\3\2\2\2\u009c\u021a\3\2"+ - "\2\2\u009e\u021f\3\2\2\2\u00a0\u022a\3\2\2\2\u00a2\u0239\3\2\2\2\u00a4"+ - "\u023d\3\2\2\2\u00a6\u00a8\t\2\2\2\u00a7\u00a6\3\2\2\2\u00a8\u00a9\3\2"+ - "\2\2\u00a9\u00a7\3\2\2\2\u00a9\u00aa\3\2\2\2\u00aa\u00ab\3\2\2\2\u00ab"+ - "\u00ac\b\2\2\2\u00ac\5\3\2\2\2\u00ad\u00ae\7\61\2\2\u00ae\u00af\7\61\2"+ - "\2\u00af\u00b3\3\2\2\2\u00b0\u00b2\13\2\2\2\u00b1\u00b0\3\2\2\2\u00b2"+ - "\u00b5\3\2\2\2\u00b3\u00b4\3\2\2\2\u00b3\u00b1\3\2\2\2\u00b4\u00b6\3\2"+ - "\2\2\u00b5\u00b3\3\2\2\2\u00b6\u00c3\t\3\2\2\u00b7\u00b8\7\61\2\2\u00b8"+ - "\u00b9\7,\2\2\u00b9\u00bd\3\2\2\2\u00ba\u00bc\13\2\2\2\u00bb\u00ba\3\2"+ - "\2\2\u00bc\u00bf\3\2\2\2\u00bd\u00be\3\2\2\2\u00bd\u00bb\3\2\2\2\u00be"+ - "\u00c0\3\2\2\2\u00bf\u00bd\3\2\2\2\u00c0\u00c1\7,\2\2\u00c1\u00c3\7\61"+ - "\2\2\u00c2\u00ad\3\2\2\2\u00c2\u00b7\3\2\2\2\u00c3\u00c4\3\2\2\2\u00c4"+ - "\u00c5\b\3\2\2\u00c5\7\3\2\2\2\u00c6\u00c7\7}\2\2\u00c7\t\3\2\2\2\u00c8"+ - "\u00c9\7\177\2\2\u00c9\13\3\2\2\2\u00ca\u00cb\7]\2\2\u00cb\r\3\2\2\2\u00cc"+ - "\u00cd\7_\2\2\u00cd\17\3\2\2\2\u00ce\u00cf\7*\2\2\u00cf\21\3\2\2\2\u00d0"+ - "\u00d1\7+\2\2\u00d1\23\3\2\2\2\u00d2\u00d3\7\60\2\2\u00d3\u00d4\3\2\2"+ - "\2\u00d4\u00d5\b\n\3\2\u00d5\25\3\2\2\2\u00d6\u00d7\7.\2\2\u00d7\27\3"+ - "\2\2\2\u00d8\u00d9\7=\2\2\u00d9\31\3\2\2\2\u00da\u00db\7k\2\2\u00db\u00dc"+ - "\7h\2\2\u00dc\33\3\2\2\2\u00dd\u00de\7g\2\2\u00de\u00df\7n\2\2\u00df\u00e0"+ - "\7u\2\2\u00e0\u00e1\7g\2\2\u00e1\35\3\2\2\2\u00e2\u00e3\7y\2\2\u00e3\u00e4"+ - "\7j\2\2\u00e4\u00e5\7k\2\2\u00e5\u00e6\7n\2\2\u00e6\u00e7\7g\2\2\u00e7"+ - "\37\3\2\2\2\u00e8\u00e9\7f\2\2\u00e9\u00ea\7q\2\2\u00ea!\3\2\2\2\u00eb"+ - "\u00ec\7h\2\2\u00ec\u00ed\7q\2\2\u00ed\u00ee\7t\2\2\u00ee#\3\2\2\2\u00ef"+ - "\u00f0\7e\2\2\u00f0\u00f1\7q\2\2\u00f1\u00f2\7p\2\2\u00f2\u00f3\7v\2\2"+ - "\u00f3\u00f4\7k\2\2\u00f4\u00f5\7p\2\2\u00f5\u00f6\7w\2\2\u00f6\u00f7"+ - "\7g\2\2\u00f7%\3\2\2\2\u00f8\u00f9\7d\2\2\u00f9\u00fa\7t\2\2\u00fa\u00fb"+ - "\7g\2\2\u00fb\u00fc\7c\2\2\u00fc\u00fd\7m\2\2\u00fd\'\3\2\2\2\u00fe\u00ff"+ - "\7t\2\2\u00ff\u0100\7g\2\2\u0100\u0101\7v\2\2\u0101\u0102\7w\2\2\u0102"+ - "\u0103\7t\2\2\u0103\u0104\7p\2\2\u0104)\3\2\2\2\u0105\u0106\7p\2\2\u0106"+ - "\u0107\7g\2\2\u0107\u0108\7y\2\2\u0108+\3\2\2\2\u0109\u010a\7v\2\2\u010a"+ - "\u010b\7t\2\2\u010b\u010c\7{\2\2\u010c-\3\2\2\2\u010d\u010e\7e\2\2\u010e"+ - "\u010f\7c\2\2\u010f\u0110\7v\2\2\u0110\u0111\7e\2\2\u0111\u0112\7j\2\2"+ - "\u0112/\3\2\2\2\u0113\u0114\7v\2\2\u0114\u0115\7j\2\2\u0115\u0116\7t\2"+ - "\2\u0116\u0117\7q\2\2\u0117\u0118\7y\2\2\u0118\61\3\2\2\2\u0119\u011a"+ - "\7v\2\2\u011a\u011b\7j\2\2\u011b\u011c\7k\2\2\u011c\u011d\7u\2\2\u011d"+ - "\63\3\2\2\2\u011e\u011f\7k\2\2\u011f\u0120\7p\2\2\u0120\u0121\7u\2\2\u0121"+ - "\u0122\7v\2\2\u0122\u0123\7c\2\2\u0123\u0124\7p\2\2\u0124\u0125\7e\2\2"+ - "\u0125\u0126\7g\2\2\u0126\u0127\7q\2\2\u0127\u0128\7h\2\2\u0128\65\3\2"+ - "\2\2\u0129\u012a\7#\2\2\u012a\67\3\2\2\2\u012b\u012c\7\u0080\2\2\u012c"+ - "9\3\2\2\2\u012d\u012e\7,\2\2\u012e;\3\2\2\2\u012f\u0130\7\61\2\2\u0130"+ - "\u0131\6\36\2\2\u0131=\3\2\2\2\u0132\u0133\7\'\2\2\u0133?\3\2\2\2\u0134"+ - "\u0135\7-\2\2\u0135A\3\2\2\2\u0136\u0137\7/\2\2\u0137C\3\2\2\2\u0138\u0139"+ - "\7>\2\2\u0139\u013a\7>\2\2\u013aE\3\2\2\2\u013b\u013c\7@\2\2\u013c\u013d"+ - "\7@\2\2\u013dG\3\2\2\2\u013e\u013f\7@\2\2\u013f\u0140\7@\2\2\u0140\u0141"+ - "\7@\2\2\u0141I\3\2\2\2\u0142\u0143\7>\2\2\u0143K\3\2\2\2\u0144\u0145\7"+ - ">\2\2\u0145\u0146\7?\2\2\u0146M\3\2\2\2\u0147\u0148\7@\2\2\u0148O\3\2"+ - "\2\2\u0149\u014a\7@\2\2\u014a\u014b\7?\2\2\u014bQ\3\2\2\2\u014c\u014d"+ - "\7?\2\2\u014d\u014e\7?\2\2\u014eS\3\2\2\2\u014f\u0150\7?\2\2\u0150\u0151"+ - "\7?\2\2\u0151\u0152\7?\2\2\u0152U\3\2\2\2\u0153\u0154\7#\2\2\u0154\u0155"+ - "\7?\2\2\u0155W\3\2\2\2\u0156\u0157\7#\2\2\u0157\u0158\7?\2\2\u0158\u0159"+ - "\7?\2\2\u0159Y\3\2\2\2\u015a\u015b\7(\2\2\u015b[\3\2\2\2\u015c\u015d\7"+ - "`\2\2\u015d]\3\2\2\2\u015e\u015f\7~\2\2\u015f_\3\2\2\2\u0160\u0161\7("+ - "\2\2\u0161\u0162\7(\2\2\u0162a\3\2\2\2\u0163\u0164\7~\2\2\u0164\u0165"+ - "\7~\2\2\u0165c\3\2\2\2\u0166\u0167\7A\2\2\u0167e\3\2\2\2\u0168\u0169\7"+ - "<\2\2\u0169g\3\2\2\2\u016a\u016b\7<\2\2\u016b\u016c\7<\2\2\u016ci\3\2"+ - "\2\2\u016d\u016e\7/\2\2\u016e\u016f\7@\2\2\u016fk\3\2\2\2\u0170\u0171"+ - "\7?\2\2\u0171\u0172\7\u0080\2\2\u0172m\3\2\2\2\u0173\u0174\7?\2\2\u0174"+ - "\u0175\7?\2\2\u0175\u0176\7\u0080\2\2\u0176o\3\2\2\2\u0177\u0178\7-\2"+ - "\2\u0178\u0179\7-\2\2\u0179q\3\2\2\2\u017a\u017b\7/\2\2\u017b\u017c\7"+ - "/\2\2\u017cs\3\2\2\2\u017d\u017e\7?\2\2\u017eu\3\2\2\2\u017f\u0180\7-"+ - "\2\2\u0180\u0181\7?\2\2\u0181w\3\2\2\2\u0182\u0183\7/\2\2\u0183\u0184"+ - "\7?\2\2\u0184y\3\2\2\2\u0185\u0186\7,\2\2\u0186\u0187\7?\2\2\u0187{\3"+ - "\2\2\2\u0188\u0189\7\61\2\2\u0189\u018a\7?\2\2\u018a}\3\2\2\2\u018b\u018c"+ - "\7\'\2\2\u018c\u018d\7?\2\2\u018d\177\3\2\2\2\u018e\u018f\7(\2\2\u018f"+ - "\u0190\7?\2\2\u0190\u0081\3\2\2\2\u0191\u0192\7`\2\2\u0192\u0193\7?\2"+ - "\2\u0193\u0083\3\2\2\2\u0194\u0195\7~\2\2\u0195\u0196\7?\2\2\u0196\u0085"+ - "\3\2\2\2\u0197\u0198\7>\2\2\u0198\u0199\7>\2\2\u0199\u019a\7?\2\2\u019a"+ - "\u0087\3\2\2\2\u019b\u019c\7@\2\2\u019c\u019d\7@\2\2\u019d\u019e\7?\2"+ - "\2\u019e\u0089\3\2\2\2\u019f\u01a0\7@\2\2\u01a0\u01a1\7@\2\2\u01a1\u01a2"+ - "\7@\2\2\u01a2\u01a3\7?\2\2\u01a3\u008b\3\2\2\2\u01a4\u01a6\7\62\2\2\u01a5"+ - "\u01a7\t\4\2\2\u01a6\u01a5\3\2\2\2\u01a7\u01a8\3\2\2\2\u01a8\u01a6\3\2"+ - "\2\2\u01a8\u01a9\3\2\2\2\u01a9\u01ab\3\2\2\2\u01aa\u01ac\t\5\2\2\u01ab"+ - "\u01aa\3\2\2\2\u01ab\u01ac\3\2\2\2\u01ac\u008d\3\2\2\2\u01ad\u01ae\7\62"+ - "\2\2\u01ae\u01b0\t\6\2\2\u01af\u01b1\t\7\2\2\u01b0\u01af\3\2\2\2\u01b1"+ - "\u01b2\3\2\2\2\u01b2\u01b0\3\2\2\2\u01b2\u01b3\3\2\2\2\u01b3\u01b5\3\2"+ - "\2\2\u01b4\u01b6\t\5\2\2\u01b5\u01b4\3\2\2\2\u01b5\u01b6\3\2\2\2\u01b6"+ - "\u008f\3\2\2\2\u01b7\u01c0\7\62\2\2\u01b8\u01bc\t\b\2\2\u01b9\u01bb\t"+ - "\t\2\2\u01ba\u01b9\3\2\2\2\u01bb\u01be\3\2\2\2\u01bc\u01ba\3\2\2\2\u01bc"+ - "\u01bd\3\2\2\2\u01bd\u01c0\3\2\2\2\u01be\u01bc\3\2\2\2\u01bf\u01b7\3\2"+ - "\2\2\u01bf\u01b8\3\2\2\2\u01c0\u01c2\3\2\2\2\u01c1\u01c3\t\n\2\2\u01c2"+ - "\u01c1\3\2\2\2\u01c2\u01c3\3\2\2\2\u01c3\u0091\3\2\2\2\u01c4\u01cd\7\62"+ - "\2\2\u01c5\u01c9\t\b\2\2\u01c6\u01c8\t\t\2\2\u01c7\u01c6\3\2\2\2\u01c8"+ - "\u01cb\3\2\2\2\u01c9\u01c7\3\2\2\2\u01c9\u01ca\3\2\2\2\u01ca\u01cd\3\2"+ - "\2\2\u01cb\u01c9\3\2\2\2\u01cc\u01c4\3\2\2\2\u01cc\u01c5\3\2\2\2\u01cd"+ - "\u01d4\3\2\2\2\u01ce\u01d0\5\24\n\2\u01cf\u01d1\t\t\2\2\u01d0\u01cf\3"+ - "\2\2\2\u01d1\u01d2\3\2\2\2\u01d2\u01d0\3\2\2\2\u01d2\u01d3\3\2\2\2\u01d3"+ - "\u01d5\3\2\2\2\u01d4\u01ce\3\2\2\2\u01d4\u01d5\3\2\2\2\u01d5\u01df\3\2"+ - "\2\2\u01d6\u01d8\t\13\2\2\u01d7\u01d9\t\f\2\2\u01d8\u01d7\3\2\2\2\u01d8"+ - "\u01d9\3\2\2\2\u01d9\u01db\3\2\2\2\u01da\u01dc\t\t\2\2\u01db\u01da\3\2"+ - "\2\2\u01dc\u01dd\3\2\2\2\u01dd\u01db\3\2\2\2\u01dd\u01de\3\2\2\2\u01de"+ - "\u01e0\3\2\2\2\u01df\u01d6\3\2\2\2\u01df\u01e0\3\2\2\2\u01e0\u01e2\3\2"+ - "\2\2\u01e1\u01e3\t\r\2\2\u01e2\u01e1\3\2\2\2\u01e2\u01e3\3\2\2\2\u01e3"+ - "\u0093\3\2\2\2\u01e4\u01ec\7$\2\2\u01e5\u01e6\7^\2\2\u01e6\u01eb\7$\2"+ - "\2\u01e7\u01e8\7^\2\2\u01e8\u01eb\7^\2\2\u01e9\u01eb\n\16\2\2\u01ea\u01e5"+ - "\3\2\2\2\u01ea\u01e7\3\2\2\2\u01ea\u01e9\3\2\2\2\u01eb\u01ee\3\2\2\2\u01ec"+ - "\u01ed\3\2\2\2\u01ec\u01ea\3\2\2\2\u01ed\u01ef\3\2\2\2\u01ee\u01ec\3\2"+ - "\2\2\u01ef\u01fd\7$\2\2\u01f0\u01f8\7)\2\2\u01f1\u01f2\7^\2\2\u01f2\u01f7"+ - "\7)\2\2\u01f3\u01f4\7^\2\2\u01f4\u01f7\7^\2\2\u01f5\u01f7\n\16\2\2\u01f6"+ - "\u01f1\3\2\2\2\u01f6\u01f3\3\2\2\2\u01f6\u01f5\3\2\2\2\u01f7\u01fa\3\2"+ - "\2\2\u01f8\u01f9\3\2\2\2\u01f8\u01f6\3\2\2\2\u01f9\u01fb\3\2\2\2\u01fa"+ - "\u01f8\3\2\2\2\u01fb\u01fd\7)\2\2\u01fc\u01e4\3\2\2\2\u01fc\u01f0\3\2"+ - "\2\2\u01fd\u0095\3\2\2\2\u01fe\u0202\7\61\2\2\u01ff\u0203\n\17\2\2\u0200"+ - "\u0201\7^\2\2\u0201\u0203\n\20\2\2\u0202\u01ff\3\2\2\2\u0202\u0200\3\2"+ - "\2\2\u0203\u0204\3\2\2\2\u0204\u0202\3\2\2\2\u0204\u0205\3\2\2\2\u0205"+ - "\u0206\3\2\2\2\u0206\u020a\7\61\2\2\u0207\u0209\t\21\2\2\u0208\u0207\3"+ - "\2\2\2\u0209\u020c\3\2\2\2\u020a\u0208\3\2\2\2\u020a\u020b\3\2\2\2\u020b"+ - "\u020d\3\2\2\2\u020c\u020a\3\2\2\2\u020d\u020e\6K\3\2\u020e\u0097\3\2"+ - "\2\2\u020f\u0210\7v\2\2\u0210\u0211\7t\2\2\u0211\u0212\7w\2\2\u0212\u0213"+ - "\7g\2\2\u0213\u0099\3\2\2\2\u0214\u0215\7h\2\2\u0215\u0216\7c\2\2\u0216"+ - "\u0217\7n\2\2\u0217\u0218\7u\2\2\u0218\u0219\7g\2\2\u0219\u009b\3\2\2"+ - "\2\u021a\u021b\7p\2\2\u021b\u021c\7w\2\2\u021c\u021d\7n\2\2\u021d\u021e"+ - "\7n\2\2\u021e\u009d\3\2\2\2\u021f\u0225\5\u00a0P\2\u0220\u0221\5\24\n"+ - "\2\u0221\u0222\5\u00a0P\2\u0222\u0224\3\2\2\2\u0223\u0220\3\2\2\2\u0224"+ - "\u0227\3\2\2\2\u0225\u0223\3\2\2\2\u0225\u0226\3\2\2\2\u0226\u0228\3\2"+ - "\2\2\u0227\u0225\3\2\2\2\u0228\u0229\6O\4\2\u0229\u009f\3\2\2\2\u022a"+ - "\u022e\t\22\2\2\u022b\u022d\t\23\2\2\u022c\u022b\3\2\2\2\u022d\u0230\3"+ - "\2\2\2\u022e\u022c\3\2\2\2\u022e\u022f\3\2\2\2\u022f\u00a1\3\2\2\2\u0230"+ - "\u022e\3\2\2\2\u0231\u023a\7\62\2\2\u0232\u0236\t\b\2\2\u0233\u0235\t"+ - "\t\2\2\u0234\u0233\3\2\2\2\u0235\u0238\3\2\2\2\u0236\u0234\3\2\2\2\u0236"+ - "\u0237\3\2\2\2\u0237\u023a\3\2\2\2\u0238\u0236\3\2\2\2\u0239\u0231\3\2"+ - "\2\2\u0239\u0232\3\2\2\2\u023a\u023b\3\2\2\2\u023b\u023c\bQ\4\2\u023c"+ - "\u00a3\3\2\2\2\u023d\u0241\t\22\2\2\u023e\u0240\t\23\2\2\u023f\u023e\3"+ - "\2\2\2\u0240\u0243\3\2\2\2\u0241\u023f\3\2\2\2\u0241\u0242\3\2\2\2\u0242"+ - "\u0244\3\2\2\2\u0243\u0241\3\2\2\2\u0244\u0245\bR\4\2\u0245\u00a5\3\2"+ - "\2\2$\2\3\u00a9\u00b3\u00bd\u00c2\u01a8\u01ab\u01b2\u01b5\u01bc\u01bf"+ - "\u01c2\u01c9\u01cc\u01d2\u01d4\u01d8\u01dd\u01df\u01e2\u01ea\u01ec\u01f6"+ - "\u01f8\u01fc\u0202\u0204\u020a\u0225\u022e\u0236\u0239\u0241\5\b\2\2\4"+ - "\3\2\4\2\2"; + "I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\3\2\6"+ + "\2\u00aa\n\2\r\2\16\2\u00ab\3\2\3\2\3\3\3\3\3\3\3\3\7\3\u00b4\n\3\f\3"+ + "\16\3\u00b7\13\3\3\3\3\3\3\3\3\3\3\3\7\3\u00be\n\3\f\3\16\3\u00c1\13\3"+ + "\3\3\3\3\5\3\u00c5\n\3\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b"+ + "\3\t\3\t\3\n\3\n\3\n\3\n\3\13\3\13\3\f\3\f\3\r\3\r\3\r\3\16\3\16\3\16"+ + "\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21"+ + "\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24"+ + "\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26"+ + "\3\26\3\26\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31"+ + "\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33"+ + "\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37"+ + "\3\37\3 \3 \3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3%\3&\3&\3\'\3\'"+ + "\3\'\3(\3(\3)\3)\3)\3*\3*\3*\3+\3+\3+\3+\3,\3,\3,\3-\3-\3-\3-\3.\3.\3"+ + "/\3/\3\60\3\60\3\61\3\61\3\61\3\62\3\62\3\62\3\63\3\63\3\64\3\64\3\65"+ + "\3\65\3\65\3\66\3\66\3\66\3\67\3\67\3\67\38\38\38\38\39\39\39\3:\3:\3"+ + ":\3;\3;\3<\3<\3<\3=\3=\3=\3>\3>\3>\3?\3?\3?\3@\3@\3@\3A\3A\3A\3B\3B\3"+ + "B\3C\3C\3C\3D\3D\3D\3D\3E\3E\3E\3E\3F\3F\3F\3F\3F\3G\3G\6G\u01ac\nG\r"+ + "G\16G\u01ad\3G\5G\u01b1\nG\3H\3H\3H\6H\u01b6\nH\rH\16H\u01b7\3H\5H\u01bb"+ + "\nH\3I\3I\3I\7I\u01c0\nI\fI\16I\u01c3\13I\5I\u01c5\nI\3I\5I\u01c8\nI\3"+ + "J\3J\3J\7J\u01cd\nJ\fJ\16J\u01d0\13J\5J\u01d2\nJ\3J\3J\6J\u01d6\nJ\rJ"+ + "\16J\u01d7\5J\u01da\nJ\3J\3J\5J\u01de\nJ\3J\6J\u01e1\nJ\rJ\16J\u01e2\5"+ + "J\u01e5\nJ\3J\5J\u01e8\nJ\3K\3K\3K\3K\3K\3K\7K\u01f0\nK\fK\16K\u01f3\13"+ + "K\3K\3K\3K\3K\3K\3K\3K\7K\u01fc\nK\fK\16K\u01ff\13K\3K\5K\u0202\nK\3L"+ + "\3L\3L\3L\6L\u0208\nL\rL\16L\u0209\3L\3L\7L\u020e\nL\fL\16L\u0211\13L"+ + "\3L\3L\3M\3M\3M\3M\3M\3N\3N\3N\3N\3N\3N\3O\3O\3O\3O\3O\3P\3P\3P\3P\7P"+ + "\u0229\nP\fP\16P\u022c\13P\3P\3P\3Q\3Q\7Q\u0232\nQ\fQ\16Q\u0235\13Q\3"+ + "R\3R\3R\7R\u023a\nR\fR\16R\u023d\13R\5R\u023f\nR\3R\3R\3S\3S\7S\u0245"+ + "\nS\fS\16S\u0248\13S\3S\3S\6\u00b5\u00bf\u01f1\u01fd\2T\4\3\6\4\b\5\n"+ + "\6\f\7\16\b\20\t\22\n\24\13\26\f\30\r\32\16\34\17\36\20 \21\"\22$\23&"+ + "\24(\25*\26,\27.\30\60\31\62\32\64\33\66\348\35:\36<\37> @!B\"D#F$H%J"+ + "&L\'N(P)R*T+V,X-Z.\\/^\60`\61b\62d\63f\64h\65j\66l\67n8p9r:t;v|?"+ + "~@\u0080A\u0082B\u0084C\u0086D\u0088E\u008aF\u008cG\u008eH\u0090I\u0092"+ + "J\u0094K\u0096L\u0098M\u009aN\u009cO\u009eP\u00a0Q\u00a2R\u00a4S\u00a6"+ + "T\4\2\3\24\5\2\13\f\17\17\"\"\4\2\f\f\17\17\3\2\629\4\2NNnn\4\2ZZzz\5"+ + "\2\62;CHch\3\2\63;\3\2\62;\b\2FFHHNNffhhnn\4\2GGgg\4\2--//\4\2HHhh\4\2"+ + "$$^^\4\2\f\f\61\61\3\2\f\f\t\2WWeekknouuwwzz\5\2C\\aac|\6\2\62;C\\aac"+ + "|\u026b\2\4\3\2\2\2\2\6\3\2\2\2\2\b\3\2\2\2\2\n\3\2\2\2\2\f\3\2\2\2\2"+ + "\16\3\2\2\2\2\20\3\2\2\2\2\22\3\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2\2\30\3"+ + "\2\2\2\2\32\3\2\2\2\2\34\3\2\2\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3\2\2\2\2"+ + "$\3\2\2\2\2&\3\2\2\2\2(\3\2\2\2\2*\3\2\2\2\2,\3\2\2\2\2.\3\2\2\2\2\60"+ + "\3\2\2\2\2\62\3\2\2\2\2\64\3\2\2\2\2\66\3\2\2\2\28\3\2\2\2\2:\3\2\2\2"+ + "\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2\2\2B\3\2\2\2\2D\3\2\2\2\2F\3\2\2\2\2H"+ + "\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2N\3\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2T\3\2"+ + "\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3\2\2\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3\2\2"+ + "\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2\2\2\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2\2\2"+ + "n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2\2t\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2z\3"+ + "\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080\3\2\2\2\2\u0082\3\2\2\2\2\u0084\3"+ + "\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2\2\2\u008a\3\2\2\2\2\u008c\3\2\2\2"+ + "\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092\3\2\2\2\2\u0094\3\2\2\2\2\u0096"+ + "\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2\2\2\u009c\3\2\2\2\2\u009e\3\2\2"+ + "\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\3\u00a4\3\2\2\2\3\u00a6\3\2\2\2\4\u00a9"+ + "\3\2\2\2\6\u00c4\3\2\2\2\b\u00c8\3\2\2\2\n\u00ca\3\2\2\2\f\u00cc\3\2\2"+ + "\2\16\u00ce\3\2\2\2\20\u00d0\3\2\2\2\22\u00d2\3\2\2\2\24\u00d4\3\2\2\2"+ + "\26\u00d8\3\2\2\2\30\u00da\3\2\2\2\32\u00dc\3\2\2\2\34\u00df\3\2\2\2\36"+ + "\u00e2\3\2\2\2 \u00e7\3\2\2\2\"\u00ed\3\2\2\2$\u00f0\3\2\2\2&\u00f4\3"+ + "\2\2\2(\u00fd\3\2\2\2*\u0103\3\2\2\2,\u010a\3\2\2\2.\u010e\3\2\2\2\60"+ + "\u0112\3\2\2\2\62\u0118\3\2\2\2\64\u011e\3\2\2\2\66\u0123\3\2\2\28\u012e"+ + "\3\2\2\2:\u0130\3\2\2\2<\u0132\3\2\2\2>\u0134\3\2\2\2@\u0137\3\2\2\2B"+ + "\u0139\3\2\2\2D\u013b\3\2\2\2F\u013d\3\2\2\2H\u0140\3\2\2\2J\u0143\3\2"+ + "\2\2L\u0147\3\2\2\2N\u0149\3\2\2\2P\u014c\3\2\2\2R\u014e\3\2\2\2T\u0151"+ + "\3\2\2\2V\u0154\3\2\2\2X\u0158\3\2\2\2Z\u015b\3\2\2\2\\\u015f\3\2\2\2"+ + "^\u0161\3\2\2\2`\u0163\3\2\2\2b\u0165\3\2\2\2d\u0168\3\2\2\2f\u016b\3"+ + "\2\2\2h\u016d\3\2\2\2j\u016f\3\2\2\2l\u0172\3\2\2\2n\u0175\3\2\2\2p\u0178"+ + "\3\2\2\2r\u017c\3\2\2\2t\u017f\3\2\2\2v\u0182\3\2\2\2x\u0184\3\2\2\2z"+ + "\u0187\3\2\2\2|\u018a\3\2\2\2~\u018d\3\2\2\2\u0080\u0190\3\2\2\2\u0082"+ + "\u0193\3\2\2\2\u0084\u0196\3\2\2\2\u0086\u0199\3\2\2\2\u0088\u019c\3\2"+ + "\2\2\u008a\u01a0\3\2\2\2\u008c\u01a4\3\2\2\2\u008e\u01a9\3\2\2\2\u0090"+ + "\u01b2\3\2\2\2\u0092\u01c4\3\2\2\2\u0094\u01d1\3\2\2\2\u0096\u0201\3\2"+ + "\2\2\u0098\u0203\3\2\2\2\u009a\u0214\3\2\2\2\u009c\u0219\3\2\2\2\u009e"+ + "\u021f\3\2\2\2\u00a0\u0224\3\2\2\2\u00a2\u022f\3\2\2\2\u00a4\u023e\3\2"+ + "\2\2\u00a6\u0242\3\2\2\2\u00a8\u00aa\t\2\2\2\u00a9\u00a8\3\2\2\2\u00aa"+ + "\u00ab\3\2\2\2\u00ab\u00a9\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad\3\2"+ + "\2\2\u00ad\u00ae\b\2\2\2\u00ae\5\3\2\2\2\u00af\u00b0\7\61\2\2\u00b0\u00b1"+ + "\7\61\2\2\u00b1\u00b5\3\2\2\2\u00b2\u00b4\13\2\2\2\u00b3\u00b2\3\2\2\2"+ + "\u00b4\u00b7\3\2\2\2\u00b5\u00b6\3\2\2\2\u00b5\u00b3\3\2\2\2\u00b6\u00b8"+ + "\3\2\2\2\u00b7\u00b5\3\2\2\2\u00b8\u00c5\t\3\2\2\u00b9\u00ba\7\61\2\2"+ + "\u00ba\u00bb\7,\2\2\u00bb\u00bf\3\2\2\2\u00bc\u00be\13\2\2\2\u00bd\u00bc"+ + "\3\2\2\2\u00be\u00c1\3\2\2\2\u00bf\u00c0\3\2\2\2\u00bf\u00bd\3\2\2\2\u00c0"+ + "\u00c2\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c2\u00c3\7,\2\2\u00c3\u00c5\7\61"+ + "\2\2\u00c4\u00af\3\2\2\2\u00c4\u00b9\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c6"+ + "\u00c7\b\3\2\2\u00c7\7\3\2\2\2\u00c8\u00c9\7}\2\2\u00c9\t\3\2\2\2\u00ca"+ + "\u00cb\7\177\2\2\u00cb\13\3\2\2\2\u00cc\u00cd\7]\2\2\u00cd\r\3\2\2\2\u00ce"+ + "\u00cf\7_\2\2\u00cf\17\3\2\2\2\u00d0\u00d1\7*\2\2\u00d1\21\3\2\2\2\u00d2"+ + "\u00d3\7+\2\2\u00d3\23\3\2\2\2\u00d4\u00d5\7\60\2\2\u00d5\u00d6\3\2\2"+ + "\2\u00d6\u00d7\b\n\3\2\u00d7\25\3\2\2\2\u00d8\u00d9\7.\2\2\u00d9\27\3"+ + "\2\2\2\u00da\u00db\7=\2\2\u00db\31\3\2\2\2\u00dc\u00dd\7k\2\2\u00dd\u00de"+ + "\7h\2\2\u00de\33\3\2\2\2\u00df\u00e0\7k\2\2\u00e0\u00e1\7p\2\2\u00e1\35"+ + "\3\2\2\2\u00e2\u00e3\7g\2\2\u00e3\u00e4\7n\2\2\u00e4\u00e5\7u\2\2\u00e5"+ + "\u00e6\7g\2\2\u00e6\37\3\2\2\2\u00e7\u00e8\7y\2\2\u00e8\u00e9\7j\2\2\u00e9"+ + "\u00ea\7k\2\2\u00ea\u00eb\7n\2\2\u00eb\u00ec\7g\2\2\u00ec!\3\2\2\2\u00ed"+ + "\u00ee\7f\2\2\u00ee\u00ef\7q\2\2\u00ef#\3\2\2\2\u00f0\u00f1\7h\2\2\u00f1"+ + "\u00f2\7q\2\2\u00f2\u00f3\7t\2\2\u00f3%\3\2\2\2\u00f4\u00f5\7e\2\2\u00f5"+ + "\u00f6\7q\2\2\u00f6\u00f7\7p\2\2\u00f7\u00f8\7v\2\2\u00f8\u00f9\7k\2\2"+ + "\u00f9\u00fa\7p\2\2\u00fa\u00fb\7w\2\2\u00fb\u00fc\7g\2\2\u00fc\'\3\2"+ + "\2\2\u00fd\u00fe\7d\2\2\u00fe\u00ff\7t\2\2\u00ff\u0100\7g\2\2\u0100\u0101"+ + "\7c\2\2\u0101\u0102\7m\2\2\u0102)\3\2\2\2\u0103\u0104\7t\2\2\u0104\u0105"+ + "\7g\2\2\u0105\u0106\7v\2\2\u0106\u0107\7w\2\2\u0107\u0108\7t\2\2\u0108"+ + "\u0109\7p\2\2\u0109+\3\2\2\2\u010a\u010b\7p\2\2\u010b\u010c\7g\2\2\u010c"+ + "\u010d\7y\2\2\u010d-\3\2\2\2\u010e\u010f\7v\2\2\u010f\u0110\7t\2\2\u0110"+ + "\u0111\7{\2\2\u0111/\3\2\2\2\u0112\u0113\7e\2\2\u0113\u0114\7c\2\2\u0114"+ + "\u0115\7v\2\2\u0115\u0116\7e\2\2\u0116\u0117\7j\2\2\u0117\61\3\2\2\2\u0118"+ + "\u0119\7v\2\2\u0119\u011a\7j\2\2\u011a\u011b\7t\2\2\u011b\u011c\7q\2\2"+ + "\u011c\u011d\7y\2\2\u011d\63\3\2\2\2\u011e\u011f\7v\2\2\u011f\u0120\7"+ + "j\2\2\u0120\u0121\7k\2\2\u0121\u0122\7u\2\2\u0122\65\3\2\2\2\u0123\u0124"+ + "\7k\2\2\u0124\u0125\7p\2\2\u0125\u0126\7u\2\2\u0126\u0127\7v\2\2\u0127"+ + "\u0128\7c\2\2\u0128\u0129\7p\2\2\u0129\u012a\7e\2\2\u012a\u012b\7g\2\2"+ + "\u012b\u012c\7q\2\2\u012c\u012d\7h\2\2\u012d\67\3\2\2\2\u012e\u012f\7"+ + "#\2\2\u012f9\3\2\2\2\u0130\u0131\7\u0080\2\2\u0131;\3\2\2\2\u0132\u0133"+ + "\7,\2\2\u0133=\3\2\2\2\u0134\u0135\7\61\2\2\u0135\u0136\6\37\2\2\u0136"+ + "?\3\2\2\2\u0137\u0138\7\'\2\2\u0138A\3\2\2\2\u0139\u013a\7-\2\2\u013a"+ + "C\3\2\2\2\u013b\u013c\7/\2\2\u013cE\3\2\2\2\u013d\u013e\7>\2\2\u013e\u013f"+ + "\7>\2\2\u013fG\3\2\2\2\u0140\u0141\7@\2\2\u0141\u0142\7@\2\2\u0142I\3"+ + "\2\2\2\u0143\u0144\7@\2\2\u0144\u0145\7@\2\2\u0145\u0146\7@\2\2\u0146"+ + "K\3\2\2\2\u0147\u0148\7>\2\2\u0148M\3\2\2\2\u0149\u014a\7>\2\2\u014a\u014b"+ + "\7?\2\2\u014bO\3\2\2\2\u014c\u014d\7@\2\2\u014dQ\3\2\2\2\u014e\u014f\7"+ + "@\2\2\u014f\u0150\7?\2\2\u0150S\3\2\2\2\u0151\u0152\7?\2\2\u0152\u0153"+ + "\7?\2\2\u0153U\3\2\2\2\u0154\u0155\7?\2\2\u0155\u0156\7?\2\2\u0156\u0157"+ + "\7?\2\2\u0157W\3\2\2\2\u0158\u0159\7#\2\2\u0159\u015a\7?\2\2\u015aY\3"+ + "\2\2\2\u015b\u015c\7#\2\2\u015c\u015d\7?\2\2\u015d\u015e\7?\2\2\u015e"+ + "[\3\2\2\2\u015f\u0160\7(\2\2\u0160]\3\2\2\2\u0161\u0162\7`\2\2\u0162_"+ + "\3\2\2\2\u0163\u0164\7~\2\2\u0164a\3\2\2\2\u0165\u0166\7(\2\2\u0166\u0167"+ + "\7(\2\2\u0167c\3\2\2\2\u0168\u0169\7~\2\2\u0169\u016a\7~\2\2\u016ae\3"+ + "\2\2\2\u016b\u016c\7A\2\2\u016cg\3\2\2\2\u016d\u016e\7<\2\2\u016ei\3\2"+ + "\2\2\u016f\u0170\7<\2\2\u0170\u0171\7<\2\2\u0171k\3\2\2\2\u0172\u0173"+ + "\7/\2\2\u0173\u0174\7@\2\2\u0174m\3\2\2\2\u0175\u0176\7?\2\2\u0176\u0177"+ + "\7\u0080\2\2\u0177o\3\2\2\2\u0178\u0179\7?\2\2\u0179\u017a\7?\2\2\u017a"+ + "\u017b\7\u0080\2\2\u017bq\3\2\2\2\u017c\u017d\7-\2\2\u017d\u017e\7-\2"+ + "\2\u017es\3\2\2\2\u017f\u0180\7/\2\2\u0180\u0181\7/\2\2\u0181u\3\2\2\2"+ + "\u0182\u0183\7?\2\2\u0183w\3\2\2\2\u0184\u0185\7-\2\2\u0185\u0186\7?\2"+ + "\2\u0186y\3\2\2\2\u0187\u0188\7/\2\2\u0188\u0189\7?\2\2\u0189{\3\2\2\2"+ + "\u018a\u018b\7,\2\2\u018b\u018c\7?\2\2\u018c}\3\2\2\2\u018d\u018e\7\61"+ + "\2\2\u018e\u018f\7?\2\2\u018f\177\3\2\2\2\u0190\u0191\7\'\2\2\u0191\u0192"+ + "\7?\2\2\u0192\u0081\3\2\2\2\u0193\u0194\7(\2\2\u0194\u0195\7?\2\2\u0195"+ + "\u0083\3\2\2\2\u0196\u0197\7`\2\2\u0197\u0198\7?\2\2\u0198\u0085\3\2\2"+ + "\2\u0199\u019a\7~\2\2\u019a\u019b\7?\2\2\u019b\u0087\3\2\2\2\u019c\u019d"+ + "\7>\2\2\u019d\u019e\7>\2\2\u019e\u019f\7?\2\2\u019f\u0089\3\2\2\2\u01a0"+ + "\u01a1\7@\2\2\u01a1\u01a2\7@\2\2\u01a2\u01a3\7?\2\2\u01a3\u008b\3\2\2"+ + "\2\u01a4\u01a5\7@\2\2\u01a5\u01a6\7@\2\2\u01a6\u01a7\7@\2\2\u01a7\u01a8"+ + "\7?\2\2\u01a8\u008d\3\2\2\2\u01a9\u01ab\7\62\2\2\u01aa\u01ac\t\4\2\2\u01ab"+ + "\u01aa\3\2\2\2\u01ac\u01ad\3\2\2\2\u01ad\u01ab\3\2\2\2\u01ad\u01ae\3\2"+ + "\2\2\u01ae\u01b0\3\2\2\2\u01af\u01b1\t\5\2\2\u01b0\u01af\3\2\2\2\u01b0"+ + "\u01b1\3\2\2\2\u01b1\u008f\3\2\2\2\u01b2\u01b3\7\62\2\2\u01b3\u01b5\t"+ + "\6\2\2\u01b4\u01b6\t\7\2\2\u01b5\u01b4\3\2\2\2\u01b6\u01b7\3\2\2\2\u01b7"+ + "\u01b5\3\2\2\2\u01b7\u01b8\3\2\2\2\u01b8\u01ba\3\2\2\2\u01b9\u01bb\t\5"+ + "\2\2\u01ba\u01b9\3\2\2\2\u01ba\u01bb\3\2\2\2\u01bb\u0091\3\2\2\2\u01bc"+ + "\u01c5\7\62\2\2\u01bd\u01c1\t\b\2\2\u01be\u01c0\t\t\2\2\u01bf\u01be\3"+ + "\2\2\2\u01c0\u01c3\3\2\2\2\u01c1\u01bf\3\2\2\2\u01c1\u01c2\3\2\2\2\u01c2"+ + "\u01c5\3\2\2\2\u01c3\u01c1\3\2\2\2\u01c4\u01bc\3\2\2\2\u01c4\u01bd\3\2"+ + "\2\2\u01c5\u01c7\3\2\2\2\u01c6\u01c8\t\n\2\2\u01c7\u01c6\3\2\2\2\u01c7"+ + "\u01c8\3\2\2\2\u01c8\u0093\3\2\2\2\u01c9\u01d2\7\62\2\2\u01ca\u01ce\t"+ + "\b\2\2\u01cb\u01cd\t\t\2\2\u01cc\u01cb\3\2\2\2\u01cd\u01d0\3\2\2\2\u01ce"+ + "\u01cc\3\2\2\2\u01ce\u01cf\3\2\2\2\u01cf\u01d2\3\2\2\2\u01d0\u01ce\3\2"+ + "\2\2\u01d1\u01c9\3\2\2\2\u01d1\u01ca\3\2\2\2\u01d2\u01d9\3\2\2\2\u01d3"+ + "\u01d5\5\24\n\2\u01d4\u01d6\t\t\2\2\u01d5\u01d4\3\2\2\2\u01d6\u01d7\3"+ + "\2\2\2\u01d7\u01d5\3\2\2\2\u01d7\u01d8\3\2\2\2\u01d8\u01da\3\2\2\2\u01d9"+ + "\u01d3\3\2\2\2\u01d9\u01da\3\2\2\2\u01da\u01e4\3\2\2\2\u01db\u01dd\t\13"+ + "\2\2\u01dc\u01de\t\f\2\2\u01dd\u01dc\3\2\2\2\u01dd\u01de\3\2\2\2\u01de"+ + "\u01e0\3\2\2\2\u01df\u01e1\t\t\2\2\u01e0\u01df\3\2\2\2\u01e1\u01e2\3\2"+ + "\2\2\u01e2\u01e0\3\2\2\2\u01e2\u01e3\3\2\2\2\u01e3\u01e5\3\2\2\2\u01e4"+ + "\u01db\3\2\2\2\u01e4\u01e5\3\2\2\2\u01e5\u01e7\3\2\2\2\u01e6\u01e8\t\r"+ + "\2\2\u01e7\u01e6\3\2\2\2\u01e7\u01e8\3\2\2\2\u01e8\u0095\3\2\2\2\u01e9"+ + "\u01f1\7$\2\2\u01ea\u01eb\7^\2\2\u01eb\u01f0\7$\2\2\u01ec\u01ed\7^\2\2"+ + "\u01ed\u01f0\7^\2\2\u01ee\u01f0\n\16\2\2\u01ef\u01ea\3\2\2\2\u01ef\u01ec"+ + "\3\2\2\2\u01ef\u01ee\3\2\2\2\u01f0\u01f3\3\2\2\2\u01f1\u01f2\3\2\2\2\u01f1"+ + "\u01ef\3\2\2\2\u01f2\u01f4\3\2\2\2\u01f3\u01f1\3\2\2\2\u01f4\u0202\7$"+ + "\2\2\u01f5\u01fd\7)\2\2\u01f6\u01f7\7^\2\2\u01f7\u01fc\7)\2\2\u01f8\u01f9"+ + "\7^\2\2\u01f9\u01fc\7^\2\2\u01fa\u01fc\n\16\2\2\u01fb\u01f6\3\2\2\2\u01fb"+ + "\u01f8\3\2\2\2\u01fb\u01fa\3\2\2\2\u01fc\u01ff\3\2\2\2\u01fd\u01fe\3\2"+ + "\2\2\u01fd\u01fb\3\2\2\2\u01fe\u0200\3\2\2\2\u01ff\u01fd\3\2\2\2\u0200"+ + "\u0202\7)\2\2\u0201\u01e9\3\2\2\2\u0201\u01f5\3\2\2\2\u0202\u0097\3\2"+ + "\2\2\u0203\u0207\7\61\2\2\u0204\u0208\n\17\2\2\u0205\u0206\7^\2\2\u0206"+ + "\u0208\n\20\2\2\u0207\u0204\3\2\2\2\u0207\u0205\3\2\2\2\u0208\u0209\3"+ + "\2\2\2\u0209\u0207\3\2\2\2\u0209\u020a\3\2\2\2\u020a\u020b\3\2\2\2\u020b"+ + "\u020f\7\61\2\2\u020c\u020e\t\21\2\2\u020d\u020c\3\2\2\2\u020e\u0211\3"+ + "\2\2\2\u020f\u020d\3\2\2\2\u020f\u0210\3\2\2\2\u0210\u0212\3\2\2\2\u0211"+ + "\u020f\3\2\2\2\u0212\u0213\6L\3\2\u0213\u0099\3\2\2\2\u0214\u0215\7v\2"+ + "\2\u0215\u0216\7t\2\2\u0216\u0217\7w\2\2\u0217\u0218\7g\2\2\u0218\u009b"+ + "\3\2\2\2\u0219\u021a\7h\2\2\u021a\u021b\7c\2\2\u021b\u021c\7n\2\2\u021c"+ + "\u021d\7u\2\2\u021d\u021e\7g\2\2\u021e\u009d\3\2\2\2\u021f\u0220\7p\2"+ + "\2\u0220\u0221\7w\2\2\u0221\u0222\7n\2\2\u0222\u0223\7n\2\2\u0223\u009f"+ + "\3\2\2\2\u0224\u022a\5\u00a2Q\2\u0225\u0226\5\24\n\2\u0226\u0227\5\u00a2"+ + "Q\2\u0227\u0229\3\2\2\2\u0228\u0225\3\2\2\2\u0229\u022c\3\2\2\2\u022a"+ + "\u0228\3\2\2\2\u022a\u022b\3\2\2\2\u022b\u022d\3\2\2\2\u022c\u022a\3\2"+ + "\2\2\u022d\u022e\6P\4\2\u022e\u00a1\3\2\2\2\u022f\u0233\t\22\2\2\u0230"+ + "\u0232\t\23\2\2\u0231\u0230\3\2\2\2\u0232\u0235\3\2\2\2\u0233\u0231\3"+ + "\2\2\2\u0233\u0234\3\2\2\2\u0234\u00a3\3\2\2\2\u0235\u0233\3\2\2\2\u0236"+ + "\u023f\7\62\2\2\u0237\u023b\t\b\2\2\u0238\u023a\t\t\2\2\u0239\u0238\3"+ + "\2\2\2\u023a\u023d\3\2\2\2\u023b\u0239\3\2\2\2\u023b\u023c\3\2\2\2\u023c"+ + "\u023f\3\2\2\2\u023d\u023b\3\2\2\2\u023e\u0236\3\2\2\2\u023e\u0237\3\2"+ + "\2\2\u023f\u0240\3\2\2\2\u0240\u0241\bR\4\2\u0241\u00a5\3\2\2\2\u0242"+ + "\u0246\t\22\2\2\u0243\u0245\t\23\2\2\u0244\u0243\3\2\2\2\u0245\u0248\3"+ + "\2\2\2\u0246\u0244\3\2\2\2\u0246\u0247\3\2\2\2\u0247\u0249\3\2\2\2\u0248"+ + "\u0246\3\2\2\2\u0249\u024a\bS\4\2\u024a\u00a7\3\2\2\2$\2\3\u00ab\u00b5"+ + "\u00bf\u00c4\u01ad\u01b0\u01b7\u01ba\u01c1\u01c4\u01c7\u01ce\u01d1\u01d7"+ + "\u01d9\u01dd\u01e2\u01e4\u01e7\u01ef\u01f1\u01fb\u01fd\u0201\u0207\u0209"+ + "\u020f\u022a\u0233\u023b\u023e\u0246\5\b\2\2\4\3\2\4\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParser.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParser.java index c1b698a9530..933a5f35dcd 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParser.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParser.java @@ -18,15 +18,16 @@ class PainlessParser extends Parser { new PredictionContextCache(); public static final int WS=1, COMMENT=2, LBRACK=3, RBRACK=4, LBRACE=5, RBRACE=6, LP=7, RP=8, DOT=9, - COMMA=10, SEMICOLON=11, IF=12, ELSE=13, WHILE=14, DO=15, FOR=16, CONTINUE=17, - BREAK=18, RETURN=19, NEW=20, TRY=21, CATCH=22, THROW=23, THIS=24, INSTANCEOF=25, - BOOLNOT=26, BWNOT=27, MUL=28, DIV=29, REM=30, ADD=31, SUB=32, LSH=33, - RSH=34, USH=35, LT=36, LTE=37, GT=38, GTE=39, EQ=40, EQR=41, NE=42, NER=43, - BWAND=44, XOR=45, BWOR=46, BOOLAND=47, BOOLOR=48, COND=49, COLON=50, REF=51, - ARROW=52, FIND=53, MATCH=54, INCR=55, DECR=56, ASSIGN=57, AADD=58, ASUB=59, - AMUL=60, ADIV=61, AREM=62, AAND=63, AXOR=64, AOR=65, ALSH=66, ARSH=67, - AUSH=68, OCTAL=69, HEX=70, INTEGER=71, DECIMAL=72, STRING=73, REGEX=74, - TRUE=75, FALSE=76, NULL=77, TYPE=78, ID=79, DOTINTEGER=80, DOTID=81; + COMMA=10, SEMICOLON=11, IF=12, IN=13, ELSE=14, WHILE=15, DO=16, FOR=17, + CONTINUE=18, BREAK=19, RETURN=20, NEW=21, TRY=22, CATCH=23, THROW=24, + THIS=25, INSTANCEOF=26, BOOLNOT=27, BWNOT=28, MUL=29, DIV=30, REM=31, + ADD=32, SUB=33, LSH=34, RSH=35, USH=36, LT=37, LTE=38, GT=39, GTE=40, + EQ=41, EQR=42, NE=43, NER=44, BWAND=45, XOR=46, BWOR=47, BOOLAND=48, BOOLOR=49, + COND=50, COLON=51, REF=52, ARROW=53, FIND=54, MATCH=55, INCR=56, DECR=57, + ASSIGN=58, AADD=59, ASUB=60, AMUL=61, ADIV=62, AREM=63, AAND=64, AXOR=65, + AOR=66, ALSH=67, ARSH=68, AUSH=69, OCTAL=70, HEX=71, INTEGER=72, DECIMAL=73, + STRING=74, REGEX=75, TRUE=76, FALSE=77, NULL=78, TYPE=79, ID=80, DOTINTEGER=81, + DOTID=82; public static final int RULE_source = 0, RULE_function = 1, RULE_parameters = 2, RULE_statement = 3, RULE_trailer = 4, RULE_block = 5, RULE_empty = 6, RULE_initializer = 7, @@ -48,25 +49,25 @@ class PainlessParser extends Parser { private static final String[] _LITERAL_NAMES = { null, null, null, "'{'", "'}'", "'['", "']'", "'('", "')'", "'.'", "','", - "';'", "'if'", "'else'", "'while'", "'do'", "'for'", "'continue'", "'break'", - "'return'", "'new'", "'try'", "'catch'", "'throw'", "'this'", "'instanceof'", - "'!'", "'~'", "'*'", "'/'", "'%'", "'+'", "'-'", "'<<'", "'>>'", "'>>>'", - "'<'", "'<='", "'>'", "'>='", "'=='", "'==='", "'!='", "'!=='", "'&'", - "'^'", "'|'", "'&&'", "'||'", "'?'", "':'", "'::'", "'->'", "'=~'", "'==~'", - "'++'", "'--'", "'='", "'+='", "'-='", "'*='", "'/='", "'%='", "'&='", - "'^='", "'|='", "'<<='", "'>>='", "'>>>='", null, null, null, null, null, - null, "'true'", "'false'", "'null'" + "';'", "'if'", "'in'", "'else'", "'while'", "'do'", "'for'", "'continue'", + "'break'", "'return'", "'new'", "'try'", "'catch'", "'throw'", "'this'", + "'instanceof'", "'!'", "'~'", "'*'", "'/'", "'%'", "'+'", "'-'", "'<<'", + "'>>'", "'>>>'", "'<'", "'<='", "'>'", "'>='", "'=='", "'==='", "'!='", + "'!=='", "'&'", "'^'", "'|'", "'&&'", "'||'", "'?'", "':'", "'::'", "'->'", + "'=~'", "'==~'", "'++'", "'--'", "'='", "'+='", "'-='", "'*='", "'/='", + "'%='", "'&='", "'^='", "'|='", "'<<='", "'>>='", "'>>>='", null, null, + null, null, null, null, "'true'", "'false'", "'null'" }; private static final String[] _SYMBOLIC_NAMES = { null, "WS", "COMMENT", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "LP", "RP", - "DOT", "COMMA", "SEMICOLON", "IF", "ELSE", "WHILE", "DO", "FOR", "CONTINUE", - "BREAK", "RETURN", "NEW", "TRY", "CATCH", "THROW", "THIS", "INSTANCEOF", - "BOOLNOT", "BWNOT", "MUL", "DIV", "REM", "ADD", "SUB", "LSH", "RSH", "USH", - "LT", "LTE", "GT", "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "XOR", "BWOR", - "BOOLAND", "BOOLOR", "COND", "COLON", "REF", "ARROW", "FIND", "MATCH", - "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", "AAND", - "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", "HEX", "INTEGER", "DECIMAL", - "STRING", "REGEX", "TRUE", "FALSE", "NULL", "TYPE", "ID", "DOTINTEGER", + "DOT", "COMMA", "SEMICOLON", "IF", "IN", "ELSE", "WHILE", "DO", "FOR", + "CONTINUE", "BREAK", "RETURN", "NEW", "TRY", "CATCH", "THROW", "THIS", + "INSTANCEOF", "BOOLNOT", "BWNOT", "MUL", "DIV", "REM", "ADD", "SUB", "LSH", + "RSH", "USH", "LT", "LTE", "GT", "GTE", "EQ", "EQR", "NE", "NER", "BWAND", + "XOR", "BWOR", "BOOLAND", "BOOLOR", "COND", "COLON", "REF", "ARROW", "FIND", + "MATCH", "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", + "AAND", "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", "HEX", "INTEGER", + "DECIMAL", "STRING", "REGEX", "TRUE", "FALSE", "NULL", "TYPE", "ID", "DOTINTEGER", "DOTID" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -364,33 +365,6 @@ class PainlessParser extends Parser { else return visitor.visitChildren(this); } } - public static class ThrowContext extends StatementContext { - public TerminalNode THROW() { return getToken(PainlessParser.THROW, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public DelimiterContext delimiter() { - return getRuleContext(DelimiterContext.class,0); - } - public ThrowContext(StatementContext ctx) { copyFrom(ctx); } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitThrow(this); - else return visitor.visitChildren(this); - } - } - public static class ContinueContext extends StatementContext { - public TerminalNode CONTINUE() { return getToken(PainlessParser.CONTINUE, 0); } - public DelimiterContext delimiter() { - return getRuleContext(DelimiterContext.class,0); - } - public ContinueContext(StatementContext ctx) { copyFrom(ctx); } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitContinue(this); - else return visitor.visitChildren(this); - } - } public static class ForContext extends StatementContext { public TerminalNode FOR() { return getToken(PainlessParser.FOR, 0); } public TerminalNode LP() { return getToken(PainlessParser.LP, 0); } @@ -421,38 +395,6 @@ class PainlessParser extends Parser { else return visitor.visitChildren(this); } } - public static class TryContext extends StatementContext { - public TerminalNode TRY() { return getToken(PainlessParser.TRY, 0); } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public List trap() { - return getRuleContexts(TrapContext.class); - } - public TrapContext trap(int i) { - return getRuleContext(TrapContext.class,i); - } - public TryContext(StatementContext ctx) { copyFrom(ctx); } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitTry(this); - else return visitor.visitChildren(this); - } - } - public static class ExprContext extends StatementContext { - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public DelimiterContext delimiter() { - return getRuleContext(DelimiterContext.class,0); - } - public ExprContext(StatementContext ctx) { copyFrom(ctx); } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitExpr(this); - else return visitor.visitChildren(this); - } - } public static class DoContext extends StatementContext { public TerminalNode DO() { return getToken(PainlessParser.DO, 0); } public BlockContext block() { @@ -494,24 +436,22 @@ class PainlessParser extends Parser { else return visitor.visitChildren(this); } } - public static class IfContext extends StatementContext { - public TerminalNode IF() { return getToken(PainlessParser.IF, 0); } + public static class IneachContext extends StatementContext { + public TerminalNode FOR() { return getToken(PainlessParser.FOR, 0); } public TerminalNode LP() { return getToken(PainlessParser.LP, 0); } + public TerminalNode ID() { return getToken(PainlessParser.ID, 0); } + public TerminalNode IN() { return getToken(PainlessParser.IN, 0); } public ExpressionContext expression() { return getRuleContext(ExpressionContext.class,0); } public TerminalNode RP() { return getToken(PainlessParser.RP, 0); } - public List trailer() { - return getRuleContexts(TrailerContext.class); + public TrailerContext trailer() { + return getRuleContext(TrailerContext.class,0); } - public TrailerContext trailer(int i) { - return getRuleContext(TrailerContext.class,i); - } - public TerminalNode ELSE() { return getToken(PainlessParser.ELSE, 0); } - public IfContext(StatementContext ctx) { copyFrom(ctx); } + public IneachContext(StatementContext ctx) { copyFrom(ctx); } @Override public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitIf(this); + if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitIneach(this); else return visitor.visitChildren(this); } } @@ -537,6 +477,86 @@ class PainlessParser extends Parser { else return visitor.visitChildren(this); } } + public static class ThrowContext extends StatementContext { + public TerminalNode THROW() { return getToken(PainlessParser.THROW, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public DelimiterContext delimiter() { + return getRuleContext(DelimiterContext.class,0); + } + public ThrowContext(StatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitThrow(this); + else return visitor.visitChildren(this); + } + } + public static class ContinueContext extends StatementContext { + public TerminalNode CONTINUE() { return getToken(PainlessParser.CONTINUE, 0); } + public DelimiterContext delimiter() { + return getRuleContext(DelimiterContext.class,0); + } + public ContinueContext(StatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitContinue(this); + else return visitor.visitChildren(this); + } + } + public static class TryContext extends StatementContext { + public TerminalNode TRY() { return getToken(PainlessParser.TRY, 0); } + public BlockContext block() { + return getRuleContext(BlockContext.class,0); + } + public List trap() { + return getRuleContexts(TrapContext.class); + } + public TrapContext trap(int i) { + return getRuleContext(TrapContext.class,i); + } + public TryContext(StatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitTry(this); + else return visitor.visitChildren(this); + } + } + public static class ExprContext extends StatementContext { + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public DelimiterContext delimiter() { + return getRuleContext(DelimiterContext.class,0); + } + public ExprContext(StatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitExpr(this); + else return visitor.visitChildren(this); + } + } + public static class IfContext extends StatementContext { + public TerminalNode IF() { return getToken(PainlessParser.IF, 0); } + public TerminalNode LP() { return getToken(PainlessParser.LP, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode RP() { return getToken(PainlessParser.RP, 0); } + public List trailer() { + return getRuleContexts(TrailerContext.class); + } + public TrailerContext trailer(int i) { + return getRuleContext(TrailerContext.class,i); + } + public TerminalNode ELSE() { return getToken(PainlessParser.ELSE, 0); } + public IfContext(StatementContext ctx) { copyFrom(ctx); } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitIf(this); + else return visitor.visitChildren(this); + } + } public static class ReturnContext extends StatementContext { public TerminalNode RETURN() { return getToken(PainlessParser.RETURN, 0); } public ExpressionContext expression() { @@ -558,7 +578,7 @@ class PainlessParser extends Parser { enterRule(_localctx, 6, RULE_statement); try { int _alt; - setState(181); + setState(189); switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { case 1: _localctx = new IfContext(_localctx); @@ -723,56 +743,76 @@ class PainlessParser extends Parser { } break; case 6: - _localctx = new DeclContext(_localctx); + _localctx = new IneachContext(_localctx); enterOuterAlt(_localctx, 6); { setState(156); - declaration(); + match(FOR); setState(157); - delimiter(); + match(LP); + setState(158); + match(ID); + setState(159); + match(IN); + setState(160); + expression(0); + setState(161); + match(RP); + setState(162); + trailer(); } break; case 7: - _localctx = new ContinueContext(_localctx); + _localctx = new DeclContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(159); - match(CONTINUE); - setState(160); - delimiter(); - } - break; - case 8: - _localctx = new BreakContext(_localctx); - enterOuterAlt(_localctx, 8); - { - setState(161); - match(BREAK); - setState(162); - delimiter(); - } - break; - case 9: - _localctx = new ReturnContext(_localctx); - enterOuterAlt(_localctx, 9); - { - setState(163); - match(RETURN); setState(164); - expression(0); + declaration(); setState(165); delimiter(); } break; - case 10: - _localctx = new TryContext(_localctx); - enterOuterAlt(_localctx, 10); + case 8: + _localctx = new ContinueContext(_localctx); + enterOuterAlt(_localctx, 8); { setState(167); - match(TRY); + match(CONTINUE); setState(168); + delimiter(); + } + break; + case 9: + _localctx = new BreakContext(_localctx); + enterOuterAlt(_localctx, 9); + { + setState(169); + match(BREAK); + setState(170); + delimiter(); + } + break; + case 10: + _localctx = new ReturnContext(_localctx); + enterOuterAlt(_localctx, 10); + { + setState(171); + match(RETURN); + setState(172); + expression(0); + setState(173); + delimiter(); + } + break; + case 11: + _localctx = new TryContext(_localctx); + enterOuterAlt(_localctx, 11); + { + setState(175); + match(TRY); + setState(176); block(); - setState(170); + setState(178); _errHandler.sync(this); _alt = 1; do { @@ -780,7 +820,7 @@ class PainlessParser extends Parser { case 1: { { - setState(169); + setState(177); trap(); } } @@ -788,31 +828,31 @@ class PainlessParser extends Parser { default: throw new NoViableAltException(this); } - setState(172); + setState(180); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,10,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); } break; - case 11: + case 12: _localctx = new ThrowContext(_localctx); - enterOuterAlt(_localctx, 11); + enterOuterAlt(_localctx, 12); { - setState(174); + setState(182); match(THROW); - setState(175); + setState(183); expression(0); - setState(176); + setState(184); delimiter(); } break; - case 12: + case 13: _localctx = new ExprContext(_localctx); - enterOuterAlt(_localctx, 12); + enterOuterAlt(_localctx, 13); { - setState(178); + setState(186); expression(0); - setState(179); + setState(187); delimiter(); } break; @@ -851,19 +891,19 @@ class PainlessParser extends Parser { TrailerContext _localctx = new TrailerContext(_ctx, getState()); enterRule(_localctx, 8, RULE_trailer); try { - setState(185); + setState(193); switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(183); + setState(191); block(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(184); + setState(192); statement(); } break; @@ -907,25 +947,25 @@ class PainlessParser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(187); + setState(195); match(LBRACK); - setState(191); + setState(199); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(188); + setState(196); statement(); } } } - setState(193); + setState(201); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); } - setState(194); + setState(202); match(RBRACK); } } @@ -959,7 +999,7 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(196); + setState(204); match(SEMICOLON); } } @@ -996,19 +1036,19 @@ class PainlessParser extends Parser { InitializerContext _localctx = new InitializerContext(_ctx, getState()); enterRule(_localctx, 14, RULE_initializer); try { - setState(200); + setState(208); switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(198); + setState(206); declaration(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(199); + setState(207); expression(0); } break; @@ -1046,7 +1086,7 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(202); + setState(210); expression(0); } } @@ -1093,23 +1133,23 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(204); + setState(212); decltype(); - setState(205); + setState(213); declvar(); - setState(210); + setState(218); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(206); + setState(214); match(COMMA); - setState(207); + setState(215); declvar(); } } - setState(212); + setState(220); _errHandler.sync(this); _la = _input.LA(1); } @@ -1154,23 +1194,23 @@ class PainlessParser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(213); + setState(221); match(TYPE); - setState(218); + setState(226); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,16,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(214); + setState(222); match(LBRACE); - setState(215); + setState(223); match(RBRACE); } } } - setState(220); + setState(228); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,16,_ctx); } @@ -1211,15 +1251,15 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(221); + setState(229); match(ID); - setState(224); + setState(232); _la = _input.LA(1); if (_la==ASSIGN) { { - setState(222); + setState(230); match(ASSIGN); - setState(223); + setState(231); expression(0); } } @@ -1263,17 +1303,17 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(226); + setState(234); match(CATCH); - setState(227); + setState(235); match(LP); - setState(228); + setState(236); match(TYPE); - setState(229); + setState(237); match(ID); - setState(230); + setState(238); match(RP); - setState(231); + setState(239); block(); } } @@ -1309,7 +1349,7 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(233); + setState(241); _la = _input.LA(1); if ( !(_la==EOF || _la==SEMICOLON) ) { _errHandler.recoverInline(this); @@ -1495,7 +1535,7 @@ class PainlessParser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(244); + setState(252); switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: { @@ -1503,16 +1543,16 @@ class PainlessParser extends Parser { _ctx = _localctx; _prevctx = _localctx; - setState(236); + setState(244); chain(true); - setState(237); + setState(245); _la = _input.LA(1); - if ( !(((((_la - 57)) & ~0x3f) == 0 && ((1L << (_la - 57)) & ((1L << (ASSIGN - 57)) | (1L << (AADD - 57)) | (1L << (ASUB - 57)) | (1L << (AMUL - 57)) | (1L << (ADIV - 57)) | (1L << (AREM - 57)) | (1L << (AAND - 57)) | (1L << (AXOR - 57)) | (1L << (AOR - 57)) | (1L << (ALSH - 57)) | (1L << (ARSH - 57)) | (1L << (AUSH - 57)))) != 0)) ) { + if ( !(((((_la - 58)) & ~0x3f) == 0 && ((1L << (_la - 58)) & ((1L << (ASSIGN - 58)) | (1L << (AADD - 58)) | (1L << (ASUB - 58)) | (1L << (AMUL - 58)) | (1L << (ADIV - 58)) | (1L << (AREM - 58)) | (1L << (AAND - 58)) | (1L << (AXOR - 58)) | (1L << (AOR - 58)) | (1L << (ALSH - 58)) | (1L << (ARSH - 58)) | (1L << (AUSH - 58)))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(238); + setState(246); expression(1); ((AssignmentContext)_localctx).s = false; } @@ -1522,14 +1562,14 @@ class PainlessParser extends Parser { _localctx = new SingleContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(241); + setState(249); ((SingleContext)_localctx).u = unary(false); ((SingleContext)_localctx).s = ((SingleContext)_localctx).u.s; } break; } _ctx.stop = _input.LT(-1); - setState(315); + setState(323); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,20,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1537,22 +1577,22 @@ class PainlessParser extends Parser { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(313); + setState(321); switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { case 1: { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(246); + setState(254); if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); - setState(247); + setState(255); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << MUL) | (1L << DIV) | (1L << REM))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(248); + setState(256); expression(15); ((BinaryContext)_localctx).s = false; } @@ -1561,16 +1601,16 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(251); + setState(259); if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); - setState(252); + setState(260); _la = _input.LA(1); if ( !(_la==ADD || _la==SUB) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(253); + setState(261); expression(14); ((BinaryContext)_localctx).s = false; } @@ -1579,16 +1619,16 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(256); + setState(264); if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); - setState(257); + setState(265); _la = _input.LA(1); if ( !(_la==FIND || _la==MATCH) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(258); + setState(266); expression(13); ((BinaryContext)_localctx).s = false; } @@ -1597,16 +1637,16 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(261); + setState(269); if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); - setState(262); + setState(270); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LSH) | (1L << RSH) | (1L << USH))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(263); + setState(271); expression(12); ((BinaryContext)_localctx).s = false; } @@ -1615,16 +1655,16 @@ class PainlessParser extends Parser { { _localctx = new CompContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(266); + setState(274); if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); - setState(267); + setState(275); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LT) | (1L << LTE) | (1L << GT) | (1L << GTE))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(268); + setState(276); expression(11); ((CompContext)_localctx).s = false; } @@ -1633,16 +1673,16 @@ class PainlessParser extends Parser { { _localctx = new CompContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(271); + setState(279); if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(272); + setState(280); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << EQR) | (1L << NE) | (1L << NER))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(273); + setState(281); expression(9); ((CompContext)_localctx).s = false; } @@ -1651,11 +1691,11 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(276); + setState(284); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(277); + setState(285); match(BWAND); - setState(278); + setState(286); expression(8); ((BinaryContext)_localctx).s = false; } @@ -1664,11 +1704,11 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(281); + setState(289); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(282); + setState(290); match(XOR); - setState(283); + setState(291); expression(7); ((BinaryContext)_localctx).s = false; } @@ -1677,11 +1717,11 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(286); + setState(294); if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); - setState(287); + setState(295); match(BWOR); - setState(288); + setState(296); expression(6); ((BinaryContext)_localctx).s = false; } @@ -1690,11 +1730,11 @@ class PainlessParser extends Parser { { _localctx = new BoolContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(291); + setState(299); if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); - setState(292); + setState(300); match(BOOLAND); - setState(293); + setState(301); expression(5); ((BoolContext)_localctx).s = false; } @@ -1703,11 +1743,11 @@ class PainlessParser extends Parser { { _localctx = new BoolContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(296); + setState(304); if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); - setState(297); + setState(305); match(BOOLOR); - setState(298); + setState(306); expression(4); ((BoolContext)_localctx).s = false; } @@ -1716,15 +1756,15 @@ class PainlessParser extends Parser { { _localctx = new ConditionalContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(301); + setState(309); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(302); + setState(310); match(COND); - setState(303); + setState(311); ((ConditionalContext)_localctx).e0 = expression(0); - setState(304); + setState(312); match(COLON); - setState(305); + setState(313); ((ConditionalContext)_localctx).e1 = expression(2); ((ConditionalContext)_localctx).s = ((ConditionalContext)_localctx).e0.s && ((ConditionalContext)_localctx).e1.s; } @@ -1733,11 +1773,11 @@ class PainlessParser extends Parser { { _localctx = new InstanceofContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(308); + setState(316); if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); - setState(309); + setState(317); match(INSTANCEOF); - setState(310); + setState(318); decltype(); ((InstanceofContext)_localctx).s = false; } @@ -1745,7 +1785,7 @@ class PainlessParser extends Parser { } } } - setState(317); + setState(325); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,20,_ctx); } @@ -1914,22 +1954,22 @@ class PainlessParser extends Parser { enterRule(_localctx, 30, RULE_unary); int _la; try { - setState(355); + setState(363); switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: _localctx = new PreContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(318); + setState(326); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(319); + setState(327); _la = _input.LA(1); if ( !(_la==INCR || _la==DECR) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(320); + setState(328); chain(true); } break; @@ -1937,11 +1977,11 @@ class PainlessParser extends Parser { _localctx = new PostContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(321); + setState(329); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(322); + setState(330); chain(true); - setState(323); + setState(331); _la = _input.LA(1); if ( !(_la==INCR || _la==DECR) ) { _errHandler.recoverInline(this); @@ -1954,9 +1994,9 @@ class PainlessParser extends Parser { _localctx = new ReadContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(325); + setState(333); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(326); + setState(334); chain(false); } break; @@ -1964,11 +2004,11 @@ class PainlessParser extends Parser { _localctx = new NumericContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(327); + setState(335); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(328); + setState(336); _la = _input.LA(1); - if ( !(((((_la - 69)) & ~0x3f) == 0 && ((1L << (_la - 69)) & ((1L << (OCTAL - 69)) | (1L << (HEX - 69)) | (1L << (INTEGER - 69)) | (1L << (DECIMAL - 69)))) != 0)) ) { + if ( !(((((_la - 70)) & ~0x3f) == 0 && ((1L << (_la - 70)) & ((1L << (OCTAL - 70)) | (1L << (HEX - 70)) | (1L << (INTEGER - 70)) | (1L << (DECIMAL - 70)))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); @@ -1980,9 +2020,9 @@ class PainlessParser extends Parser { _localctx = new TrueContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(330); + setState(338); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(331); + setState(339); match(TRUE); ((TrueContext)_localctx).s = false; } @@ -1991,9 +2031,9 @@ class PainlessParser extends Parser { _localctx = new FalseContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(333); + setState(341); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(334); + setState(342); match(FALSE); ((FalseContext)_localctx).s = false; } @@ -2002,9 +2042,9 @@ class PainlessParser extends Parser { _localctx = new NullContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(336); + setState(344); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(337); + setState(345); match(NULL); ((NullContext)_localctx).s = false; } @@ -2013,9 +2053,9 @@ class PainlessParser extends Parser { _localctx = new ListinitContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(339); + setState(347); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(340); + setState(348); listinitializer(); ((ListinitContext)_localctx).s = false; } @@ -2024,9 +2064,9 @@ class PainlessParser extends Parser { _localctx = new MapinitContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(343); + setState(351); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(344); + setState(352); mapinitializer(); ((MapinitContext)_localctx).s = false; } @@ -2035,16 +2075,16 @@ class PainlessParser extends Parser { _localctx = new OperatorContext(_localctx); enterOuterAlt(_localctx, 10); { - setState(347); + setState(355); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(348); + setState(356); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(349); + setState(357); unary(false); } break; @@ -2052,13 +2092,13 @@ class PainlessParser extends Parser { _localctx = new CastContext(_localctx); enterOuterAlt(_localctx, 11); { - setState(350); + setState(358); match(LP); - setState(351); + setState(359); decltype(); - setState(352); + setState(360); match(RP); - setState(353); + setState(361); unary(_localctx.c); } break; @@ -2145,27 +2185,27 @@ class PainlessParser extends Parser { enterRule(_localctx, 32, RULE_chain); try { int _alt; - setState(373); + setState(381); switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { case 1: _localctx = new DynamicContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(357); + setState(365); ((DynamicContext)_localctx).p = primary(_localctx.c); - setState(361); + setState(369); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,22,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(358); + setState(366); secondary(((DynamicContext)_localctx).p.s); } } } - setState(363); + setState(371); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,22,_ctx); } @@ -2175,23 +2215,23 @@ class PainlessParser extends Parser { _localctx = new StaticContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(364); + setState(372); decltype(); - setState(365); + setState(373); dot(); - setState(369); + setState(377); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,23,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(366); + setState(374); secondary(true); } } } - setState(371); + setState(379); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,23,_ctx); } @@ -2201,7 +2241,7 @@ class PainlessParser extends Parser { _localctx = new NewarrayContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(372); + setState(380); arrayinitializer(); } break; @@ -2319,19 +2359,19 @@ class PainlessParser extends Parser { PrimaryContext _localctx = new PrimaryContext(_ctx, getState(), c); enterRule(_localctx, 34, RULE_primary); try { - setState(394); + setState(402); switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) { case 1: _localctx = new ExprprecContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(375); + setState(383); if (!( !_localctx.c )) throw new FailedPredicateException(this, " !$c "); - setState(376); + setState(384); match(LP); - setState(377); + setState(385); ((ExprprecContext)_localctx).e = expression(0); - setState(378); + setState(386); match(RP); ((ExprprecContext)_localctx).s = ((ExprprecContext)_localctx).e.s; } @@ -2340,13 +2380,13 @@ class PainlessParser extends Parser { _localctx = new ChainprecContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(381); + setState(389); if (!( _localctx.c )) throw new FailedPredicateException(this, " $c "); - setState(382); + setState(390); match(LP); - setState(383); + setState(391); unary(true); - setState(384); + setState(392); match(RP); } break; @@ -2354,7 +2394,7 @@ class PainlessParser extends Parser { _localctx = new StringContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(386); + setState(394); match(STRING); } break; @@ -2362,7 +2402,7 @@ class PainlessParser extends Parser { _localctx = new RegexContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(387); + setState(395); match(REGEX); } break; @@ -2370,7 +2410,7 @@ class PainlessParser extends Parser { _localctx = new VariableContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(388); + setState(396); match(ID); } break; @@ -2378,9 +2418,9 @@ class PainlessParser extends Parser { _localctx = new CalllocalContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(389); + setState(397); match(ID); - setState(390); + setState(398); arguments(); } break; @@ -2388,11 +2428,11 @@ class PainlessParser extends Parser { _localctx = new NewobjectContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(391); + setState(399); match(NEW); - setState(392); + setState(400); match(TYPE); - setState(393); + setState(401); arguments(); } break; @@ -2434,23 +2474,23 @@ class PainlessParser extends Parser { SecondaryContext _localctx = new SecondaryContext(_ctx, getState(), s); enterRule(_localctx, 36, RULE_secondary); try { - setState(400); + setState(408); switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(396); + setState(404); if (!( _localctx.s )) throw new FailedPredicateException(this, " $s "); - setState(397); + setState(405); dot(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(398); + setState(406); if (!( _localctx.s )) throw new FailedPredicateException(this, " $s "); - setState(399); + setState(407); brace(); } break; @@ -2508,17 +2548,17 @@ class PainlessParser extends Parser { enterRule(_localctx, 38, RULE_dot); int _la; try { - setState(407); + setState(415); switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { case 1: _localctx = new CallinvokeContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(402); + setState(410); match(DOT); - setState(403); + setState(411); match(DOTID); - setState(404); + setState(412); arguments(); } break; @@ -2526,9 +2566,9 @@ class PainlessParser extends Parser { _localctx = new FieldaccessContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(405); + setState(413); match(DOT); - setState(406); + setState(414); _la = _input.LA(1); if ( !(_la==DOTINTEGER || _la==DOTID) ) { _errHandler.recoverInline(this); @@ -2582,11 +2622,11 @@ class PainlessParser extends Parser { _localctx = new BraceaccessContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(409); + setState(417); match(LBRACE); - setState(410); + setState(418); expression(0); - setState(411); + setState(419); match(RBRACE); } } @@ -2633,34 +2673,34 @@ class PainlessParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(413); + setState(421); match(LP); - setState(422); + setState(430); switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) { case 1: { - setState(414); + setState(422); argument(); - setState(419); + setState(427); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(415); + setState(423); match(COMMA); - setState(416); + setState(424); argument(); } } - setState(421); + setState(429); _errHandler.sync(this); _la = _input.LA(1); } } break; } - setState(424); + setState(432); match(RP); } } @@ -2701,26 +2741,26 @@ class PainlessParser extends Parser { ArgumentContext _localctx = new ArgumentContext(_ctx, getState()); enterRule(_localctx, 44, RULE_argument); try { - setState(429); + setState(437); switch ( getInterpreter().adaptivePredict(_input,30,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(426); + setState(434); expression(0); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(427); + setState(435); lambda(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(428); + setState(436); funcref(); } break; @@ -2775,64 +2815,64 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(444); + setState(452); switch (_input.LA(1)) { case TYPE: case ID: { - setState(431); + setState(439); lamtype(); } break; case LP: { - setState(432); + setState(440); match(LP); - setState(441); + setState(449); _la = _input.LA(1); if (_la==TYPE || _la==ID) { { - setState(433); + setState(441); lamtype(); - setState(438); + setState(446); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(434); + setState(442); match(COMMA); - setState(435); + setState(443); lamtype(); } } - setState(440); + setState(448); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(443); + setState(451); match(RP); } break; default: throw new NoViableAltException(this); } - setState(446); + setState(454); match(ARROW); - setState(449); + setState(457); switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) { case 1: { - setState(447); + setState(455); block(); } break; case 2: { - setState(448); + setState(456); expression(0); } break; @@ -2873,16 +2913,16 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(452); + setState(460); _la = _input.LA(1); if (_la==TYPE) { { - setState(451); + setState(459); decltype(); } } - setState(454); + setState(462); match(ID); } } @@ -2925,33 +2965,33 @@ class PainlessParser extends Parser { FuncrefContext _localctx = new FuncrefContext(_ctx, getState()); enterRule(_localctx, 50, RULE_funcref); try { - setState(460); + setState(468); switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(456); + setState(464); classFuncref(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(457); + setState(465); constructorFuncref(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(458); + setState(466); capturingFuncref(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(459); + setState(467); localFuncref(); } break; @@ -2989,11 +3029,11 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(462); + setState(470); match(TYPE); - setState(463); + setState(471); match(REF); - setState(464); + setState(472); match(ID); } } @@ -3031,11 +3071,11 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(466); + setState(474); decltype(); - setState(467); + setState(475); match(REF); - setState(468); + setState(476); match(NEW); } } @@ -3073,11 +3113,11 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(470); + setState(478); match(ID); - setState(471); + setState(479); match(REF); - setState(472); + setState(480); match(ID); } } @@ -3113,11 +3153,11 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(474); + setState(482); match(THIS); - setState(475); + setState(483); match(REF); - setState(476); + setState(484); match(ID); } } @@ -3208,17 +3248,17 @@ class PainlessParser extends Parser { int _la; try { int _alt; - setState(516); + setState(524); switch ( getInterpreter().adaptivePredict(_input,43,_ctx) ) { case 1: _localctx = new NewstandardarrayContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(478); + setState(486); match(NEW); - setState(479); + setState(487); match(TYPE); - setState(484); + setState(492); _errHandler.sync(this); _alt = 1; do { @@ -3226,11 +3266,11 @@ class PainlessParser extends Parser { case 1: { { - setState(480); + setState(488); match(LBRACE); - setState(481); + setState(489); expression(0); - setState(482); + setState(490); match(RBRACE); } } @@ -3238,29 +3278,29 @@ class PainlessParser extends Parser { default: throw new NoViableAltException(this); } - setState(486); + setState(494); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,37,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); - setState(495); + setState(503); switch ( getInterpreter().adaptivePredict(_input,39,_ctx) ) { case 1: { - setState(488); + setState(496); dot(); - setState(492); + setState(500); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,38,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(489); + setState(497); secondary(true); } } } - setState(494); + setState(502); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,38,_ctx); } @@ -3273,51 +3313,51 @@ class PainlessParser extends Parser { _localctx = new NewinitializedarrayContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(497); + setState(505); match(NEW); - setState(498); + setState(506); match(TYPE); - setState(499); + setState(507); match(LBRACE); - setState(500); + setState(508); match(RBRACE); - setState(501); + setState(509); match(LBRACK); - setState(510); + setState(518); switch ( getInterpreter().adaptivePredict(_input,41,_ctx) ) { case 1: { - setState(502); + setState(510); expression(0); - setState(507); + setState(515); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(503); + setState(511); match(COMMA); - setState(504); + setState(512); expression(0); } } - setState(509); + setState(517); _errHandler.sync(this); _la = _input.LA(1); } } break; } - setState(513); + setState(521); _la = _input.LA(1); if (_la==SEMICOLON) { { - setState(512); + setState(520); match(SEMICOLON); } } - setState(515); + setState(523); match(RBRACK); } break; @@ -3363,41 +3403,41 @@ class PainlessParser extends Parser { enterRule(_localctx, 62, RULE_listinitializer); int _la; try { - setState(531); + setState(539); switch ( getInterpreter().adaptivePredict(_input,45,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(518); + setState(526); match(LBRACE); - setState(519); + setState(527); expression(0); - setState(524); + setState(532); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(520); + setState(528); match(COMMA); - setState(521); + setState(529); expression(0); } } - setState(526); + setState(534); _errHandler.sync(this); _la = _input.LA(1); } - setState(527); + setState(535); match(RBRACE); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(529); + setState(537); match(LBRACE); - setState(530); + setState(538); match(RBRACE); } break; @@ -3444,43 +3484,43 @@ class PainlessParser extends Parser { enterRule(_localctx, 64, RULE_mapinitializer); int _la; try { - setState(547); + setState(555); switch ( getInterpreter().adaptivePredict(_input,47,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(533); + setState(541); match(LBRACE); - setState(534); + setState(542); maptoken(); - setState(539); + setState(547); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(535); + setState(543); match(COMMA); - setState(536); + setState(544); maptoken(); } } - setState(541); + setState(549); _errHandler.sync(this); _la = _input.LA(1); } - setState(542); + setState(550); match(RBRACE); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(544); + setState(552); match(LBRACE); - setState(545); + setState(553); match(COLON); - setState(546); + setState(554); match(RBRACE); } break; @@ -3522,11 +3562,11 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(549); + setState(557); expression(0); - setState(550); + setState(558); match(COLON); - setState(551); + setState(559); expression(0); } } @@ -3639,7 +3679,7 @@ class PainlessParser extends Parser { } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3S\u022c\4\2\t\2\4"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3T\u0234\4\2\t\2\4"+ "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ @@ -3650,204 +3690,207 @@ class PainlessParser extends Parser { "\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5z\n\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3"+ "\5\3\5\3\5\5\5\u0087\n\5\3\5\3\5\5\5\u008b\n\5\3\5\3\5\5\5\u008f\n\5\3"+ "\5\3\5\3\5\5\5\u0094\n\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3"+ - "\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\6\5\u00ad\n\5\r\5\16\5"+ - "\u00ae\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5\u00b8\n\5\3\6\3\6\5\6\u00bc\n\6"+ - "\3\7\3\7\7\7\u00c0\n\7\f\7\16\7\u00c3\13\7\3\7\3\7\3\b\3\b\3\t\3\t\5\t"+ - "\u00cb\n\t\3\n\3\n\3\13\3\13\3\13\3\13\7\13\u00d3\n\13\f\13\16\13\u00d6"+ - "\13\13\3\f\3\f\3\f\7\f\u00db\n\f\f\f\16\f\u00de\13\f\3\r\3\r\3\r\5\r\u00e3"+ - "\n\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20"+ - "\3\20\3\20\3\20\3\20\3\20\5\20\u00f7\n\20\3\20\3\20\3\20\3\20\3\20\3\20"+ + "\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5"+ + "\3\5\3\5\6\5\u00b5\n\5\r\5\16\5\u00b6\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5"+ + "\u00c0\n\5\3\6\3\6\5\6\u00c4\n\6\3\7\3\7\7\7\u00c8\n\7\f\7\16\7\u00cb"+ + "\13\7\3\7\3\7\3\b\3\b\3\t\3\t\5\t\u00d3\n\t\3\n\3\n\3\13\3\13\3\13\3\13"+ + "\7\13\u00db\n\13\f\13\16\13\u00de\13\13\3\f\3\f\3\f\7\f\u00e3\n\f\f\f"+ + "\16\f\u00e6\13\f\3\r\3\r\3\r\5\r\u00eb\n\r\3\16\3\16\3\16\3\16\3\16\3"+ + "\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\5\20\u00ff"+ + "\n\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20"+ "\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20"+ "\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20"+ "\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20"+ - "\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20"+ - "\3\20\3\20\3\20\3\20\3\20\7\20\u013c\n\20\f\20\16\20\u013f\13\20\3\21"+ - "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21"+ - "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21"+ - "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\5\21\u0166\n\21\3\22\3\22\7\22"+ - "\u016a\n\22\f\22\16\22\u016d\13\22\3\22\3\22\3\22\7\22\u0172\n\22\f\22"+ - "\16\22\u0175\13\22\3\22\5\22\u0178\n\22\3\23\3\23\3\23\3\23\3\23\3\23"+ - "\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\5\23"+ - "\u018d\n\23\3\24\3\24\3\24\3\24\5\24\u0193\n\24\3\25\3\25\3\25\3\25\3"+ - "\25\5\25\u019a\n\25\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\7\27\u01a4"+ - "\n\27\f\27\16\27\u01a7\13\27\5\27\u01a9\n\27\3\27\3\27\3\30\3\30\3\30"+ - "\5\30\u01b0\n\30\3\31\3\31\3\31\3\31\3\31\7\31\u01b7\n\31\f\31\16\31\u01ba"+ - "\13\31\5\31\u01bc\n\31\3\31\5\31\u01bf\n\31\3\31\3\31\3\31\5\31\u01c4"+ - "\n\31\3\32\5\32\u01c7\n\32\3\32\3\32\3\33\3\33\3\33\3\33\5\33\u01cf\n"+ - "\33\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\37\3"+ - "\37\3\37\3\37\3 \3 \3 \3 \3 \3 \6 \u01e7\n \r \16 \u01e8\3 \3 \7 \u01ed"+ - "\n \f \16 \u01f0\13 \5 \u01f2\n \3 \3 \3 \3 \3 \3 \3 \3 \7 \u01fc\n \f"+ - " \16 \u01ff\13 \5 \u0201\n \3 \5 \u0204\n \3 \5 \u0207\n \3!\3!\3!\3!"+ - "\7!\u020d\n!\f!\16!\u0210\13!\3!\3!\3!\3!\5!\u0216\n!\3\"\3\"\3\"\3\""+ - "\7\"\u021c\n\"\f\"\16\"\u021f\13\"\3\"\3\"\3\"\3\"\3\"\5\"\u0226\n\"\3"+ - "#\3#\3#\3#\3#\2\3\36$\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,."+ - "\60\62\64\668:<>@BD\2\16\3\3\r\r\3\2;F\3\2\36 \3\2!\"\3\2\678\3\2#%\3"+ - "\2&)\3\2*-\3\29:\3\2GJ\4\2\34\35!\"\3\2RS\u0260\2I\3\2\2\2\4T\3\2\2\2"+ - "\6Y\3\2\2\2\b\u00b7\3\2\2\2\n\u00bb\3\2\2\2\f\u00bd\3\2\2\2\16\u00c6\3"+ - "\2\2\2\20\u00ca\3\2\2\2\22\u00cc\3\2\2\2\24\u00ce\3\2\2\2\26\u00d7\3\2"+ - "\2\2\30\u00df\3\2\2\2\32\u00e4\3\2\2\2\34\u00eb\3\2\2\2\36\u00f6\3\2\2"+ - "\2 \u0165\3\2\2\2\"\u0177\3\2\2\2$\u018c\3\2\2\2&\u0192\3\2\2\2(\u0199"+ - "\3\2\2\2*\u019b\3\2\2\2,\u019f\3\2\2\2.\u01af\3\2\2\2\60\u01be\3\2\2\2"+ - "\62\u01c6\3\2\2\2\64\u01ce\3\2\2\2\66\u01d0\3\2\2\28\u01d4\3\2\2\2:\u01d8"+ - "\3\2\2\2<\u01dc\3\2\2\2>\u0206\3\2\2\2@\u0215\3\2\2\2B\u0225\3\2\2\2D"+ - "\u0227\3\2\2\2FH\5\4\3\2GF\3\2\2\2HK\3\2\2\2IG\3\2\2\2IJ\3\2\2\2JO\3\2"+ - "\2\2KI\3\2\2\2LN\5\b\5\2ML\3\2\2\2NQ\3\2\2\2OM\3\2\2\2OP\3\2\2\2PR\3\2"+ - "\2\2QO\3\2\2\2RS\7\2\2\3S\3\3\2\2\2TU\5\26\f\2UV\7Q\2\2VW\5\6\4\2WX\5"+ - "\f\7\2X\5\3\2\2\2Ye\7\t\2\2Z[\5\26\f\2[b\7Q\2\2\\]\7\f\2\2]^\5\26\f\2"+ - "^_\7Q\2\2_a\3\2\2\2`\\\3\2\2\2ad\3\2\2\2b`\3\2\2\2bc\3\2\2\2cf\3\2\2\2"+ - "db\3\2\2\2eZ\3\2\2\2ef\3\2\2\2fg\3\2\2\2gh\7\n\2\2h\7\3\2\2\2ij\7\16\2"+ - "\2jk\7\t\2\2kl\5\36\20\2lm\7\n\2\2mq\5\n\6\2no\7\17\2\2or\5\n\6\2pr\6"+ - "\5\2\2qn\3\2\2\2qp\3\2\2\2r\u00b8\3\2\2\2st\7\20\2\2tu\7\t\2\2uv\5\36"+ - "\20\2vy\7\n\2\2wz\5\n\6\2xz\5\16\b\2yw\3\2\2\2yx\3\2\2\2z\u00b8\3\2\2"+ - "\2{|\7\21\2\2|}\5\f\7\2}~\7\20\2\2~\177\7\t\2\2\177\u0080\5\36\20\2\u0080"+ - "\u0081\7\n\2\2\u0081\u0082\5\34\17\2\u0082\u00b8\3\2\2\2\u0083\u0084\7"+ - "\22\2\2\u0084\u0086\7\t\2\2\u0085\u0087\5\20\t\2\u0086\u0085\3\2\2\2\u0086"+ - "\u0087\3\2\2\2\u0087\u0088\3\2\2\2\u0088\u008a\7\r\2\2\u0089\u008b\5\36"+ - "\20\2\u008a\u0089\3\2\2\2\u008a\u008b\3\2\2\2\u008b\u008c\3\2\2\2\u008c"+ - "\u008e\7\r\2\2\u008d\u008f\5\22\n\2\u008e\u008d\3\2\2\2\u008e\u008f\3"+ - "\2\2\2\u008f\u0090\3\2\2\2\u0090\u0093\7\n\2\2\u0091\u0094\5\n\6\2\u0092"+ - "\u0094\5\16\b\2\u0093\u0091\3\2\2\2\u0093\u0092\3\2\2\2\u0094\u00b8\3"+ - "\2\2\2\u0095\u0096\7\22\2\2\u0096\u0097\7\t\2\2\u0097\u0098\5\26\f\2\u0098"+ - "\u0099\7Q\2\2\u0099\u009a\7\64\2\2\u009a\u009b\5\36\20\2\u009b\u009c\7"+ - "\n\2\2\u009c\u009d\5\n\6\2\u009d\u00b8\3\2\2\2\u009e\u009f\5\24\13\2\u009f"+ - "\u00a0\5\34\17\2\u00a0\u00b8\3\2\2\2\u00a1\u00a2\7\23\2\2\u00a2\u00b8"+ - "\5\34\17\2\u00a3\u00a4\7\24\2\2\u00a4\u00b8\5\34\17\2\u00a5\u00a6\7\25"+ - "\2\2\u00a6\u00a7\5\36\20\2\u00a7\u00a8\5\34\17\2\u00a8\u00b8\3\2\2\2\u00a9"+ - "\u00aa\7\27\2\2\u00aa\u00ac\5\f\7\2\u00ab\u00ad\5\32\16\2\u00ac\u00ab"+ - "\3\2\2\2\u00ad\u00ae\3\2\2\2\u00ae\u00ac\3\2\2\2\u00ae\u00af\3\2\2\2\u00af"+ - "\u00b8\3\2\2\2\u00b0\u00b1\7\31\2\2\u00b1\u00b2\5\36\20\2\u00b2\u00b3"+ - "\5\34\17\2\u00b3\u00b8\3\2\2\2\u00b4\u00b5\5\36\20\2\u00b5\u00b6\5\34"+ - "\17\2\u00b6\u00b8\3\2\2\2\u00b7i\3\2\2\2\u00b7s\3\2\2\2\u00b7{\3\2\2\2"+ - "\u00b7\u0083\3\2\2\2\u00b7\u0095\3\2\2\2\u00b7\u009e\3\2\2\2\u00b7\u00a1"+ - "\3\2\2\2\u00b7\u00a3\3\2\2\2\u00b7\u00a5\3\2\2\2\u00b7\u00a9\3\2\2\2\u00b7"+ - "\u00b0\3\2\2\2\u00b7\u00b4\3\2\2\2\u00b8\t\3\2\2\2\u00b9\u00bc\5\f\7\2"+ - "\u00ba\u00bc\5\b\5\2\u00bb\u00b9\3\2\2\2\u00bb\u00ba\3\2\2\2\u00bc\13"+ - "\3\2\2\2\u00bd\u00c1\7\5\2\2\u00be\u00c0\5\b\5\2\u00bf\u00be\3\2\2\2\u00c0"+ - "\u00c3\3\2\2\2\u00c1\u00bf\3\2\2\2\u00c1\u00c2\3\2\2\2\u00c2\u00c4\3\2"+ - "\2\2\u00c3\u00c1\3\2\2\2\u00c4\u00c5\7\6\2\2\u00c5\r\3\2\2\2\u00c6\u00c7"+ - "\7\r\2\2\u00c7\17\3\2\2\2\u00c8\u00cb\5\24\13\2\u00c9\u00cb\5\36\20\2"+ - "\u00ca\u00c8\3\2\2\2\u00ca\u00c9\3\2\2\2\u00cb\21\3\2\2\2\u00cc\u00cd"+ - "\5\36\20\2\u00cd\23\3\2\2\2\u00ce\u00cf\5\26\f\2\u00cf\u00d4\5\30\r\2"+ - "\u00d0\u00d1\7\f\2\2\u00d1\u00d3\5\30\r\2\u00d2\u00d0\3\2\2\2\u00d3\u00d6"+ - "\3\2\2\2\u00d4\u00d2\3\2\2\2\u00d4\u00d5\3\2\2\2\u00d5\25\3\2\2\2\u00d6"+ - "\u00d4\3\2\2\2\u00d7\u00dc\7P\2\2\u00d8\u00d9\7\7\2\2\u00d9\u00db\7\b"+ - "\2\2\u00da\u00d8\3\2\2\2\u00db\u00de\3\2\2\2\u00dc\u00da\3\2\2\2\u00dc"+ - "\u00dd\3\2\2\2\u00dd\27\3\2\2\2\u00de\u00dc\3\2\2\2\u00df\u00e2\7Q\2\2"+ - "\u00e0\u00e1\7;\2\2\u00e1\u00e3\5\36\20\2\u00e2\u00e0\3\2\2\2\u00e2\u00e3"+ - "\3\2\2\2\u00e3\31\3\2\2\2\u00e4\u00e5\7\30\2\2\u00e5\u00e6\7\t\2\2\u00e6"+ - "\u00e7\7P\2\2\u00e7\u00e8\7Q\2\2\u00e8\u00e9\7\n\2\2\u00e9\u00ea\5\f\7"+ - "\2\u00ea\33\3\2\2\2\u00eb\u00ec\t\2\2\2\u00ec\35\3\2\2\2\u00ed\u00ee\b"+ - "\20\1\2\u00ee\u00ef\5\"\22\2\u00ef\u00f0\t\3\2\2\u00f0\u00f1\5\36\20\3"+ - "\u00f1\u00f2\b\20\1\2\u00f2\u00f7\3\2\2\2\u00f3\u00f4\5 \21\2\u00f4\u00f5"+ - "\b\20\1\2\u00f5\u00f7\3\2\2\2\u00f6\u00ed\3\2\2\2\u00f6\u00f3\3\2\2\2"+ - "\u00f7\u013d\3\2\2\2\u00f8\u00f9\f\20\2\2\u00f9\u00fa\t\4\2\2\u00fa\u00fb"+ - "\5\36\20\21\u00fb\u00fc\b\20\1\2\u00fc\u013c\3\2\2\2\u00fd\u00fe\f\17"+ - "\2\2\u00fe\u00ff\t\5\2\2\u00ff\u0100\5\36\20\20\u0100\u0101\b\20\1\2\u0101"+ - "\u013c\3\2\2\2\u0102\u0103\f\16\2\2\u0103\u0104\t\6\2\2\u0104\u0105\5"+ - "\36\20\17\u0105\u0106\b\20\1\2\u0106\u013c\3\2\2\2\u0107\u0108\f\r\2\2"+ - "\u0108\u0109\t\7\2\2\u0109\u010a\5\36\20\16\u010a\u010b\b\20\1\2\u010b"+ - "\u013c\3\2\2\2\u010c\u010d\f\f\2\2\u010d\u010e\t\b\2\2\u010e\u010f\5\36"+ - "\20\r\u010f\u0110\b\20\1\2\u0110\u013c\3\2\2\2\u0111\u0112\f\n\2\2\u0112"+ - "\u0113\t\t\2\2\u0113\u0114\5\36\20\13\u0114\u0115\b\20\1\2\u0115\u013c"+ - "\3\2\2\2\u0116\u0117\f\t\2\2\u0117\u0118\7.\2\2\u0118\u0119\5\36\20\n"+ - "\u0119\u011a\b\20\1\2\u011a\u013c\3\2\2\2\u011b\u011c\f\b\2\2\u011c\u011d"+ - "\7/\2\2\u011d\u011e\5\36\20\t\u011e\u011f\b\20\1\2\u011f\u013c\3\2\2\2"+ - "\u0120\u0121\f\7\2\2\u0121\u0122\7\60\2\2\u0122\u0123\5\36\20\b\u0123"+ - "\u0124\b\20\1\2\u0124\u013c\3\2\2\2\u0125\u0126\f\6\2\2\u0126\u0127\7"+ - "\61\2\2\u0127\u0128\5\36\20\7\u0128\u0129\b\20\1\2\u0129\u013c\3\2\2\2"+ - "\u012a\u012b\f\5\2\2\u012b\u012c\7\62\2\2\u012c\u012d\5\36\20\6\u012d"+ - "\u012e\b\20\1\2\u012e\u013c\3\2\2\2\u012f\u0130\f\4\2\2\u0130\u0131\7"+ - "\63\2\2\u0131\u0132\5\36\20\2\u0132\u0133\7\64\2\2\u0133\u0134\5\36\20"+ - "\4\u0134\u0135\b\20\1\2\u0135\u013c\3\2\2\2\u0136\u0137\f\13\2\2\u0137"+ - "\u0138\7\33\2\2\u0138\u0139\5\26\f\2\u0139\u013a\b\20\1\2\u013a\u013c"+ - "\3\2\2\2\u013b\u00f8\3\2\2\2\u013b\u00fd\3\2\2\2\u013b\u0102\3\2\2\2\u013b"+ - "\u0107\3\2\2\2\u013b\u010c\3\2\2\2\u013b\u0111\3\2\2\2\u013b\u0116\3\2"+ - "\2\2\u013b\u011b\3\2\2\2\u013b\u0120\3\2\2\2\u013b\u0125\3\2\2\2\u013b"+ - "\u012a\3\2\2\2\u013b\u012f\3\2\2\2\u013b\u0136\3\2\2\2\u013c\u013f\3\2"+ - "\2\2\u013d\u013b\3\2\2\2\u013d\u013e\3\2\2\2\u013e\37\3\2\2\2\u013f\u013d"+ - "\3\2\2\2\u0140\u0141\6\21\20\3\u0141\u0142\t\n\2\2\u0142\u0166\5\"\22"+ - "\2\u0143\u0144\6\21\21\3\u0144\u0145\5\"\22\2\u0145\u0146\t\n\2\2\u0146"+ - "\u0166\3\2\2\2\u0147\u0148\6\21\22\3\u0148\u0166\5\"\22\2\u0149\u014a"+ - "\6\21\23\3\u014a\u014b\t\13\2\2\u014b\u0166\b\21\1\2\u014c\u014d\6\21"+ - "\24\3\u014d\u014e\7M\2\2\u014e\u0166\b\21\1\2\u014f\u0150\6\21\25\3\u0150"+ - "\u0151\7N\2\2\u0151\u0166\b\21\1\2\u0152\u0153\6\21\26\3\u0153\u0154\7"+ - "O\2\2\u0154\u0166\b\21\1\2\u0155\u0156\6\21\27\3\u0156\u0157\5@!\2\u0157"+ - "\u0158\b\21\1\2\u0158\u0166\3\2\2\2\u0159\u015a\6\21\30\3\u015a\u015b"+ - "\5B\"\2\u015b\u015c\b\21\1\2\u015c\u0166\3\2\2\2\u015d\u015e\6\21\31\3"+ - "\u015e\u015f\t\f\2\2\u015f\u0166\5 \21\2\u0160\u0161\7\t\2\2\u0161\u0162"+ - "\5\26\f\2\u0162\u0163\7\n\2\2\u0163\u0164\5 \21\2\u0164\u0166\3\2\2\2"+ - "\u0165\u0140\3\2\2\2\u0165\u0143\3\2\2\2\u0165\u0147\3\2\2\2\u0165\u0149"+ - "\3\2\2\2\u0165\u014c\3\2\2\2\u0165\u014f\3\2\2\2\u0165\u0152\3\2\2\2\u0165"+ - "\u0155\3\2\2\2\u0165\u0159\3\2\2\2\u0165\u015d\3\2\2\2\u0165\u0160\3\2"+ - "\2\2\u0166!\3\2\2\2\u0167\u016b\5$\23\2\u0168\u016a\5&\24\2\u0169\u0168"+ - "\3\2\2\2\u016a\u016d\3\2\2\2\u016b\u0169\3\2\2\2\u016b\u016c\3\2\2\2\u016c"+ - "\u0178\3\2\2\2\u016d\u016b\3\2\2\2\u016e\u016f\5\26\f\2\u016f\u0173\5"+ - "(\25\2\u0170\u0172\5&\24\2\u0171\u0170\3\2\2\2\u0172\u0175\3\2\2\2\u0173"+ - "\u0171\3\2\2\2\u0173\u0174\3\2\2\2\u0174\u0178\3\2\2\2\u0175\u0173\3\2"+ - "\2\2\u0176\u0178\5> \2\u0177\u0167\3\2\2\2\u0177\u016e\3\2\2\2\u0177\u0176"+ - "\3\2\2\2\u0178#\3\2\2\2\u0179\u017a\6\23\32\3\u017a\u017b\7\t\2\2\u017b"+ - "\u017c\5\36\20\2\u017c\u017d\7\n\2\2\u017d\u017e\b\23\1\2\u017e\u018d"+ - "\3\2\2\2\u017f\u0180\6\23\33\3\u0180\u0181\7\t\2\2\u0181\u0182\5 \21\2"+ - "\u0182\u0183\7\n\2\2\u0183\u018d\3\2\2\2\u0184\u018d\7K\2\2\u0185\u018d"+ - "\7L\2\2\u0186\u018d\7Q\2\2\u0187\u0188\7Q\2\2\u0188\u018d\5,\27\2\u0189"+ - "\u018a\7\26\2\2\u018a\u018b\7P\2\2\u018b\u018d\5,\27\2\u018c\u0179\3\2"+ - "\2\2\u018c\u017f\3\2\2\2\u018c\u0184\3\2\2\2\u018c\u0185\3\2\2\2\u018c"+ - "\u0186\3\2\2\2\u018c\u0187\3\2\2\2\u018c\u0189\3\2\2\2\u018d%\3\2\2\2"+ - "\u018e\u018f\6\24\34\3\u018f\u0193\5(\25\2\u0190\u0191\6\24\35\3\u0191"+ - "\u0193\5*\26\2\u0192\u018e\3\2\2\2\u0192\u0190\3\2\2\2\u0193\'\3\2\2\2"+ - "\u0194\u0195\7\13\2\2\u0195\u0196\7S\2\2\u0196\u019a\5,\27\2\u0197\u0198"+ - "\7\13\2\2\u0198\u019a\t\r\2\2\u0199\u0194\3\2\2\2\u0199\u0197\3\2\2\2"+ - "\u019a)\3\2\2\2\u019b\u019c\7\7\2\2\u019c\u019d\5\36\20\2\u019d\u019e"+ - "\7\b\2\2\u019e+\3\2\2\2\u019f\u01a8\7\t\2\2\u01a0\u01a5\5.\30\2\u01a1"+ - "\u01a2\7\f\2\2\u01a2\u01a4\5.\30\2\u01a3\u01a1\3\2\2\2\u01a4\u01a7\3\2"+ - "\2\2\u01a5\u01a3\3\2\2\2\u01a5\u01a6\3\2\2\2\u01a6\u01a9\3\2\2\2\u01a7"+ - "\u01a5\3\2\2\2\u01a8\u01a0\3\2\2\2\u01a8\u01a9\3\2\2\2\u01a9\u01aa\3\2"+ - "\2\2\u01aa\u01ab\7\n\2\2\u01ab-\3\2\2\2\u01ac\u01b0\5\36\20\2\u01ad\u01b0"+ - "\5\60\31\2\u01ae\u01b0\5\64\33\2\u01af\u01ac\3\2\2\2\u01af\u01ad\3\2\2"+ - "\2\u01af\u01ae\3\2\2\2\u01b0/\3\2\2\2\u01b1\u01bf\5\62\32\2\u01b2\u01bb"+ - "\7\t\2\2\u01b3\u01b8\5\62\32\2\u01b4\u01b5\7\f\2\2\u01b5\u01b7\5\62\32"+ - "\2\u01b6\u01b4\3\2\2\2\u01b7\u01ba\3\2\2\2\u01b8\u01b6\3\2\2\2\u01b8\u01b9"+ - "\3\2\2\2\u01b9\u01bc\3\2\2\2\u01ba\u01b8\3\2\2\2\u01bb\u01b3\3\2\2\2\u01bb"+ - "\u01bc\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01bf\7\n\2\2\u01be\u01b1\3\2"+ - "\2\2\u01be\u01b2\3\2\2\2\u01bf\u01c0\3\2\2\2\u01c0\u01c3\7\66\2\2\u01c1"+ - "\u01c4\5\f\7\2\u01c2\u01c4\5\36\20\2\u01c3\u01c1\3\2\2\2\u01c3\u01c2\3"+ - "\2\2\2\u01c4\61\3\2\2\2\u01c5\u01c7\5\26\f\2\u01c6\u01c5\3\2\2\2\u01c6"+ - "\u01c7\3\2\2\2\u01c7\u01c8\3\2\2\2\u01c8\u01c9\7Q\2\2\u01c9\63\3\2\2\2"+ - "\u01ca\u01cf\5\66\34\2\u01cb\u01cf\58\35\2\u01cc\u01cf\5:\36\2\u01cd\u01cf"+ - "\5<\37\2\u01ce\u01ca\3\2\2\2\u01ce\u01cb\3\2\2\2\u01ce\u01cc\3\2\2\2\u01ce"+ - "\u01cd\3\2\2\2\u01cf\65\3\2\2\2\u01d0\u01d1\7P\2\2\u01d1\u01d2\7\65\2"+ - "\2\u01d2\u01d3\7Q\2\2\u01d3\67\3\2\2\2\u01d4\u01d5\5\26\f\2\u01d5\u01d6"+ - "\7\65\2\2\u01d6\u01d7\7\26\2\2\u01d79\3\2\2\2\u01d8\u01d9\7Q\2\2\u01d9"+ - "\u01da\7\65\2\2\u01da\u01db\7Q\2\2\u01db;\3\2\2\2\u01dc\u01dd\7\32\2\2"+ - "\u01dd\u01de\7\65\2\2\u01de\u01df\7Q\2\2\u01df=\3\2\2\2\u01e0\u01e1\7"+ - "\26\2\2\u01e1\u01e6\7P\2\2\u01e2\u01e3\7\7\2\2\u01e3\u01e4\5\36\20\2\u01e4"+ - "\u01e5\7\b\2\2\u01e5\u01e7\3\2\2\2\u01e6\u01e2\3\2\2\2\u01e7\u01e8\3\2"+ - "\2\2\u01e8\u01e6\3\2\2\2\u01e8\u01e9\3\2\2\2\u01e9\u01f1\3\2\2\2\u01ea"+ - "\u01ee\5(\25\2\u01eb\u01ed\5&\24\2\u01ec\u01eb\3\2\2\2\u01ed\u01f0\3\2"+ - "\2\2\u01ee\u01ec\3\2\2\2\u01ee\u01ef\3\2\2\2\u01ef\u01f2\3\2\2\2\u01f0"+ - "\u01ee\3\2\2\2\u01f1\u01ea\3\2\2\2\u01f1\u01f2\3\2\2\2\u01f2\u0207\3\2"+ - "\2\2\u01f3\u01f4\7\26\2\2\u01f4\u01f5\7P\2\2\u01f5\u01f6\7\7\2\2\u01f6"+ - "\u01f7\7\b\2\2\u01f7\u0200\7\5\2\2\u01f8\u01fd\5\36\20\2\u01f9\u01fa\7"+ - "\f\2\2\u01fa\u01fc\5\36\20\2\u01fb\u01f9\3\2\2\2\u01fc\u01ff\3\2\2\2\u01fd"+ - "\u01fb\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u0201\3\2\2\2\u01ff\u01fd\3\2"+ - "\2\2\u0200\u01f8\3\2\2\2\u0200\u0201\3\2\2\2\u0201\u0203\3\2\2\2\u0202"+ - "\u0204\7\r\2\2\u0203\u0202\3\2\2\2\u0203\u0204\3\2\2\2\u0204\u0205\3\2"+ - "\2\2\u0205\u0207\7\6\2\2\u0206\u01e0\3\2\2\2\u0206\u01f3\3\2\2\2\u0207"+ - "?\3\2\2\2\u0208\u0209\7\7\2\2\u0209\u020e\5\36\20\2\u020a\u020b\7\f\2"+ - "\2\u020b\u020d\5\36\20\2\u020c\u020a\3\2\2\2\u020d\u0210\3\2\2\2\u020e"+ - "\u020c\3\2\2\2\u020e\u020f\3\2\2\2\u020f\u0211\3\2\2\2\u0210\u020e\3\2"+ - "\2\2\u0211\u0212\7\b\2\2\u0212\u0216\3\2\2\2\u0213\u0214\7\7\2\2\u0214"+ - "\u0216\7\b\2\2\u0215\u0208\3\2\2\2\u0215\u0213\3\2\2\2\u0216A\3\2\2\2"+ - "\u0217\u0218\7\7\2\2\u0218\u021d\5D#\2\u0219\u021a\7\f\2\2\u021a\u021c"+ - "\5D#\2\u021b\u0219\3\2\2\2\u021c\u021f\3\2\2\2\u021d\u021b\3\2\2\2\u021d"+ - "\u021e\3\2\2\2\u021e\u0220\3\2\2\2\u021f\u021d\3\2\2\2\u0220\u0221\7\b"+ - "\2\2\u0221\u0226\3\2\2\2\u0222\u0223\7\7\2\2\u0223\u0224\7\64\2\2\u0224"+ - "\u0226\7\b\2\2\u0225\u0217\3\2\2\2\u0225\u0222\3\2\2\2\u0226C\3\2\2\2"+ - "\u0227\u0228\5\36\20\2\u0228\u0229\7\64\2\2\u0229\u022a\5\36\20\2\u022a"+ - "E\3\2\2\2\62IObeqy\u0086\u008a\u008e\u0093\u00ae\u00b7\u00bb\u00c1\u00ca"+ - "\u00d4\u00dc\u00e2\u00f6\u013b\u013d\u0165\u016b\u0173\u0177\u018c\u0192"+ - "\u0199\u01a5\u01a8\u01af\u01b8\u01bb\u01be\u01c3\u01c6\u01ce\u01e8\u01ee"+ - "\u01f1\u01fd\u0200\u0203\u0206\u020e\u0215\u021d\u0225"; + "\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\7\20\u0144"+ + "\n\20\f\20\16\20\u0147\13\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3"+ + "\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3"+ + "\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3"+ + "\21\5\21\u016e\n\21\3\22\3\22\7\22\u0172\n\22\f\22\16\22\u0175\13\22\3"+ + "\22\3\22\3\22\7\22\u017a\n\22\f\22\16\22\u017d\13\22\3\22\5\22\u0180\n"+ + "\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3"+ + "\23\3\23\3\23\3\23\3\23\3\23\5\23\u0195\n\23\3\24\3\24\3\24\3\24\5\24"+ + "\u019b\n\24\3\25\3\25\3\25\3\25\3\25\5\25\u01a2\n\25\3\26\3\26\3\26\3"+ + "\26\3\27\3\27\3\27\3\27\7\27\u01ac\n\27\f\27\16\27\u01af\13\27\5\27\u01b1"+ + "\n\27\3\27\3\27\3\30\3\30\3\30\5\30\u01b8\n\30\3\31\3\31\3\31\3\31\3\31"+ + "\7\31\u01bf\n\31\f\31\16\31\u01c2\13\31\5\31\u01c4\n\31\3\31\5\31\u01c7"+ + "\n\31\3\31\3\31\3\31\5\31\u01cc\n\31\3\32\5\32\u01cf\n\32\3\32\3\32\3"+ + "\33\3\33\3\33\3\33\5\33\u01d7\n\33\3\34\3\34\3\34\3\34\3\35\3\35\3\35"+ + "\3\35\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \3 \6 \u01ef"+ + "\n \r \16 \u01f0\3 \3 \7 \u01f5\n \f \16 \u01f8\13 \5 \u01fa\n \3 \3 "+ + "\3 \3 \3 \3 \3 \3 \7 \u0204\n \f \16 \u0207\13 \5 \u0209\n \3 \5 \u020c"+ + "\n \3 \5 \u020f\n \3!\3!\3!\3!\7!\u0215\n!\f!\16!\u0218\13!\3!\3!\3!\3"+ + "!\5!\u021e\n!\3\"\3\"\3\"\3\"\7\"\u0224\n\"\f\"\16\"\u0227\13\"\3\"\3"+ + "\"\3\"\3\"\3\"\5\"\u022e\n\"\3#\3#\3#\3#\3#\2\3\36$\2\4\6\b\n\f\16\20"+ + "\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BD\2\16\3\3\r\r\3\2\u020e\3\2\2\2@"+ + "\u021d\3\2\2\2B\u022d\3\2\2\2D\u022f\3\2\2\2FH\5\4\3\2GF\3\2\2\2HK\3\2"+ + "\2\2IG\3\2\2\2IJ\3\2\2\2JO\3\2\2\2KI\3\2\2\2LN\5\b\5\2ML\3\2\2\2NQ\3\2"+ + "\2\2OM\3\2\2\2OP\3\2\2\2PR\3\2\2\2QO\3\2\2\2RS\7\2\2\3S\3\3\2\2\2TU\5"+ + "\26\f\2UV\7R\2\2VW\5\6\4\2WX\5\f\7\2X\5\3\2\2\2Ye\7\t\2\2Z[\5\26\f\2["+ + "b\7R\2\2\\]\7\f\2\2]^\5\26\f\2^_\7R\2\2_a\3\2\2\2`\\\3\2\2\2ad\3\2\2\2"+ + "b`\3\2\2\2bc\3\2\2\2cf\3\2\2\2db\3\2\2\2eZ\3\2\2\2ef\3\2\2\2fg\3\2\2\2"+ + "gh\7\n\2\2h\7\3\2\2\2ij\7\16\2\2jk\7\t\2\2kl\5\36\20\2lm\7\n\2\2mq\5\n"+ + "\6\2no\7\20\2\2or\5\n\6\2pr\6\5\2\2qn\3\2\2\2qp\3\2\2\2r\u00c0\3\2\2\2"+ + "st\7\21\2\2tu\7\t\2\2uv\5\36\20\2vy\7\n\2\2wz\5\n\6\2xz\5\16\b\2yw\3\2"+ + "\2\2yx\3\2\2\2z\u00c0\3\2\2\2{|\7\22\2\2|}\5\f\7\2}~\7\21\2\2~\177\7\t"+ + "\2\2\177\u0080\5\36\20\2\u0080\u0081\7\n\2\2\u0081\u0082\5\34\17\2\u0082"+ + "\u00c0\3\2\2\2\u0083\u0084\7\23\2\2\u0084\u0086\7\t\2\2\u0085\u0087\5"+ + "\20\t\2\u0086\u0085\3\2\2\2\u0086\u0087\3\2\2\2\u0087\u0088\3\2\2\2\u0088"+ + "\u008a\7\r\2\2\u0089\u008b\5\36\20\2\u008a\u0089\3\2\2\2\u008a\u008b\3"+ + "\2\2\2\u008b\u008c\3\2\2\2\u008c\u008e\7\r\2\2\u008d\u008f\5\22\n\2\u008e"+ + "\u008d\3\2\2\2\u008e\u008f\3\2\2\2\u008f\u0090\3\2\2\2\u0090\u0093\7\n"+ + "\2\2\u0091\u0094\5\n\6\2\u0092\u0094\5\16\b\2\u0093\u0091\3\2\2\2\u0093"+ + "\u0092\3\2\2\2\u0094\u00c0\3\2\2\2\u0095\u0096\7\23\2\2\u0096\u0097\7"+ + "\t\2\2\u0097\u0098\5\26\f\2\u0098\u0099\7R\2\2\u0099\u009a\7\65\2\2\u009a"+ + "\u009b\5\36\20\2\u009b\u009c\7\n\2\2\u009c\u009d\5\n\6\2\u009d\u00c0\3"+ + "\2\2\2\u009e\u009f\7\23\2\2\u009f\u00a0\7\t\2\2\u00a0\u00a1\7R\2\2\u00a1"+ + "\u00a2\7\17\2\2\u00a2\u00a3\5\36\20\2\u00a3\u00a4\7\n\2\2\u00a4\u00a5"+ + "\5\n\6\2\u00a5\u00c0\3\2\2\2\u00a6\u00a7\5\24\13\2\u00a7\u00a8\5\34\17"+ + "\2\u00a8\u00c0\3\2\2\2\u00a9\u00aa\7\24\2\2\u00aa\u00c0\5\34\17\2\u00ab"+ + "\u00ac\7\25\2\2\u00ac\u00c0\5\34\17\2\u00ad\u00ae\7\26\2\2\u00ae\u00af"+ + "\5\36\20\2\u00af\u00b0\5\34\17\2\u00b0\u00c0\3\2\2\2\u00b1\u00b2\7\30"+ + "\2\2\u00b2\u00b4\5\f\7\2\u00b3\u00b5\5\32\16\2\u00b4\u00b3\3\2\2\2\u00b5"+ + "\u00b6\3\2\2\2\u00b6\u00b4\3\2\2\2\u00b6\u00b7\3\2\2\2\u00b7\u00c0\3\2"+ + "\2\2\u00b8\u00b9\7\32\2\2\u00b9\u00ba\5\36\20\2\u00ba\u00bb\5\34\17\2"+ + "\u00bb\u00c0\3\2\2\2\u00bc\u00bd\5\36\20\2\u00bd\u00be\5\34\17\2\u00be"+ + "\u00c0\3\2\2\2\u00bfi\3\2\2\2\u00bfs\3\2\2\2\u00bf{\3\2\2\2\u00bf\u0083"+ + "\3\2\2\2\u00bf\u0095\3\2\2\2\u00bf\u009e\3\2\2\2\u00bf\u00a6\3\2\2\2\u00bf"+ + "\u00a9\3\2\2\2\u00bf\u00ab\3\2\2\2\u00bf\u00ad\3\2\2\2\u00bf\u00b1\3\2"+ + "\2\2\u00bf\u00b8\3\2\2\2\u00bf\u00bc\3\2\2\2\u00c0\t\3\2\2\2\u00c1\u00c4"+ + "\5\f\7\2\u00c2\u00c4\5\b\5\2\u00c3\u00c1\3\2\2\2\u00c3\u00c2\3\2\2\2\u00c4"+ + "\13\3\2\2\2\u00c5\u00c9\7\5\2\2\u00c6\u00c8\5\b\5\2\u00c7\u00c6\3\2\2"+ + "\2\u00c8\u00cb\3\2\2\2\u00c9\u00c7\3\2\2\2\u00c9\u00ca\3\2\2\2\u00ca\u00cc"+ + "\3\2\2\2\u00cb\u00c9\3\2\2\2\u00cc\u00cd\7\6\2\2\u00cd\r\3\2\2\2\u00ce"+ + "\u00cf\7\r\2\2\u00cf\17\3\2\2\2\u00d0\u00d3\5\24\13\2\u00d1\u00d3\5\36"+ + "\20\2\u00d2\u00d0\3\2\2\2\u00d2\u00d1\3\2\2\2\u00d3\21\3\2\2\2\u00d4\u00d5"+ + "\5\36\20\2\u00d5\23\3\2\2\2\u00d6\u00d7\5\26\f\2\u00d7\u00dc\5\30\r\2"+ + "\u00d8\u00d9\7\f\2\2\u00d9\u00db\5\30\r\2\u00da\u00d8\3\2\2\2\u00db\u00de"+ + "\3\2\2\2\u00dc\u00da\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd\25\3\2\2\2\u00de"+ + "\u00dc\3\2\2\2\u00df\u00e4\7Q\2\2\u00e0\u00e1\7\7\2\2\u00e1\u00e3\7\b"+ + "\2\2\u00e2\u00e0\3\2\2\2\u00e3\u00e6\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e4"+ + "\u00e5\3\2\2\2\u00e5\27\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e7\u00ea\7R\2\2"+ + "\u00e8\u00e9\7<\2\2\u00e9\u00eb\5\36\20\2\u00ea\u00e8\3\2\2\2\u00ea\u00eb"+ + "\3\2\2\2\u00eb\31\3\2\2\2\u00ec\u00ed\7\31\2\2\u00ed\u00ee\7\t\2\2\u00ee"+ + "\u00ef\7Q\2\2\u00ef\u00f0\7R\2\2\u00f0\u00f1\7\n\2\2\u00f1\u00f2\5\f\7"+ + "\2\u00f2\33\3\2\2\2\u00f3\u00f4\t\2\2\2\u00f4\35\3\2\2\2\u00f5\u00f6\b"+ + "\20\1\2\u00f6\u00f7\5\"\22\2\u00f7\u00f8\t\3\2\2\u00f8\u00f9\5\36\20\3"+ + "\u00f9\u00fa\b\20\1\2\u00fa\u00ff\3\2\2\2\u00fb\u00fc\5 \21\2\u00fc\u00fd"+ + "\b\20\1\2\u00fd\u00ff\3\2\2\2\u00fe\u00f5\3\2\2\2\u00fe\u00fb\3\2\2\2"+ + "\u00ff\u0145\3\2\2\2\u0100\u0101\f\20\2\2\u0101\u0102\t\4\2\2\u0102\u0103"+ + "\5\36\20\21\u0103\u0104\b\20\1\2\u0104\u0144\3\2\2\2\u0105\u0106\f\17"+ + "\2\2\u0106\u0107\t\5\2\2\u0107\u0108\5\36\20\20\u0108\u0109\b\20\1\2\u0109"+ + "\u0144\3\2\2\2\u010a\u010b\f\16\2\2\u010b\u010c\t\6\2\2\u010c\u010d\5"+ + "\36\20\17\u010d\u010e\b\20\1\2\u010e\u0144\3\2\2\2\u010f\u0110\f\r\2\2"+ + "\u0110\u0111\t\7\2\2\u0111\u0112\5\36\20\16\u0112\u0113\b\20\1\2\u0113"+ + "\u0144\3\2\2\2\u0114\u0115\f\f\2\2\u0115\u0116\t\b\2\2\u0116\u0117\5\36"+ + "\20\r\u0117\u0118\b\20\1\2\u0118\u0144\3\2\2\2\u0119\u011a\f\n\2\2\u011a"+ + "\u011b\t\t\2\2\u011b\u011c\5\36\20\13\u011c\u011d\b\20\1\2\u011d\u0144"+ + "\3\2\2\2\u011e\u011f\f\t\2\2\u011f\u0120\7/\2\2\u0120\u0121\5\36\20\n"+ + "\u0121\u0122\b\20\1\2\u0122\u0144\3\2\2\2\u0123\u0124\f\b\2\2\u0124\u0125"+ + "\7\60\2\2\u0125\u0126\5\36\20\t\u0126\u0127\b\20\1\2\u0127\u0144\3\2\2"+ + "\2\u0128\u0129\f\7\2\2\u0129\u012a\7\61\2\2\u012a\u012b\5\36\20\b\u012b"+ + "\u012c\b\20\1\2\u012c\u0144\3\2\2\2\u012d\u012e\f\6\2\2\u012e\u012f\7"+ + "\62\2\2\u012f\u0130\5\36\20\7\u0130\u0131\b\20\1\2\u0131\u0144\3\2\2\2"+ + "\u0132\u0133\f\5\2\2\u0133\u0134\7\63\2\2\u0134\u0135\5\36\20\6\u0135"+ + "\u0136\b\20\1\2\u0136\u0144\3\2\2\2\u0137\u0138\f\4\2\2\u0138\u0139\7"+ + "\64\2\2\u0139\u013a\5\36\20\2\u013a\u013b\7\65\2\2\u013b\u013c\5\36\20"+ + "\4\u013c\u013d\b\20\1\2\u013d\u0144\3\2\2\2\u013e\u013f\f\13\2\2\u013f"+ + "\u0140\7\34\2\2\u0140\u0141\5\26\f\2\u0141\u0142\b\20\1\2\u0142\u0144"+ + "\3\2\2\2\u0143\u0100\3\2\2\2\u0143\u0105\3\2\2\2\u0143\u010a\3\2\2\2\u0143"+ + "\u010f\3\2\2\2\u0143\u0114\3\2\2\2\u0143\u0119\3\2\2\2\u0143\u011e\3\2"+ + "\2\2\u0143\u0123\3\2\2\2\u0143\u0128\3\2\2\2\u0143\u012d\3\2\2\2\u0143"+ + "\u0132\3\2\2\2\u0143\u0137\3\2\2\2\u0143\u013e\3\2\2\2\u0144\u0147\3\2"+ + "\2\2\u0145\u0143\3\2\2\2\u0145\u0146\3\2\2\2\u0146\37\3\2\2\2\u0147\u0145"+ + "\3\2\2\2\u0148\u0149\6\21\20\3\u0149\u014a\t\n\2\2\u014a\u016e\5\"\22"+ + "\2\u014b\u014c\6\21\21\3\u014c\u014d\5\"\22\2\u014d\u014e\t\n\2\2\u014e"+ + "\u016e\3\2\2\2\u014f\u0150\6\21\22\3\u0150\u016e\5\"\22\2\u0151\u0152"+ + "\6\21\23\3\u0152\u0153\t\13\2\2\u0153\u016e\b\21\1\2\u0154\u0155\6\21"+ + "\24\3\u0155\u0156\7N\2\2\u0156\u016e\b\21\1\2\u0157\u0158\6\21\25\3\u0158"+ + "\u0159\7O\2\2\u0159\u016e\b\21\1\2\u015a\u015b\6\21\26\3\u015b\u015c\7"+ + "P\2\2\u015c\u016e\b\21\1\2\u015d\u015e\6\21\27\3\u015e\u015f\5@!\2\u015f"+ + "\u0160\b\21\1\2\u0160\u016e\3\2\2\2\u0161\u0162\6\21\30\3\u0162\u0163"+ + "\5B\"\2\u0163\u0164\b\21\1\2\u0164\u016e\3\2\2\2\u0165\u0166\6\21\31\3"+ + "\u0166\u0167\t\f\2\2\u0167\u016e\5 \21\2\u0168\u0169\7\t\2\2\u0169\u016a"+ + "\5\26\f\2\u016a\u016b\7\n\2\2\u016b\u016c\5 \21\2\u016c\u016e\3\2\2\2"+ + "\u016d\u0148\3\2\2\2\u016d\u014b\3\2\2\2\u016d\u014f\3\2\2\2\u016d\u0151"+ + "\3\2\2\2\u016d\u0154\3\2\2\2\u016d\u0157\3\2\2\2\u016d\u015a\3\2\2\2\u016d"+ + "\u015d\3\2\2\2\u016d\u0161\3\2\2\2\u016d\u0165\3\2\2\2\u016d\u0168\3\2"+ + "\2\2\u016e!\3\2\2\2\u016f\u0173\5$\23\2\u0170\u0172\5&\24\2\u0171\u0170"+ + "\3\2\2\2\u0172\u0175\3\2\2\2\u0173\u0171\3\2\2\2\u0173\u0174\3\2\2\2\u0174"+ + "\u0180\3\2\2\2\u0175\u0173\3\2\2\2\u0176\u0177\5\26\f\2\u0177\u017b\5"+ + "(\25\2\u0178\u017a\5&\24\2\u0179\u0178\3\2\2\2\u017a\u017d\3\2\2\2\u017b"+ + "\u0179\3\2\2\2\u017b\u017c\3\2\2\2\u017c\u0180\3\2\2\2\u017d\u017b\3\2"+ + "\2\2\u017e\u0180\5> \2\u017f\u016f\3\2\2\2\u017f\u0176\3\2\2\2\u017f\u017e"+ + "\3\2\2\2\u0180#\3\2\2\2\u0181\u0182\6\23\32\3\u0182\u0183\7\t\2\2\u0183"+ + "\u0184\5\36\20\2\u0184\u0185\7\n\2\2\u0185\u0186\b\23\1\2\u0186\u0195"+ + "\3\2\2\2\u0187\u0188\6\23\33\3\u0188\u0189\7\t\2\2\u0189\u018a\5 \21\2"+ + "\u018a\u018b\7\n\2\2\u018b\u0195\3\2\2\2\u018c\u0195\7L\2\2\u018d\u0195"+ + "\7M\2\2\u018e\u0195\7R\2\2\u018f\u0190\7R\2\2\u0190\u0195\5,\27\2\u0191"+ + "\u0192\7\27\2\2\u0192\u0193\7Q\2\2\u0193\u0195\5,\27\2\u0194\u0181\3\2"+ + "\2\2\u0194\u0187\3\2\2\2\u0194\u018c\3\2\2\2\u0194\u018d\3\2\2\2\u0194"+ + "\u018e\3\2\2\2\u0194\u018f\3\2\2\2\u0194\u0191\3\2\2\2\u0195%\3\2\2\2"+ + "\u0196\u0197\6\24\34\3\u0197\u019b\5(\25\2\u0198\u0199\6\24\35\3\u0199"+ + "\u019b\5*\26\2\u019a\u0196\3\2\2\2\u019a\u0198\3\2\2\2\u019b\'\3\2\2\2"+ + "\u019c\u019d\7\13\2\2\u019d\u019e\7T\2\2\u019e\u01a2\5,\27\2\u019f\u01a0"+ + "\7\13\2\2\u01a0\u01a2\t\r\2\2\u01a1\u019c\3\2\2\2\u01a1\u019f\3\2\2\2"+ + "\u01a2)\3\2\2\2\u01a3\u01a4\7\7\2\2\u01a4\u01a5\5\36\20\2\u01a5\u01a6"+ + "\7\b\2\2\u01a6+\3\2\2\2\u01a7\u01b0\7\t\2\2\u01a8\u01ad\5.\30\2\u01a9"+ + "\u01aa\7\f\2\2\u01aa\u01ac\5.\30\2\u01ab\u01a9\3\2\2\2\u01ac\u01af\3\2"+ + "\2\2\u01ad\u01ab\3\2\2\2\u01ad\u01ae\3\2\2\2\u01ae\u01b1\3\2\2\2\u01af"+ + "\u01ad\3\2\2\2\u01b0\u01a8\3\2\2\2\u01b0\u01b1\3\2\2\2\u01b1\u01b2\3\2"+ + "\2\2\u01b2\u01b3\7\n\2\2\u01b3-\3\2\2\2\u01b4\u01b8\5\36\20\2\u01b5\u01b8"+ + "\5\60\31\2\u01b6\u01b8\5\64\33\2\u01b7\u01b4\3\2\2\2\u01b7\u01b5\3\2\2"+ + "\2\u01b7\u01b6\3\2\2\2\u01b8/\3\2\2\2\u01b9\u01c7\5\62\32\2\u01ba\u01c3"+ + "\7\t\2\2\u01bb\u01c0\5\62\32\2\u01bc\u01bd\7\f\2\2\u01bd\u01bf\5\62\32"+ + "\2\u01be\u01bc\3\2\2\2\u01bf\u01c2\3\2\2\2\u01c0\u01be\3\2\2\2\u01c0\u01c1"+ + "\3\2\2\2\u01c1\u01c4\3\2\2\2\u01c2\u01c0\3\2\2\2\u01c3\u01bb\3\2\2\2\u01c3"+ + "\u01c4\3\2\2\2\u01c4\u01c5\3\2\2\2\u01c5\u01c7\7\n\2\2\u01c6\u01b9\3\2"+ + "\2\2\u01c6\u01ba\3\2\2\2\u01c7\u01c8\3\2\2\2\u01c8\u01cb\7\67\2\2\u01c9"+ + "\u01cc\5\f\7\2\u01ca\u01cc\5\36\20\2\u01cb\u01c9\3\2\2\2\u01cb\u01ca\3"+ + "\2\2\2\u01cc\61\3\2\2\2\u01cd\u01cf\5\26\f\2\u01ce\u01cd\3\2\2\2\u01ce"+ + "\u01cf\3\2\2\2\u01cf\u01d0\3\2\2\2\u01d0\u01d1\7R\2\2\u01d1\63\3\2\2\2"+ + "\u01d2\u01d7\5\66\34\2\u01d3\u01d7\58\35\2\u01d4\u01d7\5:\36\2\u01d5\u01d7"+ + "\5<\37\2\u01d6\u01d2\3\2\2\2\u01d6\u01d3\3\2\2\2\u01d6\u01d4\3\2\2\2\u01d6"+ + "\u01d5\3\2\2\2\u01d7\65\3\2\2\2\u01d8\u01d9\7Q\2\2\u01d9\u01da\7\66\2"+ + "\2\u01da\u01db\7R\2\2\u01db\67\3\2\2\2\u01dc\u01dd\5\26\f\2\u01dd\u01de"+ + "\7\66\2\2\u01de\u01df\7\27\2\2\u01df9\3\2\2\2\u01e0\u01e1\7R\2\2\u01e1"+ + "\u01e2\7\66\2\2\u01e2\u01e3\7R\2\2\u01e3;\3\2\2\2\u01e4\u01e5\7\33\2\2"+ + "\u01e5\u01e6\7\66\2\2\u01e6\u01e7\7R\2\2\u01e7=\3\2\2\2\u01e8\u01e9\7"+ + "\27\2\2\u01e9\u01ee\7Q\2\2\u01ea\u01eb\7\7\2\2\u01eb\u01ec\5\36\20\2\u01ec"+ + "\u01ed\7\b\2\2\u01ed\u01ef\3\2\2\2\u01ee\u01ea\3\2\2\2\u01ef\u01f0\3\2"+ + "\2\2\u01f0\u01ee\3\2\2\2\u01f0\u01f1\3\2\2\2\u01f1\u01f9\3\2\2\2\u01f2"+ + "\u01f6\5(\25\2\u01f3\u01f5\5&\24\2\u01f4\u01f3\3\2\2\2\u01f5\u01f8\3\2"+ + "\2\2\u01f6\u01f4\3\2\2\2\u01f6\u01f7\3\2\2\2\u01f7\u01fa\3\2\2\2\u01f8"+ + "\u01f6\3\2\2\2\u01f9\u01f2\3\2\2\2\u01f9\u01fa\3\2\2\2\u01fa\u020f\3\2"+ + "\2\2\u01fb\u01fc\7\27\2\2\u01fc\u01fd\7Q\2\2\u01fd\u01fe\7\7\2\2\u01fe"+ + "\u01ff\7\b\2\2\u01ff\u0208\7\5\2\2\u0200\u0205\5\36\20\2\u0201\u0202\7"+ + "\f\2\2\u0202\u0204\5\36\20\2\u0203\u0201\3\2\2\2\u0204\u0207\3\2\2\2\u0205"+ + "\u0203\3\2\2\2\u0205\u0206\3\2\2\2\u0206\u0209\3\2\2\2\u0207\u0205\3\2"+ + "\2\2\u0208\u0200\3\2\2\2\u0208\u0209\3\2\2\2\u0209\u020b\3\2\2\2\u020a"+ + "\u020c\7\r\2\2\u020b\u020a\3\2\2\2\u020b\u020c\3\2\2\2\u020c\u020d\3\2"+ + "\2\2\u020d\u020f\7\6\2\2\u020e\u01e8\3\2\2\2\u020e\u01fb\3\2\2\2\u020f"+ + "?\3\2\2\2\u0210\u0211\7\7\2\2\u0211\u0216\5\36\20\2\u0212\u0213\7\f\2"+ + "\2\u0213\u0215\5\36\20\2\u0214\u0212\3\2\2\2\u0215\u0218\3\2\2\2\u0216"+ + "\u0214\3\2\2\2\u0216\u0217\3\2\2\2\u0217\u0219\3\2\2\2\u0218\u0216\3\2"+ + "\2\2\u0219\u021a\7\b\2\2\u021a\u021e\3\2\2\2\u021b\u021c\7\7\2\2\u021c"+ + "\u021e\7\b\2\2\u021d\u0210\3\2\2\2\u021d\u021b\3\2\2\2\u021eA\3\2\2\2"+ + "\u021f\u0220\7\7\2\2\u0220\u0225\5D#\2\u0221\u0222\7\f\2\2\u0222\u0224"+ + "\5D#\2\u0223\u0221\3\2\2\2\u0224\u0227\3\2\2\2\u0225\u0223\3\2\2\2\u0225"+ + "\u0226\3\2\2\2\u0226\u0228\3\2\2\2\u0227\u0225\3\2\2\2\u0228\u0229\7\b"+ + "\2\2\u0229\u022e\3\2\2\2\u022a\u022b\7\7\2\2\u022b\u022c\7\65\2\2\u022c"+ + "\u022e\7\b\2\2\u022d\u021f\3\2\2\2\u022d\u022a\3\2\2\2\u022eC\3\2\2\2"+ + "\u022f\u0230\5\36\20\2\u0230\u0231\7\65\2\2\u0231\u0232\5\36\20\2\u0232"+ + "E\3\2\2\2\62IObeqy\u0086\u008a\u008e\u0093\u00b6\u00bf\u00c3\u00c9\u00d2"+ + "\u00dc\u00e4\u00ea\u00fe\u0143\u0145\u016d\u0173\u017b\u017f\u0194\u019a"+ + "\u01a1\u01ad\u01b0\u01b7\u01c0\u01c3\u01c6\u01cb\u01ce\u01d6\u01f0\u01f6"+ + "\u01f9\u0205\u0208\u020b\u020e\u0216\u021d\u0225\u022d"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserBaseVisitor.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserBaseVisitor.java index a11a856edd4..a1279d611e3 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserBaseVisitor.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserBaseVisitor.java @@ -67,6 +67,13 @@ class PainlessParserBaseVisitor extends AbstractParseTreeVisitor implement * {@link #visitChildren} on {@code ctx}.

*/ @Override public T visitEach(PainlessParser.EachContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIneach(PainlessParser.IneachContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserVisitor.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserVisitor.java index bc9e8c4f994..8a297651070 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserVisitor.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParserVisitor.java @@ -63,6 +63,13 @@ interface PainlessParserVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitEach(PainlessParser.EachContext ctx); + /** + * Visit a parse tree produced by the {@code ineach} + * labeled alternative in {@link PainlessParser#statement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIneach(PainlessParser.IneachContext ctx); /** * Visit a parse tree produced by the {@code decl} * labeled alternative in {@link PainlessParser#statement}. diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/Walker.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/Walker.java index 88774bb9984..55e3445bace 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/Walker.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/Walker.java @@ -81,6 +81,7 @@ import org.elasticsearch.painless.antlr.PainlessParser.ForContext; import org.elasticsearch.painless.antlr.PainlessParser.FuncrefContext; import org.elasticsearch.painless.antlr.PainlessParser.FunctionContext; import org.elasticsearch.painless.antlr.PainlessParser.IfContext; +import org.elasticsearch.painless.antlr.PainlessParser.IneachContext; import org.elasticsearch.painless.antlr.PainlessParser.InitializerContext; import org.elasticsearch.painless.antlr.PainlessParser.InstanceofContext; import org.elasticsearch.painless.antlr.PainlessParser.LambdaContext; @@ -358,6 +359,17 @@ public final class Walker extends PainlessParserBaseVisitor { return new SEach(location(ctx), type, name, expression, block); } + + @Override + public Object visitIneach(IneachContext ctx) { + reserved.peek().setMaxLoopCounter(settings.getMaxLoopCounter()); + + String name = ctx.ID().getText(); + AExpression expression = (AExpression)visitExpression(ctx.expression()); + SBlock block = (SBlock)visit(ctx.trailer()); + + return new SEach(location(ctx), "def", name, expression, block); + } @Override public Object visitDecl(DeclContext ctx) { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SFunction.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SFunction.java index 46dc8af5ab9..3eee2a7b2d8 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SFunction.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SFunction.java @@ -158,6 +158,7 @@ public class SFunction extends AStatement { access |= Opcodes.ACC_SYNTHETIC; } final MethodWriter function = new MethodWriter(access, method.method, writer, globals.getStatements(), settings); + function.visitCode(); write(function, globals); function.endMethod(); } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SSource.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SSource.java index 950b021486f..e55ad91d492 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SSource.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/node/SSource.java @@ -31,6 +31,7 @@ import org.elasticsearch.painless.node.SFunction.Reserved; import org.elasticsearch.painless.WriterConstants; import org.elasticsearch.painless.Location; import org.elasticsearch.painless.MethodWriter; +import org.elasticsearch.painless.SimpleChecksAdapter; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Opcodes; @@ -146,7 +147,6 @@ public final class SSource extends AStatement { // Create the ClassWriter. int classFrames = ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS; - int classVersion = Opcodes.V1_8; int classAccess = Opcodes.ACC_PUBLIC | Opcodes.ACC_SUPER | Opcodes.ACC_FINAL; String classBase = BASE_CLASS_TYPE.getInternalName(); String className = CLASS_TYPE.getInternalName(); @@ -155,10 +155,15 @@ public final class SSource extends AStatement { ClassWriter writer = new ClassWriter(classFrames); ClassVisitor visitor = writer; + // if picky is enabled, turn on some checks. instead of VerifyError at the end, you get a helpful stacktrace. + if (settings.isPicky()) { + visitor = new SimpleChecksAdapter(visitor); + } + if (debugStream != null) { visitor = new TraceClassVisitor(visitor, debugStream, null); } - visitor.visit(classVersion, classAccess, className, null, classBase, classInterfaces); + visitor.visit(WriterConstants.CLASS_VERSION, classAccess, className, null, classBase, classInterfaces); visitor.visitSource(Location.computeSourceName(name, source), null); // Write the constructor: @@ -207,6 +212,7 @@ public final class SSource extends AStatement { // Initialize the constants in a static initializer final MethodWriter clinit = new MethodWriter(Opcodes.ACC_STATIC, WriterConstants.CLINIT, visitor, globals.getStatements(), settings); + clinit.visitCode(); for (Constant constant : inits) { constant.initializer.accept(clinit); clinit.putStatic(CLASS_TYPE, constant.name, constant.type); diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicStatementTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicStatementTests.java index 01f3ee42ae6..e023ac364b3 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicStatementTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicStatementTests.java @@ -130,39 +130,65 @@ public class BasicStatementTests extends ScriptTestCase { public void testIterableForEachStatement() { assertEquals(6, exec("List l = new ArrayList(); l.add(1); l.add(2); l.add(3); int total = 0;" + " for (int x : l) total += x; return total")); + assertEquals(6, exec("List l = new ArrayList(); l.add(1); l.add(2); l.add(3); int total = 0;" + + " for (x in l) total += x; return total")); assertEquals("123", exec("List l = new ArrayList(); l.add('1'); l.add('2'); l.add('3'); String cat = '';" + " for (String x : l) cat += x; return cat")); + assertEquals("123", exec("List l = new ArrayList(); l.add('1'); l.add('2'); l.add('3'); String cat = '';" + + " for (x in l) cat += x; return cat")); assertEquals("1236", exec("Map m = new HashMap(); m.put('1', 1); m.put('2', 2); m.put('3', 3);" + " String cat = ''; int total = 0;" + " for (Map.Entry e : m.entrySet()) { cat += e.getKey(); total += e.getValue(); } return cat + total")); + assertEquals("1236", exec("Map m = new HashMap(); m.put('1', 1); m.put('2', 2); m.put('3', 3);" + + " String cat = ''; int total = 0;" + + " for (e in m.entrySet()) { cat += e.getKey(); total += e.getValue(); } return cat + total")); } public void testIterableForEachStatementDef() { assertEquals(6, exec("def l = new ArrayList(); l.add(1); l.add(2); l.add(3); int total = 0;" + " for (int x : l) total += x; return total")); + assertEquals(6, exec("def l = new ArrayList(); l.add(1); l.add(2); l.add(3); int total = 0;" + + " for (x in l) total += x; return total")); assertEquals("123", exec("def l = new ArrayList(); l.add('1'); l.add('2'); l.add('3'); String cat = '';" + " for (String x : l) cat += x; return cat")); + assertEquals("123", exec("def l = new ArrayList(); l.add('1'); l.add('2'); l.add('3'); String cat = '';" + + " for (x in l) cat += x; return cat")); assertEquals("1236", exec("def m = new HashMap(); m.put('1', 1); m.put('2', 2); m.put('3', 3);" + " String cat = ''; int total = 0;" + " for (Map.Entry e : m.entrySet()) { cat += e.getKey(); total += e.getValue(); } return cat + total")); + assertEquals("1236", exec("def m = new HashMap(); m.put('1', 1); m.put('2', 2); m.put('3', 3);" + + " String cat = ''; int total = 0;" + + " for (e in m.entrySet()) { cat += e.getKey(); total += e.getValue(); } return cat + total")); } public void testArrayForEachStatement() { assertEquals(6, exec("int[] a = new int[3]; a[0] = 1; a[1] = 2; a[2] = 3; int total = 0;" + " for (int x : a) total += x; return total")); + assertEquals(6, exec("int[] a = new int[3]; a[0] = 1; a[1] = 2; a[2] = 3; int total = 0;" + + " for (x in a) total += x; return total")); assertEquals("123", exec("String[] a = new String[3]; a[0] = '1'; a[1] = '2'; a[2] = '3'; def total = '';" + " for (String x : a) total += x; return total")); + assertEquals("123", exec("String[] a = new String[3]; a[0] = '1'; a[1] = '2'; a[2] = '3'; def total = '';" + + " for (x in a) total += x; return total")); assertEquals(6, exec("int[][] i = new int[3][1]; i[0][0] = 1; i[1][0] = 2; i[2][0] = 3; int total = 0;" + " for (int[] j : i) total += j[0]; return total")); + assertEquals(6, exec("int[][] i = new int[3][1]; i[0][0] = 1; i[1][0] = 2; i[2][0] = 3; int total = 0;" + + " for (j in i) total += j[0]; return total")); } public void testArrayForEachStatementDef() { assertEquals(6, exec("def a = new int[3]; a[0] = 1; a[1] = 2; a[2] = 3; int total = 0;" + " for (int x : a) total += x; return total")); + assertEquals(6, exec("def a = new int[3]; a[0] = 1; a[1] = 2; a[2] = 3; int total = 0;" + + " for (x in a) total += x; return total")); assertEquals("123", exec("def a = new String[3]; a[0] = '1'; a[1] = '2'; a[2] = '3'; def total = '';" + " for (String x : a) total += x; return total")); + assertEquals("123", exec("def a = new String[3]; a[0] = '1'; a[1] = '2'; a[2] = '3'; def total = '';" + + " for (x in a) total += x; return total")); assertEquals(6, exec("def i = new int[3][1]; i[0][0] = 1; i[1][0] = 2; i[2][0] = 3; int total = 0;" + " for (int[] j : i) total += j[0]; return total")); + assertEquals(6, exec("def i = new int[3][1]; i[0][0] = 1; i[1][0] = 2; i[2][0] = 3; int total = 0;" + + " for (j in i) total += j[0]; return total")); } public void testDeclarationStatement() { diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/LambdaTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/LambdaTests.java index dbca5243ec2..6bb800eb92c 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/LambdaTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/LambdaTests.java @@ -79,7 +79,7 @@ public class LambdaTests extends ScriptTestCase { } public void testMultipleStatements() { - assertEquals(2, exec("int applyOne(IntFunction arg) { arg.apply(1) } applyOne(x -> { x = x + 1; return x })")); + assertEquals(2, exec("int applyOne(IntFunction arg) { arg.apply(1) } applyOne(x -> { def y = x + 1; return y })")); } public void testUnneededCurlyStatements() { @@ -138,6 +138,7 @@ public class LambdaTests extends ScriptTestCase { assertTrue(expected.getMessage().contains("is read-only")); } + @AwaitsFix(bugUrl = "def type tracking") public void testOnlyCapturesAreReadOnly() { assertEquals(4, exec("List l = new ArrayList(); l.add(1); l.add(1); " + "return l.stream().mapToInt(x -> { x += 1; return x }).sum();"));