From 2cae575f538af8cea473fa69788645c39c157307 Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Thu, 5 May 2016 09:26:02 -0700 Subject: [PATCH] Added single-quoted strings. Closes #18150 --- .../modules/scripting/painless.asciidoc | 14 +- .../src/main/antlr/PainlessLexer.g4 | 3 +- .../src/main/antlr/PainlessParser.g4 | 1 - .../org/elasticsearch/painless/Analyzer.java | 8 - .../painless/AnalyzerCaster.java | 15 +- .../painless/AnalyzerExpression.java | 12 - .../painless/AnalyzerExternal.java | 3 +- .../elasticsearch/painless/Definition.java | 9 + .../elasticsearch/painless/PainlessLexer.java | 342 ++++++------ .../painless/PainlessParser.java | 495 +++++++++--------- .../painless/PainlessParserBaseVisitor.java | 7 - .../painless/PainlessParserVisitor.java | 7 - .../org/elasticsearch/painless/Utility.java | 28 + .../org/elasticsearch/painless/Writer.java | 8 - .../painless/WriterExpression.java | 15 - .../painless/BasicExpressionTests.java | 2 +- .../elasticsearch/painless/EqualsTests.java | 44 +- .../elasticsearch/painless/StringTests.java | 114 ++++ .../test/plan_a/20_scriptfield.yaml | 2 +- .../rest-api-spec/test/plan_a/30_search.yaml | 12 +- 20 files changed, 614 insertions(+), 527 deletions(-) diff --git a/docs/reference/modules/scripting/painless.asciidoc b/docs/reference/modules/scripting/painless.asciidoc index 1937bd9947b..b96e1f099de 100644 --- a/docs/reference/modules/scripting/painless.asciidoc +++ b/docs/reference/modules/scripting/painless.asciidoc @@ -86,7 +86,7 @@ GET /hockey-stats/_search "script_score": { "script": { "lang": "painless", - "inline": "int total = 0; for (int i = 0; i < input.doc.goals.size(); ++i) { total += input.doc.goals[i]; } return total;" + "inline": "int total = 0; for (int i = 0; i < input.doc['goals'].size(); ++i) { total += input.doc['goals'][i]; } return total;" } } } @@ -108,7 +108,7 @@ GET /hockey-stats/_search "total_goals": { "script": { "lang": "painless", - "inline": "int total = 0; for (int i = 0; i < input.doc.goals.size(); ++i) { total += input.doc.goals[i]; } return total;" + "inline": "int total = 0; for (int i = 0; i < input.doc['goals'].size(); ++i) { total += input.doc['goals'][i]; } return total;" } } } @@ -118,7 +118,7 @@ GET /hockey-stats/_search You must always specify the index of the field value you want, even if there's only a single item in the field. All fields in Elasticsearch are multi-valued and Painless does not provide a `.value` shortcut. The following example uses a Painless script to sort the players by their combined first and last names. The names are accessed using -`input.doc.first.0` and `input.doc.last.0`. +`input.doc['first'].0` and `input.doc['last'].0`. [source,sh] ---------------------------------------------------------------- @@ -133,7 +133,7 @@ GET /hockey-stats/_search "order": "asc", "script": { "lang": "painless", - "inline": "input.doc.first.0 + \" \" + input.doc.last.0" + "inline": "input.doc['first'].0 + ' ' + input.doc['last'].0" } } } @@ -219,13 +219,13 @@ GET /hockey-stats/_search "full_name_dynamic": { "script": { "lang": "painless", - "inline": "def first = input.doc.first.0; def last = input.doc.last.0; return first + \" \" + last;" + "inline": "def first = input.doc['first'].0; def last = input.doc['last'].0; return first + ' ' + last;" } }, "full_name_static": { "script": { "lang": "painless", - "inline": "String first = (String)((List)((Map)input.get(\"doc\")).get(\"first\")).get(0); String last = (String)((List)((Map)input.get(\"doc\")).get(\"last\")).get(0); return first + \" \" + last;" + "inline": "String first = (String)((List)((Map)input.get('doc')).get('first')).get(0); String last = (String)((List)((Map)input.get('doc')).get('last')).get(0); return first + ' ' + last;" } } } @@ -727,4 +727,4 @@ Def static Long defToLong(def) static Float defToFloat(def) static Double defToDouble(def) ------ \ No newline at end of file +----- diff --git a/modules/lang-painless/src/main/antlr/PainlessLexer.g4 b/modules/lang-painless/src/main/antlr/PainlessLexer.g4 index f1e40f93d02..eab0670f973 100644 --- a/modules/lang-painless/src/main/antlr/PainlessLexer.g4 +++ b/modules/lang-painless/src/main/antlr/PainlessLexer.g4 @@ -90,8 +90,7 @@ HEX: '0' [xX] [0-9a-fA-F]+ [lL]?; INTEGER: ( '0' | [1-9] [0-9]* ) [lLfFdD]?; DECIMAL: ( '0' | [1-9] [0-9]* ) DOT [0-9]* ( [eE] [+\-]? [0-9]+ )? [fF]?; -STRING: '"' ( '\\"' | '\\\\' | ~[\\"] )*? '"'; -CHAR: '\'' . '\''; +STRING: ( '"' ( '\\"' | '\\\\' | ~[\\"] )*? '"' ) | ( '\'' ( '\\\'' | '\\\\' | ~[\\"] )*? '\'' ); TRUE: 'true'; FALSE: 'false'; diff --git a/modules/lang-painless/src/main/antlr/PainlessParser.g4 b/modules/lang-painless/src/main/antlr/PainlessParser.g4 index c9e0de72210..1ecd72528e0 100644 --- a/modules/lang-painless/src/main/antlr/PainlessParser.g4 +++ b/modules/lang-painless/src/main/antlr/PainlessParser.g4 @@ -89,7 +89,6 @@ generic expression : LP expression RP # precedence | ( OCTAL | HEX | INTEGER | DECIMAL ) # numeric - | CHAR # char | TRUE # true | FALSE # false | NULL # null diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Analyzer.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Analyzer.java index 50473ea4e88..f411db00802 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Analyzer.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Analyzer.java @@ -26,7 +26,6 @@ import org.elasticsearch.painless.PainlessParser.BinaryContext; import org.elasticsearch.painless.PainlessParser.BoolContext; import org.elasticsearch.painless.PainlessParser.BreakContext; import org.elasticsearch.painless.PainlessParser.CastContext; -import org.elasticsearch.painless.PainlessParser.CharContext; import org.elasticsearch.painless.PainlessParser.CompContext; import org.elasticsearch.painless.PainlessParser.ConditionalContext; import org.elasticsearch.painless.PainlessParser.ContinueContext; @@ -276,13 +275,6 @@ class Analyzer extends PainlessParserBaseVisitor { return null; } - @Override - public Void visitChar(final CharContext ctx) { - expression.processChar(ctx); - - return null; - } - @Override public Void visitTrue(final TrueContext ctx) { expression.processTrue(ctx); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java index 46a510bc6bb..dddb3491f64 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java @@ -159,6 +159,7 @@ class AnalyzerCaster { return checkTransform(source, cast); case BYTE_OBJ: case SHORT_OBJ: + case STRING: if (explicit) return checkTransform(source, cast); @@ -371,6 +372,7 @@ class AnalyzerCaster { case SHORT: case BYTE_OBJ: case SHORT_OBJ: + case STRING: if (explicit) return checkTransform(source, cast); @@ -470,6 +472,15 @@ class AnalyzerCaster { } break; + case STRING: + switch (to.sort) { + case CHAR: + case CHAR_OBJ: + if (explicit) + return checkTransform(source, cast); + + break; + } } try { @@ -556,8 +567,8 @@ class AnalyzerCaster { } catch (IllegalAccessException | IllegalArgumentException | java.lang.reflect.InvocationTargetException | NullPointerException | ExceptionInInitializerError exception) { - throw new IllegalStateException(AnalyzerUtility.error(source) + "Unable to invoke transform to cast constant from " + - "[" + transform.from.name + "] to [" + transform.to.name + "]."); + throw new IllegalArgumentException(AnalyzerUtility.error(source) + + "Cannot cast constant from [" + transform.from.name + "] to [" + transform.to.name + "]."); } } } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExpression.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExpression.java index 029e7e530b5..3db42f88696 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExpression.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExpression.java @@ -27,7 +27,6 @@ import org.elasticsearch.painless.PainlessParser.AssignmentContext; import org.elasticsearch.painless.PainlessParser.BinaryContext; import org.elasticsearch.painless.PainlessParser.BoolContext; import org.elasticsearch.painless.PainlessParser.CastContext; -import org.elasticsearch.painless.PainlessParser.CharContext; import org.elasticsearch.painless.PainlessParser.CompContext; import org.elasticsearch.painless.PainlessParser.ConditionalContext; import org.elasticsearch.painless.PainlessParser.DecltypeContext; @@ -161,17 +160,6 @@ class AnalyzerExpression { } } - void processChar(final CharContext ctx) { - final ExpressionMetadata charemd = metadata.getExpressionMetadata(ctx); - - if (ctx.CHAR() == null) { - throw new IllegalStateException(AnalyzerUtility.error(ctx) + "Unexpected state."); - } - - charemd.preConst = ctx.CHAR().getText().charAt(1); - charemd.from = definition.charType; - } - void processTrue(final TrueContext ctx) { final ExpressionMetadata trueemd = metadata.getExpressionMetadata(ctx); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExternal.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExternal.java index 2ce5fa14d22..32ab8f43c9e 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExternal.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerExternal.java @@ -584,8 +584,7 @@ class AnalyzerExternal { "Illegal list get shortcut [" + value + "] for type [" + struct.name + "]."); } - if (setter != null && (setter.rtn.sort != Sort.VOID || setter.arguments.size() != 2 || - setter.arguments.get(0).sort != Sort.INT)) { + if (setter != null && (setter.arguments.size() != 2 || setter.arguments.get(0).sort != Sort.INT)) { throw new IllegalArgumentException(AnalyzerUtility.error(ctx) + "Illegal list set shortcut [" + value + "] for type [" + struct.name + "]."); } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java index 6cb4125f026..450f2aa6fa4 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java @@ -801,6 +801,7 @@ class Definition { addMethod("Utility", "charToLong", null, true, longobjType, new Type[] {charType}, null, null); addMethod("Utility", "charToFloat", null, true, floatobjType, new Type[] {charType}, null, null); addMethod("Utility", "charToDouble", null, true, doubleobjType, new Type[] {charType}, null, null); + addMethod("Utility", "charToString", null, true, stringType, new Type[] {charType}, null, null); addMethod("Utility", "CharacterToboolean", null, true, booleanType, new Type[] {charobjType}, null, null); addMethod("Utility", "CharacterTobyte", null, true, byteType, new Type[] {charobjType}, null, null); addMethod("Utility", "CharacterToshort", null, true, shortType, new Type[] {charobjType}, null, null); @@ -815,6 +816,7 @@ class Definition { addMethod("Utility", "CharacterToLong", null, true, longobjType, new Type[] {charobjType}, null, null); addMethod("Utility", "CharacterToFloat", null, true, floatobjType, new Type[] {charobjType}, null, null); addMethod("Utility", "CharacterToDouble", null, true, doubleobjType, new Type[] {charobjType}, null, null); + addMethod("Utility", "CharacterToString", null, true, stringType, new Type[] {charobjType}, null, null); addMethod("Utility", "intToboolean", null, true, booleanType, new Type[] {intType}, null, null); addMethod("Utility", "intToByte", null, true, byteobjType, new Type[] {intType}, null, null); addMethod("Utility", "intToShort", null, true, shortobjType, new Type[] {intType}, null, null); @@ -851,6 +853,8 @@ class Definition { addMethod("Utility", "doubleToFloat", null, true, floatobjType, new Type[] {doubleType}, null, null); addMethod("Utility", "DoubleToboolean", null, true, booleanType, new Type[] {doubleobjType}, null, null); addMethod("Utility", "DoubleTochar", null, true, charType, new Type[] {doubleobjType}, null, null); + addMethod("Utility", "StringTochar", null, true, charType, new Type[] {stringType}, null, null); + addMethod("Utility", "StringToCharacter", null, true, charobjType, new Type[] {stringType}, null, null); addMethod("Math", "abs", null, true, doubleType, new Type[] {doubleType}, null, null); addMethod("Math", "fabs", "abs", true, floatType, new Type[] {floatType}, null, null); @@ -1125,6 +1129,7 @@ class Definition { addTransform(charType, longobjType, "Utility", "charToLong", true); addTransform(charType, floatobjType, "Utility", "charToFloat", true); addTransform(charType, doubleobjType, "Utility", "charToDouble", true); + addTransform(charType, stringType, "Utility", "charToString", true); addTransform(intType, booleanType, "Utility", "intToboolean", true); addTransform(intType, objectType, "Integer", "valueOf", true); @@ -1281,6 +1286,7 @@ class Definition { addTransform(charobjType, longobjType, "Utility", "CharacterToLong", true); addTransform(charobjType, floatobjType, "Utility", "CharacterToFloat", true); addTransform(charobjType, doubleobjType, "Utility", "CharacterToDouble", true); + addTransform(charobjType, stringType, "Utility", "CharacterToString", true); addTransform(intobjType, booleanType, "Utility", "IntegerToboolean", true); addTransform(intobjType, byteType, "Integer", "byteValue", false); @@ -1345,6 +1351,9 @@ class Definition { addTransform(doubleobjType, intobjType, "Utility", "NumberToInteger", true); addTransform(doubleobjType, longobjType, "Utility", "NumberToLong", true); addTransform(doubleobjType, floatobjType, "Utility", "NumberToFloat", true); + + addTransform(stringType, charType, "Utility", "StringTochar", true); + addTransform(stringType, charobjType, "Utility", "StringToCharacter", true); } private void addDefaultBounds() { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessLexer.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessLexer.java index ad71e155bb0..6951c67605a 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessLexer.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessLexer.java @@ -25,7 +25,7 @@ class PainlessLexer extends Lexer { BWOR=44, BOOLAND=45, BOOLOR=46, COND=47, COLON=48, INCR=49, DECR=50, ASSIGN=51, AADD=52, ASUB=53, AMUL=54, ADIV=55, AREM=56, AAND=57, AXOR=58, AOR=59, ALSH=60, ARSH=61, AUSH=62, OCTAL=63, HEX=64, INTEGER=65, DECIMAL=66, STRING=67, - CHAR=68, TRUE=69, FALSE=70, NULL=71, ID=72, EXTINTEGER=73, EXTID=74; + TRUE=68, FALSE=69, NULL=70, ID=71, EXTINTEGER=72, EXTID=73; public static final int EXT = 1; public static String[] modeNames = { "DEFAULT_MODE", "EXT" @@ -39,8 +39,8 @@ class PainlessLexer extends Lexer { "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "BWXOR", "BWOR", "BOOLAND", "BOOLOR", "COND", "COLON", "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", "AAND", "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", - "HEX", "INTEGER", "DECIMAL", "STRING", "CHAR", "TRUE", "FALSE", "NULL", - "ID", "EXTINTEGER", "EXTID" + "HEX", "INTEGER", "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "ID", + "EXTINTEGER", "EXTID" }; private static final String[] _LITERAL_NAMES = { @@ -51,7 +51,7 @@ class PainlessLexer extends Lexer { "'>='", "'=='", "'==='", "'!='", "'!=='", "'&'", "'^'", "'|'", "'&&'", "'||'", "'?'", "':'", "'++'", "'--'", "'='", "'+='", "'-='", "'*='", "'/='", "'%='", "'&='", "'^='", "'|='", "'<<='", "'>>='", "'>>>='", null, null, - null, null, null, null, "'true'", "'false'", "'null'" + null, null, null, "'true'", "'false'", "'null'" }; private static final String[] _SYMBOLIC_NAMES = { null, "WS", "COMMENT", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "LP", "RP", @@ -61,8 +61,8 @@ class PainlessLexer extends Lexer { "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "BWXOR", "BWOR", "BOOLAND", "BOOLOR", "COND", "COLON", "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", "AAND", "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", - "HEX", "INTEGER", "DECIMAL", "STRING", "CHAR", "TRUE", "FALSE", "NULL", - "ID", "EXTINTEGER", "EXTID" + "HEX", "INTEGER", "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "ID", + "EXTINTEGER", "EXTID" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -119,7 +119,7 @@ class PainlessLexer extends Lexer { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2L\u01f4\b\1\b\1\4"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2K\u01fb\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"+ @@ -128,168 +128,172 @@ 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\3\2\6\2\u009a\n\2\r\2\16\2\u009b\3\2\3\2\3\3\3\3\3\3"+ - "\3\3\7\3\u00a4\n\3\f\3\16\3\u00a7\13\3\3\3\3\3\3\3\3\3\3\3\7\3\u00ae\n"+ - "\3\f\3\16\3\u00b1\13\3\3\3\3\3\5\3\u00b5\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\32\3\32\3\33\3\33\3\34\3\34\3\35"+ - "\3\35\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/\3/\3\60\3\60\3\61\3\61\3\62\3\62\3\62\3\63"+ - "\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\3"+ - "8\38\39\39\39\3:\3:\3:\3;\3;\3;\3<\3<\3<\3=\3=\3=\3=\3>\3>\3>\3>\3?\3"+ - "?\3?\3?\3?\3@\3@\6@\u017b\n@\r@\16@\u017c\3@\5@\u0180\n@\3A\3A\3A\6A\u0185"+ - "\nA\rA\16A\u0186\3A\5A\u018a\nA\3B\3B\3B\7B\u018f\nB\fB\16B\u0192\13B"+ - "\5B\u0194\nB\3B\5B\u0197\nB\3C\3C\3C\7C\u019c\nC\fC\16C\u019f\13C\5C\u01a1"+ - "\nC\3C\3C\7C\u01a5\nC\fC\16C\u01a8\13C\3C\3C\5C\u01ac\nC\3C\6C\u01af\n"+ - "C\rC\16C\u01b0\5C\u01b3\nC\3C\5C\u01b6\nC\3D\3D\3D\3D\3D\3D\7D\u01be\n"+ - "D\fD\16D\u01c1\13D\3D\3D\3E\3E\3E\3E\3F\3F\3F\3F\3F\3G\3G\3G\3G\3G\3G"+ - "\3H\3H\3H\3H\3H\3I\3I\7I\u01db\nI\fI\16I\u01de\13I\3J\3J\3J\7J\u01e3\n"+ - "J\fJ\16J\u01e6\13J\5J\u01e8\nJ\3J\3J\3K\3K\7K\u01ee\nK\fK\16K\u01f1\13"+ - "K\3K\3K\5\u00a5\u00af\u01bf\2L\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`\61"+ - "b\62d\63f\64h\65j\66l\67n8p9r:t;v|?~@\u0080A\u0082B\u0084C\u0086"+ - "D\u0088E\u008aF\u008cG\u008eH\u0090I\u0092J\u0094K\u0096L\4\2\3\21\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$$^^\5\2C\\aa"+ - "c|\6\2\62;C\\aac|\u020b\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\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\2"+ - "x\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\3\u0094"+ - "\3\2\2\2\3\u0096\3\2\2\2\4\u0099\3\2\2\2\6\u00b4\3\2\2\2\b\u00b8\3\2\2"+ - "\2\n\u00ba\3\2\2\2\f\u00bc\3\2\2\2\16\u00be\3\2\2\2\20\u00c0\3\2\2\2\22"+ - "\u00c2\3\2\2\2\24\u00c4\3\2\2\2\26\u00c8\3\2\2\2\30\u00ca\3\2\2\2\32\u00cc"+ - "\3\2\2\2\34\u00cf\3\2\2\2\36\u00d4\3\2\2\2 \u00da\3\2\2\2\"\u00dd\3\2"+ - "\2\2$\u00e1\3\2\2\2&\u00ea\3\2\2\2(\u00f0\3\2\2\2*\u00f7\3\2\2\2,\u00fb"+ - "\3\2\2\2.\u00ff\3\2\2\2\60\u0105\3\2\2\2\62\u010b\3\2\2\2\64\u010d\3\2"+ - "\2\2\66\u010f\3\2\2\28\u0111\3\2\2\2:\u0113\3\2\2\2<\u0115\3\2\2\2>\u0117"+ - "\3\2\2\2@\u0119\3\2\2\2B\u011c\3\2\2\2D\u011f\3\2\2\2F\u0123\3\2\2\2H"+ - "\u0125\3\2\2\2J\u0128\3\2\2\2L\u012a\3\2\2\2N\u012d\3\2\2\2P\u0130\3\2"+ - "\2\2R\u0134\3\2\2\2T\u0137\3\2\2\2V\u013b\3\2\2\2X\u013d\3\2\2\2Z\u013f"+ - "\3\2\2\2\\\u0141\3\2\2\2^\u0144\3\2\2\2`\u0147\3\2\2\2b\u0149\3\2\2\2"+ - "d\u014b\3\2\2\2f\u014e\3\2\2\2h\u0151\3\2\2\2j\u0153\3\2\2\2l\u0156\3"+ - "\2\2\2n\u0159\3\2\2\2p\u015c\3\2\2\2r\u015f\3\2\2\2t\u0162\3\2\2\2v\u0165"+ - "\3\2\2\2x\u0168\3\2\2\2z\u016b\3\2\2\2|\u016f\3\2\2\2~\u0173\3\2\2\2\u0080"+ - "\u0178\3\2\2\2\u0082\u0181\3\2\2\2\u0084\u0193\3\2\2\2\u0086\u01a0\3\2"+ - "\2\2\u0088\u01b7\3\2\2\2\u008a\u01c4\3\2\2\2\u008c\u01c8\3\2\2\2\u008e"+ - "\u01cd\3\2\2\2\u0090\u01d3\3\2\2\2\u0092\u01d8\3\2\2\2\u0094\u01e7\3\2"+ - "\2\2\u0096\u01eb\3\2\2\2\u0098\u009a\t\2\2\2\u0099\u0098\3\2\2\2\u009a"+ - "\u009b\3\2\2\2\u009b\u0099\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009d\3\2"+ - "\2\2\u009d\u009e\b\2\2\2\u009e\5\3\2\2\2\u009f\u00a0\7\61\2\2\u00a0\u00a1"+ - "\7\61\2\2\u00a1\u00a5\3\2\2\2\u00a2\u00a4\13\2\2\2\u00a3\u00a2\3\2\2\2"+ - "\u00a4\u00a7\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a5\u00a3\3\2\2\2\u00a6\u00a8"+ - "\3\2\2\2\u00a7\u00a5\3\2\2\2\u00a8\u00b5\t\3\2\2\u00a9\u00aa\7\61\2\2"+ - "\u00aa\u00ab\7,\2\2\u00ab\u00af\3\2\2\2\u00ac\u00ae\13\2\2\2\u00ad\u00ac"+ - "\3\2\2\2\u00ae\u00b1\3\2\2\2\u00af\u00b0\3\2\2\2\u00af\u00ad\3\2\2\2\u00b0"+ - "\u00b2\3\2\2\2\u00b1\u00af\3\2\2\2\u00b2\u00b3\7,\2\2\u00b3\u00b5\7\61"+ - "\2\2\u00b4\u009f\3\2\2\2\u00b4\u00a9\3\2\2\2\u00b5\u00b6\3\2\2\2\u00b6"+ - "\u00b7\b\3\2\2\u00b7\7\3\2\2\2\u00b8\u00b9\7}\2\2\u00b9\t\3\2\2\2\u00ba"+ - "\u00bb\7\177\2\2\u00bb\13\3\2\2\2\u00bc\u00bd\7]\2\2\u00bd\r\3\2\2\2\u00be"+ - "\u00bf\7_\2\2\u00bf\17\3\2\2\2\u00c0\u00c1\7*\2\2\u00c1\21\3\2\2\2\u00c2"+ - "\u00c3\7+\2\2\u00c3\23\3\2\2\2\u00c4\u00c5\7\60\2\2\u00c5\u00c6\3\2\2"+ - "\2\u00c6\u00c7\b\n\3\2\u00c7\25\3\2\2\2\u00c8\u00c9\7.\2\2\u00c9\27\3"+ - "\2\2\2\u00ca\u00cb\7=\2\2\u00cb\31\3\2\2\2\u00cc\u00cd\7k\2\2\u00cd\u00ce"+ - "\7h\2\2\u00ce\33\3\2\2\2\u00cf\u00d0\7g\2\2\u00d0\u00d1\7n\2\2\u00d1\u00d2"+ - "\7u\2\2\u00d2\u00d3\7g\2\2\u00d3\35\3\2\2\2\u00d4\u00d5\7y\2\2\u00d5\u00d6"+ - "\7j\2\2\u00d6\u00d7\7k\2\2\u00d7\u00d8\7n\2\2\u00d8\u00d9\7g\2\2\u00d9"+ - "\37\3\2\2\2\u00da\u00db\7f\2\2\u00db\u00dc\7q\2\2\u00dc!\3\2\2\2\u00dd"+ - "\u00de\7h\2\2\u00de\u00df\7q\2\2\u00df\u00e0\7t\2\2\u00e0#\3\2\2\2\u00e1"+ - "\u00e2\7e\2\2\u00e2\u00e3\7q\2\2\u00e3\u00e4\7p\2\2\u00e4\u00e5\7v\2\2"+ - "\u00e5\u00e6\7k\2\2\u00e6\u00e7\7p\2\2\u00e7\u00e8\7w\2\2\u00e8\u00e9"+ - "\7g\2\2\u00e9%\3\2\2\2\u00ea\u00eb\7d\2\2\u00eb\u00ec\7t\2\2\u00ec\u00ed"+ - "\7g\2\2\u00ed\u00ee\7c\2\2\u00ee\u00ef\7m\2\2\u00ef\'\3\2\2\2\u00f0\u00f1"+ - "\7t\2\2\u00f1\u00f2\7g\2\2\u00f2\u00f3\7v\2\2\u00f3\u00f4\7w\2\2\u00f4"+ - "\u00f5\7t\2\2\u00f5\u00f6\7p\2\2\u00f6)\3\2\2\2\u00f7\u00f8\7p\2\2\u00f8"+ - "\u00f9\7g\2\2\u00f9\u00fa\7y\2\2\u00fa+\3\2\2\2\u00fb\u00fc\7v\2\2\u00fc"+ - "\u00fd\7t\2\2\u00fd\u00fe\7{\2\2\u00fe-\3\2\2\2\u00ff\u0100\7e\2\2\u0100"+ - "\u0101\7c\2\2\u0101\u0102\7v\2\2\u0102\u0103\7e\2\2\u0103\u0104\7j\2\2"+ - "\u0104/\3\2\2\2\u0105\u0106\7v\2\2\u0106\u0107\7j\2\2\u0107\u0108\7t\2"+ - "\2\u0108\u0109\7q\2\2\u0109\u010a\7y\2\2\u010a\61\3\2\2\2\u010b\u010c"+ - "\7#\2\2\u010c\63\3\2\2\2\u010d\u010e\7\u0080\2\2\u010e\65\3\2\2\2\u010f"+ - "\u0110\7,\2\2\u0110\67\3\2\2\2\u0111\u0112\7\61\2\2\u01129\3\2\2\2\u0113"+ - "\u0114\7\'\2\2\u0114;\3\2\2\2\u0115\u0116\7-\2\2\u0116=\3\2\2\2\u0117"+ - "\u0118\7/\2\2\u0118?\3\2\2\2\u0119\u011a\7>\2\2\u011a\u011b\7>\2\2\u011b"+ - "A\3\2\2\2\u011c\u011d\7@\2\2\u011d\u011e\7@\2\2\u011eC\3\2\2\2\u011f\u0120"+ - "\7@\2\2\u0120\u0121\7@\2\2\u0121\u0122\7@\2\2\u0122E\3\2\2\2\u0123\u0124"+ - "\7>\2\2\u0124G\3\2\2\2\u0125\u0126\7>\2\2\u0126\u0127\7?\2\2\u0127I\3"+ - "\2\2\2\u0128\u0129\7@\2\2\u0129K\3\2\2\2\u012a\u012b\7@\2\2\u012b\u012c"+ - "\7?\2\2\u012cM\3\2\2\2\u012d\u012e\7?\2\2\u012e\u012f\7?\2\2\u012fO\3"+ - "\2\2\2\u0130\u0131\7?\2\2\u0131\u0132\7?\2\2\u0132\u0133\7?\2\2\u0133"+ - "Q\3\2\2\2\u0134\u0135\7#\2\2\u0135\u0136\7?\2\2\u0136S\3\2\2\2\u0137\u0138"+ - "\7#\2\2\u0138\u0139\7?\2\2\u0139\u013a\7?\2\2\u013aU\3\2\2\2\u013b\u013c"+ - "\7(\2\2\u013cW\3\2\2\2\u013d\u013e\7`\2\2\u013eY\3\2\2\2\u013f\u0140\7"+ - "~\2\2\u0140[\3\2\2\2\u0141\u0142\7(\2\2\u0142\u0143\7(\2\2\u0143]\3\2"+ - "\2\2\u0144\u0145\7~\2\2\u0145\u0146\7~\2\2\u0146_\3\2\2\2\u0147\u0148"+ - "\7A\2\2\u0148a\3\2\2\2\u0149\u014a\7<\2\2\u014ac\3\2\2\2\u014b\u014c\7"+ - "-\2\2\u014c\u014d\7-\2\2\u014de\3\2\2\2\u014e\u014f\7/\2\2\u014f\u0150"+ - "\7/\2\2\u0150g\3\2\2\2\u0151\u0152\7?\2\2\u0152i\3\2\2\2\u0153\u0154\7"+ - "-\2\2\u0154\u0155\7?\2\2\u0155k\3\2\2\2\u0156\u0157\7/\2\2\u0157\u0158"+ - "\7?\2\2\u0158m\3\2\2\2\u0159\u015a\7,\2\2\u015a\u015b\7?\2\2\u015bo\3"+ - "\2\2\2\u015c\u015d\7\61\2\2\u015d\u015e\7?\2\2\u015eq\3\2\2\2\u015f\u0160"+ - "\7\'\2\2\u0160\u0161\7?\2\2\u0161s\3\2\2\2\u0162\u0163\7(\2\2\u0163\u0164"+ - "\7?\2\2\u0164u\3\2\2\2\u0165\u0166\7`\2\2\u0166\u0167\7?\2\2\u0167w\3"+ - "\2\2\2\u0168\u0169\7~\2\2\u0169\u016a\7?\2\2\u016ay\3\2\2\2\u016b\u016c"+ - "\7>\2\2\u016c\u016d\7>\2\2\u016d\u016e\7?\2\2\u016e{\3\2\2\2\u016f\u0170"+ - "\7@\2\2\u0170\u0171\7@\2\2\u0171\u0172\7?\2\2\u0172}\3\2\2\2\u0173\u0174"+ - "\7@\2\2\u0174\u0175\7@\2\2\u0175\u0176\7@\2\2\u0176\u0177\7?\2\2\u0177"+ - "\177\3\2\2\2\u0178\u017a\7\62\2\2\u0179\u017b\t\4\2\2\u017a\u0179\3\2"+ - "\2\2\u017b\u017c\3\2\2\2\u017c\u017a\3\2\2\2\u017c\u017d\3\2\2\2\u017d"+ - "\u017f\3\2\2\2\u017e\u0180\t\5\2\2\u017f\u017e\3\2\2\2\u017f\u0180\3\2"+ - "\2\2\u0180\u0081\3\2\2\2\u0181\u0182\7\62\2\2\u0182\u0184\t\6\2\2\u0183"+ - "\u0185\t\7\2\2\u0184\u0183\3\2\2\2\u0185\u0186\3\2\2\2\u0186\u0184\3\2"+ - "\2\2\u0186\u0187\3\2\2\2\u0187\u0189\3\2\2\2\u0188\u018a\t\5\2\2\u0189"+ - "\u0188\3\2\2\2\u0189\u018a\3\2\2\2\u018a\u0083\3\2\2\2\u018b\u0194\7\62"+ - "\2\2\u018c\u0190\t\b\2\2\u018d\u018f\t\t\2\2\u018e\u018d\3\2\2\2\u018f"+ - "\u0192\3\2\2\2\u0190\u018e\3\2\2\2\u0190\u0191\3\2\2\2\u0191\u0194\3\2"+ - "\2\2\u0192\u0190\3\2\2\2\u0193\u018b\3\2\2\2\u0193\u018c\3\2\2\2\u0194"+ - "\u0196\3\2\2\2\u0195\u0197\t\n\2\2\u0196\u0195\3\2\2\2\u0196\u0197\3\2"+ - "\2\2\u0197\u0085\3\2\2\2\u0198\u01a1\7\62\2\2\u0199\u019d\t\b\2\2\u019a"+ - "\u019c\t\t\2\2\u019b\u019a\3\2\2\2\u019c\u019f\3\2\2\2\u019d\u019b\3\2"+ - "\2\2\u019d\u019e\3\2\2\2\u019e\u01a1\3\2\2\2\u019f\u019d\3\2\2\2\u01a0"+ - "\u0198\3\2\2\2\u01a0\u0199\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a2\u01a6\5\24"+ - "\n\2\u01a3\u01a5\t\t\2\2\u01a4\u01a3\3\2\2\2\u01a5\u01a8\3\2\2\2\u01a6"+ - "\u01a4\3\2\2\2\u01a6\u01a7\3\2\2\2\u01a7\u01b2\3\2\2\2\u01a8\u01a6\3\2"+ - "\2\2\u01a9\u01ab\t\13\2\2\u01aa\u01ac\t\f\2\2\u01ab\u01aa\3\2\2\2\u01ab"+ - "\u01ac\3\2\2\2\u01ac\u01ae\3\2\2\2\u01ad\u01af\t\t\2\2\u01ae\u01ad\3\2"+ - "\2\2\u01af\u01b0\3\2\2\2\u01b0\u01ae\3\2\2\2\u01b0\u01b1\3\2\2\2\u01b1"+ - "\u01b3\3\2\2\2\u01b2\u01a9\3\2\2\2\u01b2\u01b3\3\2\2\2\u01b3\u01b5\3\2"+ - "\2\2\u01b4\u01b6\t\r\2\2\u01b5\u01b4\3\2\2\2\u01b5\u01b6\3\2\2\2\u01b6"+ - "\u0087\3\2\2\2\u01b7\u01bf\7$\2\2\u01b8\u01b9\7^\2\2\u01b9\u01be\7$\2"+ - "\2\u01ba\u01bb\7^\2\2\u01bb\u01be\7^\2\2\u01bc\u01be\n\16\2\2\u01bd\u01b8"+ - "\3\2\2\2\u01bd\u01ba\3\2\2\2\u01bd\u01bc\3\2\2\2\u01be\u01c1\3\2\2\2\u01bf"+ - "\u01c0\3\2\2\2\u01bf\u01bd\3\2\2\2\u01c0\u01c2\3\2\2\2\u01c1\u01bf\3\2"+ - "\2\2\u01c2\u01c3\7$\2\2\u01c3\u0089\3\2\2\2\u01c4\u01c5\7)\2\2\u01c5\u01c6"+ - "\13\2\2\2\u01c6\u01c7\7)\2\2\u01c7\u008b\3\2\2\2\u01c8\u01c9\7v\2\2\u01c9"+ - "\u01ca\7t\2\2\u01ca\u01cb\7w\2\2\u01cb\u01cc\7g\2\2\u01cc\u008d\3\2\2"+ - "\2\u01cd\u01ce\7h\2\2\u01ce\u01cf\7c\2\2\u01cf\u01d0\7n\2\2\u01d0\u01d1"+ - "\7u\2\2\u01d1\u01d2\7g\2\2\u01d2\u008f\3\2\2\2\u01d3\u01d4\7p\2\2\u01d4"+ - "\u01d5\7w\2\2\u01d5\u01d6\7n\2\2\u01d6\u01d7\7n\2\2\u01d7\u0091\3\2\2"+ - "\2\u01d8\u01dc\t\17\2\2\u01d9\u01db\t\20\2\2\u01da\u01d9\3\2\2\2\u01db"+ - "\u01de\3\2\2\2\u01dc\u01da\3\2\2\2\u01dc\u01dd\3\2\2\2\u01dd\u0093\3\2"+ - "\2\2\u01de\u01dc\3\2\2\2\u01df\u01e8\7\62\2\2\u01e0\u01e4\t\b\2\2\u01e1"+ - "\u01e3\t\t\2\2\u01e2\u01e1\3\2\2\2\u01e3\u01e6\3\2\2\2\u01e4\u01e2\3\2"+ - "\2\2\u01e4\u01e5\3\2\2\2\u01e5\u01e8\3\2\2\2\u01e6\u01e4\3\2\2\2\u01e7"+ - "\u01df\3\2\2\2\u01e7\u01e0\3\2\2\2\u01e8\u01e9\3\2\2\2\u01e9\u01ea\bJ"+ - "\4\2\u01ea\u0095\3\2\2\2\u01eb\u01ef\t\17\2\2\u01ec\u01ee\t\20\2\2\u01ed"+ - "\u01ec\3\2\2\2\u01ee\u01f1\3\2\2\2\u01ef\u01ed\3\2\2\2\u01ef\u01f0\3\2"+ - "\2\2\u01f0\u01f2\3\2\2\2\u01f1\u01ef\3\2\2\2\u01f2\u01f3\bK\4\2\u01f3"+ - "\u0097\3\2\2\2\34\2\3\u009b\u00a5\u00af\u00b4\u017c\u017f\u0186\u0189"+ - "\u0190\u0193\u0196\u019d\u01a0\u01a6\u01ab\u01b0\u01b2\u01b5\u01bd\u01bf"+ - "\u01dc\u01e4\u01e7\u01ef\5\b\2\2\4\3\2\4\2\2"; + "I\tI\4J\tJ\3\2\6\2\u0098\n\2\r\2\16\2\u0099\3\2\3\2\3\3\3\3\3\3\3\3\7"+ + "\3\u00a2\n\3\f\3\16\3\u00a5\13\3\3\3\3\3\3\3\3\3\3\3\7\3\u00ac\n\3\f\3"+ + "\16\3\u00af\13\3\3\3\3\3\5\3\u00b3\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\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35"+ + "\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/\3/\3\60\3\60\3\61\3\61\3\62\3\62\3\62\3\63\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\39\39\39\3:\3:\3:\3;\3;\3;\3<\3<\3<\3=\3=\3=\3=\3>\3>\3>\3>\3?\3?"+ + "\3?\3?\3?\3@\3@\6@\u0179\n@\r@\16@\u017a\3@\5@\u017e\n@\3A\3A\3A\6A\u0183"+ + "\nA\rA\16A\u0184\3A\5A\u0188\nA\3B\3B\3B\7B\u018d\nB\fB\16B\u0190\13B"+ + "\5B\u0192\nB\3B\5B\u0195\nB\3C\3C\3C\7C\u019a\nC\fC\16C\u019d\13C\5C\u019f"+ + "\nC\3C\3C\7C\u01a3\nC\fC\16C\u01a6\13C\3C\3C\5C\u01aa\nC\3C\6C\u01ad\n"+ + "C\rC\16C\u01ae\5C\u01b1\nC\3C\5C\u01b4\nC\3D\3D\3D\3D\3D\3D\7D\u01bc\n"+ + "D\fD\16D\u01bf\13D\3D\3D\3D\3D\3D\3D\3D\7D\u01c8\nD\fD\16D\u01cb\13D\3"+ + "D\5D\u01ce\nD\3E\3E\3E\3E\3E\3F\3F\3F\3F\3F\3F\3G\3G\3G\3G\3G\3H\3H\7"+ + "H\u01e2\nH\fH\16H\u01e5\13H\3I\3I\3I\7I\u01ea\nI\fI\16I\u01ed\13I\5I\u01ef"+ + "\nI\3I\3I\3J\3J\7J\u01f5\nJ\fJ\16J\u01f8\13J\3J\3J\6\u00a3\u00ad\u01bd"+ + "\u01c9\2K\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\66"+ + "l\67n8p9r:t;v|?~@\u0080A\u0082B\u0084C\u0086D\u0088E\u008aF\u008c"+ + "G\u008eH\u0090I\u0092J\u0094K\4\2\3\21\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$$^^\5\2C\\aac|\6\2\62;C\\aac|\u0216\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\2"+ + "X\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\3\u0092\3\2\2\2\3\u0094\3\2\2\2\4\u0097\3\2\2\2\6\u00b2"+ + "\3\2\2\2\b\u00b6\3\2\2\2\n\u00b8\3\2\2\2\f\u00ba\3\2\2\2\16\u00bc\3\2"+ + "\2\2\20\u00be\3\2\2\2\22\u00c0\3\2\2\2\24\u00c2\3\2\2\2\26\u00c6\3\2\2"+ + "\2\30\u00c8\3\2\2\2\32\u00ca\3\2\2\2\34\u00cd\3\2\2\2\36\u00d2\3\2\2\2"+ + " \u00d8\3\2\2\2\"\u00db\3\2\2\2$\u00df\3\2\2\2&\u00e8\3\2\2\2(\u00ee\3"+ + "\2\2\2*\u00f5\3\2\2\2,\u00f9\3\2\2\2.\u00fd\3\2\2\2\60\u0103\3\2\2\2\62"+ + "\u0109\3\2\2\2\64\u010b\3\2\2\2\66\u010d\3\2\2\28\u010f\3\2\2\2:\u0111"+ + "\3\2\2\2<\u0113\3\2\2\2>\u0115\3\2\2\2@\u0117\3\2\2\2B\u011a\3\2\2\2D"+ + "\u011d\3\2\2\2F\u0121\3\2\2\2H\u0123\3\2\2\2J\u0126\3\2\2\2L\u0128\3\2"+ + "\2\2N\u012b\3\2\2\2P\u012e\3\2\2\2R\u0132\3\2\2\2T\u0135\3\2\2\2V\u0139"+ + "\3\2\2\2X\u013b\3\2\2\2Z\u013d\3\2\2\2\\\u013f\3\2\2\2^\u0142\3\2\2\2"+ + "`\u0145\3\2\2\2b\u0147\3\2\2\2d\u0149\3\2\2\2f\u014c\3\2\2\2h\u014f\3"+ + "\2\2\2j\u0151\3\2\2\2l\u0154\3\2\2\2n\u0157\3\2\2\2p\u015a\3\2\2\2r\u015d"+ + "\3\2\2\2t\u0160\3\2\2\2v\u0163\3\2\2\2x\u0166\3\2\2\2z\u0169\3\2\2\2|"+ + "\u016d\3\2\2\2~\u0171\3\2\2\2\u0080\u0176\3\2\2\2\u0082\u017f\3\2\2\2"+ + "\u0084\u0191\3\2\2\2\u0086\u019e\3\2\2\2\u0088\u01cd\3\2\2\2\u008a\u01cf"+ + "\3\2\2\2\u008c\u01d4\3\2\2\2\u008e\u01da\3\2\2\2\u0090\u01df\3\2\2\2\u0092"+ + "\u01ee\3\2\2\2\u0094\u01f2\3\2\2\2\u0096\u0098\t\2\2\2\u0097\u0096\3\2"+ + "\2\2\u0098\u0099\3\2\2\2\u0099\u0097\3\2\2\2\u0099\u009a\3\2\2\2\u009a"+ + "\u009b\3\2\2\2\u009b\u009c\b\2\2\2\u009c\5\3\2\2\2\u009d\u009e\7\61\2"+ + "\2\u009e\u009f\7\61\2\2\u009f\u00a3\3\2\2\2\u00a0\u00a2\13\2\2\2\u00a1"+ + "\u00a0\3\2\2\2\u00a2\u00a5\3\2\2\2\u00a3\u00a4\3\2\2\2\u00a3\u00a1\3\2"+ + "\2\2\u00a4\u00a6\3\2\2\2\u00a5\u00a3\3\2\2\2\u00a6\u00b3\t\3\2\2\u00a7"+ + "\u00a8\7\61\2\2\u00a8\u00a9\7,\2\2\u00a9\u00ad\3\2\2\2\u00aa\u00ac\13"+ + "\2\2\2\u00ab\u00aa\3\2\2\2\u00ac\u00af\3\2\2\2\u00ad\u00ae\3\2\2\2\u00ad"+ + "\u00ab\3\2\2\2\u00ae\u00b0\3\2\2\2\u00af\u00ad\3\2\2\2\u00b0\u00b1\7,"+ + "\2\2\u00b1\u00b3\7\61\2\2\u00b2\u009d\3\2\2\2\u00b2\u00a7\3\2\2\2\u00b3"+ + "\u00b4\3\2\2\2\u00b4\u00b5\b\3\2\2\u00b5\7\3\2\2\2\u00b6\u00b7\7}\2\2"+ + "\u00b7\t\3\2\2\2\u00b8\u00b9\7\177\2\2\u00b9\13\3\2\2\2\u00ba\u00bb\7"+ + "]\2\2\u00bb\r\3\2\2\2\u00bc\u00bd\7_\2\2\u00bd\17\3\2\2\2\u00be\u00bf"+ + "\7*\2\2\u00bf\21\3\2\2\2\u00c0\u00c1\7+\2\2\u00c1\23\3\2\2\2\u00c2\u00c3"+ + "\7\60\2\2\u00c3\u00c4\3\2\2\2\u00c4\u00c5\b\n\3\2\u00c5\25\3\2\2\2\u00c6"+ + "\u00c7\7.\2\2\u00c7\27\3\2\2\2\u00c8\u00c9\7=\2\2\u00c9\31\3\2\2\2\u00ca"+ + "\u00cb\7k\2\2\u00cb\u00cc\7h\2\2\u00cc\33\3\2\2\2\u00cd\u00ce\7g\2\2\u00ce"+ + "\u00cf\7n\2\2\u00cf\u00d0\7u\2\2\u00d0\u00d1\7g\2\2\u00d1\35\3\2\2\2\u00d2"+ + "\u00d3\7y\2\2\u00d3\u00d4\7j\2\2\u00d4\u00d5\7k\2\2\u00d5\u00d6\7n\2\2"+ + "\u00d6\u00d7\7g\2\2\u00d7\37\3\2\2\2\u00d8\u00d9\7f\2\2\u00d9\u00da\7"+ + "q\2\2\u00da!\3\2\2\2\u00db\u00dc\7h\2\2\u00dc\u00dd\7q\2\2\u00dd\u00de"+ + "\7t\2\2\u00de#\3\2\2\2\u00df\u00e0\7e\2\2\u00e0\u00e1\7q\2\2\u00e1\u00e2"+ + "\7p\2\2\u00e2\u00e3\7v\2\2\u00e3\u00e4\7k\2\2\u00e4\u00e5\7p\2\2\u00e5"+ + "\u00e6\7w\2\2\u00e6\u00e7\7g\2\2\u00e7%\3\2\2\2\u00e8\u00e9\7d\2\2\u00e9"+ + "\u00ea\7t\2\2\u00ea\u00eb\7g\2\2\u00eb\u00ec\7c\2\2\u00ec\u00ed\7m\2\2"+ + "\u00ed\'\3\2\2\2\u00ee\u00ef\7t\2\2\u00ef\u00f0\7g\2\2\u00f0\u00f1\7v"+ + "\2\2\u00f1\u00f2\7w\2\2\u00f2\u00f3\7t\2\2\u00f3\u00f4\7p\2\2\u00f4)\3"+ + "\2\2\2\u00f5\u00f6\7p\2\2\u00f6\u00f7\7g\2\2\u00f7\u00f8\7y\2\2\u00f8"+ + "+\3\2\2\2\u00f9\u00fa\7v\2\2\u00fa\u00fb\7t\2\2\u00fb\u00fc\7{\2\2\u00fc"+ + "-\3\2\2\2\u00fd\u00fe\7e\2\2\u00fe\u00ff\7c\2\2\u00ff\u0100\7v\2\2\u0100"+ + "\u0101\7e\2\2\u0101\u0102\7j\2\2\u0102/\3\2\2\2\u0103\u0104\7v\2\2\u0104"+ + "\u0105\7j\2\2\u0105\u0106\7t\2\2\u0106\u0107\7q\2\2\u0107\u0108\7y\2\2"+ + "\u0108\61\3\2\2\2\u0109\u010a\7#\2\2\u010a\63\3\2\2\2\u010b\u010c\7\u0080"+ + "\2\2\u010c\65\3\2\2\2\u010d\u010e\7,\2\2\u010e\67\3\2\2\2\u010f\u0110"+ + "\7\61\2\2\u01109\3\2\2\2\u0111\u0112\7\'\2\2\u0112;\3\2\2\2\u0113\u0114"+ + "\7-\2\2\u0114=\3\2\2\2\u0115\u0116\7/\2\2\u0116?\3\2\2\2\u0117\u0118\7"+ + ">\2\2\u0118\u0119\7>\2\2\u0119A\3\2\2\2\u011a\u011b\7@\2\2\u011b\u011c"+ + "\7@\2\2\u011cC\3\2\2\2\u011d\u011e\7@\2\2\u011e\u011f\7@\2\2\u011f\u0120"+ + "\7@\2\2\u0120E\3\2\2\2\u0121\u0122\7>\2\2\u0122G\3\2\2\2\u0123\u0124\7"+ + ">\2\2\u0124\u0125\7?\2\2\u0125I\3\2\2\2\u0126\u0127\7@\2\2\u0127K\3\2"+ + "\2\2\u0128\u0129\7@\2\2\u0129\u012a\7?\2\2\u012aM\3\2\2\2\u012b\u012c"+ + "\7?\2\2\u012c\u012d\7?\2\2\u012dO\3\2\2\2\u012e\u012f\7?\2\2\u012f\u0130"+ + "\7?\2\2\u0130\u0131\7?\2\2\u0131Q\3\2\2\2\u0132\u0133\7#\2\2\u0133\u0134"+ + "\7?\2\2\u0134S\3\2\2\2\u0135\u0136\7#\2\2\u0136\u0137\7?\2\2\u0137\u0138"+ + "\7?\2\2\u0138U\3\2\2\2\u0139\u013a\7(\2\2\u013aW\3\2\2\2\u013b\u013c\7"+ + "`\2\2\u013cY\3\2\2\2\u013d\u013e\7~\2\2\u013e[\3\2\2\2\u013f\u0140\7("+ + "\2\2\u0140\u0141\7(\2\2\u0141]\3\2\2\2\u0142\u0143\7~\2\2\u0143\u0144"+ + "\7~\2\2\u0144_\3\2\2\2\u0145\u0146\7A\2\2\u0146a\3\2\2\2\u0147\u0148\7"+ + "<\2\2\u0148c\3\2\2\2\u0149\u014a\7-\2\2\u014a\u014b\7-\2\2\u014be\3\2"+ + "\2\2\u014c\u014d\7/\2\2\u014d\u014e\7/\2\2\u014eg\3\2\2\2\u014f\u0150"+ + "\7?\2\2\u0150i\3\2\2\2\u0151\u0152\7-\2\2\u0152\u0153\7?\2\2\u0153k\3"+ + "\2\2\2\u0154\u0155\7/\2\2\u0155\u0156\7?\2\2\u0156m\3\2\2\2\u0157\u0158"+ + "\7,\2\2\u0158\u0159\7?\2\2\u0159o\3\2\2\2\u015a\u015b\7\61\2\2\u015b\u015c"+ + "\7?\2\2\u015cq\3\2\2\2\u015d\u015e\7\'\2\2\u015e\u015f\7?\2\2\u015fs\3"+ + "\2\2\2\u0160\u0161\7(\2\2\u0161\u0162\7?\2\2\u0162u\3\2\2\2\u0163\u0164"+ + "\7`\2\2\u0164\u0165\7?\2\2\u0165w\3\2\2\2\u0166\u0167\7~\2\2\u0167\u0168"+ + "\7?\2\2\u0168y\3\2\2\2\u0169\u016a\7>\2\2\u016a\u016b\7>\2\2\u016b\u016c"+ + "\7?\2\2\u016c{\3\2\2\2\u016d\u016e\7@\2\2\u016e\u016f\7@\2\2\u016f\u0170"+ + "\7?\2\2\u0170}\3\2\2\2\u0171\u0172\7@\2\2\u0172\u0173\7@\2\2\u0173\u0174"+ + "\7@\2\2\u0174\u0175\7?\2\2\u0175\177\3\2\2\2\u0176\u0178\7\62\2\2\u0177"+ + "\u0179\t\4\2\2\u0178\u0177\3\2\2\2\u0179\u017a\3\2\2\2\u017a\u0178\3\2"+ + "\2\2\u017a\u017b\3\2\2\2\u017b\u017d\3\2\2\2\u017c\u017e\t\5\2\2\u017d"+ + "\u017c\3\2\2\2\u017d\u017e\3\2\2\2\u017e\u0081\3\2\2\2\u017f\u0180\7\62"+ + "\2\2\u0180\u0182\t\6\2\2\u0181\u0183\t\7\2\2\u0182\u0181\3\2\2\2\u0183"+ + "\u0184\3\2\2\2\u0184\u0182\3\2\2\2\u0184\u0185\3\2\2\2\u0185\u0187\3\2"+ + "\2\2\u0186\u0188\t\5\2\2\u0187\u0186\3\2\2\2\u0187\u0188\3\2\2\2\u0188"+ + "\u0083\3\2\2\2\u0189\u0192\7\62\2\2\u018a\u018e\t\b\2\2\u018b\u018d\t"+ + "\t\2\2\u018c\u018b\3\2\2\2\u018d\u0190\3\2\2\2\u018e\u018c\3\2\2\2\u018e"+ + "\u018f\3\2\2\2\u018f\u0192\3\2\2\2\u0190\u018e\3\2\2\2\u0191\u0189\3\2"+ + "\2\2\u0191\u018a\3\2\2\2\u0192\u0194\3\2\2\2\u0193\u0195\t\n\2\2\u0194"+ + "\u0193\3\2\2\2\u0194\u0195\3\2\2\2\u0195\u0085\3\2\2\2\u0196\u019f\7\62"+ + "\2\2\u0197\u019b\t\b\2\2\u0198\u019a\t\t\2\2\u0199\u0198\3\2\2\2\u019a"+ + "\u019d\3\2\2\2\u019b\u0199\3\2\2\2\u019b\u019c\3\2\2\2\u019c\u019f\3\2"+ + "\2\2\u019d\u019b\3\2\2\2\u019e\u0196\3\2\2\2\u019e\u0197\3\2\2\2\u019f"+ + "\u01a0\3\2\2\2\u01a0\u01a4\5\24\n\2\u01a1\u01a3\t\t\2\2\u01a2\u01a1\3"+ + "\2\2\2\u01a3\u01a6\3\2\2\2\u01a4\u01a2\3\2\2\2\u01a4\u01a5\3\2\2\2\u01a5"+ + "\u01b0\3\2\2\2\u01a6\u01a4\3\2\2\2\u01a7\u01a9\t\13\2\2\u01a8\u01aa\t"+ + "\f\2\2\u01a9\u01a8\3\2\2\2\u01a9\u01aa\3\2\2\2\u01aa\u01ac\3\2\2\2\u01ab"+ + "\u01ad\t\t\2\2\u01ac\u01ab\3\2\2\2\u01ad\u01ae\3\2\2\2\u01ae\u01ac\3\2"+ + "\2\2\u01ae\u01af\3\2\2\2\u01af\u01b1\3\2\2\2\u01b0\u01a7\3\2\2\2\u01b0"+ + "\u01b1\3\2\2\2\u01b1\u01b3\3\2\2\2\u01b2\u01b4\t\r\2\2\u01b3\u01b2\3\2"+ + "\2\2\u01b3\u01b4\3\2\2\2\u01b4\u0087\3\2\2\2\u01b5\u01bd\7$\2\2\u01b6"+ + "\u01b7\7^\2\2\u01b7\u01bc\7$\2\2\u01b8\u01b9\7^\2\2\u01b9\u01bc\7^\2\2"+ + "\u01ba\u01bc\n\16\2\2\u01bb\u01b6\3\2\2\2\u01bb\u01b8\3\2\2\2\u01bb\u01ba"+ + "\3\2\2\2\u01bc\u01bf\3\2\2\2\u01bd\u01be\3\2\2\2\u01bd\u01bb\3\2\2\2\u01be"+ + "\u01c0\3\2\2\2\u01bf\u01bd\3\2\2\2\u01c0\u01ce\7$\2\2\u01c1\u01c9\7)\2"+ + "\2\u01c2\u01c3\7^\2\2\u01c3\u01c8\7)\2\2\u01c4\u01c5\7^\2\2\u01c5\u01c8"+ + "\7^\2\2\u01c6\u01c8\n\16\2\2\u01c7\u01c2\3\2\2\2\u01c7\u01c4\3\2\2\2\u01c7"+ + "\u01c6\3\2\2\2\u01c8\u01cb\3\2\2\2\u01c9\u01ca\3\2\2\2\u01c9\u01c7\3\2"+ + "\2\2\u01ca\u01cc\3\2\2\2\u01cb\u01c9\3\2\2\2\u01cc\u01ce\7)\2\2\u01cd"+ + "\u01b5\3\2\2\2\u01cd\u01c1\3\2\2\2\u01ce\u0089\3\2\2\2\u01cf\u01d0\7v"+ + "\2\2\u01d0\u01d1\7t\2\2\u01d1\u01d2\7w\2\2\u01d2\u01d3\7g\2\2\u01d3\u008b"+ + "\3\2\2\2\u01d4\u01d5\7h\2\2\u01d5\u01d6\7c\2\2\u01d6\u01d7\7n\2\2\u01d7"+ + "\u01d8\7u\2\2\u01d8\u01d9\7g\2\2\u01d9\u008d\3\2\2\2\u01da\u01db\7p\2"+ + "\2\u01db\u01dc\7w\2\2\u01dc\u01dd\7n\2\2\u01dd\u01de\7n\2\2\u01de\u008f"+ + "\3\2\2\2\u01df\u01e3\t\17\2\2\u01e0\u01e2\t\20\2\2\u01e1\u01e0\3\2\2\2"+ + "\u01e2\u01e5\3\2\2\2\u01e3\u01e1\3\2\2\2\u01e3\u01e4\3\2\2\2\u01e4\u0091"+ + "\3\2\2\2\u01e5\u01e3\3\2\2\2\u01e6\u01ef\7\62\2\2\u01e7\u01eb\t\b\2\2"+ + "\u01e8\u01ea\t\t\2\2\u01e9\u01e8\3\2\2\2\u01ea\u01ed\3\2\2\2\u01eb\u01e9"+ + "\3\2\2\2\u01eb\u01ec\3\2\2\2\u01ec\u01ef\3\2\2\2\u01ed\u01eb\3\2\2\2\u01ee"+ + "\u01e6\3\2\2\2\u01ee\u01e7\3\2\2\2\u01ef\u01f0\3\2\2\2\u01f0\u01f1\bI"+ + "\4\2\u01f1\u0093\3\2\2\2\u01f2\u01f6\t\17\2\2\u01f3\u01f5\t\20\2\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\u01f9\3\2\2\2\u01f8\u01f6\3\2\2\2\u01f9\u01fa\bJ\4\2\u01fa"+ + "\u0095\3\2\2\2\37\2\3\u0099\u00a3\u00ad\u00b2\u017a\u017d\u0184\u0187"+ + "\u018e\u0191\u0194\u019b\u019e\u01a4\u01a9\u01ae\u01b0\u01b3\u01bb\u01bd"+ + "\u01c7\u01c9\u01cd\u01e3\u01eb\u01ee\u01f6\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/PainlessParser.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParser.java index c4499fca638..b92c9d75198 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParser.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParser.java @@ -25,7 +25,7 @@ class PainlessParser extends Parser { BWOR=44, BOOLAND=45, BOOLOR=46, COND=47, COLON=48, INCR=49, DECR=50, ASSIGN=51, AADD=52, ASUB=53, AMUL=54, ADIV=55, AREM=56, AAND=57, AXOR=58, AOR=59, ALSH=60, ARSH=61, AUSH=62, OCTAL=63, HEX=64, INTEGER=65, DECIMAL=66, STRING=67, - CHAR=68, TRUE=69, FALSE=70, NULL=71, ID=72, EXTINTEGER=73, EXTID=74; + TRUE=68, FALSE=69, NULL=70, ID=71, EXTINTEGER=72, EXTID=73; public static final int RULE_source = 0, RULE_statement = 1, RULE_block = 2, RULE_empty = 3, RULE_emptyscope = 4, RULE_initializer = 5, RULE_afterthought = 6, RULE_declaration = 7, RULE_decltype = 8, @@ -50,7 +50,7 @@ class PainlessParser extends Parser { "'>='", "'=='", "'==='", "'!='", "'!=='", "'&'", "'^'", "'|'", "'&&'", "'||'", "'?'", "':'", "'++'", "'--'", "'='", "'+='", "'-='", "'*='", "'/='", "'%='", "'&='", "'^='", "'|='", "'<<='", "'>>='", "'>>>='", null, null, - null, null, null, null, "'true'", "'false'", "'null'" + null, null, null, "'true'", "'false'", "'null'" }; private static final String[] _SYMBOLIC_NAMES = { null, "WS", "COMMENT", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "LP", "RP", @@ -60,8 +60,8 @@ class PainlessParser extends Parser { "GTE", "EQ", "EQR", "NE", "NER", "BWAND", "BWXOR", "BWOR", "BOOLAND", "BOOLOR", "COND", "COLON", "INCR", "DECR", "ASSIGN", "AADD", "ASUB", "AMUL", "ADIV", "AREM", "AAND", "AXOR", "AOR", "ALSH", "ARSH", "AUSH", "OCTAL", - "HEX", "INTEGER", "DECIMAL", "STRING", "CHAR", "TRUE", "FALSE", "NULL", - "ID", "EXTINTEGER", "EXTID" + "HEX", "INTEGER", "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "ID", + "EXTINTEGER", "EXTID" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -151,7 +151,7 @@ class PainlessParser extends Parser { setState(55); _errHandler.sync(this); _la = _input.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << IF) | (1L << WHILE) | (1L << DO) | (1L << FOR) | (1L << CONTINUE) | (1L << BREAK) | (1L << RETURN) | (1L << NEW) | (1L << TRY) | (1L << THROW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (CHAR - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0) ); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << IF) | (1L << WHILE) | (1L << DO) | (1L << FOR) | (1L << CONTINUE) | (1L << BREAK) | (1L << RETURN) | (1L << NEW) | (1L << TRY) | (1L << THROW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0) ); setState(57); match(EOF); } @@ -458,7 +458,7 @@ class PainlessParser extends Parser { match(LP); setState(88); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (CHAR - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { { setState(87); initializer(); @@ -469,7 +469,7 @@ class PainlessParser extends Parser { match(SEMICOLON); setState(92); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (CHAR - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { { setState(91); expression(0); @@ -480,7 +480,7 @@ class PainlessParser extends Parser { match(SEMICOLON); setState(96); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (CHAR - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { { setState(95); afterthought(); @@ -720,7 +720,7 @@ class PainlessParser extends Parser { setState(142); _errHandler.sync(this); _la = _input.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << IF) | (1L << WHILE) | (1L << DO) | (1L << FOR) | (1L << CONTINUE) | (1L << BREAK) | (1L << RETURN) | (1L << NEW) | (1L << TRY) | (1L << THROW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (CHAR - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0) ); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << IF) | (1L << WHILE) | (1L << DO) | (1L << FOR) | (1L << CONTINUE) | (1L << BREAK) | (1L << RETURN) | (1L << NEW) | (1L << TRY) | (1L << THROW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0) ); setState(144); match(RBRACK); } @@ -747,7 +747,6 @@ class PainlessParser extends Parser { case INTEGER: case DECIMAL: case STRING: - case CHAR: case TRUE: case FALSE: case NULL: @@ -1541,15 +1540,6 @@ class PainlessParser extends Parser { else return visitor.visitChildren(this); } } - public static class CharContext extends ExpressionContext { - public TerminalNode CHAR() { return getToken(PainlessParser.CHAR, 0); } - public CharContext(ExpressionContext ctx) { copyFrom(ctx); } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor)visitor).visitChar(this); - else return visitor.visitChildren(this); - } - } public static class TrueContext extends ExpressionContext { public TerminalNode TRUE() { return getToken(PainlessParser.TRUE, 0); } public TrueContext(ExpressionContext ctx) { copyFrom(ctx); } @@ -1576,7 +1566,7 @@ class PainlessParser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(237); + setState(236); switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) { case 1: { @@ -1657,74 +1647,65 @@ class PainlessParser extends Parser { break; case 6: { - _localctx = new CharContext(_localctx); + _localctx = new TrueContext(_localctx); _ctx = _localctx; _prevctx = _localctx; setState(226); - match(CHAR); + match(TRUE); } break; case 7: { - _localctx = new TrueContext(_localctx); + _localctx = new FalseContext(_localctx); _ctx = _localctx; _prevctx = _localctx; setState(227); - match(TRUE); + match(FALSE); } break; case 8: { - _localctx = new FalseContext(_localctx); + _localctx = new NullContext(_localctx); _ctx = _localctx; _prevctx = _localctx; setState(228); - match(FALSE); + match(NULL); } break; case 9: { - _localctx = new NullContext(_localctx); + _localctx = new PostincContext(_localctx); _ctx = _localctx; _prevctx = _localctx; setState(229); - match(NULL); + extstart(); + setState(230); + increment(); } break; case 10: { - _localctx = new PostincContext(_localctx); + _localctx = new PreincContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(230); - extstart(); - setState(231); + setState(232); increment(); + setState(233); + extstart(); } break; case 11: - { - _localctx = new PreincContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(233); - increment(); - setState(234); - extstart(); - } - break; - case 12: { _localctx = new ExternalContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(236); + setState(235); extstart(); } break; } _ctx.stop = _input.LT(-1); - setState(277); + setState(276); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,28,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1732,22 +1713,22 @@ class PainlessParser extends Parser { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(275); + setState(274); switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { case 1: { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(239); + setState(238); if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); - setState(240); + setState(239); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << MUL) | (1L << DIV) | (1L << REM))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(241); + setState(240); expression(13); } break; @@ -1755,16 +1736,16 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(242); + setState(241); if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); - setState(243); + setState(242); _la = _input.LA(1); if ( !(_la==ADD || _la==SUB) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(244); + setState(243); expression(12); } break; @@ -1772,16 +1753,16 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(245); + setState(244); if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); - setState(246); + setState(245); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LSH) | (1L << RSH) | (1L << USH))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(247); + setState(246); expression(11); } break; @@ -1789,16 +1770,16 @@ class PainlessParser extends Parser { { _localctx = new CompContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(248); + setState(247); if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)"); - setState(249); + setState(248); _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(250); + setState(249); expression(10); } break; @@ -1806,16 +1787,16 @@ class PainlessParser extends Parser { { _localctx = new CompContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(251); + setState(250); if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(252); + setState(251); _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(253); + setState(252); expression(9); } break; @@ -1823,11 +1804,11 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(254); + setState(253); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(255); + setState(254); match(BWAND); - setState(256); + setState(255); expression(8); } break; @@ -1835,11 +1816,11 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(257); + setState(256); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(258); + setState(257); match(BWXOR); - setState(259); + setState(258); expression(7); } break; @@ -1847,11 +1828,11 @@ class PainlessParser extends Parser { { _localctx = new BinaryContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(260); + setState(259); if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); - setState(261); + setState(260); match(BWOR); - setState(262); + setState(261); expression(6); } break; @@ -1859,11 +1840,11 @@ class PainlessParser extends Parser { { _localctx = new BoolContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(263); + setState(262); if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); - setState(264); + setState(263); match(BOOLAND); - setState(265); + setState(264); expression(5); } break; @@ -1871,11 +1852,11 @@ class PainlessParser extends Parser { { _localctx = new BoolContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(266); + setState(265); if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); - setState(267); + setState(266); match(BOOLOR); - setState(268); + setState(267); expression(4); } break; @@ -1883,22 +1864,22 @@ class PainlessParser extends Parser { { _localctx = new ConditionalContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(269); + setState(268); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(270); + setState(269); match(COND); - setState(271); + setState(270); expression(0); - setState(272); + setState(271); match(COLON); - setState(273); + setState(272); expression(2); } break; } } } - setState(279); + setState(278); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,28,_ctx); } @@ -1946,40 +1927,40 @@ class PainlessParser extends Parser { ExtstartContext _localctx = new ExtstartContext(_ctx, getState()); enterRule(_localctx, 28, RULE_extstart); try { - setState(285); + setState(284); switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(280); + setState(279); extprec(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(281); + setState(280); extcast(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(282); + setState(281); extvar(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(283); + setState(282); extnew(); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(284); + setState(283); extstring(); } break; @@ -2037,54 +2018,54 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(287); + setState(286); match(LP); - setState(293); + setState(292); switch ( getInterpreter().adaptivePredict(_input,30,_ctx) ) { case 1: { - setState(288); + setState(287); extprec(); } break; case 2: { - setState(289); + setState(288); extcast(); } break; case 3: { - setState(290); + setState(289); extvar(); } break; case 4: { - setState(291); + setState(290); extnew(); } break; case 5: { - setState(292); + setState(291); extstring(); } break; } - setState(295); + setState(294); match(RP); - setState(298); + setState(297); switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) { case 1: { - setState(296); + setState(295); extdot(); } break; case 2: { - setState(297); + setState(296); extbrace(); } break; @@ -2140,41 +2121,41 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(300); + setState(299); match(LP); - setState(301); + setState(300); decltype(); - setState(302); + setState(301); match(RP); - setState(308); + setState(307); switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) { case 1: { - setState(303); + setState(302); extprec(); } break; case 2: { - setState(304); + setState(303); extcast(); } break; case 3: { - setState(305); + setState(304); extvar(); } break; case 4: { - setState(306); + setState(305); extnew(); } break; case 5: { - setState(307); + setState(306); extstring(); } break; @@ -2221,23 +2202,23 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(310); + setState(309); match(LBRACE); - setState(311); + setState(310); expression(0); - setState(312); + setState(311); match(RBRACE); - setState(315); + setState(314); switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) { case 1: { - setState(313); + setState(312); extdot(); } break; case 2: { - setState(314); + setState(313); extbrace(); } break; @@ -2280,19 +2261,19 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(317); + setState(316); match(DOT); - setState(320); + setState(319); switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) { case 1: { - setState(318); + setState(317); extcall(); } break; case 2: { - setState(319); + setState(318); extfield(); } break; @@ -2338,21 +2319,21 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(322); + setState(321); match(EXTID); - setState(323); + setState(322); arguments(); - setState(326); + setState(325); switch ( getInterpreter().adaptivePredict(_input,35,_ctx) ) { case 1: { - setState(324); + setState(323); extdot(); } break; case 2: { - setState(325); + setState(324); extbrace(); } break; @@ -2397,19 +2378,19 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(328); + setState(327); identifier(); - setState(331); + setState(330); switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { case 1: { - setState(329); + setState(328); extdot(); } break; case 2: { - setState(330); + setState(329); extbrace(); } break; @@ -2454,24 +2435,24 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(333); + setState(332); _la = _input.LA(1); if ( !(_la==EXTINTEGER || _la==EXTID) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(336); + setState(335); switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) { case 1: { - setState(334); + setState(333); extdot(); } break; case 2: { - setState(335); + setState(334); extbrace(); } break; @@ -2532,22 +2513,22 @@ class PainlessParser extends Parser { int _alt; enterOuterAlt(_localctx, 1); { - setState(338); + setState(337); match(NEW); - setState(339); + setState(338); identifier(); - setState(355); + setState(354); switch (_input.LA(1)) { case LP: { { - setState(340); + setState(339); arguments(); - setState(342); + setState(341); switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) { case 1: { - setState(341); + setState(340); extdot(); } break; @@ -2558,7 +2539,7 @@ class PainlessParser extends Parser { case LBRACE: { { - setState(348); + setState(347); _errHandler.sync(this); _alt = 1; do { @@ -2566,11 +2547,11 @@ class PainlessParser extends Parser { case 1: { { - setState(344); + setState(343); match(LBRACE); - setState(345); + setState(344); expression(0); - setState(346); + setState(345); match(RBRACE); } } @@ -2578,15 +2559,15 @@ class PainlessParser extends Parser { default: throw new NoViableAltException(this); } - setState(350); + setState(349); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,39,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); - setState(353); + setState(352); switch ( getInterpreter().adaptivePredict(_input,40,_ctx) ) { case 1: { - setState(352); + setState(351); extdot(); } break; @@ -2635,19 +2616,19 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(357); + setState(356); match(STRING); - setState(360); + setState(359); switch ( getInterpreter().adaptivePredict(_input,42,_ctx) ) { case 1: { - setState(358); + setState(357); extdot(); } break; case 2: { - setState(359); + setState(358); extbrace(); } break; @@ -2697,34 +2678,34 @@ class PainlessParser extends Parser { enterOuterAlt(_localctx, 1); { { - setState(362); + setState(361); match(LP); - setState(371); + setState(370); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (CHAR - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LP) | (1L << NEW) | (1L << BOOLNOT) | (1L << BWNOT) | (1L << ADD) | (1L << SUB) | (1L << INCR) | (1L << DECR) | (1L << OCTAL))) != 0) || ((((_la - 64)) & ~0x3f) == 0 && ((1L << (_la - 64)) & ((1L << (HEX - 64)) | (1L << (INTEGER - 64)) | (1L << (DECIMAL - 64)) | (1L << (STRING - 64)) | (1L << (TRUE - 64)) | (1L << (FALSE - 64)) | (1L << (NULL - 64)) | (1L << (ID - 64)))) != 0)) { { - setState(363); + setState(362); expression(0); - setState(368); + setState(367); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(364); + setState(363); match(COMMA); - setState(365); + setState(364); expression(0); } } - setState(370); + setState(369); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(373); + setState(372); match(RP); } } @@ -2761,7 +2742,7 @@ class PainlessParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(375); + setState(374); _la = _input.LA(1); if ( !(_la==INCR || _la==DECR) ) { _errHandler.recoverInline(this); @@ -2817,7 +2798,7 @@ class PainlessParser extends Parser { } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3L\u017c\4\2\t\2\4"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3K\u017b\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"+ @@ -2834,40 +2815,40 @@ class PainlessParser extends Parser { "\f\3\r\3\r\5\r\u00c7\n\r\3\16\3\16\3\16\3\16\7\16\u00cd\n\16\f\16\16\16"+ "\u00d0\13\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3"+ "\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3"+ - "\17\3\17\3\17\3\17\3\17\5\17\u00f0\n\17\3\17\3\17\3\17\3\17\3\17\3\17"+ + "\17\3\17\3\17\3\17\5\17\u00ef\n\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+ "\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+ "\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+ - "\3\17\3\17\7\17\u0116\n\17\f\17\16\17\u0119\13\17\3\20\3\20\3\20\3\20"+ - "\3\20\5\20\u0120\n\20\3\21\3\21\3\21\3\21\3\21\3\21\5\21\u0128\n\21\3"+ - "\21\3\21\3\21\5\21\u012d\n\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22"+ - "\5\22\u0137\n\22\3\23\3\23\3\23\3\23\3\23\5\23\u013e\n\23\3\24\3\24\3"+ - "\24\5\24\u0143\n\24\3\25\3\25\3\25\3\25\5\25\u0149\n\25\3\26\3\26\3\26"+ - "\5\26\u014e\n\26\3\27\3\27\3\27\5\27\u0153\n\27\3\30\3\30\3\30\3\30\5"+ - "\30\u0159\n\30\3\30\3\30\3\30\3\30\6\30\u015f\n\30\r\30\16\30\u0160\3"+ - "\30\5\30\u0164\n\30\5\30\u0166\n\30\3\31\3\31\3\31\5\31\u016b\n\31\3\32"+ - "\3\32\3\32\3\32\7\32\u0171\n\32\f\32\16\32\u0174\13\32\5\32\u0176\n\32"+ - "\3\32\3\32\3\33\3\33\3\33\2\3\34\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34"+ - "\36 \"$&(*,.\60\62\64\2\f\4\2\32\33\37 \3\2\65@\3\2AD\3\2\34\36\3\2\37"+ - " \3\2!#\3\2$\'\3\2(+\3\2KL\3\2\63\64\u01b9\2\67\3\2\2\2\4\u008a\3\2\2"+ - "\2\6\u0095\3\2\2\2\b\u0099\3\2\2\2\n\u009b\3\2\2\2\f\u00a0\3\2\2\2\16"+ - "\u00a2\3\2\2\2\20\u00a4\3\2\2\2\22\u00ad\3\2\2\2\24\u00b5\3\2\2\2\26\u00ba"+ - "\3\2\2\2\30\u00c4\3\2\2\2\32\u00c8\3\2\2\2\34\u00ef\3\2\2\2\36\u011f\3"+ - "\2\2\2 \u0121\3\2\2\2\"\u012e\3\2\2\2$\u0138\3\2\2\2&\u013f\3\2\2\2(\u0144"+ - "\3\2\2\2*\u014a\3\2\2\2,\u014f\3\2\2\2.\u0154\3\2\2\2\60\u0167\3\2\2\2"+ - "\62\u016c\3\2\2\2\64\u0179\3\2\2\2\668\5\4\3\2\67\66\3\2\2\289\3\2\2\2"+ - "9\67\3\2\2\29:\3\2\2\2:;\3\2\2\2;<\7\2\2\3<\3\3\2\2\2=>\7\16\2\2>?\7\t"+ - "\2\2?@\5\34\17\2@A\7\n\2\2AD\5\6\4\2BC\7\17\2\2CE\5\6\4\2DB\3\2\2\2DE"+ - "\3\2\2\2E\u008b\3\2\2\2FG\7\20\2\2GH\7\t\2\2HI\5\34\17\2IL\7\n\2\2JM\5"+ - "\6\4\2KM\5\b\5\2LJ\3\2\2\2LK\3\2\2\2M\u008b\3\2\2\2NO\7\21\2\2OP\5\6\4"+ - "\2PQ\7\20\2\2QR\7\t\2\2RS\5\34\17\2SU\7\n\2\2TV\7\r\2\2UT\3\2\2\2UV\3"+ - "\2\2\2V\u008b\3\2\2\2WX\7\22\2\2XZ\7\t\2\2Y[\5\f\7\2ZY\3\2\2\2Z[\3\2\2"+ - "\2[\\\3\2\2\2\\^\7\r\2\2]_\5\34\17\2^]\3\2\2\2^_\3\2\2\2_`\3\2\2\2`b\7"+ - "\r\2\2ac\5\16\b\2ba\3\2\2\2bc\3\2\2\2cd\3\2\2\2dg\7\n\2\2eh\5\6\4\2fh"+ - "\5\b\5\2ge\3\2\2\2gf\3\2\2\2h\u008b\3\2\2\2ik\5\20\t\2jl\7\r\2\2kj\3\2"+ - "\2\2kl\3\2\2\2l\u008b\3\2\2\2mo\7\23\2\2np\7\r\2\2on\3\2\2\2op\3\2\2\2"+ - "p\u008b\3\2\2\2qs\7\24\2\2rt\7\r\2\2sr\3\2\2\2st\3\2\2\2t\u008b\3\2\2"+ - "\2uv\7\25\2\2vx\5\34\17\2wy\7\r\2\2xw\3\2\2\2xy\3\2\2\2y\u008b\3\2\2\2"+ - "z{\7\27\2\2{}\5\6\4\2|~\5\26\f\2}|\3\2\2\2~\177\3\2\2\2\177}\3\2\2\2\177"+ + "\3\17\7\17\u0115\n\17\f\17\16\17\u0118\13\17\3\20\3\20\3\20\3\20\3\20"+ + "\5\20\u011f\n\20\3\21\3\21\3\21\3\21\3\21\3\21\5\21\u0127\n\21\3\21\3"+ + "\21\3\21\5\21\u012c\n\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\5\22"+ + "\u0136\n\22\3\23\3\23\3\23\3\23\3\23\5\23\u013d\n\23\3\24\3\24\3\24\5"+ + "\24\u0142\n\24\3\25\3\25\3\25\3\25\5\25\u0148\n\25\3\26\3\26\3\26\5\26"+ + "\u014d\n\26\3\27\3\27\3\27\5\27\u0152\n\27\3\30\3\30\3\30\3\30\5\30\u0158"+ + "\n\30\3\30\3\30\3\30\3\30\6\30\u015e\n\30\r\30\16\30\u015f\3\30\5\30\u0163"+ + "\n\30\5\30\u0165\n\30\3\31\3\31\3\31\5\31\u016a\n\31\3\32\3\32\3\32\3"+ + "\32\7\32\u0170\n\32\f\32\16\32\u0173\13\32\5\32\u0175\n\32\3\32\3\32\3"+ + "\33\3\33\3\33\2\3\34\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*"+ + ",.\60\62\64\2\f\4\2\32\33\37 \3\2\65@\3\2AD\3\2\34\36\3\2\37 \3\2!#\3"+ + "\2$\'\3\2(+\3\2JK\3\2\63\64\u01b7\2\67\3\2\2\2\4\u008a\3\2\2\2\6\u0095"+ + "\3\2\2\2\b\u0099\3\2\2\2\n\u009b\3\2\2\2\f\u00a0\3\2\2\2\16\u00a2\3\2"+ + "\2\2\20\u00a4\3\2\2\2\22\u00ad\3\2\2\2\24\u00b5\3\2\2\2\26\u00ba\3\2\2"+ + "\2\30\u00c4\3\2\2\2\32\u00c8\3\2\2\2\34\u00ee\3\2\2\2\36\u011e\3\2\2\2"+ + " \u0120\3\2\2\2\"\u012d\3\2\2\2$\u0137\3\2\2\2&\u013e\3\2\2\2(\u0143\3"+ + "\2\2\2*\u0149\3\2\2\2,\u014e\3\2\2\2.\u0153\3\2\2\2\60\u0166\3\2\2\2\62"+ + "\u016b\3\2\2\2\64\u0178\3\2\2\2\668\5\4\3\2\67\66\3\2\2\289\3\2\2\29\67"+ + "\3\2\2\29:\3\2\2\2:;\3\2\2\2;<\7\2\2\3<\3\3\2\2\2=>\7\16\2\2>?\7\t\2\2"+ + "?@\5\34\17\2@A\7\n\2\2AD\5\6\4\2BC\7\17\2\2CE\5\6\4\2DB\3\2\2\2DE\3\2"+ + "\2\2E\u008b\3\2\2\2FG\7\20\2\2GH\7\t\2\2HI\5\34\17\2IL\7\n\2\2JM\5\6\4"+ + "\2KM\5\b\5\2LJ\3\2\2\2LK\3\2\2\2M\u008b\3\2\2\2NO\7\21\2\2OP\5\6\4\2P"+ + "Q\7\20\2\2QR\7\t\2\2RS\5\34\17\2SU\7\n\2\2TV\7\r\2\2UT\3\2\2\2UV\3\2\2"+ + "\2V\u008b\3\2\2\2WX\7\22\2\2XZ\7\t\2\2Y[\5\f\7\2ZY\3\2\2\2Z[\3\2\2\2["+ + "\\\3\2\2\2\\^\7\r\2\2]_\5\34\17\2^]\3\2\2\2^_\3\2\2\2_`\3\2\2\2`b\7\r"+ + "\2\2ac\5\16\b\2ba\3\2\2\2bc\3\2\2\2cd\3\2\2\2dg\7\n\2\2eh\5\6\4\2fh\5"+ + "\b\5\2ge\3\2\2\2gf\3\2\2\2h\u008b\3\2\2\2ik\5\20\t\2jl\7\r\2\2kj\3\2\2"+ + "\2kl\3\2\2\2l\u008b\3\2\2\2mo\7\23\2\2np\7\r\2\2on\3\2\2\2op\3\2\2\2p"+ + "\u008b\3\2\2\2qs\7\24\2\2rt\7\r\2\2sr\3\2\2\2st\3\2\2\2t\u008b\3\2\2\2"+ + "uv\7\25\2\2vx\5\34\17\2wy\7\r\2\2xw\3\2\2\2xy\3\2\2\2y\u008b\3\2\2\2z"+ + "{\7\27\2\2{}\5\6\4\2|~\5\26\f\2}|\3\2\2\2~\177\3\2\2\2\177}\3\2\2\2\177"+ "\u0080\3\2\2\2\u0080\u008b\3\2\2\2\u0081\u0082\7\31\2\2\u0082\u0084\5"+ "\34\17\2\u0083\u0085\7\r\2\2\u0084\u0083\3\2\2\2\u0084\u0085\3\2\2\2\u0085"+ "\u008b\3\2\2\2\u0086\u0088\5\34\17\2\u0087\u0089\7\r\2\2\u0088\u0087\3"+ @@ -2892,77 +2873,77 @@ class PainlessParser extends Parser { "\2\u00b9\25\3\2\2\2\u00ba\u00bb\7\30\2\2\u00bb\u00bc\7\t\2\2\u00bc\u00bd"+ "\5\30\r\2\u00bd\u00be\5\30\r\2\u00be\u00bf\3\2\2\2\u00bf\u00c2\7\n\2\2"+ "\u00c0\u00c3\5\6\4\2\u00c1\u00c3\5\n\6\2\u00c2\u00c0\3\2\2\2\u00c2\u00c1"+ - "\3\2\2\2\u00c3\27\3\2\2\2\u00c4\u00c6\7J\2\2\u00c5\u00c7\5\32\16\2\u00c6"+ + "\3\2\2\2\u00c3\27\3\2\2\2\u00c4\u00c6\7I\2\2\u00c5\u00c7\5\32\16\2\u00c6"+ "\u00c5\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7\31\3\2\2\2\u00c8\u00c9\7$\2\2"+ "\u00c9\u00ce\5\30\r\2\u00ca\u00cb\7\f\2\2\u00cb\u00cd\5\30\r\2\u00cc\u00ca"+ "\3\2\2\2\u00cd\u00d0\3\2\2\2\u00ce\u00cc\3\2\2\2\u00ce\u00cf\3\2\2\2\u00cf"+ "\u00d1\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d1\u00d2\7&\2\2\u00d2\33\3\2\2\2"+ - "\u00d3\u00d4\b\17\1\2\u00d4\u00d5\t\2\2\2\u00d5\u00f0\5\34\17\20\u00d6"+ + "\u00d3\u00d4\b\17\1\2\u00d4\u00d5\t\2\2\2\u00d5\u00ef\5\34\17\20\u00d6"+ "\u00d7\7\t\2\2\u00d7\u00d8\5\22\n\2\u00d8\u00d9\7\n\2\2\u00d9\u00da\5"+ - "\34\17\17\u00da\u00f0\3\2\2\2\u00db\u00dc\5\36\20\2\u00dc\u00dd\t\3\2"+ - "\2\u00dd\u00de\5\34\17\3\u00de\u00f0\3\2\2\2\u00df\u00e0\7\t\2\2\u00e0"+ - "\u00e1\5\34\17\2\u00e1\u00e2\7\n\2\2\u00e2\u00f0\3\2\2\2\u00e3\u00f0\t"+ - "\4\2\2\u00e4\u00f0\7F\2\2\u00e5\u00f0\7G\2\2\u00e6\u00f0\7H\2\2\u00e7"+ - "\u00f0\7I\2\2\u00e8\u00e9\5\36\20\2\u00e9\u00ea\5\64\33\2\u00ea\u00f0"+ - "\3\2\2\2\u00eb\u00ec\5\64\33\2\u00ec\u00ed\5\36\20\2\u00ed\u00f0\3\2\2"+ - "\2\u00ee\u00f0\5\36\20\2\u00ef\u00d3\3\2\2\2\u00ef\u00d6\3\2\2\2\u00ef"+ - "\u00db\3\2\2\2\u00ef\u00df\3\2\2\2\u00ef\u00e3\3\2\2\2\u00ef\u00e4\3\2"+ - "\2\2\u00ef\u00e5\3\2\2\2\u00ef\u00e6\3\2\2\2\u00ef\u00e7\3\2\2\2\u00ef"+ - "\u00e8\3\2\2\2\u00ef\u00eb\3\2\2\2\u00ef\u00ee\3\2\2\2\u00f0\u0117\3\2"+ - "\2\2\u00f1\u00f2\f\16\2\2\u00f2\u00f3\t\5\2\2\u00f3\u0116\5\34\17\17\u00f4"+ - "\u00f5\f\r\2\2\u00f5\u00f6\t\6\2\2\u00f6\u0116\5\34\17\16\u00f7\u00f8"+ - "\f\f\2\2\u00f8\u00f9\t\7\2\2\u00f9\u0116\5\34\17\r\u00fa\u00fb\f\13\2"+ - "\2\u00fb\u00fc\t\b\2\2\u00fc\u0116\5\34\17\f\u00fd\u00fe\f\n\2\2\u00fe"+ - "\u00ff\t\t\2\2\u00ff\u0116\5\34\17\13\u0100\u0101\f\t\2\2\u0101\u0102"+ - "\7,\2\2\u0102\u0116\5\34\17\n\u0103\u0104\f\b\2\2\u0104\u0105\7-\2\2\u0105"+ - "\u0116\5\34\17\t\u0106\u0107\f\7\2\2\u0107\u0108\7.\2\2\u0108\u0116\5"+ - "\34\17\b\u0109\u010a\f\6\2\2\u010a\u010b\7/\2\2\u010b\u0116\5\34\17\7"+ - "\u010c\u010d\f\5\2\2\u010d\u010e\7\60\2\2\u010e\u0116\5\34\17\6\u010f"+ - "\u0110\f\4\2\2\u0110\u0111\7\61\2\2\u0111\u0112\5\34\17\2\u0112\u0113"+ - "\7\62\2\2\u0113\u0114\5\34\17\4\u0114\u0116\3\2\2\2\u0115\u00f1\3\2\2"+ - "\2\u0115\u00f4\3\2\2\2\u0115\u00f7\3\2\2\2\u0115\u00fa\3\2\2\2\u0115\u00fd"+ - "\3\2\2\2\u0115\u0100\3\2\2\2\u0115\u0103\3\2\2\2\u0115\u0106\3\2\2\2\u0115"+ - "\u0109\3\2\2\2\u0115\u010c\3\2\2\2\u0115\u010f\3\2\2\2\u0116\u0119\3\2"+ - "\2\2\u0117\u0115\3\2\2\2\u0117\u0118\3\2\2\2\u0118\35\3\2\2\2\u0119\u0117"+ - "\3\2\2\2\u011a\u0120\5 \21\2\u011b\u0120\5\"\22\2\u011c\u0120\5*\26\2"+ - "\u011d\u0120\5.\30\2\u011e\u0120\5\60\31\2\u011f\u011a\3\2\2\2\u011f\u011b"+ - "\3\2\2\2\u011f\u011c\3\2\2\2\u011f\u011d\3\2\2\2\u011f\u011e\3\2\2\2\u0120"+ - "\37\3\2\2\2\u0121\u0127\7\t\2\2\u0122\u0128\5 \21\2\u0123\u0128\5\"\22"+ - "\2\u0124\u0128\5*\26\2\u0125\u0128\5.\30\2\u0126\u0128\5\60\31\2\u0127"+ - "\u0122\3\2\2\2\u0127\u0123\3\2\2\2\u0127\u0124\3\2\2\2\u0127\u0125\3\2"+ - "\2\2\u0127\u0126\3\2\2\2\u0128\u0129\3\2\2\2\u0129\u012c\7\n\2\2\u012a"+ - "\u012d\5&\24\2\u012b\u012d\5$\23\2\u012c\u012a\3\2\2\2\u012c\u012b\3\2"+ - "\2\2\u012c\u012d\3\2\2\2\u012d!\3\2\2\2\u012e\u012f\7\t\2\2\u012f\u0130"+ - "\5\22\n\2\u0130\u0136\7\n\2\2\u0131\u0137\5 \21\2\u0132\u0137\5\"\22\2"+ - "\u0133\u0137\5*\26\2\u0134\u0137\5.\30\2\u0135\u0137\5\60\31\2\u0136\u0131"+ - "\3\2\2\2\u0136\u0132\3\2\2\2\u0136\u0133\3\2\2\2\u0136\u0134\3\2\2\2\u0136"+ - "\u0135\3\2\2\2\u0137#\3\2\2\2\u0138\u0139\7\7\2\2\u0139\u013a\5\34\17"+ - "\2\u013a\u013d\7\b\2\2\u013b\u013e\5&\24\2\u013c\u013e\5$\23\2\u013d\u013b"+ - "\3\2\2\2\u013d\u013c\3\2\2\2\u013d\u013e\3\2\2\2\u013e%\3\2\2\2\u013f"+ - "\u0142\7\13\2\2\u0140\u0143\5(\25\2\u0141\u0143\5,\27\2\u0142\u0140\3"+ - "\2\2\2\u0142\u0141\3\2\2\2\u0143\'\3\2\2\2\u0144\u0145\7L\2\2\u0145\u0148"+ - "\5\62\32\2\u0146\u0149\5&\24\2\u0147\u0149\5$\23\2\u0148\u0146\3\2\2\2"+ - "\u0148\u0147\3\2\2\2\u0148\u0149\3\2\2\2\u0149)\3\2\2\2\u014a\u014d\5"+ - "\30\r\2\u014b\u014e\5&\24\2\u014c\u014e\5$\23\2\u014d\u014b\3\2\2\2\u014d"+ - "\u014c\3\2\2\2\u014d\u014e\3\2\2\2\u014e+\3\2\2\2\u014f\u0152\t\n\2\2"+ - "\u0150\u0153\5&\24\2\u0151\u0153\5$\23\2\u0152\u0150\3\2\2\2\u0152\u0151"+ - "\3\2\2\2\u0152\u0153\3\2\2\2\u0153-\3\2\2\2\u0154\u0155\7\26\2\2\u0155"+ - "\u0165\5\30\r\2\u0156\u0158\5\62\32\2\u0157\u0159\5&\24\2\u0158\u0157"+ - "\3\2\2\2\u0158\u0159\3\2\2\2\u0159\u0166\3\2\2\2\u015a\u015b\7\7\2\2\u015b"+ - "\u015c\5\34\17\2\u015c\u015d\7\b\2\2\u015d\u015f\3\2\2\2\u015e\u015a\3"+ - "\2\2\2\u015f\u0160\3\2\2\2\u0160\u015e\3\2\2\2\u0160\u0161\3\2\2\2\u0161"+ - "\u0163\3\2\2\2\u0162\u0164\5&\24\2\u0163\u0162\3\2\2\2\u0163\u0164\3\2"+ - "\2\2\u0164\u0166\3\2\2\2\u0165\u0156\3\2\2\2\u0165\u015e\3\2\2\2\u0166"+ - "/\3\2\2\2\u0167\u016a\7E\2\2\u0168\u016b\5&\24\2\u0169\u016b\5$\23\2\u016a"+ - "\u0168\3\2\2\2\u016a\u0169\3\2\2\2\u016a\u016b\3\2\2\2\u016b\61\3\2\2"+ - "\2\u016c\u0175\7\t\2\2\u016d\u0172\5\34\17\2\u016e\u016f\7\f\2\2\u016f"+ - "\u0171\5\34\17\2\u0170\u016e\3\2\2\2\u0171\u0174\3\2\2\2\u0172\u0170\3"+ - "\2\2\2\u0172\u0173\3\2\2\2\u0173\u0176\3\2\2\2\u0174\u0172\3\2\2\2\u0175"+ - "\u016d\3\2\2\2\u0175\u0176\3\2\2\2\u0176\u0177\3\2\2\2\u0177\u0178\7\n"+ - "\2\2\u0178\63\3\2\2\2\u0179\u017a\t\13\2\2\u017a\65\3\2\2\2/9DLUZ^bgk"+ - "osx\177\u0084\u0088\u008a\u0090\u0095\u0099\u00a0\u00aa\u00b2\u00b8\u00c2"+ - "\u00c6\u00ce\u00ef\u0115\u0117\u011f\u0127\u012c\u0136\u013d\u0142\u0148"+ - "\u014d\u0152\u0158\u0160\u0163\u0165\u016a\u0172\u0175"; + "\34\17\17\u00da\u00ef\3\2\2\2\u00db\u00dc\5\36\20\2\u00dc\u00dd\t\3\2"+ + "\2\u00dd\u00de\5\34\17\3\u00de\u00ef\3\2\2\2\u00df\u00e0\7\t\2\2\u00e0"+ + "\u00e1\5\34\17\2\u00e1\u00e2\7\n\2\2\u00e2\u00ef\3\2\2\2\u00e3\u00ef\t"+ + "\4\2\2\u00e4\u00ef\7F\2\2\u00e5\u00ef\7G\2\2\u00e6\u00ef\7H\2\2\u00e7"+ + "\u00e8\5\36\20\2\u00e8\u00e9\5\64\33\2\u00e9\u00ef\3\2\2\2\u00ea\u00eb"+ + "\5\64\33\2\u00eb\u00ec\5\36\20\2\u00ec\u00ef\3\2\2\2\u00ed\u00ef\5\36"+ + "\20\2\u00ee\u00d3\3\2\2\2\u00ee\u00d6\3\2\2\2\u00ee\u00db\3\2\2\2\u00ee"+ + "\u00df\3\2\2\2\u00ee\u00e3\3\2\2\2\u00ee\u00e4\3\2\2\2\u00ee\u00e5\3\2"+ + "\2\2\u00ee\u00e6\3\2\2\2\u00ee\u00e7\3\2\2\2\u00ee\u00ea\3\2\2\2\u00ee"+ + "\u00ed\3\2\2\2\u00ef\u0116\3\2\2\2\u00f0\u00f1\f\16\2\2\u00f1\u00f2\t"+ + "\5\2\2\u00f2\u0115\5\34\17\17\u00f3\u00f4\f\r\2\2\u00f4\u00f5\t\6\2\2"+ + "\u00f5\u0115\5\34\17\16\u00f6\u00f7\f\f\2\2\u00f7\u00f8\t\7\2\2\u00f8"+ + "\u0115\5\34\17\r\u00f9\u00fa\f\13\2\2\u00fa\u00fb\t\b\2\2\u00fb\u0115"+ + "\5\34\17\f\u00fc\u00fd\f\n\2\2\u00fd\u00fe\t\t\2\2\u00fe\u0115\5\34\17"+ + "\13\u00ff\u0100\f\t\2\2\u0100\u0101\7,\2\2\u0101\u0115\5\34\17\n\u0102"+ + "\u0103\f\b\2\2\u0103\u0104\7-\2\2\u0104\u0115\5\34\17\t\u0105\u0106\f"+ + "\7\2\2\u0106\u0107\7.\2\2\u0107\u0115\5\34\17\b\u0108\u0109\f\6\2\2\u0109"+ + "\u010a\7/\2\2\u010a\u0115\5\34\17\7\u010b\u010c\f\5\2\2\u010c\u010d\7"+ + "\60\2\2\u010d\u0115\5\34\17\6\u010e\u010f\f\4\2\2\u010f\u0110\7\61\2\2"+ + "\u0110\u0111\5\34\17\2\u0111\u0112\7\62\2\2\u0112\u0113\5\34\17\4\u0113"+ + "\u0115\3\2\2\2\u0114\u00f0\3\2\2\2\u0114\u00f3\3\2\2\2\u0114\u00f6\3\2"+ + "\2\2\u0114\u00f9\3\2\2\2\u0114\u00fc\3\2\2\2\u0114\u00ff\3\2\2\2\u0114"+ + "\u0102\3\2\2\2\u0114\u0105\3\2\2\2\u0114\u0108\3\2\2\2\u0114\u010b\3\2"+ + "\2\2\u0114\u010e\3\2\2\2\u0115\u0118\3\2\2\2\u0116\u0114\3\2\2\2\u0116"+ + "\u0117\3\2\2\2\u0117\35\3\2\2\2\u0118\u0116\3\2\2\2\u0119\u011f\5 \21"+ + "\2\u011a\u011f\5\"\22\2\u011b\u011f\5*\26\2\u011c\u011f\5.\30\2\u011d"+ + "\u011f\5\60\31\2\u011e\u0119\3\2\2\2\u011e\u011a\3\2\2\2\u011e\u011b\3"+ + "\2\2\2\u011e\u011c\3\2\2\2\u011e\u011d\3\2\2\2\u011f\37\3\2\2\2\u0120"+ + "\u0126\7\t\2\2\u0121\u0127\5 \21\2\u0122\u0127\5\"\22\2\u0123\u0127\5"+ + "*\26\2\u0124\u0127\5.\30\2\u0125\u0127\5\60\31\2\u0126\u0121\3\2\2\2\u0126"+ + "\u0122\3\2\2\2\u0126\u0123\3\2\2\2\u0126\u0124\3\2\2\2\u0126\u0125\3\2"+ + "\2\2\u0127\u0128\3\2\2\2\u0128\u012b\7\n\2\2\u0129\u012c\5&\24\2\u012a"+ + "\u012c\5$\23\2\u012b\u0129\3\2\2\2\u012b\u012a\3\2\2\2\u012b\u012c\3\2"+ + "\2\2\u012c!\3\2\2\2\u012d\u012e\7\t\2\2\u012e\u012f\5\22\n\2\u012f\u0135"+ + "\7\n\2\2\u0130\u0136\5 \21\2\u0131\u0136\5\"\22\2\u0132\u0136\5*\26\2"+ + "\u0133\u0136\5.\30\2\u0134\u0136\5\60\31\2\u0135\u0130\3\2\2\2\u0135\u0131"+ + "\3\2\2\2\u0135\u0132\3\2\2\2\u0135\u0133\3\2\2\2\u0135\u0134\3\2\2\2\u0136"+ + "#\3\2\2\2\u0137\u0138\7\7\2\2\u0138\u0139\5\34\17\2\u0139\u013c\7\b\2"+ + "\2\u013a\u013d\5&\24\2\u013b\u013d\5$\23\2\u013c\u013a\3\2\2\2\u013c\u013b"+ + "\3\2\2\2\u013c\u013d\3\2\2\2\u013d%\3\2\2\2\u013e\u0141\7\13\2\2\u013f"+ + "\u0142\5(\25\2\u0140\u0142\5,\27\2\u0141\u013f\3\2\2\2\u0141\u0140\3\2"+ + "\2\2\u0142\'\3\2\2\2\u0143\u0144\7K\2\2\u0144\u0147\5\62\32\2\u0145\u0148"+ + "\5&\24\2\u0146\u0148\5$\23\2\u0147\u0145\3\2\2\2\u0147\u0146\3\2\2\2\u0147"+ + "\u0148\3\2\2\2\u0148)\3\2\2\2\u0149\u014c\5\30\r\2\u014a\u014d\5&\24\2"+ + "\u014b\u014d\5$\23\2\u014c\u014a\3\2\2\2\u014c\u014b\3\2\2\2\u014c\u014d"+ + "\3\2\2\2\u014d+\3\2\2\2\u014e\u0151\t\n\2\2\u014f\u0152\5&\24\2\u0150"+ + "\u0152\5$\23\2\u0151\u014f\3\2\2\2\u0151\u0150\3\2\2\2\u0151\u0152\3\2"+ + "\2\2\u0152-\3\2\2\2\u0153\u0154\7\26\2\2\u0154\u0164\5\30\r\2\u0155\u0157"+ + "\5\62\32\2\u0156\u0158\5&\24\2\u0157\u0156\3\2\2\2\u0157\u0158\3\2\2\2"+ + "\u0158\u0165\3\2\2\2\u0159\u015a\7\7\2\2\u015a\u015b\5\34\17\2\u015b\u015c"+ + "\7\b\2\2\u015c\u015e\3\2\2\2\u015d\u0159\3\2\2\2\u015e\u015f\3\2\2\2\u015f"+ + "\u015d\3\2\2\2\u015f\u0160\3\2\2\2\u0160\u0162\3\2\2\2\u0161\u0163\5&"+ + "\24\2\u0162\u0161\3\2\2\2\u0162\u0163\3\2\2\2\u0163\u0165\3\2\2\2\u0164"+ + "\u0155\3\2\2\2\u0164\u015d\3\2\2\2\u0165/\3\2\2\2\u0166\u0169\7E\2\2\u0167"+ + "\u016a\5&\24\2\u0168\u016a\5$\23\2\u0169\u0167\3\2\2\2\u0169\u0168\3\2"+ + "\2\2\u0169\u016a\3\2\2\2\u016a\61\3\2\2\2\u016b\u0174\7\t\2\2\u016c\u0171"+ + "\5\34\17\2\u016d\u016e\7\f\2\2\u016e\u0170\5\34\17\2\u016f\u016d\3\2\2"+ + "\2\u0170\u0173\3\2\2\2\u0171\u016f\3\2\2\2\u0171\u0172\3\2\2\2\u0172\u0175"+ + "\3\2\2\2\u0173\u0171\3\2\2\2\u0174\u016c\3\2\2\2\u0174\u0175\3\2\2\2\u0175"+ + "\u0176\3\2\2\2\u0176\u0177\7\n\2\2\u0177\63\3\2\2\2\u0178\u0179\t\13\2"+ + "\2\u0179\65\3\2\2\2/9DLUZ^bgkosx\177\u0084\u0088\u008a\u0090\u0095\u0099"+ + "\u00a0\u00aa\u00b2\u00b8\u00c2\u00c6\u00ce\u00ee\u0114\u0116\u011e\u0126"+ + "\u012b\u0135\u013c\u0141\u0147\u014c\u0151\u0157\u015f\u0162\u0164\u0169"+ + "\u0171\u0174"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserBaseVisitor.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserBaseVisitor.java index f1cc222edd9..824b83fe952 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserBaseVisitor.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserBaseVisitor.java @@ -277,13 +277,6 @@ class PainlessParserBaseVisitor extends AbstractParseTreeVisitor implement * {@link #visitChildren} on {@code ctx}.

