diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java index d54a40c6b77..ba98f950ca9 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java @@ -115,7 +115,7 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); GradleDependency.Matcher gradleDependencyMatcher = new GradleDependency.Matcher(); - + if (!((gradleDependencyMatcher.get(getCursor()).isPresent() || dependencyDsl.matches(m)) && (StringUtils.isBlank(configuration) || m.getSimpleName().equals(configuration)))) { return m; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java index 0338bdc25d8..984523ff5d8 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseMapNotation.java @@ -60,7 +60,7 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); GradleDependency.Matcher gradleDependencyMatcher = new GradleDependency.Matcher(); - + if (!(gradleDependencyMatcher.get(getCursor()).isPresent() || dependencyDsl.matches(m))) { return m; } diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java index cc1a24e6141..4d18b7a5e97 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/ChangeDependencyArtifactIdTest.java @@ -195,7 +195,7 @@ void worksWithoutVersion() { ) ); } - + @ParameterizedTest @CsvSource(value = {"org.openrewrite:rewrite-core", "*:*"}, delimiterString = ":") void worksWithClassifier(String group, String artifact) { diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLLexer.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLLexer.java index b31ec8e667b..31598f56b7a 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLLexer.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLLexer.java @@ -33,12 +33,12 @@ public class HCLLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - FOR_BRACE=1, FOR_BRACK=2, IF=3, IN=4, LBRACE=5, RBRACE=6, ASSIGN=7, Identifier=8, - WS=9, COMMENT=10, LINE_COMMENT=11, NEWLINE=12, NumericLiteral=13, BooleanLiteral=14, - QUOTE=15, NULL=16, HEREDOC_START=17, PLUS=18, AND=19, EQ=20, LT=21, COLON=22, - LBRACK=23, LPAREN=24, MINUS=25, OR=26, NEQ=27, GT=28, QUESTION=29, RBRACK=30, - RPAREN=31, MUL=32, NOT=33, LEQ=34, DOT=35, DIV=36, GEQ=37, ARROW=38, COMMA=39, - MOD=40, ELLIPSIS=41, TILDE=42, TEMPLATE_INTERPOLATION_START=43, TemplateStringLiteral=44, + FOR_BRACE=1, FOR_BRACK=2, IF=3, IN=4, LBRACE=5, RBRACE=6, ASSIGN=7, Identifier=8, + WS=9, COMMENT=10, LINE_COMMENT=11, NEWLINE=12, NumericLiteral=13, BooleanLiteral=14, + QUOTE=15, NULL=16, HEREDOC_START=17, PLUS=18, AND=19, EQ=20, LT=21, COLON=22, + LBRACK=23, LPAREN=24, MINUS=25, OR=26, NEQ=27, GT=28, QUESTION=29, RBRACK=30, + RPAREN=31, MUL=32, NOT=33, LEQ=34, DOT=35, DIV=36, GEQ=37, ARROW=38, COMMA=39, + MOD=40, ELLIPSIS=41, TILDE=42, TEMPLATE_INTERPOLATION_START=43, TemplateStringLiteral=44, TemplateStringLiteralChar=45, HTemplateLiteral=46, HTemplateLiteralChar=47; public static final int TEMPLATE=1, HEREDOC_PREAMBLE=2, HEREDOC=3; @@ -52,15 +52,15 @@ public class HCLLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "FOR_BRACE", "FOR_BRACK", "IF", "IN", "LBRACE", "RBRACE", "ASSIGN", "StringLiteralChar", - "Identifier", "WS", "COMMENT", "LINE_COMMENT", "NEWLINE", "LetterOrDigit", - "Letter", "EscapeSequence", "HexDigit", "NumericLiteral", "ExponentPart", - "BooleanLiteral", "QUOTE", "NULL", "HEREDOC_START", "PLUS", "AND", "EQ", - "LT", "COLON", "LBRACK", "LPAREN", "MINUS", "OR", "NEQ", "GT", "QUESTION", - "RBRACK", "RPAREN", "MUL", "NOT", "LEQ", "DOT", "DIV", "GEQ", "ARROW", - "COMMA", "MOD", "ELLIPSIS", "TILDE", "TEMPLATE_INTERPOLATION_START", - "TemplateStringLiteral", "TemplateStringLiteralChar", "END_QUOTE", "HP_NEWLINE", - "HPIdentifier", "H_NEWLINE", "H_TEMPLATE_INTERPOLATION_START", "HTemplateLiteral", + "FOR_BRACE", "FOR_BRACK", "IF", "IN", "LBRACE", "RBRACE", "ASSIGN", "StringLiteralChar", + "Identifier", "WS", "COMMENT", "LINE_COMMENT", "NEWLINE", "LetterOrDigit", + "Letter", "EscapeSequence", "HexDigit", "NumericLiteral", "ExponentPart", + "BooleanLiteral", "QUOTE", "NULL", "HEREDOC_START", "PLUS", "AND", "EQ", + "LT", "COLON", "LBRACK", "LPAREN", "MINUS", "OR", "NEQ", "GT", "QUESTION", + "RBRACK", "RPAREN", "MUL", "NOT", "LEQ", "DOT", "DIV", "GEQ", "ARROW", + "COMMA", "MOD", "ELLIPSIS", "TILDE", "TEMPLATE_INTERPOLATION_START", + "TemplateStringLiteral", "TemplateStringLiteralChar", "END_QUOTE", "HP_NEWLINE", + "HPIdentifier", "H_NEWLINE", "H_TEMPLATE_INTERPOLATION_START", "HTemplateLiteral", "HTemplateLiteralChar" }; } @@ -68,23 +68,23 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, null, "'if'", "'in'", "'{'", "'}'", "'='", null, null, null, - null, null, null, null, null, "'null'", null, "'+'", "'&&'", "'=='", - "'<'", "':'", "'['", "'('", "'-'", "'||'", "'!='", "'>'", "'?'", "']'", - "')'", "'*'", "'!'", "'<='", "'.'", "'/'", "'>='", "'=>'", "','", "'%'", + null, null, null, "'if'", "'in'", "'{'", "'}'", "'='", null, null, null, + null, null, null, null, null, "'null'", null, "'+'", "'&&'", "'=='", + "'<'", "':'", "'['", "'('", "'-'", "'||'", "'!='", "'>'", "'?'", "']'", + "')'", "'*'", "'!'", "'<='", "'.'", "'/'", "'>='", "'=>'", "','", "'%'", "'...'", "'~'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "FOR_BRACE", "FOR_BRACK", "IF", "IN", "LBRACE", "RBRACE", "ASSIGN", - "Identifier", "WS", "COMMENT", "LINE_COMMENT", "NEWLINE", "NumericLiteral", - "BooleanLiteral", "QUOTE", "NULL", "HEREDOC_START", "PLUS", "AND", "EQ", - "LT", "COLON", "LBRACK", "LPAREN", "MINUS", "OR", "NEQ", "GT", "QUESTION", - "RBRACK", "RPAREN", "MUL", "NOT", "LEQ", "DOT", "DIV", "GEQ", "ARROW", - "COMMA", "MOD", "ELLIPSIS", "TILDE", "TEMPLATE_INTERPOLATION_START", - "TemplateStringLiteral", "TemplateStringLiteralChar", "HTemplateLiteral", + null, "FOR_BRACE", "FOR_BRACK", "IF", "IN", "LBRACE", "RBRACE", "ASSIGN", + "Identifier", "WS", "COMMENT", "LINE_COMMENT", "NEWLINE", "NumericLiteral", + "BooleanLiteral", "QUOTE", "NULL", "HEREDOC_START", "PLUS", "AND", "EQ", + "LT", "COLON", "LBRACK", "LPAREN", "MINUS", "OR", "NEQ", "GT", "QUESTION", + "RBRACK", "RPAREN", "MUL", "NOT", "LEQ", "DOT", "DIV", "GEQ", "ARROW", + "COMMA", "MOD", "ELLIPSIS", "TILDE", "TEMPLATE_INTERPOLATION_START", + "TemplateStringLiteral", "TemplateStringLiteralChar", "HTemplateLiteral", "HTemplateLiteralChar" }; } diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.java index 57f3ac08fee..94796886905 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.java @@ -36,34 +36,34 @@ public class HCLParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - FOR_BRACE=1, FOR_BRACK=2, IF=3, IN=4, LBRACE=5, RBRACE=6, ASSIGN=7, Identifier=8, - WS=9, COMMENT=10, LINE_COMMENT=11, NEWLINE=12, NumericLiteral=13, BooleanLiteral=14, - QUOTE=15, NULL=16, HEREDOC_START=17, PLUS=18, AND=19, EQ=20, LT=21, COLON=22, - LBRACK=23, LPAREN=24, MINUS=25, OR=26, NEQ=27, GT=28, QUESTION=29, RBRACK=30, - RPAREN=31, MUL=32, NOT=33, LEQ=34, DOT=35, DIV=36, GEQ=37, ARROW=38, COMMA=39, - MOD=40, ELLIPSIS=41, TILDE=42, TEMPLATE_INTERPOLATION_START=43, TemplateStringLiteral=44, + FOR_BRACE=1, FOR_BRACK=2, IF=3, IN=4, LBRACE=5, RBRACE=6, ASSIGN=7, Identifier=8, + WS=9, COMMENT=10, LINE_COMMENT=11, NEWLINE=12, NumericLiteral=13, BooleanLiteral=14, + QUOTE=15, NULL=16, HEREDOC_START=17, PLUS=18, AND=19, EQ=20, LT=21, COLON=22, + LBRACK=23, LPAREN=24, MINUS=25, OR=26, NEQ=27, GT=28, QUESTION=29, RBRACK=30, + RPAREN=31, MUL=32, NOT=33, LEQ=34, DOT=35, DIV=36, GEQ=37, ARROW=38, COMMA=39, + MOD=40, ELLIPSIS=41, TILDE=42, TEMPLATE_INTERPOLATION_START=43, TemplateStringLiteral=44, TemplateStringLiteralChar=45, HTemplateLiteral=46, HTemplateLiteralChar=47; public static final int - RULE_configFile = 0, RULE_body = 1, RULE_bodyContent = 2, RULE_attribute = 3, - RULE_block = 4, RULE_blockLabel = 5, RULE_expression = 6, RULE_exprTerm = 7, - RULE_blockExpr = 8, RULE_literalValue = 9, RULE_collectionValue = 10, - RULE_tuple = 11, RULE_object = 12, RULE_objectelem = 13, RULE_forExpr = 14, - RULE_forTupleExpr = 15, RULE_forObjectExpr = 16, RULE_forIntro = 17, RULE_forCond = 18, - RULE_variableExpr = 19, RULE_functionCall = 20, RULE_arguments = 21, RULE_index = 22, - RULE_getAttr = 23, RULE_splat = 24, RULE_attrSplat = 25, RULE_fullSplat = 26, - RULE_operation = 27, RULE_unaryOp = 28, RULE_binaryOp = 29, RULE_binaryOperator = 30, - RULE_compareOperator = 31, RULE_arithmeticOperator = 32, RULE_logicOperator = 33, - RULE_templateExpr = 34, RULE_heredocTemplatePart = 35, RULE_heredocLiteral = 36, + RULE_configFile = 0, RULE_body = 1, RULE_bodyContent = 2, RULE_attribute = 3, + RULE_block = 4, RULE_blockLabel = 5, RULE_expression = 6, RULE_exprTerm = 7, + RULE_blockExpr = 8, RULE_literalValue = 9, RULE_collectionValue = 10, + RULE_tuple = 11, RULE_object = 12, RULE_objectelem = 13, RULE_forExpr = 14, + RULE_forTupleExpr = 15, RULE_forObjectExpr = 16, RULE_forIntro = 17, RULE_forCond = 18, + RULE_variableExpr = 19, RULE_functionCall = 20, RULE_arguments = 21, RULE_index = 22, + RULE_getAttr = 23, RULE_splat = 24, RULE_attrSplat = 25, RULE_fullSplat = 26, + RULE_operation = 27, RULE_unaryOp = 28, RULE_binaryOp = 29, RULE_binaryOperator = 30, + RULE_compareOperator = 31, RULE_arithmeticOperator = 32, RULE_logicOperator = 33, + RULE_templateExpr = 34, RULE_heredocTemplatePart = 35, RULE_heredocLiteral = 36, RULE_quotedTemplatePart = 37, RULE_stringLiteral = 38, RULE_templateInterpolation = 39; private static String[] makeRuleNames() { return new String[] { - "configFile", "body", "bodyContent", "attribute", "block", "blockLabel", - "expression", "exprTerm", "blockExpr", "literalValue", "collectionValue", - "tuple", "object", "objectelem", "forExpr", "forTupleExpr", "forObjectExpr", - "forIntro", "forCond", "variableExpr", "functionCall", "arguments", "index", - "getAttr", "splat", "attrSplat", "fullSplat", "operation", "unaryOp", - "binaryOp", "binaryOperator", "compareOperator", "arithmeticOperator", - "logicOperator", "templateExpr", "heredocTemplatePart", "heredocLiteral", + "configFile", "body", "bodyContent", "attribute", "block", "blockLabel", + "expression", "exprTerm", "blockExpr", "literalValue", "collectionValue", + "tuple", "object", "objectelem", "forExpr", "forTupleExpr", "forObjectExpr", + "forIntro", "forCond", "variableExpr", "functionCall", "arguments", "index", + "getAttr", "splat", "attrSplat", "fullSplat", "operation", "unaryOp", + "binaryOp", "binaryOperator", "compareOperator", "arithmeticOperator", + "logicOperator", "templateExpr", "heredocTemplatePart", "heredocLiteral", "quotedTemplatePart", "stringLiteral", "templateInterpolation" }; } @@ -71,23 +71,23 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, null, "'if'", "'in'", "'{'", "'}'", "'='", null, null, null, - null, null, null, null, null, "'null'", null, "'+'", "'&&'", "'=='", - "'<'", "':'", "'['", "'('", "'-'", "'||'", "'!='", "'>'", "'?'", "']'", - "')'", "'*'", "'!'", "'<='", "'.'", "'/'", "'>='", "'=>'", "','", "'%'", + null, null, null, "'if'", "'in'", "'{'", "'}'", "'='", null, null, null, + null, null, null, null, null, "'null'", null, "'+'", "'&&'", "'=='", + "'<'", "':'", "'['", "'('", "'-'", "'||'", "'!='", "'>'", "'?'", "']'", + "')'", "'*'", "'!'", "'<='", "'.'", "'/'", "'>='", "'=>'", "','", "'%'", "'...'", "'~'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "FOR_BRACE", "FOR_BRACK", "IF", "IN", "LBRACE", "RBRACE", "ASSIGN", - "Identifier", "WS", "COMMENT", "LINE_COMMENT", "NEWLINE", "NumericLiteral", - "BooleanLiteral", "QUOTE", "NULL", "HEREDOC_START", "PLUS", "AND", "EQ", - "LT", "COLON", "LBRACK", "LPAREN", "MINUS", "OR", "NEQ", "GT", "QUESTION", - "RBRACK", "RPAREN", "MUL", "NOT", "LEQ", "DOT", "DIV", "GEQ", "ARROW", - "COMMA", "MOD", "ELLIPSIS", "TILDE", "TEMPLATE_INTERPOLATION_START", - "TemplateStringLiteral", "TemplateStringLiteralChar", "HTemplateLiteral", + null, "FOR_BRACE", "FOR_BRACK", "IF", "IN", "LBRACE", "RBRACE", "ASSIGN", + "Identifier", "WS", "COMMENT", "LINE_COMMENT", "NEWLINE", "NumericLiteral", + "BooleanLiteral", "QUOTE", "NULL", "HEREDOC_START", "PLUS", "AND", "EQ", + "LT", "COLON", "LBRACK", "LPAREN", "MINUS", "OR", "NEQ", "GT", "QUESTION", + "RBRACK", "RPAREN", "MUL", "NOT", "LEQ", "DOT", "DIV", "GEQ", "ARROW", + "COMMA", "MOD", "ELLIPSIS", "TILDE", "TEMPLATE_INTERPOLATION_START", + "TemplateStringLiteral", "TemplateStringLiteralChar", "HTemplateLiteral", "HTemplateLiteralChar" }; } @@ -504,7 +504,7 @@ public ExpressionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_expression; } - + public ExpressionContext() { } public void copyFrom(ExpressionContext ctx) { super.copyFrom(ctx); @@ -637,7 +637,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { setState(121); expression(2); } - } + } } setState(127); _errHandler.sync(this); @@ -662,7 +662,7 @@ public ExprTermContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_exprTerm; } - + public ExprTermContext() { } public void copyFrom(ExprTermContext ctx) { super.copyFrom(ctx); @@ -1010,7 +1010,7 @@ private ExprTermContext exprTerm(int _p) throws RecognitionException { } break; } - } + } } setState(151); _errHandler.sync(this); @@ -1259,7 +1259,7 @@ public final TupleContext tuple() throws RecognitionException { setState(165); expression(0); } - } + } } setState(170); _errHandler.sync(this); @@ -1990,7 +1990,7 @@ public final ArgumentsContext arguments() throws RecognitionException { setState(255); expression(0); } - } + } } setState(260); _errHandler.sync(this); @@ -2237,7 +2237,7 @@ public final AttrSplatContext attrSplat() throws RecognitionException { setState(277); getAttr(); } - } + } } setState(282); _errHandler.sync(this); @@ -2329,7 +2329,7 @@ public final FullSplatContext fullSplat() throws RecognitionException { default: throw new NoViableAltException(this); } - } + } } setState(292); _errHandler.sync(this); @@ -2824,7 +2824,7 @@ public TemplateExprContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_templateExpr; } - + public TemplateExprContext() { } public void copyFrom(TemplateExprContext ctx) { super.copyFrom(ctx); @@ -2906,7 +2906,7 @@ public final TemplateExprContext templateExpr() throws RecognitionException { match(HEREDOC_START); setState(321); match(Identifier); - setState(329); + setState(329); _errHandler.sync(this); _la = _input.LA(1); do { @@ -2930,7 +2930,7 @@ public final TemplateExprContext templateExpr() throws RecognitionException { } } } - setState(331); + setState(331); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==NEWLINE ); diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathLexer.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathLexer.java index 54b01b27054..e4ff51db26c 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathLexer.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathLexer.java @@ -31,11 +31,11 @@ public class JsonPathLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, - RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, - COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, - NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, - LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, + WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, + RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, + COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, + NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, + LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, TRUE=33, FALSE=34, NULL=35, MATCHES_REGEX_CLOSE=36, S=37, REGEX=38; public static final int MATCHES_REGEX=1; @@ -49,12 +49,12 @@ public class JsonPathLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", - "FALSE", "NULL", "ESCAPE_SEQUENCE", "UNICODE", "HEX_DIGIT", "SAFE_CODE_POINT", + "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + "FALSE", "NULL", "ESCAPE_SEQUENCE", "UNICODE", "HEX_DIGIT", "SAFE_CODE_POINT", "EXPONENT_PART", "MINUS", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } @@ -62,20 +62,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", - "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, - null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", + null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", + "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, + null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", null, "'=='", "'!='", "'true'", "'false'", "'null'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", "FALSE", "NULL", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathParser.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathParser.java index fdd8f4faa89..687e2a8d034 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathParser.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/JsonPathParser.java @@ -36,23 +36,23 @@ public class JsonPathParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, - RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, - COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, - NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, - LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, + WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, + RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, + COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, + NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, + LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, TRUE=33, FALSE=34, NULL=35, MATCHES_REGEX_CLOSE=36, S=37, REGEX=38; public static final int - RULE_jsonPath = 0, RULE_expression = 1, RULE_dotOperator = 2, RULE_recursiveDecent = 3, - RULE_bracketOperator = 4, RULE_filter = 5, RULE_filterExpression = 6, - RULE_binaryExpression = 7, RULE_containsExpression = 8, RULE_regexExpression = 9, - RULE_unaryExpression = 10, RULE_literalExpression = 11, RULE_property = 12, + RULE_jsonPath = 0, RULE_expression = 1, RULE_dotOperator = 2, RULE_recursiveDecent = 3, + RULE_bracketOperator = 4, RULE_filter = 5, RULE_filterExpression = 6, + RULE_binaryExpression = 7, RULE_containsExpression = 8, RULE_regexExpression = 9, + RULE_unaryExpression = 10, RULE_literalExpression = 11, RULE_property = 12, RULE_wildcard = 13, RULE_slice = 14, RULE_start = 15, RULE_end = 16, RULE_indexes = 17; private static String[] makeRuleNames() { return new String[] { - "jsonPath", "expression", "dotOperator", "recursiveDecent", "bracketOperator", - "filter", "filterExpression", "binaryExpression", "containsExpression", - "regexExpression", "unaryExpression", "literalExpression", "property", + "jsonPath", "expression", "dotOperator", "recursiveDecent", "bracketOperator", + "filter", "filterExpression", "binaryExpression", "containsExpression", + "regexExpression", "unaryExpression", "literalExpression", "property", "wildcard", "slice", "start", "end", "indexes" }; } @@ -60,20 +60,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", - "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, - null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", + null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", + "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, + null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", null, "'=='", "'!='", "'true'", "'false'", "'null'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", "FALSE", "NULL", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } @@ -174,7 +174,7 @@ public final JsonPathContext jsonPath() throws RecognitionException { } } - setState(40); + setState(40); _errHandler.sync(this); _alt = 1; do { @@ -190,7 +190,7 @@ public final JsonPathContext jsonPath() throws RecognitionException { default: throw new NoViableAltException(this); } - setState(42); + setState(42); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,1,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -475,7 +475,7 @@ public final BracketOperatorContext bracketOperator() throws RecognitionExceptio break; case 4: { - setState(63); + setState(63); _errHandler.sync(this); _la = _input.LA(1); do { @@ -485,7 +485,7 @@ public final BracketOperatorContext bracketOperator() throws RecognitionExceptio property(); } } - setState(65); + setState(65); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==Identifier || _la==StringLiteral ); @@ -548,7 +548,7 @@ public final FilterContext filter() throws RecognitionException { match(QUESTION); setState(72); match(LPAREN); - setState(74); + setState(74); _errHandler.sync(this); _la = _input.LA(1); do { @@ -558,7 +558,7 @@ public final FilterContext filter() throws RecognitionException { filterExpression(); } } - setState(76); + setState(76); _errHandler.sync(this); _la = _input.LA(1); } while ( ((_la) & ~0x3f) == 0 && ((1L << _la) & 60137421888L) != 0 ); @@ -853,7 +853,7 @@ private BinaryExpressionContext binaryExpression(int _p) throws RecognitionExcep } break; } - } + } } setState(134); _errHandler.sync(this); @@ -1482,7 +1482,7 @@ public final IndexesContext indexes() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(187); + setState(187); _errHandler.sync(this); _la = _input.LA(1); do { @@ -1492,7 +1492,7 @@ public final IndexesContext indexes() throws RecognitionException { match(PositiveNumber); } } - setState(189); + setState(189); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==PositiveNumber ); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java index c27e1a3cf1f..cc13dd44d7e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java @@ -32,7 +32,7 @@ public interface JavaTypeSignatureBuilder { * @return The type signature. If t is null, the signature is {undefined}. */ String signature(@Nullable Object type); - + /** * @param type An array type. * @return Formatted like Integer[]. diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureLexer.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureLexer.java index c5f2864b95e..6dd25a1d182 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureLexer.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureLexer.java @@ -30,9 +30,9 @@ public class AnnotationSignatureLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - IntegerLiteral=1, FloatingPointLiteral=2, BooleanLiteral=3, CharacterLiteral=4, - StringLiteral=5, LPAREN=6, RPAREN=7, LBRACK=8, RBRACK=9, COMMA=10, DOT=11, - ASSIGN=12, COLON=13, ADD=14, SUB=15, AND=16, OR=17, AT=18, ELLIPSIS=19, + IntegerLiteral=1, FloatingPointLiteral=2, BooleanLiteral=3, CharacterLiteral=4, + StringLiteral=5, LPAREN=6, RPAREN=7, LBRACK=8, RBRACK=9, COMMA=10, DOT=11, + ASSIGN=12, COLON=13, ADD=14, SUB=15, AND=16, OR=17, AT=18, ELLIPSIS=19, DOTDOT=20, SPACE=21, Identifier=22; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -44,18 +44,18 @@ public class AnnotationSignatureLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "IntegerLiteral", "DecimalIntegerLiteral", "HexIntegerLiteral", "OctalIntegerLiteral", - "BinaryIntegerLiteral", "IntegerTypeSuffix", "DecimalNumeral", "Digits", - "Digit", "NonZeroDigit", "DigitOrUnderscore", "Underscores", "HexNumeral", - "HexDigits", "HexDigit", "HexDigitOrUnderscore", "OctalNumeral", "OctalDigits", - "OctalDigit", "OctalDigitOrUnderscore", "BinaryNumeral", "BinaryDigits", - "BinaryDigit", "BinaryDigitOrUnderscore", "FloatingPointLiteral", "DecimalFloatingPointLiteral", - "ExponentPart", "ExponentIndicator", "SignedInteger", "Sign", "FloatTypeSuffix", - "HexadecimalFloatingPointLiteral", "HexSignificand", "BinaryExponent", - "BinaryExponentIndicator", "BooleanLiteral", "CharacterLiteral", "SingleCharacter", - "StringLiteral", "StringCharacters", "StringCharacter", "EscapeSequence", - "OctalEscape", "UnicodeEscape", "ZeroToThree", "LPAREN", "RPAREN", "LBRACK", - "RBRACK", "COMMA", "DOT", "ASSIGN", "COLON", "ADD", "SUB", "AND", "OR", + "IntegerLiteral", "DecimalIntegerLiteral", "HexIntegerLiteral", "OctalIntegerLiteral", + "BinaryIntegerLiteral", "IntegerTypeSuffix", "DecimalNumeral", "Digits", + "Digit", "NonZeroDigit", "DigitOrUnderscore", "Underscores", "HexNumeral", + "HexDigits", "HexDigit", "HexDigitOrUnderscore", "OctalNumeral", "OctalDigits", + "OctalDigit", "OctalDigitOrUnderscore", "BinaryNumeral", "BinaryDigits", + "BinaryDigit", "BinaryDigitOrUnderscore", "FloatingPointLiteral", "DecimalFloatingPointLiteral", + "ExponentPart", "ExponentIndicator", "SignedInteger", "Sign", "FloatTypeSuffix", + "HexadecimalFloatingPointLiteral", "HexSignificand", "BinaryExponent", + "BinaryExponentIndicator", "BooleanLiteral", "CharacterLiteral", "SingleCharacter", + "StringLiteral", "StringCharacters", "StringCharacter", "EscapeSequence", + "OctalEscape", "UnicodeEscape", "ZeroToThree", "LPAREN", "RPAREN", "LBRACK", + "RBRACK", "COMMA", "DOT", "ASSIGN", "COLON", "ADD", "SUB", "AND", "OR", "AT", "ELLIPSIS", "DOTDOT", "SPACE", "Identifier", "JavaLetter", "JavaLetterOrDigit" }; } @@ -63,17 +63,17 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, null, null, null, null, "'('", "')'", "'['", "']'", "','", - "'.'", "'='", "':'", "'+'", "'-'", "'&&'", "'||'", "'@'", "'...'", "'..'", + null, null, null, null, null, null, "'('", "')'", "'['", "']'", "','", + "'.'", "'='", "':'", "'+'", "'-'", "'&&'", "'||'", "'@'", "'...'", "'..'", "' '" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "IntegerLiteral", "FloatingPointLiteral", "BooleanLiteral", "CharacterLiteral", - "StringLiteral", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", "DOT", - "ASSIGN", "COLON", "ADD", "SUB", "AND", "OR", "AT", "ELLIPSIS", "DOTDOT", + null, "IntegerLiteral", "FloatingPointLiteral", "BooleanLiteral", "CharacterLiteral", + "StringLiteral", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", "DOT", + "ASSIGN", "COLON", "ADD", "SUB", "AND", "OR", "AT", "ELLIPSIS", "DOTDOT", "SPACE", "Identifier" }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureParser.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureParser.java index a36d8d41798..c08b31d1a93 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureParser.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/AnnotationSignatureParser.java @@ -35,18 +35,18 @@ public class AnnotationSignatureParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - IntegerLiteral=1, FloatingPointLiteral=2, BooleanLiteral=3, CharacterLiteral=4, - StringLiteral=5, LPAREN=6, RPAREN=7, LBRACK=8, RBRACK=9, COMMA=10, DOT=11, - ASSIGN=12, COLON=13, ADD=14, SUB=15, AND=16, OR=17, AT=18, ELLIPSIS=19, + IntegerLiteral=1, FloatingPointLiteral=2, BooleanLiteral=3, CharacterLiteral=4, + StringLiteral=5, LPAREN=6, RPAREN=7, LBRACK=8, RBRACK=9, COMMA=10, DOT=11, + ASSIGN=12, COLON=13, ADD=14, SUB=15, AND=16, OR=17, AT=18, ELLIPSIS=19, DOTDOT=20, SPACE=21, Identifier=22; public static final int - RULE_annotation = 0, RULE_annotationName = 1, RULE_qualifiedName = 2, - RULE_elementValuePairs = 3, RULE_elementValuePair = 4, RULE_elementValue = 5, + RULE_annotation = 0, RULE_annotationName = 1, RULE_qualifiedName = 2, + RULE_elementValuePairs = 3, RULE_elementValuePair = 4, RULE_elementValue = 5, RULE_primary = 6, RULE_type = 7, RULE_classOrInterfaceType = 8, RULE_literal = 9; private static String[] makeRuleNames() { return new String[] { - "annotation", "annotationName", "qualifiedName", "elementValuePairs", - "elementValuePair", "elementValue", "primary", "type", "classOrInterfaceType", + "annotation", "annotationName", "qualifiedName", "elementValuePairs", + "elementValuePair", "elementValue", "primary", "type", "classOrInterfaceType", "literal" }; } @@ -54,17 +54,17 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, null, null, null, null, "'('", "')'", "'['", "']'", "','", - "'.'", "'='", "':'", "'+'", "'-'", "'&&'", "'||'", "'@'", "'...'", "'..'", + null, null, null, null, null, null, "'('", "')'", "'['", "']'", "','", + "'.'", "'='", "':'", "'+'", "'-'", "'&&'", "'||'", "'@'", "'...'", "'..'", "' '" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "IntegerLiteral", "FloatingPointLiteral", "BooleanLiteral", "CharacterLiteral", - "StringLiteral", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", "DOT", - "ASSIGN", "COLON", "ADD", "SUB", "AND", "OR", "AT", "ELLIPSIS", "DOTDOT", + null, "IntegerLiteral", "FloatingPointLiteral", "BooleanLiteral", "CharacterLiteral", + "StringLiteral", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", "DOT", + "ASSIGN", "COLON", "ADD", "SUB", "AND", "OR", "AT", "ELLIPSIS", "DOTDOT", "SPACE", "Identifier" }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureLexer.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureLexer.java index 3fc43612a44..a8a5a89152a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureLexer.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureLexer.java @@ -31,8 +31,8 @@ public class MethodSignatureLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - CONSTRUCTOR=1, LPAREN=2, RPAREN=3, LBRACK=4, RBRACK=5, COMMA=6, DOT=7, - BANG=8, WILDCARD=9, AND=10, OR=11, ELLIPSIS=12, DOTDOT=13, POUND=14, SPACE=15, + CONSTRUCTOR=1, LPAREN=2, RPAREN=3, LBRACK=4, RBRACK=5, COMMA=6, DOT=7, + BANG=8, WILDCARD=9, AND=10, OR=11, ELLIPSIS=12, DOTDOT=13, POUND=14, SPACE=15, Identifier=16; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -44,8 +44,8 @@ public class MethodSignatureLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "CONSTRUCTOR", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", "DOT", - "BANG", "WILDCARD", "AND", "OR", "ELLIPSIS", "DOTDOT", "POUND", "SPACE", + "CONSTRUCTOR", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", "DOT", + "BANG", "WILDCARD", "AND", "OR", "ELLIPSIS", "DOTDOT", "POUND", "SPACE", "Identifier", "JavaLetter", "JavaLetterOrDigit" }; } @@ -53,15 +53,15 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, "''", "'('", "')'", "'['", "']'", "','", "'.'", "'!'", + null, "''", "'('", "')'", "'['", "']'", "','", "'.'", "'!'", "'*'", "'&&'", "'||'", "'...'", "'..'", "'#'", "' '" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "CONSTRUCTOR", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", - "DOT", "BANG", "WILDCARD", "AND", "OR", "ELLIPSIS", "DOTDOT", "POUND", + null, "CONSTRUCTOR", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", + "DOT", "BANG", "WILDCARD", "AND", "OR", "ELLIPSIS", "DOTDOT", "POUND", "SPACE", "Identifier" }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureParser.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureParser.java index 679eba572eb..e2c6f0e49b0 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureParser.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/MethodSignatureParser.java @@ -36,18 +36,18 @@ public class MethodSignatureParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - CONSTRUCTOR=1, LPAREN=2, RPAREN=3, LBRACK=4, RBRACK=5, COMMA=6, DOT=7, - BANG=8, WILDCARD=9, AND=10, OR=11, ELLIPSIS=12, DOTDOT=13, POUND=14, SPACE=15, + CONSTRUCTOR=1, LPAREN=2, RPAREN=3, LBRACK=4, RBRACK=5, COMMA=6, DOT=7, + BANG=8, WILDCARD=9, AND=10, OR=11, ELLIPSIS=12, DOTDOT=13, POUND=14, SPACE=15, Identifier=16; public static final int - RULE_methodPattern = 0, RULE_formalParametersPattern = 1, RULE_formalsPattern = 2, - RULE_dotDot = 3, RULE_formalsPatternAfterDotDot = 4, RULE_optionalParensTypePattern = 5, - RULE_targetTypePattern = 6, RULE_formalTypePattern = 7, RULE_classNameOrInterface = 8, + RULE_methodPattern = 0, RULE_formalParametersPattern = 1, RULE_formalsPattern = 2, + RULE_dotDot = 3, RULE_formalsPatternAfterDotDot = 4, RULE_optionalParensTypePattern = 5, + RULE_targetTypePattern = 6, RULE_formalTypePattern = 7, RULE_classNameOrInterface = 8, RULE_simpleNamePattern = 9; private static String[] makeRuleNames() { return new String[] { - "methodPattern", "formalParametersPattern", "formalsPattern", "dotDot", - "formalsPatternAfterDotDot", "optionalParensTypePattern", "targetTypePattern", + "methodPattern", "formalParametersPattern", "formalsPattern", "dotDot", + "formalsPatternAfterDotDot", "optionalParensTypePattern", "targetTypePattern", "formalTypePattern", "classNameOrInterface", "simpleNamePattern" }; } @@ -55,15 +55,15 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, "''", "'('", "')'", "'['", "']'", "','", "'.'", "'!'", + null, "''", "'('", "')'", "'['", "']'", "','", "'.'", "'!'", "'*'", "'&&'", "'||'", "'...'", "'..'", "'#'", "' '" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "CONSTRUCTOR", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", - "DOT", "BANG", "WILDCARD", "AND", "OR", "ELLIPSIS", "DOTDOT", "POUND", + null, "CONSTRUCTOR", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "COMMA", + "DOT", "BANG", "WILDCARD", "AND", "OR", "ELLIPSIS", "DOTDOT", "POUND", "SPACE", "Identifier" }; } @@ -370,7 +370,7 @@ public final FormalsPatternContext formalsPattern() throws RecognitionException setState(48); formalsPatternAfterDotDot(); } - } + } } setState(53); _errHandler.sync(this); @@ -409,7 +409,7 @@ public final FormalsPatternContext formalsPattern() throws RecognitionException setState(62); formalsPattern(); } - } + } } setState(67); _errHandler.sync(this); @@ -564,7 +564,7 @@ public final FormalsPatternAfterDotDotContext formalsPatternAfterDotDot() throws setState(83); formalsPatternAfterDotDot(); } - } + } } setState(88); _errHandler.sync(this); @@ -772,7 +772,7 @@ private TargetTypePatternContext targetTypePattern(int _p) throws RecognitionExc } break; } - } + } } setState(117); _errHandler.sync(this); @@ -899,7 +899,7 @@ private FormalTypePatternContext formalTypePattern(int _p) throws RecognitionExc } break; } - } + } } setState(134); _errHandler.sync(this); @@ -971,7 +971,7 @@ public final ClassNameOrInterfaceContext classNameOrInterface() throws Recogniti int _alt; enterOuterAlt(_localctx, 1); { - setState(136); + setState(136); _errHandler.sync(this); _alt = 1; do { @@ -995,7 +995,7 @@ public final ClassNameOrInterfaceContext classNameOrInterface() throws Recogniti default: throw new NoViableAltException(this); } - setState(138); + setState(138); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,18,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -1011,7 +1011,7 @@ public final ClassNameOrInterfaceContext classNameOrInterface() throws Recogniti setState(141); match(RBRACK); } - } + } } setState(146); _errHandler.sync(this); @@ -1086,7 +1086,7 @@ public final SimpleNamePatternContext simpleNamePattern() throws RecognitionExce setState(149); match(Identifier); } - } + } } setState(154); _errHandler.sync(this); @@ -1121,7 +1121,7 @@ public final SimpleNamePatternContext simpleNamePattern() throws RecognitionExce setState(160); match(WILDCARD); } - } + } } setState(165); _errHandler.sync(this); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterLexer.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterLexer.java index 195399da966..fa1d6b3708c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterLexer.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterLexer.java @@ -30,7 +30,7 @@ public class TemplateParameterLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - LPAREN=1, RPAREN=2, DOT=3, COLON=4, COMMA=5, LBRACK=6, RBRACK=7, WILDCARD=8, + LPAREN=1, RPAREN=2, DOT=3, COLON=4, COMMA=5, LBRACK=6, RBRACK=7, WILDCARD=8, Variance=9, FullyQualifiedName=10, Number=11, Identifier=12, S=13; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -42,8 +42,8 @@ public class TemplateParameterLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "LPAREN", "RPAREN", "DOT", "COLON", "COMMA", "LBRACK", "RBRACK", "WILDCARD", - "Variance", "FullyQualifiedName", "Number", "Identifier", "JavaLetter", + "LPAREN", "RPAREN", "DOT", "COLON", "COMMA", "LBRACK", "RBRACK", "WILDCARD", + "Variance", "FullyQualifiedName", "Number", "Identifier", "JavaLetter", "JavaLetterOrDigit", "S" }; } @@ -57,8 +57,8 @@ private static String[] makeLiteralNames() { private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "LPAREN", "RPAREN", "DOT", "COLON", "COMMA", "LBRACK", "RBRACK", - "WILDCARD", "Variance", "FullyQualifiedName", "Number", "Identifier", + null, "LPAREN", "RPAREN", "DOT", "COLON", "COMMA", "LBRACK", "RBRACK", + "WILDCARD", "Variance", "FullyQualifiedName", "Number", "Identifier", "S" }; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterParser.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterParser.java index 01d3d651a7b..3c5c14cbdc6 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterParser.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/grammar/TemplateParameterParser.java @@ -35,15 +35,15 @@ public class TemplateParameterParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - LPAREN=1, RPAREN=2, DOT=3, COLON=4, COMMA=5, LBRACK=6, RBRACK=7, WILDCARD=8, + LPAREN=1, RPAREN=2, DOT=3, COLON=4, COMMA=5, LBRACK=6, RBRACK=7, WILDCARD=8, Variance=9, FullyQualifiedName=10, Number=11, Identifier=12, S=13; public static final int - RULE_matcherPattern = 0, RULE_typedPattern = 1, RULE_patternType = 2, - RULE_type = 3, RULE_typeParameter = 4, RULE_variance = 5, RULE_parameterName = 6, + RULE_matcherPattern = 0, RULE_typedPattern = 1, RULE_patternType = 2, + RULE_type = 3, RULE_typeParameter = 4, RULE_variance = 5, RULE_parameterName = 6, RULE_typeName = 7, RULE_matcherName = 8; private static String[] makeRuleNames() { return new String[] { - "matcherPattern", "typedPattern", "patternType", "type", "typeParameter", + "matcherPattern", "typedPattern", "patternType", "type", "typeParameter", "variance", "parameterName", "typeName", "matcherName" }; } @@ -57,8 +57,8 @@ private static String[] makeLiteralNames() { private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "LPAREN", "RPAREN", "DOT", "COLON", "COMMA", "LBRACK", "RBRACK", - "WILDCARD", "Variance", "FullyQualifiedName", "Number", "Identifier", + null, "LPAREN", "RPAREN", "DOT", "COLON", "COMMA", "LBRACK", "RBRACK", + "WILDCARD", "Variance", "FullyQualifiedName", "Number", "Identifier", "S" }; } @@ -365,7 +365,7 @@ public final TypeContext type() throws RecognitionException { setState(39); match(COMMA); } - } + } } setState(45); _errHandler.sync(this); diff --git a/rewrite-java/src/test/java/org/openrewrite/java/style/StyleHelperTest.java b/rewrite-java/src/test/java/org/openrewrite/java/style/StyleHelperTest.java index a4d6cd096b1..3e81020b115 100755 --- a/rewrite-java/src/test/java/org/openrewrite/java/style/StyleHelperTest.java +++ b/rewrite-java/src/test/java/org/openrewrite/java/style/StyleHelperTest.java @@ -24,7 +24,7 @@ class StyleHelperTest { @Test void mergeTabsAndIndentsStyles() { - var merged = StyleHelper.merge(IntelliJ.tabsAndIndents(), + var merged = StyleHelper.merge(IntelliJ.tabsAndIndents(), new TabsAndIndentsStyle(true, 1, 1, 2, true, new TabsAndIndentsStyle.MethodDeclarationParameters(true))); assertThat(merged.getUseTabCharacter()).isTrue(); assertThat(merged.getTabSize()).isEqualTo(1); diff --git a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Lexer.java b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Lexer.java index 04f0c8f848c..b9885bbebfd 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Lexer.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Lexer.java @@ -31,8 +31,8 @@ public class JSON5Lexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, SINGLE_LINE_COMMENT=7, - MULTI_LINE_COMMENT=8, LITERAL=9, STRING=10, NUMBER=11, NUMERIC_LITERAL=12, + T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, SINGLE_LINE_COMMENT=7, + MULTI_LINE_COMMENT=8, LITERAL=9, STRING=10, NUMBER=11, NUMERIC_LITERAL=12, SYMBOL=13, IDENTIFIER=14, WS=15, UTF_8_BOM=16; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -44,10 +44,10 @@ public class JSON5Lexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "SINGLE_LINE_COMMENT", - "MULTI_LINE_COMMENT", "LITERAL", "STRING", "DOUBLE_QUOTE_CHAR", "SINGLE_QUOTE_CHAR", - "ESCAPE_SEQUENCE", "NUMBER", "NUMERIC_LITERAL", "SYMBOL", "HEX", "INT", - "EXP", "IDENTIFIER", "IDENTIFIER_START", "IDENTIFIER_PART", "UNICODE_SEQUENCE", + "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "SINGLE_LINE_COMMENT", + "MULTI_LINE_COMMENT", "LITERAL", "STRING", "DOUBLE_QUOTE_CHAR", "SINGLE_QUOTE_CHAR", + "ESCAPE_SEQUENCE", "NUMBER", "NUMERIC_LITERAL", "SYMBOL", "HEX", "INT", + "EXP", "IDENTIFIER", "IDENTIFIER_START", "IDENTIFIER_PART", "UNICODE_SEQUENCE", "NEWLINE", "WS", "UTF_8_BOM" }; } @@ -55,15 +55,15 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, "'{'", "','", "'}'", "':'", "'['", "']'", null, null, null, null, + null, "'{'", "','", "'}'", "':'", "'['", "']'", null, null, null, null, null, null, null, null, null, "'\\uFEFF'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, null, null, null, null, null, null, "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", - "LITERAL", "STRING", "NUMBER", "NUMERIC_LITERAL", "SYMBOL", "IDENTIFIER", + null, null, null, null, null, null, null, "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", + "LITERAL", "STRING", "NUMBER", "NUMERIC_LITERAL", "SYMBOL", "IDENTIFIER", "WS", "UTF_8_BOM" }; } diff --git a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Parser.java b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Parser.java index 7a1f046f4d4..8ca8ff43d66 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Parser.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JSON5Parser.java @@ -36,11 +36,11 @@ public class JSON5Parser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, SINGLE_LINE_COMMENT=7, - MULTI_LINE_COMMENT=8, LITERAL=9, STRING=10, NUMBER=11, NUMERIC_LITERAL=12, + T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, SINGLE_LINE_COMMENT=7, + MULTI_LINE_COMMENT=8, LITERAL=9, STRING=10, NUMBER=11, NUMERIC_LITERAL=12, SYMBOL=13, IDENTIFIER=14, WS=15, UTF_8_BOM=16; public static final int - RULE_json5 = 0, RULE_obj = 1, RULE_member = 2, RULE_key = 3, RULE_value = 4, + RULE_json5 = 0, RULE_obj = 1, RULE_member = 2, RULE_key = 3, RULE_value = 4, RULE_arr = 5, RULE_number = 6; private static String[] makeRuleNames() { return new String[] { @@ -51,15 +51,15 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, "'{'", "','", "'}'", "':'", "'['", "']'", null, null, null, null, + null, "'{'", "','", "'}'", "':'", "'['", "']'", null, null, null, null, null, null, null, null, null, "'\\uFEFF'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, null, null, null, null, null, null, "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", - "LITERAL", "STRING", "NUMBER", "NUMERIC_LITERAL", "SYMBOL", "IDENTIFIER", + null, null, null, null, null, null, null, "SINGLE_LINE_COMMENT", "MULTI_LINE_COMMENT", + "LITERAL", "STRING", "NUMBER", "NUMERIC_LITERAL", "SYMBOL", "IDENTIFIER", "WS", "UTF_8_BOM" }; } @@ -226,7 +226,7 @@ public final ObjContext obj() throws RecognitionException { setState(22); member(); } - } + } } setState(27); _errHandler.sync(this); @@ -519,7 +519,7 @@ public final ArrContext arr() throws RecognitionException { setState(53); value(); } - } + } } setState(58); _errHandler.sync(this); diff --git a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathLexer.java b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathLexer.java index c2b0b762a50..cdcc1710e0d 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathLexer.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathLexer.java @@ -31,11 +31,11 @@ public class JsonPathLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, - RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, - COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, - NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, - LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, + WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, + RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, + COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, + NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, + LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, TRUE=33, FALSE=34, NULL=35, MATCHES_REGEX_CLOSE=36, S=37, REGEX=38; public static final int MATCHES_REGEX=1; @@ -49,12 +49,12 @@ public class JsonPathLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", - "FALSE", "NULL", "ESCAPE_SEQUENCE", "UNICODE", "HEX_DIGIT", "SAFE_CODE_POINT", + "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + "FALSE", "NULL", "ESCAPE_SEQUENCE", "UNICODE", "HEX_DIGIT", "SAFE_CODE_POINT", "EXPONENT_PART", "MINUS", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } @@ -62,20 +62,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", - "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, - null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", + null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", + "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, + null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", null, "'=='", "'!='", "'true'", "'false'", "'null'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", "FALSE", "NULL", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } diff --git a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathParser.java b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathParser.java index 6cd4e424cb1..40f6a09ae1d 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathParser.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/internal/grammar/JsonPathParser.java @@ -36,23 +36,23 @@ public class JsonPathParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, - RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, - COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, - NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, - LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, + WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, + RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, + COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, + NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, + LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, TRUE=33, FALSE=34, NULL=35, MATCHES_REGEX_CLOSE=36, S=37, REGEX=38; public static final int - RULE_jsonPath = 0, RULE_expression = 1, RULE_dotOperator = 2, RULE_recursiveDecent = 3, - RULE_bracketOperator = 4, RULE_filter = 5, RULE_filterExpression = 6, - RULE_binaryExpression = 7, RULE_containsExpression = 8, RULE_regexExpression = 9, - RULE_unaryExpression = 10, RULE_literalExpression = 11, RULE_property = 12, + RULE_jsonPath = 0, RULE_expression = 1, RULE_dotOperator = 2, RULE_recursiveDecent = 3, + RULE_bracketOperator = 4, RULE_filter = 5, RULE_filterExpression = 6, + RULE_binaryExpression = 7, RULE_containsExpression = 8, RULE_regexExpression = 9, + RULE_unaryExpression = 10, RULE_literalExpression = 11, RULE_property = 12, RULE_wildcard = 13, RULE_slice = 14, RULE_start = 15, RULE_end = 16, RULE_indexes = 17; private static String[] makeRuleNames() { return new String[] { - "jsonPath", "expression", "dotOperator", "recursiveDecent", "bracketOperator", - "filter", "filterExpression", "binaryExpression", "containsExpression", - "regexExpression", "unaryExpression", "literalExpression", "property", + "jsonPath", "expression", "dotOperator", "recursiveDecent", "bracketOperator", + "filter", "filterExpression", "binaryExpression", "containsExpression", + "regexExpression", "unaryExpression", "literalExpression", "property", "wildcard", "slice", "start", "end", "indexes" }; } @@ -60,20 +60,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", - "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, - null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", + null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", + "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, + null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", null, "'=='", "'!='", "'true'", "'false'", "'null'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", "FALSE", "NULL", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } @@ -174,7 +174,7 @@ public final JsonPathContext jsonPath() throws RecognitionException { } } - setState(40); + setState(40); _errHandler.sync(this); _alt = 1; do { @@ -190,7 +190,7 @@ public final JsonPathContext jsonPath() throws RecognitionException { default: throw new NoViableAltException(this); } - setState(42); + setState(42); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,1,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -475,7 +475,7 @@ public final BracketOperatorContext bracketOperator() throws RecognitionExceptio break; case 4: { - setState(63); + setState(63); _errHandler.sync(this); _la = _input.LA(1); do { @@ -485,7 +485,7 @@ public final BracketOperatorContext bracketOperator() throws RecognitionExceptio property(); } } - setState(65); + setState(65); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==Identifier || _la==StringLiteral ); @@ -548,7 +548,7 @@ public final FilterContext filter() throws RecognitionException { match(QUESTION); setState(72); match(LPAREN); - setState(74); + setState(74); _errHandler.sync(this); _la = _input.LA(1); do { @@ -558,7 +558,7 @@ public final FilterContext filter() throws RecognitionException { filterExpression(); } } - setState(76); + setState(76); _errHandler.sync(this); _la = _input.LA(1); } while ( ((_la) & ~0x3f) == 0 && ((1L << _la) & 60137421888L) != 0 ); @@ -853,7 +853,7 @@ private BinaryExpressionContext binaryExpression(int _p) throws RecognitionExcep } break; } - } + } } setState(134); _errHandler.sync(this); @@ -1482,7 +1482,7 @@ public final IndexesContext indexes() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(187); + setState(187); _errHandler.sync(this); _la = _input.LA(1); do { @@ -1492,7 +1492,7 @@ public final IndexesContext indexes() throws RecognitionException { match(PositiveNumber); } } - setState(189); + setState(189); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==PositiveNumber ); diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeLexer.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeLexer.java index f14f64791b3..5fbb76fbf44 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeLexer.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeLexer.java @@ -31,7 +31,7 @@ public class VersionRangeLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - COMMA=1, PROPERTY_OPEN=2, PROPERTY_CLOSE=3, OPEN_RANGE_OPEN=4, OPEN_RANGE_CLOSE=5, + COMMA=1, PROPERTY_OPEN=2, PROPERTY_CLOSE=3, OPEN_RANGE_OPEN=4, OPEN_RANGE_CLOSE=5, CLOSED_RANGE_OPEN=6, CLOSED_RANGE_CLOSE=7, Version=8, WS=9; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -43,7 +43,7 @@ public class VersionRangeLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "COMMA", "PROPERTY_OPEN", "PROPERTY_CLOSE", "OPEN_RANGE_OPEN", "OPEN_RANGE_CLOSE", + "COMMA", "PROPERTY_OPEN", "PROPERTY_CLOSE", "OPEN_RANGE_OPEN", "OPEN_RANGE_CLOSE", "CLOSED_RANGE_OPEN", "CLOSED_RANGE_CLOSE", "Version", "WS" }; } @@ -57,8 +57,8 @@ private static String[] makeLiteralNames() { private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "COMMA", "PROPERTY_OPEN", "PROPERTY_CLOSE", "OPEN_RANGE_OPEN", - "OPEN_RANGE_CLOSE", "CLOSED_RANGE_OPEN", "CLOSED_RANGE_CLOSE", "Version", + null, "COMMA", "PROPERTY_OPEN", "PROPERTY_CLOSE", "OPEN_RANGE_OPEN", + "OPEN_RANGE_CLOSE", "CLOSED_RANGE_OPEN", "CLOSED_RANGE_CLOSE", "Version", "WS" }; } diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeParser.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeParser.java index 68f169335f5..515aecdd9dd 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeParser.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/grammar/VersionRangeParser.java @@ -36,14 +36,14 @@ public class VersionRangeParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - COMMA=1, PROPERTY_OPEN=2, PROPERTY_CLOSE=3, OPEN_RANGE_OPEN=4, OPEN_RANGE_CLOSE=5, + COMMA=1, PROPERTY_OPEN=2, PROPERTY_CLOSE=3, OPEN_RANGE_OPEN=4, OPEN_RANGE_CLOSE=5, CLOSED_RANGE_OPEN=6, CLOSED_RANGE_CLOSE=7, Version=8, WS=9; public static final int - RULE_versionRequirement = 0, RULE_range = 1, RULE_bounds = 2, RULE_exactly = 3, + RULE_versionRequirement = 0, RULE_range = 1, RULE_bounds = 2, RULE_exactly = 3, RULE_boundedLower = 4, RULE_unboundedLower = 5, RULE_version = 6; private static String[] makeRuleNames() { return new String[] { - "versionRequirement", "range", "bounds", "exactly", "boundedLower", "unboundedLower", + "versionRequirement", "range", "bounds", "exactly", "boundedLower", "unboundedLower", "version" }; } @@ -57,8 +57,8 @@ private static String[] makeLiteralNames() { private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "COMMA", "PROPERTY_OPEN", "PROPERTY_CLOSE", "OPEN_RANGE_OPEN", - "OPEN_RANGE_CLOSE", "CLOSED_RANGE_OPEN", "CLOSED_RANGE_CLOSE", "Version", + null, "COMMA", "PROPERTY_OPEN", "PROPERTY_CLOSE", "OPEN_RANGE_OPEN", + "OPEN_RANGE_CLOSE", "CLOSED_RANGE_OPEN", "CLOSED_RANGE_CLOSE", "Version", "WS" }; } diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java b/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java index 13d90e23f21..42068287f44 100755 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java @@ -195,7 +195,7 @@ private Properties.Entry entryFromLine(String line, String prefix, StringBuilder equalsPrefix = new StringBuilder(), valuePrefix = new StringBuilder(), value = new StringBuilder(); - + Properties.Entry.Delimiter delimiter = Properties.Entry.Delimiter.NONE; char prev = '$'; State state = State.WHITESPACE_BEFORE_KEY; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Lexer.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Lexer.java index c90bb2647b2..c816cc4ab29 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Lexer.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Lexer.java @@ -31,15 +31,15 @@ public class Protobuf2Lexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - SEMI=1, COLON=2, BOOL=3, BYTES=4, DOUBLE=5, ENUM=6, EXTEND=7, FIXED32=8, - FIXED64=9, FLOAT=10, IMPORT=11, INT32=12, INT64=13, MAP=14, MESSAGE=15, - ONEOF=16, OPTION=17, PACKAGE=18, PUBLIC=19, REPEATED=20, REQUIRED=21, - RESERVED=22, RETURNS=23, RPC=24, SERVICE=25, SFIXED32=26, SFIXED64=27, - SINT32=28, SINT64=29, STREAM=30, STRING=31, SYNTAX=32, TO=33, UINT32=34, - UINT64=35, WEAK=36, OPTIONAL=37, Ident=38, IntegerLiteral=39, NumericLiteral=40, - FloatLiteral=41, BooleanLiteral=42, StringLiteral=43, Quote=44, LPAREN=45, - RPAREN=46, LBRACE=47, RBRACE=48, LBRACK=49, RBRACK=50, LCHEVR=51, RCHEVR=52, - COMMA=53, DOT=54, MINUS=55, PLUS=56, ASSIGN=57, WS=58, UTF_8_BOM=59, COMMENT=60, + SEMI=1, COLON=2, BOOL=3, BYTES=4, DOUBLE=5, ENUM=6, EXTEND=7, FIXED32=8, + FIXED64=9, FLOAT=10, IMPORT=11, INT32=12, INT64=13, MAP=14, MESSAGE=15, + ONEOF=16, OPTION=17, PACKAGE=18, PUBLIC=19, REPEATED=20, REQUIRED=21, + RESERVED=22, RETURNS=23, RPC=24, SERVICE=25, SFIXED32=26, SFIXED64=27, + SINT32=28, SINT64=29, STREAM=30, STRING=31, SYNTAX=32, TO=33, UINT32=34, + UINT64=35, WEAK=36, OPTIONAL=37, Ident=38, IntegerLiteral=39, NumericLiteral=40, + FloatLiteral=41, BooleanLiteral=42, StringLiteral=43, Quote=44, LPAREN=45, + RPAREN=46, LBRACE=47, RBRACE=48, LBRACK=49, RBRACK=50, LCHEVR=51, RCHEVR=52, + COMMA=53, DOT=54, MINUS=55, PLUS=56, ASSIGN=57, WS=58, UTF_8_BOM=59, COMMENT=60, LINE_COMMENT=61; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" @@ -51,16 +51,16 @@ public class Protobuf2Lexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "SEMI", "COLON", "BOOL", "BYTES", "DOUBLE", "ENUM", "EXTEND", "FIXED32", - "FIXED64", "FLOAT", "IMPORT", "INT32", "INT64", "MAP", "MESSAGE", "ONEOF", - "OPTION", "PACKAGE", "PUBLIC", "REPEATED", "REQUIRED", "RESERVED", "RETURNS", - "RPC", "SERVICE", "SFIXED32", "SFIXED64", "SINT32", "SINT64", "STREAM", - "STRING", "SYNTAX", "TO", "UINT32", "UINT64", "WEAK", "OPTIONAL", "Letter", - "DecimalDigit", "OctalDigit", "HexDigit", "Ident", "IntegerLiteral", - "NumericLiteral", "DecimalLiteral", "OctalLiteral", "HexLiteral", "FloatLiteral", - "Decimals", "Exponent", "BooleanLiteral", "StringLiteral", "CharValue", - "HexEscape", "OctEscape", "CharEscape", "Quote", "LPAREN", "RPAREN", - "LBRACE", "RBRACE", "LBRACK", "RBRACK", "LCHEVR", "RCHEVR", "COMMA", + "SEMI", "COLON", "BOOL", "BYTES", "DOUBLE", "ENUM", "EXTEND", "FIXED32", + "FIXED64", "FLOAT", "IMPORT", "INT32", "INT64", "MAP", "MESSAGE", "ONEOF", + "OPTION", "PACKAGE", "PUBLIC", "REPEATED", "REQUIRED", "RESERVED", "RETURNS", + "RPC", "SERVICE", "SFIXED32", "SFIXED64", "SINT32", "SINT64", "STREAM", + "STRING", "SYNTAX", "TO", "UINT32", "UINT64", "WEAK", "OPTIONAL", "Letter", + "DecimalDigit", "OctalDigit", "HexDigit", "Ident", "IntegerLiteral", + "NumericLiteral", "DecimalLiteral", "OctalLiteral", "HexLiteral", "FloatLiteral", + "Decimals", "Exponent", "BooleanLiteral", "StringLiteral", "CharValue", + "HexEscape", "OctEscape", "CharEscape", "Quote", "LPAREN", "RPAREN", + "LBRACE", "RBRACE", "LBRACK", "RBRACK", "LCHEVR", "RCHEVR", "COMMA", "DOT", "MINUS", "PLUS", "ASSIGN", "WS", "UTF_8_BOM", "COMMENT", "LINE_COMMENT" }; } @@ -68,27 +68,27 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, "';'", "':'", "'bool'", "'bytes'", "'double'", "'enum'", "'extend'", - "'fixed32'", "'fixed64'", "'float'", "'import'", "'int32'", "'int64'", - "'map'", "'message'", "'oneof'", "'option'", "'package'", "'public'", - "'repeated'", "'required'", "'reserved'", "'returns'", "'rpc'", "'service'", - "'sfixed32'", "'sfixed64'", "'sint32'", "'sint64'", "'stream'", "'string'", - "'syntax'", "'to'", "'uint32'", "'uint64'", "'weak'", "'optional'", null, - null, null, null, null, null, null, "'('", "')'", "'{'", "'}'", "'['", + null, "';'", "':'", "'bool'", "'bytes'", "'double'", "'enum'", "'extend'", + "'fixed32'", "'fixed64'", "'float'", "'import'", "'int32'", "'int64'", + "'map'", "'message'", "'oneof'", "'option'", "'package'", "'public'", + "'repeated'", "'required'", "'reserved'", "'returns'", "'rpc'", "'service'", + "'sfixed32'", "'sfixed64'", "'sint32'", "'sint64'", "'stream'", "'string'", + "'syntax'", "'to'", "'uint32'", "'uint64'", "'weak'", "'optional'", null, + null, null, null, null, null, null, "'('", "')'", "'{'", "'}'", "'['", "']'", "'<'", "'>'", "','", "'.'", "'-'", "'+'", "'='", null, "'\\uFEFF'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "SEMI", "COLON", "BOOL", "BYTES", "DOUBLE", "ENUM", "EXTEND", "FIXED32", - "FIXED64", "FLOAT", "IMPORT", "INT32", "INT64", "MAP", "MESSAGE", "ONEOF", - "OPTION", "PACKAGE", "PUBLIC", "REPEATED", "REQUIRED", "RESERVED", "RETURNS", - "RPC", "SERVICE", "SFIXED32", "SFIXED64", "SINT32", "SINT64", "STREAM", - "STRING", "SYNTAX", "TO", "UINT32", "UINT64", "WEAK", "OPTIONAL", "Ident", - "IntegerLiteral", "NumericLiteral", "FloatLiteral", "BooleanLiteral", - "StringLiteral", "Quote", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LCHEVR", "RCHEVR", "COMMA", "DOT", "MINUS", "PLUS", "ASSIGN", + null, "SEMI", "COLON", "BOOL", "BYTES", "DOUBLE", "ENUM", "EXTEND", "FIXED32", + "FIXED64", "FLOAT", "IMPORT", "INT32", "INT64", "MAP", "MESSAGE", "ONEOF", + "OPTION", "PACKAGE", "PUBLIC", "REPEATED", "REQUIRED", "RESERVED", "RETURNS", + "RPC", "SERVICE", "SFIXED32", "SFIXED64", "SINT32", "SINT64", "STREAM", + "STRING", "SYNTAX", "TO", "UINT32", "UINT64", "WEAK", "OPTIONAL", "Ident", + "IntegerLiteral", "NumericLiteral", "FloatLiteral", "BooleanLiteral", + "StringLiteral", "Quote", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LCHEVR", "RCHEVR", "COMMA", "DOT", "MINUS", "PLUS", "ASSIGN", "WS", "UTF_8_BOM", "COMMENT", "LINE_COMMENT" }; } diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Parser.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Parser.java index 44839a37c5e..af29b594ad6 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Parser.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/grammar/Protobuf2Parser.java @@ -36,35 +36,35 @@ public class Protobuf2Parser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - SEMI=1, COLON=2, BOOL=3, BYTES=4, DOUBLE=5, ENUM=6, EXTEND=7, FIXED32=8, - FIXED64=9, FLOAT=10, IMPORT=11, INT32=12, INT64=13, MAP=14, MESSAGE=15, - ONEOF=16, OPTION=17, PACKAGE=18, PUBLIC=19, REPEATED=20, REQUIRED=21, - RESERVED=22, RETURNS=23, RPC=24, SERVICE=25, SFIXED32=26, SFIXED64=27, - SINT32=28, SINT64=29, STREAM=30, STRING=31, SYNTAX=32, TO=33, UINT32=34, - UINT64=35, WEAK=36, OPTIONAL=37, Ident=38, IntegerLiteral=39, NumericLiteral=40, - FloatLiteral=41, BooleanLiteral=42, StringLiteral=43, Quote=44, LPAREN=45, - RPAREN=46, LBRACE=47, RBRACE=48, LBRACK=49, RBRACK=50, LCHEVR=51, RCHEVR=52, - COMMA=53, DOT=54, MINUS=55, PLUS=56, ASSIGN=57, WS=58, UTF_8_BOM=59, COMMENT=60, + SEMI=1, COLON=2, BOOL=3, BYTES=4, DOUBLE=5, ENUM=6, EXTEND=7, FIXED32=8, + FIXED64=9, FLOAT=10, IMPORT=11, INT32=12, INT64=13, MAP=14, MESSAGE=15, + ONEOF=16, OPTION=17, PACKAGE=18, PUBLIC=19, REPEATED=20, REQUIRED=21, + RESERVED=22, RETURNS=23, RPC=24, SERVICE=25, SFIXED32=26, SFIXED64=27, + SINT32=28, SINT64=29, STREAM=30, STRING=31, SYNTAX=32, TO=33, UINT32=34, + UINT64=35, WEAK=36, OPTIONAL=37, Ident=38, IntegerLiteral=39, NumericLiteral=40, + FloatLiteral=41, BooleanLiteral=42, StringLiteral=43, Quote=44, LPAREN=45, + RPAREN=46, LBRACE=47, RBRACE=48, LBRACK=49, RBRACK=50, LCHEVR=51, RCHEVR=52, + COMMA=53, DOT=54, MINUS=55, PLUS=56, ASSIGN=57, WS=58, UTF_8_BOM=59, COMMENT=60, LINE_COMMENT=61; public static final int - RULE_proto = 0, RULE_stringLiteral = 1, RULE_identOrReserved = 2, RULE_syntax = 3, - RULE_importStatement = 4, RULE_packageStatement = 5, RULE_optionName = 6, - RULE_option = 7, RULE_optionDef = 8, RULE_optionList = 9, RULE_topLevelDef = 10, - RULE_ident = 11, RULE_message = 12, RULE_messageField = 13, RULE_messageBody = 14, - RULE_extend = 15, RULE_enumDefinition = 16, RULE_enumBody = 17, RULE_enumField = 18, - RULE_service = 19, RULE_serviceBody = 20, RULE_rpc = 21, RULE_rpcInOut = 22, - RULE_rpcBody = 23, RULE_reserved = 24, RULE_ranges = 25, RULE_range = 26, - RULE_fieldNames = 27, RULE_type = 28, RULE_field = 29, RULE_oneOf = 30, - RULE_mapField = 31, RULE_keyType = 32, RULE_reservedWord = 33, RULE_fullIdent = 34, + RULE_proto = 0, RULE_stringLiteral = 1, RULE_identOrReserved = 2, RULE_syntax = 3, + RULE_importStatement = 4, RULE_packageStatement = 5, RULE_optionName = 6, + RULE_option = 7, RULE_optionDef = 8, RULE_optionList = 9, RULE_topLevelDef = 10, + RULE_ident = 11, RULE_message = 12, RULE_messageField = 13, RULE_messageBody = 14, + RULE_extend = 15, RULE_enumDefinition = 16, RULE_enumBody = 17, RULE_enumField = 18, + RULE_service = 19, RULE_serviceBody = 20, RULE_rpc = 21, RULE_rpcInOut = 22, + RULE_rpcBody = 23, RULE_reserved = 24, RULE_ranges = 25, RULE_range = 26, + RULE_fieldNames = 27, RULE_type = 28, RULE_field = 29, RULE_oneOf = 30, + RULE_mapField = 31, RULE_keyType = 32, RULE_reservedWord = 33, RULE_fullIdent = 34, RULE_emptyStatement = 35, RULE_constant = 36; private static String[] makeRuleNames() { return new String[] { - "proto", "stringLiteral", "identOrReserved", "syntax", "importStatement", - "packageStatement", "optionName", "option", "optionDef", "optionList", - "topLevelDef", "ident", "message", "messageField", "messageBody", "extend", - "enumDefinition", "enumBody", "enumField", "service", "serviceBody", - "rpc", "rpcInOut", "rpcBody", "reserved", "ranges", "range", "fieldNames", - "type", "field", "oneOf", "mapField", "keyType", "reservedWord", "fullIdent", + "proto", "stringLiteral", "identOrReserved", "syntax", "importStatement", + "packageStatement", "optionName", "option", "optionDef", "optionList", + "topLevelDef", "ident", "message", "messageField", "messageBody", "extend", + "enumDefinition", "enumBody", "enumField", "service", "serviceBody", + "rpc", "rpcInOut", "rpcBody", "reserved", "ranges", "range", "fieldNames", + "type", "field", "oneOf", "mapField", "keyType", "reservedWord", "fullIdent", "emptyStatement", "constant" }; } @@ -72,27 +72,27 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, "';'", "':'", "'bool'", "'bytes'", "'double'", "'enum'", "'extend'", - "'fixed32'", "'fixed64'", "'float'", "'import'", "'int32'", "'int64'", - "'map'", "'message'", "'oneof'", "'option'", "'package'", "'public'", - "'repeated'", "'required'", "'reserved'", "'returns'", "'rpc'", "'service'", - "'sfixed32'", "'sfixed64'", "'sint32'", "'sint64'", "'stream'", "'string'", - "'syntax'", "'to'", "'uint32'", "'uint64'", "'weak'", "'optional'", null, - null, null, null, null, null, null, "'('", "')'", "'{'", "'}'", "'['", + null, "';'", "':'", "'bool'", "'bytes'", "'double'", "'enum'", "'extend'", + "'fixed32'", "'fixed64'", "'float'", "'import'", "'int32'", "'int64'", + "'map'", "'message'", "'oneof'", "'option'", "'package'", "'public'", + "'repeated'", "'required'", "'reserved'", "'returns'", "'rpc'", "'service'", + "'sfixed32'", "'sfixed64'", "'sint32'", "'sint64'", "'stream'", "'string'", + "'syntax'", "'to'", "'uint32'", "'uint64'", "'weak'", "'optional'", null, + null, null, null, null, null, null, "'('", "')'", "'{'", "'}'", "'['", "']'", "'<'", "'>'", "','", "'.'", "'-'", "'+'", "'='", null, "'\\uFEFF'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "SEMI", "COLON", "BOOL", "BYTES", "DOUBLE", "ENUM", "EXTEND", "FIXED32", - "FIXED64", "FLOAT", "IMPORT", "INT32", "INT64", "MAP", "MESSAGE", "ONEOF", - "OPTION", "PACKAGE", "PUBLIC", "REPEATED", "REQUIRED", "RESERVED", "RETURNS", - "RPC", "SERVICE", "SFIXED32", "SFIXED64", "SINT32", "SINT64", "STREAM", - "STRING", "SYNTAX", "TO", "UINT32", "UINT64", "WEAK", "OPTIONAL", "Ident", - "IntegerLiteral", "NumericLiteral", "FloatLiteral", "BooleanLiteral", - "StringLiteral", "Quote", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LCHEVR", "RCHEVR", "COMMA", "DOT", "MINUS", "PLUS", "ASSIGN", + null, "SEMI", "COLON", "BOOL", "BYTES", "DOUBLE", "ENUM", "EXTEND", "FIXED32", + "FIXED64", "FLOAT", "IMPORT", "INT32", "INT64", "MAP", "MESSAGE", "ONEOF", + "OPTION", "PACKAGE", "PUBLIC", "REPEATED", "REQUIRED", "RESERVED", "RETURNS", + "RPC", "SERVICE", "SFIXED32", "SFIXED64", "SINT32", "SINT64", "STREAM", + "STRING", "SYNTAX", "TO", "UINT32", "UINT64", "WEAK", "OPTIONAL", "Ident", + "IntegerLiteral", "NumericLiteral", "FloatLiteral", "BooleanLiteral", + "StringLiteral", "Quote", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LCHEVR", "RCHEVR", "COMMA", "DOT", "MINUS", "PLUS", "ASSIGN", "WS", "UTF_8_BOM", "COMMENT", "LINE_COMMENT" }; } @@ -2242,7 +2242,7 @@ public TypeContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @Override public int getRuleIndex() { return RULE_type; } - + public TypeContext() { } public void copyFrom(TypeContext ctx) { super.copyFrom(ctx); @@ -2813,7 +2813,7 @@ public final FullIdentContext fullIdent() throws RecognitionException { setState(328); match(DOT); } - } + } } setState(334); _errHandler.sync(this); diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java index 1a3ac8187a7..a3fab69ac67 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java @@ -235,7 +235,7 @@ public static Space format(String formatting) { return trees; } - + public static

List

formatFirstPrefix(List

trees, Space prefix) { if (!trees.isEmpty() && !trees.get(0).getPrefix().equals(prefix)) { List

formattedTrees = new ArrayList<>(trees); diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLLexer.java b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLLexer.java index fa7959b8382..69ce651a7ba 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLLexer.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLLexer.java @@ -30,36 +30,36 @@ public class XMLLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - COMMENT=1, CDATA=2, ParamEntityRef=3, EntityRef=4, CharRef=5, SEA_WS=6, - UTF_ENCODING_BOM=7, QUESTION_MARK=8, SPECIAL_OPEN_XML=9, OPEN=10, SPECIAL_OPEN=11, - DTD_OPEN=12, TEXT=13, DTD_CLOSE=14, DTD_SUBSET_OPEN=15, DTD_S=16, DOCTYPE=17, - DTD_SUBSET_CLOSE=18, MARKUP_OPEN=19, DTS_SUBSET_S=20, MARK_UP_CLOSE=21, - MARKUP_S=22, MARKUP_TEXT=23, MARKUP_SUBSET=24, PI_S=25, PI_TEXT=26, CLOSE=27, - SPECIAL_CLOSE=28, SLASH_CLOSE=29, S=30, DIRECTIVE_OPEN=31, DIRECTIVE_CLOSE=32, + COMMENT=1, CDATA=2, ParamEntityRef=3, EntityRef=4, CharRef=5, SEA_WS=6, + UTF_ENCODING_BOM=7, QUESTION_MARK=8, SPECIAL_OPEN_XML=9, OPEN=10, SPECIAL_OPEN=11, + DTD_OPEN=12, TEXT=13, DTD_CLOSE=14, DTD_SUBSET_OPEN=15, DTD_S=16, DOCTYPE=17, + DTD_SUBSET_CLOSE=18, MARKUP_OPEN=19, DTS_SUBSET_S=20, MARK_UP_CLOSE=21, + MARKUP_S=22, MARKUP_TEXT=23, MARKUP_SUBSET=24, PI_S=25, PI_TEXT=26, CLOSE=27, + SPECIAL_CLOSE=28, SLASH_CLOSE=29, S=30, DIRECTIVE_OPEN=31, DIRECTIVE_CLOSE=32, SLASH=33, EQUALS=34, STRING=35, Name=36; public static final int - INSIDE_DTD=1, INSIDE_DTD_SUBSET=2, INSIDE_MARKUP=3, INSIDE_MARKUP_SUBSET=4, + INSIDE_DTD=1, INSIDE_DTD_SUBSET=2, INSIDE_MARKUP=3, INSIDE_MARKUP_SUBSET=4, INSIDE_PROCESS_INSTRUCTION=5, INSIDE_PI_TEXT=6, INSIDE=7; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; public static String[] modeNames = { - "DEFAULT_MODE", "INSIDE_DTD", "INSIDE_DTD_SUBSET", "INSIDE_MARKUP", "INSIDE_MARKUP_SUBSET", + "DEFAULT_MODE", "INSIDE_DTD", "INSIDE_DTD_SUBSET", "INSIDE_MARKUP", "INSIDE_MARKUP_SUBSET", "INSIDE_PROCESS_INSTRUCTION", "INSIDE_PI_TEXT", "INSIDE" }; private static String[] makeRuleNames() { return new String[] { - "COMMENT", "CDATA", "ParamEntityRef", "EntityRef", "CharRef", "SEA_WS", - "UTF_ENCODING_BOM", "QUESTION_MARK", "SPECIAL_OPEN_XML", "OPEN", "SPECIAL_OPEN", - "DTD_OPEN", "TEXT", "UTF_8_BOM_CHARS", "UTF_8_BOM", "DTD_CLOSE", "DTD_SUBSET_OPEN", - "DTD_S", "DOCTYPE", "DTD_NAME", "DTD_STRING", "DTD_SUBSET_CLOSE", "MARKUP_OPEN", - "DTS_SUBSET_S", "DTD_PERef", "DTD_SUBSET_COMMENT", "MARK_UP_CLOSE", "MARKUP_SUBSET_OPEN", - "MARKUP_S", "MARKUP_TEXT", "MARKUP_SUBSET", "TXT", "PI_SPECIAL_CLOSE", - "PI_S", "PI_QUESTION_MARK", "PI_TEXT", "PI_TEXT_SPECIAL_CASE", "CLOSE", - "SPECIAL_CLOSE", "SLASH_CLOSE", "S", "DIRECTIVE_OPEN", "DIRECTIVE_CLOSE", - "SLASH", "EQUALS", "STRING", "Name", "HEXDIGIT", "DIGIT", "NameChar", + "COMMENT", "CDATA", "ParamEntityRef", "EntityRef", "CharRef", "SEA_WS", + "UTF_ENCODING_BOM", "QUESTION_MARK", "SPECIAL_OPEN_XML", "OPEN", "SPECIAL_OPEN", + "DTD_OPEN", "TEXT", "UTF_8_BOM_CHARS", "UTF_8_BOM", "DTD_CLOSE", "DTD_SUBSET_OPEN", + "DTD_S", "DOCTYPE", "DTD_NAME", "DTD_STRING", "DTD_SUBSET_CLOSE", "MARKUP_OPEN", + "DTS_SUBSET_S", "DTD_PERef", "DTD_SUBSET_COMMENT", "MARK_UP_CLOSE", "MARKUP_SUBSET_OPEN", + "MARKUP_S", "MARKUP_TEXT", "MARKUP_SUBSET", "TXT", "PI_SPECIAL_CLOSE", + "PI_S", "PI_QUESTION_MARK", "PI_TEXT", "PI_TEXT_SPECIAL_CASE", "CLOSE", + "SPECIAL_CLOSE", "SLASH_CLOSE", "S", "DIRECTIVE_OPEN", "DIRECTIVE_CLOSE", + "SLASH", "EQUALS", "STRING", "Name", "HEXDIGIT", "DIGIT", "NameChar", "NameStartChar" }; } @@ -67,20 +67,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, null, null, null, null, null, null, "'?'", null, "'<'", null, - null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, "'?'", null, "'<'", null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "'/>'", null, "'%@'", "'%'", "'/'", "'='" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "COMMENT", "CDATA", "ParamEntityRef", "EntityRef", "CharRef", "SEA_WS", - "UTF_ENCODING_BOM", "QUESTION_MARK", "SPECIAL_OPEN_XML", "OPEN", "SPECIAL_OPEN", - "DTD_OPEN", "TEXT", "DTD_CLOSE", "DTD_SUBSET_OPEN", "DTD_S", "DOCTYPE", - "DTD_SUBSET_CLOSE", "MARKUP_OPEN", "DTS_SUBSET_S", "MARK_UP_CLOSE", "MARKUP_S", - "MARKUP_TEXT", "MARKUP_SUBSET", "PI_S", "PI_TEXT", "CLOSE", "SPECIAL_CLOSE", - "SLASH_CLOSE", "S", "DIRECTIVE_OPEN", "DIRECTIVE_CLOSE", "SLASH", "EQUALS", + null, "COMMENT", "CDATA", "ParamEntityRef", "EntityRef", "CharRef", "SEA_WS", + "UTF_ENCODING_BOM", "QUESTION_MARK", "SPECIAL_OPEN_XML", "OPEN", "SPECIAL_OPEN", + "DTD_OPEN", "TEXT", "DTD_CLOSE", "DTD_SUBSET_OPEN", "DTD_S", "DOCTYPE", + "DTD_SUBSET_CLOSE", "MARKUP_OPEN", "DTS_SUBSET_S", "MARK_UP_CLOSE", "MARKUP_S", + "MARKUP_TEXT", "MARKUP_SUBSET", "PI_S", "PI_TEXT", "CLOSE", "SPECIAL_CLOSE", + "SLASH_CLOSE", "S", "DIRECTIVE_OPEN", "DIRECTIVE_CLOSE", "SLASH", "EQUALS", "STRING", "Name" }; } diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLParser.java b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLParser.java index e0f40773307..84e33883e0d 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLParser.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/grammar/XMLParser.java @@ -35,22 +35,22 @@ public class XMLParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - COMMENT=1, CDATA=2, ParamEntityRef=3, EntityRef=4, CharRef=5, SEA_WS=6, - UTF_ENCODING_BOM=7, QUESTION_MARK=8, SPECIAL_OPEN_XML=9, OPEN=10, SPECIAL_OPEN=11, - DTD_OPEN=12, TEXT=13, DTD_CLOSE=14, DTD_SUBSET_OPEN=15, DTD_S=16, DOCTYPE=17, - DTD_SUBSET_CLOSE=18, MARKUP_OPEN=19, DTS_SUBSET_S=20, MARK_UP_CLOSE=21, - MARKUP_S=22, MARKUP_TEXT=23, MARKUP_SUBSET=24, PI_S=25, PI_TEXT=26, CLOSE=27, - SPECIAL_CLOSE=28, SLASH_CLOSE=29, S=30, DIRECTIVE_OPEN=31, DIRECTIVE_CLOSE=32, + COMMENT=1, CDATA=2, ParamEntityRef=3, EntityRef=4, CharRef=5, SEA_WS=6, + UTF_ENCODING_BOM=7, QUESTION_MARK=8, SPECIAL_OPEN_XML=9, OPEN=10, SPECIAL_OPEN=11, + DTD_OPEN=12, TEXT=13, DTD_CLOSE=14, DTD_SUBSET_OPEN=15, DTD_S=16, DOCTYPE=17, + DTD_SUBSET_CLOSE=18, MARKUP_OPEN=19, DTS_SUBSET_S=20, MARK_UP_CLOSE=21, + MARKUP_S=22, MARKUP_TEXT=23, MARKUP_SUBSET=24, PI_S=25, PI_TEXT=26, CLOSE=27, + SPECIAL_CLOSE=28, SLASH_CLOSE=29, S=30, DIRECTIVE_OPEN=31, DIRECTIVE_CLOSE=32, SLASH=33, EQUALS=34, STRING=35, Name=36; public static final int - RULE_document = 0, RULE_prolog = 1, RULE_xmldecl = 2, RULE_misc = 3, RULE_doctypedecl = 4, - RULE_intsubset = 5, RULE_markupdecl = 6, RULE_declSep = 7, RULE_externalid = 8, - RULE_processinginstruction = 9, RULE_content = 10, RULE_element = 11, + RULE_document = 0, RULE_prolog = 1, RULE_xmldecl = 2, RULE_misc = 3, RULE_doctypedecl = 4, + RULE_intsubset = 5, RULE_markupdecl = 6, RULE_declSep = 7, RULE_externalid = 8, + RULE_processinginstruction = 9, RULE_content = 10, RULE_element = 11, RULE_jspdirective = 12, RULE_reference = 13, RULE_attribute = 14, RULE_chardata = 15; private static String[] makeRuleNames() { return new String[] { - "document", "prolog", "xmldecl", "misc", "doctypedecl", "intsubset", - "markupdecl", "declSep", "externalid", "processinginstruction", "content", + "document", "prolog", "xmldecl", "misc", "doctypedecl", "intsubset", + "markupdecl", "declSep", "externalid", "processinginstruction", "content", "element", "jspdirective", "reference", "attribute", "chardata" }; } @@ -58,20 +58,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, null, null, null, null, null, null, "'?'", null, "'<'", null, - null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, "'?'", null, "'<'", null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "'/>'", null, "'%@'", "'%'", "'/'", "'='" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "COMMENT", "CDATA", "ParamEntityRef", "EntityRef", "CharRef", "SEA_WS", - "UTF_ENCODING_BOM", "QUESTION_MARK", "SPECIAL_OPEN_XML", "OPEN", "SPECIAL_OPEN", - "DTD_OPEN", "TEXT", "DTD_CLOSE", "DTD_SUBSET_OPEN", "DTD_S", "DOCTYPE", - "DTD_SUBSET_CLOSE", "MARKUP_OPEN", "DTS_SUBSET_S", "MARK_UP_CLOSE", "MARKUP_S", - "MARKUP_TEXT", "MARKUP_SUBSET", "PI_S", "PI_TEXT", "CLOSE", "SPECIAL_CLOSE", - "SLASH_CLOSE", "S", "DIRECTIVE_OPEN", "DIRECTIVE_CLOSE", "SLASH", "EQUALS", + null, "COMMENT", "CDATA", "ParamEntityRef", "EntityRef", "CharRef", "SEA_WS", + "UTF_ENCODING_BOM", "QUESTION_MARK", "SPECIAL_OPEN_XML", "OPEN", "SPECIAL_OPEN", + "DTD_OPEN", "TEXT", "DTD_CLOSE", "DTD_SUBSET_OPEN", "DTD_S", "DOCTYPE", + "DTD_SUBSET_CLOSE", "MARKUP_OPEN", "DTS_SUBSET_S", "MARK_UP_CLOSE", "MARKUP_S", + "MARKUP_TEXT", "MARKUP_SUBSET", "PI_S", "PI_TEXT", "CLOSE", "SPECIAL_CLOSE", + "SLASH_CLOSE", "S", "DIRECTIVE_OPEN", "DIRECTIVE_CLOSE", "SLASH", "EQUALS", "STRING", "Name" }; } @@ -266,7 +266,7 @@ public final PrologContext prolog() throws RecognitionException { setState(47); jspdirective(); } - } + } } setState(52); _errHandler.sync(this); @@ -849,7 +849,7 @@ public final ProcessinginstructionContext processinginstruction() throws Recogni { setState(115); match(SPECIAL_OPEN); - setState(117); + setState(117); _errHandler.sync(this); _la = _input.LA(1); do { @@ -859,7 +859,7 @@ public final ProcessinginstructionContext processinginstruction() throws Recogni match(PI_TEXT); } } - setState(119); + setState(119); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==PI_TEXT ); @@ -1066,7 +1066,7 @@ public final ElementContext element() throws RecognitionException { setState(140); content(); } - } + } } setState(145); _errHandler.sync(this); diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathLexer.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathLexer.java index 4cb48f527a8..264cc54e622 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathLexer.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathLexer.java @@ -31,11 +31,11 @@ public class JsonPathLexer extends Lexer { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, - RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, - COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, - NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, - LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, + WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, + RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, + COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, + NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, + LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, TRUE=33, FALSE=34, NULL=35, MATCHES_REGEX_CLOSE=36, S=37, REGEX=38; public static final int MATCHES_REGEX=1; @@ -49,12 +49,12 @@ public class JsonPathLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { - "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", - "FALSE", "NULL", "ESCAPE_SEQUENCE", "UNICODE", "HEX_DIGIT", "SAFE_CODE_POINT", + "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + "FALSE", "NULL", "ESCAPE_SEQUENCE", "UNICODE", "HEX_DIGIT", "SAFE_CODE_POINT", "EXPONENT_PART", "MINUS", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } @@ -62,20 +62,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", - "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, - null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", + null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", + "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, + null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", null, "'=='", "'!='", "'true'", "'false'", "'null'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", "FALSE", "NULL", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathParser.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathParser.java index b4682af2b6d..04422658f15 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathParser.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/grammar/JsonPathParser.java @@ -36,23 +36,23 @@ public class JsonPathParser extends Parser { protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache(); public static final int - WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, - RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, - COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, - NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, - LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, + WS=1, UTF_8_BOM=2, MATCHES_REGEX_OPEN=3, LBRACE=4, RBRACE=5, LBRACK=6, + RBRACK=7, LPAREN=8, RPAREN=9, AT=10, DOT=11, DOT_DOT=12, ROOT=13, WILDCARD=14, + COLON=15, QUESTION=16, CONTAINS=17, Identifier=18, StringLiteral=19, PositiveNumber=20, + NegativeNumber=21, NumericLiteral=22, COMMA=23, TICK=24, QUOTE=25, MATCHES=26, + LOGICAL_OPERATOR=27, AND=28, OR=29, EQUALITY_OPERATOR=30, EQ=31, NE=32, TRUE=33, FALSE=34, NULL=35, MATCHES_REGEX_CLOSE=36, S=37, REGEX=38; public static final int - RULE_jsonPath = 0, RULE_expression = 1, RULE_dotOperator = 2, RULE_recursiveDecent = 3, - RULE_bracketOperator = 4, RULE_filter = 5, RULE_filterExpression = 6, - RULE_binaryExpression = 7, RULE_containsExpression = 8, RULE_regexExpression = 9, - RULE_unaryExpression = 10, RULE_literalExpression = 11, RULE_property = 12, + RULE_jsonPath = 0, RULE_expression = 1, RULE_dotOperator = 2, RULE_recursiveDecent = 3, + RULE_bracketOperator = 4, RULE_filter = 5, RULE_filterExpression = 6, + RULE_binaryExpression = 7, RULE_containsExpression = 8, RULE_regexExpression = 9, + RULE_unaryExpression = 10, RULE_literalExpression = 11, RULE_property = 12, RULE_wildcard = 13, RULE_slice = 14, RULE_start = 15, RULE_end = 16, RULE_indexes = 17; private static String[] makeRuleNames() { return new String[] { - "jsonPath", "expression", "dotOperator", "recursiveDecent", "bracketOperator", - "filter", "filterExpression", "binaryExpression", "containsExpression", - "regexExpression", "unaryExpression", "literalExpression", "property", + "jsonPath", "expression", "dotOperator", "recursiveDecent", "bracketOperator", + "filter", "filterExpression", "binaryExpression", "containsExpression", + "regexExpression", "unaryExpression", "literalExpression", "property", "wildcard", "slice", "start", "end", "indexes" }; } @@ -60,20 +60,20 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { - null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", - "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, - null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", + null, null, "'\\uFEFF'", null, "'{'", "'}'", "'['", "']'", "'('", "')'", + "'@'", "'.'", "'..'", "'$'", "'*'", "':'", "'?'", "'contains'", null, + null, null, null, null, "','", "'''", "'\"'", "'=~'", null, "'&&'", "'||'", null, "'=='", "'!='", "'true'", "'false'", "'null'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); private static String[] makeSymbolicNames() { return new String[] { - null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", - "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", - "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", - "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", - "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", + null, "WS", "UTF_8_BOM", "MATCHES_REGEX_OPEN", "LBRACE", "RBRACE", "LBRACK", + "RBRACK", "LPAREN", "RPAREN", "AT", "DOT", "DOT_DOT", "ROOT", "WILDCARD", + "COLON", "QUESTION", "CONTAINS", "Identifier", "StringLiteral", "PositiveNumber", + "NegativeNumber", "NumericLiteral", "COMMA", "TICK", "QUOTE", "MATCHES", + "LOGICAL_OPERATOR", "AND", "OR", "EQUALITY_OPERATOR", "EQ", "NE", "TRUE", "FALSE", "NULL", "MATCHES_REGEX_CLOSE", "S", "REGEX" }; } @@ -174,7 +174,7 @@ public final JsonPathContext jsonPath() throws RecognitionException { } } - setState(40); + setState(40); _errHandler.sync(this); _alt = 1; do { @@ -190,7 +190,7 @@ public final JsonPathContext jsonPath() throws RecognitionException { default: throw new NoViableAltException(this); } - setState(42); + setState(42); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,1,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -475,7 +475,7 @@ public final BracketOperatorContext bracketOperator() throws RecognitionExceptio break; case 4: { - setState(63); + setState(63); _errHandler.sync(this); _la = _input.LA(1); do { @@ -485,7 +485,7 @@ public final BracketOperatorContext bracketOperator() throws RecognitionExceptio property(); } } - setState(65); + setState(65); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==Identifier || _la==StringLiteral ); @@ -548,7 +548,7 @@ public final FilterContext filter() throws RecognitionException { match(QUESTION); setState(72); match(LPAREN); - setState(74); + setState(74); _errHandler.sync(this); _la = _input.LA(1); do { @@ -558,7 +558,7 @@ public final FilterContext filter() throws RecognitionException { filterExpression(); } } - setState(76); + setState(76); _errHandler.sync(this); _la = _input.LA(1); } while ( ((_la) & ~0x3f) == 0 && ((1L << _la) & 60137421888L) != 0 ); @@ -853,7 +853,7 @@ private BinaryExpressionContext binaryExpression(int _p) throws RecognitionExcep } break; } - } + } } setState(134); _errHandler.sync(this); @@ -1482,7 +1482,7 @@ public final IndexesContext indexes() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(187); + setState(187); _errHandler.sync(this); _la = _input.LA(1); do { @@ -1492,7 +1492,7 @@ public final IndexesContext indexes() throws RecognitionException { match(PositiveNumber); } } - setState(189); + setState(189); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==PositiveNumber );