Skip to content

Commit 2f1d6bb

Browse files
committed
Upgrade Painless from ANTLR 4.5.1-1 to ANTLR 4.5.3. (#27153)
1 parent 4bacb60 commit 2f1d6bb

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

modules/lang-painless/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ integTestCluster {
2929
}
3030

3131
dependencies {
32-
compile 'org.antlr:antlr4-runtime:4.5.1-1'
32+
compile 'org.antlr:antlr4-runtime:4.5.3'
3333
compile 'org.ow2.asm:asm-debug-all:5.1'
3434
}
3535

@@ -71,7 +71,7 @@ configurations {
7171
}
7272

7373
dependencies {
74-
regenerate 'org.antlr:antlr4:4.5.1-1'
74+
regenerate 'org.antlr:antlr4:4.5.3'
7575
}
7676

7777
String grammarPath = 'src/main/antlr'

modules/lang-painless/licenses/antlr4-runtime-4.5.1-1.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2609e36f18f7e8d593cc1cddfb2ac776dc96b8e0

modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessLexer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
1313
abstract class PainlessLexer extends Lexer {
14-
static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }
14+
static { RuntimeMetaData.checkVersion("4.5.3", RuntimeMetaData.VERSION); }
1515

1616
protected static final DFA[] _decisionToDFA;
1717
protected static final PredictionContextCache _sharedContextCache =

modules/lang-painless/src/main/java/org/elasticsearch/painless/antlr/PainlessParser.java

+16-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
1313
class PainlessParser extends Parser {
14-
static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }
14+
static { RuntimeMetaData.checkVersion("4.5.3", RuntimeMetaData.VERSION); }
1515

1616
protected static final DFA[] _decisionToDFA;
1717
protected static final PredictionContextCache _sharedContextCache =
@@ -579,6 +579,7 @@ public final StatementContext statement() throws RecognitionException {
579579
try {
580580
int _alt;
581581
setState(185);
582+
_errHandler.sync(this);
582583
switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) {
583584
case 1:
584585
_localctx = new IfContext(_localctx);
@@ -595,6 +596,7 @@ public final StatementContext statement() throws RecognitionException {
595596
setState(103);
596597
trailer();
597598
setState(107);
599+
_errHandler.sync(this);
598600
switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
599601
case 1:
600602
{
@@ -1127,6 +1129,7 @@ public final InitializerContext initializer() throws RecognitionException {
11271129
enterRule(_localctx, 14, RULE_initializer);
11281130
try {
11291131
setState(204);
1132+
_errHandler.sync(this);
11301133
switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) {
11311134
case 1:
11321135
enterOuterAlt(_localctx, 1);
@@ -1653,6 +1656,7 @@ private ExpressionContext expression(int _p) throws RecognitionException {
16531656
_prevctx = _localctx;
16541657
{
16551658
setState(290);
1659+
_errHandler.sync(this);
16561660
switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
16571661
case 1:
16581662
{
@@ -1979,6 +1983,7 @@ public final UnaryContext unary() throws RecognitionException {
19791983
int _la;
19801984
try {
19811985
setState(308);
1986+
_errHandler.sync(this);
19821987
switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
19831988
case 1:
19841989
_localctx = new PreContext(_localctx);
@@ -2126,6 +2131,7 @@ public final ChainContext chain() throws RecognitionException {
21262131
try {
21272132
int _alt;
21282133
setState(326);
2134+
_errHandler.sync(this);
21292135
switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
21302136
case 1:
21312137
_localctx = new DynamicContext(_localctx);
@@ -2342,6 +2348,7 @@ public final PrimaryContext primary() throws RecognitionException {
23422348
int _la;
23432349
try {
23442350
setState(346);
2351+
_errHandler.sync(this);
23452352
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
23462353
case 1:
23472354
_localctx = new PrecedenceContext(_localctx);
@@ -2493,6 +2500,7 @@ public final PostfixContext postfix() throws RecognitionException {
24932500
enterRule(_localctx, 36, RULE_postfix);
24942501
try {
24952502
setState(351);
2503+
_errHandler.sync(this);
24962504
switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) {
24972505
case 1:
24982506
enterOuterAlt(_localctx, 1);
@@ -2551,6 +2559,7 @@ public final PostdotContext postdot() throws RecognitionException {
25512559
enterRule(_localctx, 38, RULE_postdot);
25522560
try {
25532561
setState(355);
2562+
_errHandler.sync(this);
25542563
switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) {
25552564
case 1:
25562565
enterOuterAlt(_localctx, 1);
@@ -2803,6 +2812,7 @@ public final ArrayinitializerContext arrayinitializer() throws RecognitionExcept
28032812
try {
28042813
int _alt;
28052814
setState(412);
2815+
_errHandler.sync(this);
28062816
switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) {
28072817
case 1:
28082818
_localctx = new NewstandardarrayContext(_localctx);
@@ -2837,6 +2847,7 @@ public final ArrayinitializerContext arrayinitializer() throws RecognitionExcept
28372847
_alt = getInterpreter().adaptivePredict(_input,27,_ctx);
28382848
} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
28392849
setState(385);
2850+
_errHandler.sync(this);
28402851
switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) {
28412852
case 1:
28422853
{
@@ -2974,6 +2985,7 @@ public final ListinitializerContext listinitializer() throws RecognitionExceptio
29742985
int _la;
29752986
try {
29762987
setState(427);
2988+
_errHandler.sync(this);
29772989
switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) {
29782990
case 1:
29792991
enterOuterAlt(_localctx, 1);
@@ -3055,6 +3067,7 @@ public final MapinitializerContext mapinitializer() throws RecognitionException
30553067
int _la;
30563068
try {
30573069
setState(443);
3070+
_errHandler.sync(this);
30583071
switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) {
30593072
case 1:
30603073
enterOuterAlt(_localctx, 1);
@@ -3252,6 +3265,7 @@ public final ArgumentContext argument() throws RecognitionException {
32523265
enterRule(_localctx, 56, RULE_argument);
32533266
try {
32543267
setState(465);
3268+
_errHandler.sync(this);
32553269
switch ( getInterpreter().adaptivePredict(_input,41,_ctx) ) {
32563270
case 1:
32573271
enterOuterAlt(_localctx, 1);
@@ -3533,6 +3547,7 @@ public final FuncrefContext funcref() throws RecognitionException {
35333547
enterRule(_localctx, 62, RULE_funcref);
35343548
try {
35353549
setState(505);
3550+
_errHandler.sync(this);
35363551
switch ( getInterpreter().adaptivePredict(_input,47,_ctx) ) {
35373552
case 1:
35383553
_localctx = new ClassfuncrefContext(_localctx);

0 commit comments

Comments
 (0)