*/ @Override public T visitBinary(PainlessParser.BinaryContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

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

- */ - @Override public T visitChar(PainlessParser.CharContext ctx) { return visitChildren(ctx); } /** * {@inheritDoc} * diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserVisitor.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserVisitor.java index 3873d6f1e08..915328a3f05 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserVisitor.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessParserVisitor.java @@ -265,13 +265,6 @@ interface PainlessParserVisitor extends ParseTreeVisitor { * @return the visitor result */ T visitBinary(PainlessParser.BinaryContext ctx); - /** - * Visit a parse tree produced by the {@code char} - * labeled alternative in {@link PainlessParser#expression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitChar(PainlessParser.CharContext ctx); /** * Visit a parse tree produced by the {@code true} * labeled alternative in {@link PainlessParser#expression}. diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java index 45c507b42ba..ee5a5f8cd1c 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java @@ -248,6 +248,10 @@ public class Utility { return (double)value; } + public static String charToString(final char value) { + return String.valueOf(value); + } + public static boolean CharacterToboolean(final Character value) { return value != 0; } @@ -304,6 +308,10 @@ public class Utility { return value == null ? null : (double)value; } + public static String CharacterToString(final Character value) { + return value == null ? null : value.toString(); + } + public static boolean intToboolean(final int value) { return value != 0; } @@ -448,6 +456,26 @@ public class Utility { return (char)value.doubleValue(); } + public static char StringTochar(final String value) { + if (value.length() != 1) { + throw new ClassCastException("Cannot cast [String] with length greater than one to [char]."); + } + + return value.charAt(0); + } + + public static Character StringToCharacter(final String value) { + if (value == null) { + return null; + } + + if (value.length() != 1) { + throw new ClassCastException("Cannot cast [String] with length greater than one to [Character]."); + } + + return value.charAt(0); + } + // although divide by zero is guaranteed, the special overflow case is not caught. // its not needed for remainder because it is not possible there. // see https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.2 diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java index 3cc6a2aa22b..4490bf119b4 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Writer.java @@ -27,7 +27,6 @@ import org.elasticsearch.painless.PainlessParser.BinaryContext; import org.elasticsearch.painless.PainlessParser.BoolContext; import org.elasticsearch.painless.PainlessParser.BreakContext; import org.elasticsearch.painless.PainlessParser.CastContext; -import org.elasticsearch.painless.PainlessParser.CharContext; import org.elasticsearch.painless.PainlessParser.CompContext; import org.elasticsearch.painless.PainlessParser.ConditionalContext; import org.elasticsearch.painless.PainlessParser.ContinueContext; @@ -354,13 +353,6 @@ class Writer extends PainlessParserBaseVisitor { return null; } - @Override - public Void visitChar(final CharContext ctx) { - expression.processChar(ctx); - - return null; - } - @Override public Void visitTrue(final TrueContext ctx) { expression.processTrue(ctx); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterExpression.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterExpression.java index c850031efa0..7d10a275690 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterExpression.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterExpression.java @@ -26,7 +26,6 @@ import org.elasticsearch.painless.PainlessParser.AssignmentContext; import org.elasticsearch.painless.PainlessParser.BinaryContext; import org.elasticsearch.painless.PainlessParser.BoolContext; import org.elasticsearch.painless.PainlessParser.CastContext; -import org.elasticsearch.painless.PainlessParser.CharContext; import org.elasticsearch.painless.PainlessParser.CompContext; import org.elasticsearch.painless.PainlessParser.ConditionalContext; import org.elasticsearch.painless.PainlessParser.ExpressionContext; @@ -104,20 +103,6 @@ class WriterExpression { utility.checkWriteBranch(ctx); } - void processChar(final CharContext ctx) { - final ExpressionMetadata charemd = metadata.getExpressionMetadata(ctx); - final Object postConst = charemd.postConst; - - if (postConst == null) { - utility.writeNumeric(ctx, (int)(char)charemd.preConst); - caster.checkWriteCast(charemd); - } else { - utility.writeConstant(ctx, postConst); - } - - utility.checkWriteBranch(ctx); - } - void processTrue(final TrueContext ctx) { final ExpressionMetadata trueemd = metadata.getExpressionMetadata(ctx); final Object postConst = trueemd.postConst; diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicExpressionTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicExpressionTests.java index ee3607242ca..d2a24ef9533 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicExpressionTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicExpressionTests.java @@ -38,7 +38,7 @@ public class BasicExpressionTests extends ScriptTestCase { } public void testReturnConstantChar() { - assertEquals('x', exec("return 'x';")); + assertEquals('x', exec("return (char)'x';")); } public void testConstantCharTruncation() { diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/EqualsTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/EqualsTests.java index 607da9f0f32..8043d9da915 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/EqualsTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/EqualsTests.java @@ -131,51 +131,51 @@ public class EqualsTests extends ScriptTestCase { } public void testBranchEquals() { - assertEquals(0, exec("Character a = 'a'; Character b = 'b'; if (a == b) return 1; else return 0;")); - assertEquals(1, exec("Character a = 'a'; Character b = 'a'; if (a == b) return 1; else return 0;")); + assertEquals(0, exec("Character a = (char)'a'; Character b = (char)'b'; if (a == b) return 1; else return 0;")); + assertEquals(1, exec("Character a = (char)'a'; Character b = (char)'a'; if (a == b) return 1; else return 0;")); assertEquals(0, exec("Integer a = new Integer(1); Integer b = 1; if (a === b) return 1; else return 0;")); - assertEquals(0, exec("Character a = 'a'; Character b = new Character('a'); if (a === b) return 1; else return 0;")); - assertEquals(1, exec("Character a = 'a'; Object b = a; if (a === b) return 1; else return 0;")); + assertEquals(0, exec("Character a = (char)'a'; Character b = new Character((char)'a'); if (a === b) return 1; else return 0;")); + assertEquals(1, exec("Character a = (char)'a'; Object b = a; if (a === b) return 1; else return 0;")); assertEquals(1, exec("Integer a = 1; Number b = a; Number c = a; if (c === b) return 1; else return 0;")); - assertEquals(0, exec("Integer a = 1; Character b = 'a'; if (a === (Object)b) return 1; else return 0;")); + assertEquals(0, exec("Integer a = 1; Character b = (char)'a'; if (a === (Object)b) return 1; else return 0;")); } public void testBranchNotEquals() { - assertEquals(1, exec("Character a = 'a'; Character b = 'b'; if (a != b) return 1; else return 0;")); - assertEquals(0, exec("Character a = 'a'; Character b = 'a'; if (a != b) return 1; else return 0;")); + assertEquals(1, exec("Character a = (char)'a'; Character b = (char)'b'; if (a != b) return 1; else return 0;")); + assertEquals(0, exec("Character a = (char)'a'; Character b = (char)'a'; if (a != b) return 1; else return 0;")); assertEquals(1, exec("Integer a = new Integer(1); Integer b = 1; if (a !== b) return 1; else return 0;")); - assertEquals(1, exec("Character a = 'a'; Character b = new Character('a'); if (a !== b) return 1; else return 0;")); - assertEquals(0, exec("Character a = 'a'; Object b = a; if (a !== b) return 1; else return 0;")); + assertEquals(1, exec("Character a = (char)'a'; Character b = new Character((char)'a'); if (a !== b) return 1; else return 0;")); + assertEquals(0, exec("Character a = (char)'a'; Object b = a; if (a !== b) return 1; else return 0;")); assertEquals(0, exec("Integer a = 1; Number b = a; Number c = a; if (c !== b) return 1; else return 0;")); - assertEquals(1, exec("Integer a = 1; Character b = 'a'; if (a !== (Object)b) return 1; else return 0;")); + assertEquals(1, exec("Integer a = 1; Character b = (char)'a'; if (a !== (Object)b) return 1; else return 0;")); } public void testRightHandNull() { - assertEquals(false, exec("Character a = 'a'; return a == null;")); - assertEquals(false, exec("Character a = 'a'; return a === null;")); - assertEquals(true, exec("Character a = 'a'; return a != null;")); - assertEquals(true, exec("Character a = 'a'; return a !== null;")); + assertEquals(false, exec("Character a = (char)'a'; return a == null;")); + assertEquals(false, exec("Character a = (char)'a'; return a === null;")); + assertEquals(true, exec("Character a = (char)'a'; return a != null;")); + assertEquals(true, exec("Character a = (char)'a'; return a !== null;")); assertEquals(true, exec("Character a = null; return a == null;")); assertEquals(false, exec("Character a = null; return a != null;")); - assertEquals(false, exec("Character a = 'a'; Character b = null; return a == b;")); + assertEquals(false, exec("Character a = (char)'a'; Character b = null; return a == b;")); assertEquals(true, exec("Character a = null; Character b = null; return a === b;")); - assertEquals(true, exec("Character a = 'a'; Character b = null; return a != b;")); + assertEquals(true, exec("Character a = (char)'a'; Character b = null; return a != b;")); assertEquals(false, exec("Character a = null; Character b = null; return a !== b;")); assertEquals(false, exec("Integer x = null; double y = 2.0; return x == y;")); assertEquals(true, exec("Integer x = null; Short y = null; return x == y;")); } public void testLeftHandNull() { - assertEquals(false, exec("Character a = 'a'; return null == a;")); - assertEquals(false, exec("Character a = 'a'; return null === a;")); - assertEquals(true, exec("Character a = 'a'; return null != a;")); - assertEquals(true, exec("Character a = 'a'; return null !== a;")); + assertEquals(false, exec("Character a = (char)'a'; return null == a;")); + assertEquals(false, exec("Character a = (char)'a'; return null === a;")); + assertEquals(true, exec("Character a = (char)'a'; return null != a;")); + assertEquals(true, exec("Character a = (char)'a'; return null !== a;")); assertEquals(true, exec("Character a = null; return null == a;")); assertEquals(false, exec("Character a = null; return null != a;")); - assertEquals(false, exec("Character a = null; Character b = 'a'; return a == b;")); + assertEquals(false, exec("Character a = null; Character b = (char)'a'; return a == b;")); assertEquals(true, exec("Character a = null; Character b = null; return a == b;")); assertEquals(true, exec("Character a = null; Character b = null; return b === a;")); - assertEquals(true, exec("Character a = null; Character b = 'a'; return a != b;")); + assertEquals(true, exec("Character a = null; Character b = (char)'a'; return a != b;")); assertEquals(false, exec("Character a = null; Character b = null; return b != a;")); assertEquals(false, exec("Character a = null; Character b = null; return b !== a;")); assertEquals(false, exec("Integer x = null; double y = 2.0; return y == x;")); diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/StringTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/StringTests.java index 7d489332f92..f619d44ad81 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/StringTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/StringTests.java @@ -41,6 +41,26 @@ public class StringTests extends ScriptTestCase { assertEquals("cat" + 2.0, exec("String s = \"cat\"; return s + 2.0;")); // String assertEquals("cat" + "cat", exec("String s = \"cat\"; return s + s;")); + + // boolean + assertEquals("cat" + true, exec("String s = 'cat'; return s + true;")); + // byte + assertEquals("cat" + (byte)3, exec("String s = 'cat'; return s + (byte)3;")); + // short + assertEquals("cat" + (short)3, exec("String s = 'cat'; return s + (short)3;")); + // char + assertEquals("cat" + 't', exec("String s = 'cat'; return s + 't';")); + assertEquals("cat" + (char)40, exec("String s = 'cat'; return s + (char)40;")); + // int + assertEquals("cat" + 2, exec("String s = 'cat'; return s + 2;")); + // long + assertEquals("cat" + 2L, exec("String s = 'cat'; return s + 2L;")); + // float + assertEquals("cat" + 2F, exec("String s = 'cat'; return s + 2F;")); + // double + assertEquals("cat" + 2.0, exec("String s = 'cat'; return s + 2.0;")); + // String + assertEquals("cat" + "cat", exec("String s = 'cat'; return s + s;")); } public void testStringAPI() { @@ -71,5 +91,99 @@ public class StringTests extends ScriptTestCase { assertEquals("e", exec("return \"abcde\".substring(4, 5);")); assertEquals(97, ((char[])exec("return \"a\".toCharArray();"))[0]); assertEquals("a", exec("return \" a \".trim();")); + + assertEquals("", exec("return new String();")); + assertEquals('x', exec("String s = 'x'; return s.charAt(0);")); + assertEquals(120, exec("String s = 'x'; return s.codePointAt(0);")); + assertEquals(0, exec("String s = 'x'; return s.compareTo('x');")); + assertEquals("xx", exec("String s = 'x'; return s.concat('x');")); + assertEquals(true, exec("String s = 'xy'; return s.endsWith('y');")); + assertEquals(2, exec("String t = 'abcde'; return t.indexOf('cd', 1);")); + assertEquals(false, exec("String t = 'abcde'; return t.isEmpty();")); + assertEquals(5, exec("String t = 'abcde'; return t.length();")); + assertEquals("cdcde", exec("String t = 'abcde'; return t.replace('ab', 'cd');")); + assertEquals(false, exec("String s = 'xy'; return s.startsWith('y');")); + assertEquals("e", exec("String t = 'abcde'; return t.substring(4, 5);")); + assertEquals(97, ((char[])exec("String s = 'a'; return s.toCharArray();"))[0]); + assertEquals("a", exec("String s = ' a '; return s.trim();")); + assertEquals('x', exec("return 'x'.charAt(0);")); + assertEquals(120, exec("return 'x'.codePointAt(0);")); + assertEquals(0, exec("return 'x'.compareTo('x');")); + assertEquals("xx", exec("return 'x'.concat('x');")); + assertEquals(true, exec("return 'xy'.endsWith('y');")); + assertEquals(2, exec("return 'abcde'.indexOf('cd', 1);")); + assertEquals(false, exec("return 'abcde'.isEmpty();")); + assertEquals(5, exec("return 'abcde'.length();")); + assertEquals("cdcde", exec("return 'abcde'.replace('ab', 'cd');")); + assertEquals(false, exec("return 'xy'.startsWith('y');")); + assertEquals("e", exec("return 'abcde'.substring(4, 5);")); + assertEquals(97, ((char[])exec("return 'a'.toCharArray();"))[0]); + assertEquals("a", exec("return ' a '.trim();")); + } + + public void testStringAndCharacter() { + assertEquals('c', exec("return (char)\"c\"")); + assertEquals('c', exec("return (char)'c'")); + assertEquals("c", exec("return (String)(char)\"c\"")); + assertEquals("c", exec("return (String)(char)'c'")); + + assertEquals('c', exec("String s = \"c\" (char)s")); + assertEquals('c', exec("String s = 'c' (char)s")); + + try { + assertEquals("cc", exec("return (String)(char)\"cc\"")); + } catch (final IllegalArgumentException ise) { + ise.getMessage().contains("Cannot cast constant from [String] to [char]."); + } + + try { + assertEquals("cc", exec("return (String)(char)'cc'")); + } catch (final IllegalArgumentException ise) { + ise.getMessage().contains("Cannot cast constant from [String] to [char]."); + } + + try { + assertEquals('c', exec("String s = \"cc\" (char)s")); + } catch (final ClassCastException cce) { + cce.getMessage().contains("Cannot cast [String] with length greater than one to [char]."); + } + + try { + assertEquals('c', exec("String s = 'cc' (char)s")); + } catch (final ClassCastException cce) { + cce.getMessage().contains("Cannot cast [String] with length greater than one to [char]."); + } + + assertEquals('c', exec("return (Character)\"c\"")); + assertEquals('c', exec("return (Character)'c'")); + assertEquals("c", exec("return (String)(Character)\"c\"")); + assertEquals("c", exec("return (String)(Character)'c'")); + + assertEquals('c', exec("String s = \"c\" (Character)s")); + assertEquals('c', exec("String s = 'c' (Character)s")); + + try { + assertEquals("cc", exec("return (String)(Character)\"cc\"")); + } catch (final ClassCastException ise) { + ise.getMessage().contains("Cannot cast [String] with length greater than one to [Character]."); + } + + try { + assertEquals("cc", exec("return (String)(Character)'cc'")); + } catch (final ClassCastException ise) { + ise.getMessage().contains("Cannot cast [String] with length greater than one to [Character]."); + } + + try { + assertEquals('c', exec("String s = \"cc\" (Character)s")); + } catch (final ClassCastException cce) { + cce.getMessage().contains("Cannot cast [String] with length greater than one to [Character]."); + } + + try { + assertEquals('c', exec("String s = 'cc' (Character)s")); + } catch (final ClassCastException cce) { + cce.getMessage().contains("Cannot cast [String] with length greater than one to [Character]."); + } } } diff --git a/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/20_scriptfield.yaml b/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/20_scriptfield.yaml index 66cff5df792..d53306b5d47 100644 --- a/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/20_scriptfield.yaml +++ b/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/20_scriptfield.yaml @@ -28,7 +28,7 @@ setup: script_fields: bar: script: - inline: "input.doc.foo.0 + input.x;" + inline: "input.doc['foo'].0 + input.x;" lang: painless params: x: "bbb" diff --git a/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/30_search.yaml b/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/30_search.yaml index da28a1f4201..2dd1a6004ff 100644 --- a/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/30_search.yaml +++ b/modules/lang-painless/src/test/resources/rest-api-spec/test/plan_a/30_search.yaml @@ -29,12 +29,12 @@ query: script: script: - inline: "input.doc.num1.0 > 1;" + inline: "input.doc['num1'].0 > 1;" lang: painless script_fields: sNum1: script: - inline: "input.doc.num1.0;" + inline: "input.doc['num1'].0;" lang: painless sort: num1: @@ -51,7 +51,7 @@ query: script: script: - inline: "input.doc.num1.0 > input.param1;" + inline: "input.doc['num1'].0 > input.param1;" lang: painless params: param1: 1 @@ -59,7 +59,7 @@ script_fields: sNum1: script: - inline: "return input.doc.num1.0;" + inline: "return input.doc['num1'].0;" lang: painless sort: num1: @@ -76,7 +76,7 @@ query: script: script: - inline: "input.doc.num1.0 > input.param1;" + inline: "input.doc['num1'].0 > input.param1;" lang: painless params: param1: -1 @@ -84,7 +84,7 @@ script_fields: sNum1: script: - inline: "input.doc.num1.0;" + inline: "input.doc['num1'].0;" lang: painless sort: num1: