diff --git a/rewrite-hcl/src/main/antlr/HCLParser.g4 b/rewrite-hcl/src/main/antlr/HCLParser.g4 index 5ff2bd1d844..faf8fcd3cd1 100644 --- a/rewrite-hcl/src/main/antlr/HCLParser.g4 +++ b/rewrite-hcl/src/main/antlr/HCLParser.g4 @@ -19,7 +19,7 @@ bodyContent ; attribute - : (Identifier | NULL) ASSIGN expression + : (Identifier | NULL | IF | IN) ASSIGN expression ; block @@ -91,7 +91,7 @@ objectelem ; qualifiedIdentifier - : Identifier (DOT Identifier)* + : (Identifier | IF | IN) (DOT (Identifier | IF | IN))* ; // For Expressions diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java index eeabca8e701..d530fdf3665 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java @@ -71,7 +71,7 @@ public Hcl visitAttribute(HCLParser.AttributeContext ctx) { randomId(), Space.format(prefix), Markers.EMPTY, - c.Identifier() != null ? visitIdentifier(c.Identifier()) : visitIdentifier(c.NULL()), + visitIdentifier(attributeNameToken(c)), new HclLeftPadded<>( sourceBefore("="), Hcl.Attribute.Type.Assignment, @@ -82,6 +82,33 @@ public Hcl visitAttribute(HCLParser.AttributeContext ctx) { )); } + private static TerminalNode attributeNameToken(HCLParser.AttributeContext ctx) { + if (ctx.Identifier() != null) { + return ctx.Identifier(); + } else if (ctx.NULL() != null) { + return ctx.NULL(); + } else if (ctx.IF() != null) { + return ctx.IF(); + } else if (ctx.IN() != null) { + return ctx.IN(); + } + throw new IllegalStateException("Unexpected attribute name token in: " + ctx.getText()); + } + + private static List qualifiedIdentifierNames(HCLParser.QualifiedIdentifierContext ctx) { + List names = new ArrayList<>(); + for (int i = 0; i < ctx.getChildCount(); i++) { + ParseTree child = ctx.getChild(i); + if (child instanceof TerminalNode) { + int type = ((TerminalNode) child).getSymbol().getType(); + if (type != HCLParser.DOT) { + names.add((TerminalNode) child); + } + } + } + return names; + } + @Override public Hcl visitAttributeAccessExpression(HCLParser.AttributeAccessExpressionContext ctx) { return convert(ctx, (c, prefix) -> new Hcl.AttributeAccess( @@ -744,7 +771,7 @@ public Hcl visitVariableExpr(HCLParser.VariableExprContext ctx) { if (ctx == null) { return null; } - List identifiers = ctx.Identifier(); + List identifiers = qualifiedIdentifierNames(ctx); if (identifiers.size() == 1) { return visitIdentifier(identifiers.get(0)); } diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.interp b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.interp index 15092e03d9d..ae5f77b09f4 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.interp +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/grammar/HCLParser.interp @@ -155,4 +155,4 @@ templateInterpolation atn: -[4, 1, 52, 391, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 1, 0, 1, 0, 1, 1, 5, 1, 90, 8, 1, 10, 1, 12, 1, 93, 9, 1, 1, 2, 1, 2, 3, 2, 97, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 5, 4, 105, 8, 4, 10, 4, 12, 4, 108, 9, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 117, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 122, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 130, 8, 6, 10, 6, 12, 6, 133, 9, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 146, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 156, 8, 7, 10, 7, 12, 7, 159, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 169, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 175, 8, 11, 10, 11, 12, 11, 178, 9, 11, 1, 11, 3, 11, 181, 8, 11, 3, 11, 183, 8, 11, 1, 11, 1, 11, 1, 12, 1, 12, 5, 12, 189, 8, 12, 10, 12, 12, 12, 192, 9, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 204, 8, 13, 10, 13, 12, 13, 207, 9, 13, 1, 13, 1, 13, 3, 13, 211, 8, 13, 1, 13, 1, 13, 1, 13, 3, 13, 216, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 221, 8, 14, 10, 14, 12, 14, 224, 9, 14, 1, 15, 1, 15, 3, 15, 228, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 235, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 246, 8, 17, 1, 17, 3, 17, 249, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 3, 18, 256, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 3, 21, 269, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 5, 22, 276, 8, 22, 10, 22, 12, 22, 279, 9, 22, 1, 23, 1, 23, 1, 23, 5, 23, 284, 8, 23, 10, 23, 12, 23, 287, 9, 23, 1, 23, 3, 23, 290, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 3, 27, 304, 8, 27, 1, 28, 1, 28, 1, 28, 5, 28, 309, 8, 28, 10, 28, 12, 28, 312, 9, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 319, 8, 29, 10, 29, 12, 29, 322, 9, 29, 1, 30, 1, 30, 3, 30, 326, 8, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 3, 32, 333, 8, 32, 1, 32, 1, 32, 1, 32, 3, 32, 338, 8, 32, 1, 33, 1, 33, 1, 33, 3, 33, 343, 8, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 5, 37, 355, 8, 37, 10, 37, 12, 37, 358, 9, 37, 4, 37, 360, 8, 37, 11, 37, 12, 37, 361, 1, 37, 1, 37, 1, 37, 5, 37, 367, 8, 37, 10, 37, 12, 37, 370, 9, 37, 1, 37, 3, 37, 373, 8, 37, 1, 38, 1, 38, 3, 38, 377, 8, 38, 1, 39, 1, 39, 1, 40, 1, 40, 3, 40, 383, 8, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 0, 2, 12, 14, 43, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 0, 8, 2, 0, 6, 6, 10, 10, 2, 0, 5, 6, 15, 15, 2, 0, 9, 9, 23, 23, 2, 0, 40, 40, 42, 42, 2, 0, 26, 26, 34, 34, 4, 0, 20, 21, 28, 29, 35, 35, 38, 38, 5, 0, 18, 18, 26, 26, 33, 33, 37, 37, 41, 41, 2, 0, 19, 19, 27, 27, 399, 0, 86, 1, 0, 0, 0, 2, 91, 1, 0, 0, 0, 4, 96, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 102, 1, 0, 0, 0, 10, 116, 1, 0, 0, 0, 12, 121, 1, 0, 0, 0, 14, 145, 1, 0, 0, 0, 16, 160, 1, 0, 0, 0, 18, 164, 1, 0, 0, 0, 20, 168, 1, 0, 0, 0, 22, 170, 1, 0, 0, 0, 24, 186, 1, 0, 0, 0, 26, 210, 1, 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 229, 1, 0, 0, 0, 34, 238, 1, 0, 0, 0, 36, 252, 1, 0, 0, 0, 38, 260, 1, 0, 0, 0, 40, 263, 1, 0, 0, 0, 42, 265, 1, 0, 0, 0, 44, 272, 1, 0, 0, 0, 46, 280, 1, 0, 0, 0, 48, 291, 1, 0, 0, 0, 50, 295, 1, 0, 0, 0, 52, 298, 1, 0, 0, 0, 54, 303, 1, 0, 0, 0, 56, 305, 1, 0, 0, 0, 58, 313, 1, 0, 0, 0, 60, 325, 1, 0, 0, 0, 62, 327, 1, 0, 0, 0, 64, 332, 1, 0, 0, 0, 66, 342, 1, 0, 0, 0, 68, 344, 1, 0, 0, 0, 70, 346, 1, 0, 0, 0, 72, 348, 1, 0, 0, 0, 74, 372, 1, 0, 0, 0, 76, 376, 1, 0, 0, 0, 78, 378, 1, 0, 0, 0, 80, 382, 1, 0, 0, 0, 82, 384, 1, 0, 0, 0, 84, 386, 1, 0, 0, 0, 86, 87, 3, 2, 1, 0, 87, 1, 1, 0, 0, 0, 88, 90, 3, 4, 2, 0, 89, 88, 1, 0, 0, 0, 90, 93, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 3, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 94, 97, 3, 6, 3, 0, 95, 97, 3, 8, 4, 0, 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 7, 0, 0, 0, 99, 100, 5, 9, 0, 0, 100, 101, 3, 12, 6, 0, 101, 7, 1, 0, 0, 0, 102, 106, 5, 10, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 3, 16, 8, 0, 110, 9, 1, 0, 0, 0, 111, 112, 5, 16, 0, 0, 112, 113, 3, 82, 41, 0, 113, 114, 5, 16, 0, 0, 114, 117, 1, 0, 0, 0, 115, 117, 5, 10, 0, 0, 116, 111, 1, 0, 0, 0, 116, 115, 1, 0, 0, 0, 117, 11, 1, 0, 0, 0, 118, 119, 6, 6, -1, 0, 119, 122, 3, 14, 7, 0, 120, 122, 3, 60, 30, 0, 121, 118, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 131, 1, 0, 0, 0, 123, 124, 10, 1, 0, 0, 124, 125, 5, 30, 0, 0, 125, 126, 3, 12, 6, 0, 126, 127, 5, 23, 0, 0, 127, 128, 3, 12, 6, 2, 128, 130, 1, 0, 0, 0, 129, 123, 1, 0, 0, 0, 130, 133, 1, 0, 0, 0, 131, 129, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 13, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 135, 6, 7, -1, 0, 135, 146, 3, 74, 37, 0, 136, 146, 3, 18, 9, 0, 137, 146, 3, 30, 15, 0, 138, 146, 3, 20, 10, 0, 139, 146, 3, 40, 20, 0, 140, 146, 3, 42, 21, 0, 141, 142, 5, 25, 0, 0, 142, 143, 3, 12, 6, 0, 143, 144, 5, 32, 0, 0, 144, 146, 1, 0, 0, 0, 145, 134, 1, 0, 0, 0, 145, 136, 1, 0, 0, 0, 145, 137, 1, 0, 0, 0, 145, 138, 1, 0, 0, 0, 145, 139, 1, 0, 0, 0, 145, 140, 1, 0, 0, 0, 145, 141, 1, 0, 0, 0, 146, 157, 1, 0, 0, 0, 147, 148, 10, 5, 0, 0, 148, 156, 3, 48, 24, 0, 149, 150, 10, 4, 0, 0, 150, 156, 3, 50, 25, 0, 151, 152, 10, 3, 0, 0, 152, 156, 3, 52, 26, 0, 153, 154, 10, 2, 0, 0, 154, 156, 3, 54, 27, 0, 155, 147, 1, 0, 0, 0, 155, 149, 1, 0, 0, 0, 155, 151, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 15, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 161, 5, 7, 0, 0, 161, 162, 3, 2, 1, 0, 162, 163, 5, 8, 0, 0, 163, 17, 1, 0, 0, 0, 164, 165, 7, 1, 0, 0, 165, 19, 1, 0, 0, 0, 166, 169, 3, 22, 11, 0, 167, 169, 3, 24, 12, 0, 168, 166, 1, 0, 0, 0, 168, 167, 1, 0, 0, 0, 169, 21, 1, 0, 0, 0, 170, 182, 5, 24, 0, 0, 171, 176, 3, 12, 6, 0, 172, 173, 5, 40, 0, 0, 173, 175, 3, 12, 6, 0, 174, 172, 1, 0, 0, 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 180, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 181, 5, 40, 0, 0, 180, 179, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 183, 1, 0, 0, 0, 182, 171, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 5, 31, 0, 0, 185, 23, 1, 0, 0, 0, 186, 190, 5, 7, 0, 0, 187, 189, 3, 26, 13, 0, 188, 187, 1, 0, 0, 0, 189, 192, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 193, 194, 5, 8, 0, 0, 194, 25, 1, 0, 0, 0, 195, 211, 3, 28, 14, 0, 196, 211, 5, 6, 0, 0, 197, 198, 5, 25, 0, 0, 198, 199, 3, 28, 14, 0, 199, 200, 5, 32, 0, 0, 200, 211, 1, 0, 0, 0, 201, 205, 5, 16, 0, 0, 202, 204, 3, 80, 40, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 208, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 208, 211, 5, 16, 0, 0, 209, 211, 3, 12, 6, 0, 210, 195, 1, 0, 0, 0, 210, 196, 1, 0, 0, 0, 210, 197, 1, 0, 0, 0, 210, 201, 1, 0, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 213, 7, 2, 0, 0, 213, 215, 3, 12, 6, 0, 214, 216, 5, 40, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, 217, 222, 5, 10, 0, 0, 218, 219, 5, 36, 0, 0, 219, 221, 5, 10, 0, 0, 220, 218, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 29, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 228, 3, 32, 16, 0, 226, 228, 3, 34, 17, 0, 227, 225, 1, 0, 0, 0, 227, 226, 1, 0, 0, 0, 228, 31, 1, 0, 0, 0, 229, 230, 5, 2, 0, 0, 230, 231, 3, 36, 18, 0, 231, 232, 5, 23, 0, 0, 232, 234, 3, 12, 6, 0, 233, 235, 3, 38, 19, 0, 234, 233, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 237, 5, 31, 0, 0, 237, 33, 1, 0, 0, 0, 238, 239, 5, 1, 0, 0, 239, 240, 3, 36, 18, 0, 240, 241, 5, 23, 0, 0, 241, 242, 3, 12, 6, 0, 242, 243, 5, 39, 0, 0, 243, 245, 3, 12, 6, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 248, 1, 0, 0, 0, 247, 249, 3, 38, 19, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 5, 8, 0, 0, 251, 35, 1, 0, 0, 0, 252, 255, 5, 10, 0, 0, 253, 254, 5, 40, 0, 0, 254, 256, 5, 10, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 258, 5, 4, 0, 0, 258, 259, 3, 12, 6, 0, 259, 37, 1, 0, 0, 0, 260, 261, 5, 3, 0, 0, 261, 262, 3, 12, 6, 0, 262, 39, 1, 0, 0, 0, 263, 264, 5, 10, 0, 0, 264, 41, 1, 0, 0, 0, 265, 266, 3, 44, 22, 0, 266, 268, 5, 25, 0, 0, 267, 269, 3, 46, 23, 0, 268, 267, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 271, 5, 32, 0, 0, 271, 43, 1, 0, 0, 0, 272, 277, 5, 10, 0, 0, 273, 274, 5, 22, 0, 0, 274, 276, 5, 10, 0, 0, 275, 273, 1, 0, 0, 0, 276, 279, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 45, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 280, 285, 3, 12, 6, 0, 281, 282, 5, 40, 0, 0, 282, 284, 3, 12, 6, 0, 283, 281, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 290, 7, 3, 0, 0, 289, 288, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 47, 1, 0, 0, 0, 291, 292, 5, 24, 0, 0, 292, 293, 3, 12, 6, 0, 293, 294, 5, 31, 0, 0, 294, 49, 1, 0, 0, 0, 295, 296, 5, 36, 0, 0, 296, 297, 5, 10, 0, 0, 297, 51, 1, 0, 0, 0, 298, 299, 5, 36, 0, 0, 299, 300, 5, 15, 0, 0, 300, 53, 1, 0, 0, 0, 301, 304, 3, 56, 28, 0, 302, 304, 3, 58, 29, 0, 303, 301, 1, 0, 0, 0, 303, 302, 1, 0, 0, 0, 304, 55, 1, 0, 0, 0, 305, 306, 5, 36, 0, 0, 306, 310, 5, 33, 0, 0, 307, 309, 3, 50, 25, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 57, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 24, 0, 0, 314, 315, 5, 33, 0, 0, 315, 320, 5, 31, 0, 0, 316, 319, 3, 50, 25, 0, 317, 319, 3, 48, 24, 0, 318, 316, 1, 0, 0, 0, 318, 317, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 59, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 326, 3, 62, 31, 0, 324, 326, 3, 64, 32, 0, 325, 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 61, 1, 0, 0, 0, 327, 328, 7, 4, 0, 0, 328, 329, 3, 14, 7, 0, 329, 63, 1, 0, 0, 0, 330, 333, 3, 14, 7, 0, 331, 333, 3, 62, 31, 0, 332, 330, 1, 0, 0, 0, 332, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 337, 3, 66, 33, 0, 335, 338, 3, 14, 7, 0, 336, 338, 3, 60, 30, 0, 337, 335, 1, 0, 0, 0, 337, 336, 1, 0, 0, 0, 338, 65, 1, 0, 0, 0, 339, 343, 3, 68, 34, 0, 340, 343, 3, 70, 35, 0, 341, 343, 3, 72, 36, 0, 342, 339, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 341, 1, 0, 0, 0, 343, 67, 1, 0, 0, 0, 344, 345, 7, 5, 0, 0, 345, 69, 1, 0, 0, 0, 346, 347, 7, 6, 0, 0, 347, 71, 1, 0, 0, 0, 348, 349, 7, 7, 0, 0, 349, 73, 1, 0, 0, 0, 350, 351, 5, 17, 0, 0, 351, 359, 5, 10, 0, 0, 352, 356, 5, 14, 0, 0, 353, 355, 3, 76, 38, 0, 354, 353, 1, 0, 0, 0, 355, 358, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 360, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 359, 352, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 373, 5, 10, 0, 0, 364, 368, 5, 16, 0, 0, 365, 367, 3, 80, 40, 0, 366, 365, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 371, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 373, 5, 16, 0, 0, 372, 350, 1, 0, 0, 0, 372, 364, 1, 0, 0, 0, 373, 75, 1, 0, 0, 0, 374, 377, 3, 84, 42, 0, 375, 377, 3, 78, 39, 0, 376, 374, 1, 0, 0, 0, 376, 375, 1, 0, 0, 0, 377, 77, 1, 0, 0, 0, 378, 379, 5, 50, 0, 0, 379, 79, 1, 0, 0, 0, 380, 383, 3, 84, 42, 0, 381, 383, 3, 82, 41, 0, 382, 380, 1, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 81, 1, 0, 0, 0, 384, 385, 5, 45, 0, 0, 385, 83, 1, 0, 0, 0, 386, 387, 5, 44, 0, 0, 387, 388, 3, 12, 6, 0, 388, 389, 5, 8, 0, 0, 389, 85, 1, 0, 0, 0, 41, 91, 96, 106, 116, 121, 131, 145, 155, 157, 168, 176, 180, 182, 190, 205, 210, 215, 222, 227, 234, 245, 248, 255, 268, 277, 285, 289, 303, 310, 318, 320, 325, 332, 337, 342, 356, 361, 368, 372, 376, 382] \ No newline at end of file +[4, 1, 52, 391, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 1, 0, 1, 0, 1, 1, 5, 1, 90, 8, 1, 10, 1, 12, 1, 93, 9, 1, 1, 2, 1, 2, 3, 2, 97, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 5, 4, 105, 8, 4, 10, 4, 12, 4, 108, 9, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 117, 8, 5, 1, 6, 1, 6, 1, 6, 3, 6, 122, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 130, 8, 6, 10, 6, 12, 6, 133, 9, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 146, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 5, 7, 156, 8, 7, 10, 7, 12, 7, 159, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 169, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 175, 8, 11, 10, 11, 12, 11, 178, 9, 11, 1, 11, 3, 11, 181, 8, 11, 3, 11, 183, 8, 11, 1, 11, 1, 11, 1, 12, 1, 12, 5, 12, 189, 8, 12, 10, 12, 12, 12, 192, 9, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 5, 13, 204, 8, 13, 10, 13, 12, 13, 207, 9, 13, 1, 13, 1, 13, 3, 13, 211, 8, 13, 1, 13, 1, 13, 1, 13, 3, 13, 216, 8, 13, 1, 14, 1, 14, 1, 14, 5, 14, 221, 8, 14, 10, 14, 12, 14, 224, 9, 14, 1, 15, 1, 15, 3, 15, 228, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 235, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 246, 8, 17, 1, 17, 3, 17, 249, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 3, 18, 256, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 3, 21, 269, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 5, 22, 276, 8, 22, 10, 22, 12, 22, 279, 9, 22, 1, 23, 1, 23, 1, 23, 5, 23, 284, 8, 23, 10, 23, 12, 23, 287, 9, 23, 1, 23, 3, 23, 290, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 3, 27, 304, 8, 27, 1, 28, 1, 28, 1, 28, 5, 28, 309, 8, 28, 10, 28, 12, 28, 312, 9, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 319, 8, 29, 10, 29, 12, 29, 322, 9, 29, 1, 30, 1, 30, 3, 30, 326, 8, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 3, 32, 333, 8, 32, 1, 32, 1, 32, 1, 32, 3, 32, 338, 8, 32, 1, 33, 1, 33, 1, 33, 3, 33, 343, 8, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 5, 37, 355, 8, 37, 10, 37, 12, 37, 358, 9, 37, 4, 37, 360, 8, 37, 11, 37, 12, 37, 361, 1, 37, 1, 37, 1, 37, 5, 37, 367, 8, 37, 10, 37, 12, 37, 370, 9, 37, 1, 37, 3, 37, 373, 8, 37, 1, 38, 1, 38, 3, 38, 377, 8, 38, 1, 39, 1, 39, 1, 40, 1, 40, 3, 40, 383, 8, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 0, 2, 12, 14, 43, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 0, 9, 3, 0, 3, 4, 6, 6, 10, 10, 2, 0, 5, 6, 15, 15, 2, 0, 9, 9, 23, 23, 2, 0, 3, 4, 10, 10, 2, 0, 40, 40, 42, 42, 2, 0, 26, 26, 34, 34, 4, 0, 20, 21, 28, 29, 35, 35, 38, 38, 5, 0, 18, 18, 26, 26, 33, 33, 37, 37, 41, 41, 2, 0, 19, 19, 27, 27, 399, 0, 86, 1, 0, 0, 0, 2, 91, 1, 0, 0, 0, 4, 96, 1, 0, 0, 0, 6, 98, 1, 0, 0, 0, 8, 102, 1, 0, 0, 0, 10, 116, 1, 0, 0, 0, 12, 121, 1, 0, 0, 0, 14, 145, 1, 0, 0, 0, 16, 160, 1, 0, 0, 0, 18, 164, 1, 0, 0, 0, 20, 168, 1, 0, 0, 0, 22, 170, 1, 0, 0, 0, 24, 186, 1, 0, 0, 0, 26, 210, 1, 0, 0, 0, 28, 217, 1, 0, 0, 0, 30, 227, 1, 0, 0, 0, 32, 229, 1, 0, 0, 0, 34, 238, 1, 0, 0, 0, 36, 252, 1, 0, 0, 0, 38, 260, 1, 0, 0, 0, 40, 263, 1, 0, 0, 0, 42, 265, 1, 0, 0, 0, 44, 272, 1, 0, 0, 0, 46, 280, 1, 0, 0, 0, 48, 291, 1, 0, 0, 0, 50, 295, 1, 0, 0, 0, 52, 298, 1, 0, 0, 0, 54, 303, 1, 0, 0, 0, 56, 305, 1, 0, 0, 0, 58, 313, 1, 0, 0, 0, 60, 325, 1, 0, 0, 0, 62, 327, 1, 0, 0, 0, 64, 332, 1, 0, 0, 0, 66, 342, 1, 0, 0, 0, 68, 344, 1, 0, 0, 0, 70, 346, 1, 0, 0, 0, 72, 348, 1, 0, 0, 0, 74, 372, 1, 0, 0, 0, 76, 376, 1, 0, 0, 0, 78, 378, 1, 0, 0, 0, 80, 382, 1, 0, 0, 0, 82, 384, 1, 0, 0, 0, 84, 386, 1, 0, 0, 0, 86, 87, 3, 2, 1, 0, 87, 1, 1, 0, 0, 0, 88, 90, 3, 4, 2, 0, 89, 88, 1, 0, 0, 0, 90, 93, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 3, 1, 0, 0, 0, 93, 91, 1, 0, 0, 0, 94, 97, 3, 6, 3, 0, 95, 97, 3, 8, 4, 0, 96, 94, 1, 0, 0, 0, 96, 95, 1, 0, 0, 0, 97, 5, 1, 0, 0, 0, 98, 99, 7, 0, 0, 0, 99, 100, 5, 9, 0, 0, 100, 101, 3, 12, 6, 0, 101, 7, 1, 0, 0, 0, 102, 106, 5, 10, 0, 0, 103, 105, 3, 10, 5, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 3, 16, 8, 0, 110, 9, 1, 0, 0, 0, 111, 112, 5, 16, 0, 0, 112, 113, 3, 82, 41, 0, 113, 114, 5, 16, 0, 0, 114, 117, 1, 0, 0, 0, 115, 117, 5, 10, 0, 0, 116, 111, 1, 0, 0, 0, 116, 115, 1, 0, 0, 0, 117, 11, 1, 0, 0, 0, 118, 119, 6, 6, -1, 0, 119, 122, 3, 14, 7, 0, 120, 122, 3, 60, 30, 0, 121, 118, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 131, 1, 0, 0, 0, 123, 124, 10, 1, 0, 0, 124, 125, 5, 30, 0, 0, 125, 126, 3, 12, 6, 0, 126, 127, 5, 23, 0, 0, 127, 128, 3, 12, 6, 2, 128, 130, 1, 0, 0, 0, 129, 123, 1, 0, 0, 0, 130, 133, 1, 0, 0, 0, 131, 129, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 13, 1, 0, 0, 0, 133, 131, 1, 0, 0, 0, 134, 135, 6, 7, -1, 0, 135, 146, 3, 74, 37, 0, 136, 146, 3, 18, 9, 0, 137, 146, 3, 30, 15, 0, 138, 146, 3, 20, 10, 0, 139, 146, 3, 40, 20, 0, 140, 146, 3, 42, 21, 0, 141, 142, 5, 25, 0, 0, 142, 143, 3, 12, 6, 0, 143, 144, 5, 32, 0, 0, 144, 146, 1, 0, 0, 0, 145, 134, 1, 0, 0, 0, 145, 136, 1, 0, 0, 0, 145, 137, 1, 0, 0, 0, 145, 138, 1, 0, 0, 0, 145, 139, 1, 0, 0, 0, 145, 140, 1, 0, 0, 0, 145, 141, 1, 0, 0, 0, 146, 157, 1, 0, 0, 0, 147, 148, 10, 5, 0, 0, 148, 156, 3, 48, 24, 0, 149, 150, 10, 4, 0, 0, 150, 156, 3, 50, 25, 0, 151, 152, 10, 3, 0, 0, 152, 156, 3, 52, 26, 0, 153, 154, 10, 2, 0, 0, 154, 156, 3, 54, 27, 0, 155, 147, 1, 0, 0, 0, 155, 149, 1, 0, 0, 0, 155, 151, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 15, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 161, 5, 7, 0, 0, 161, 162, 3, 2, 1, 0, 162, 163, 5, 8, 0, 0, 163, 17, 1, 0, 0, 0, 164, 165, 7, 1, 0, 0, 165, 19, 1, 0, 0, 0, 166, 169, 3, 22, 11, 0, 167, 169, 3, 24, 12, 0, 168, 166, 1, 0, 0, 0, 168, 167, 1, 0, 0, 0, 169, 21, 1, 0, 0, 0, 170, 182, 5, 24, 0, 0, 171, 176, 3, 12, 6, 0, 172, 173, 5, 40, 0, 0, 173, 175, 3, 12, 6, 0, 174, 172, 1, 0, 0, 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 180, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 181, 5, 40, 0, 0, 180, 179, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 183, 1, 0, 0, 0, 182, 171, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 185, 5, 31, 0, 0, 185, 23, 1, 0, 0, 0, 186, 190, 5, 7, 0, 0, 187, 189, 3, 26, 13, 0, 188, 187, 1, 0, 0, 0, 189, 192, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 193, 194, 5, 8, 0, 0, 194, 25, 1, 0, 0, 0, 195, 211, 3, 28, 14, 0, 196, 211, 5, 6, 0, 0, 197, 198, 5, 25, 0, 0, 198, 199, 3, 28, 14, 0, 199, 200, 5, 32, 0, 0, 200, 211, 1, 0, 0, 0, 201, 205, 5, 16, 0, 0, 202, 204, 3, 80, 40, 0, 203, 202, 1, 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 208, 1, 0, 0, 0, 207, 205, 1, 0, 0, 0, 208, 211, 5, 16, 0, 0, 209, 211, 3, 12, 6, 0, 210, 195, 1, 0, 0, 0, 210, 196, 1, 0, 0, 0, 210, 197, 1, 0, 0, 0, 210, 201, 1, 0, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 213, 7, 2, 0, 0, 213, 215, 3, 12, 6, 0, 214, 216, 5, 40, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 27, 1, 0, 0, 0, 217, 222, 7, 3, 0, 0, 218, 219, 5, 36, 0, 0, 219, 221, 7, 3, 0, 0, 220, 218, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 29, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 228, 3, 32, 16, 0, 226, 228, 3, 34, 17, 0, 227, 225, 1, 0, 0, 0, 227, 226, 1, 0, 0, 0, 228, 31, 1, 0, 0, 0, 229, 230, 5, 2, 0, 0, 230, 231, 3, 36, 18, 0, 231, 232, 5, 23, 0, 0, 232, 234, 3, 12, 6, 0, 233, 235, 3, 38, 19, 0, 234, 233, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 237, 5, 31, 0, 0, 237, 33, 1, 0, 0, 0, 238, 239, 5, 1, 0, 0, 239, 240, 3, 36, 18, 0, 240, 241, 5, 23, 0, 0, 241, 242, 3, 12, 6, 0, 242, 243, 5, 39, 0, 0, 243, 245, 3, 12, 6, 0, 244, 246, 5, 42, 0, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 248, 1, 0, 0, 0, 247, 249, 3, 38, 19, 0, 248, 247, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 5, 8, 0, 0, 251, 35, 1, 0, 0, 0, 252, 255, 5, 10, 0, 0, 253, 254, 5, 40, 0, 0, 254, 256, 5, 10, 0, 0, 255, 253, 1, 0, 0, 0, 255, 256, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 258, 5, 4, 0, 0, 258, 259, 3, 12, 6, 0, 259, 37, 1, 0, 0, 0, 260, 261, 5, 3, 0, 0, 261, 262, 3, 12, 6, 0, 262, 39, 1, 0, 0, 0, 263, 264, 5, 10, 0, 0, 264, 41, 1, 0, 0, 0, 265, 266, 3, 44, 22, 0, 266, 268, 5, 25, 0, 0, 267, 269, 3, 46, 23, 0, 268, 267, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 271, 5, 32, 0, 0, 271, 43, 1, 0, 0, 0, 272, 277, 5, 10, 0, 0, 273, 274, 5, 22, 0, 0, 274, 276, 5, 10, 0, 0, 275, 273, 1, 0, 0, 0, 276, 279, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 45, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 280, 285, 3, 12, 6, 0, 281, 282, 5, 40, 0, 0, 282, 284, 3, 12, 6, 0, 283, 281, 1, 0, 0, 0, 284, 287, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 289, 1, 0, 0, 0, 287, 285, 1, 0, 0, 0, 288, 290, 7, 4, 0, 0, 289, 288, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 47, 1, 0, 0, 0, 291, 292, 5, 24, 0, 0, 292, 293, 3, 12, 6, 0, 293, 294, 5, 31, 0, 0, 294, 49, 1, 0, 0, 0, 295, 296, 5, 36, 0, 0, 296, 297, 5, 10, 0, 0, 297, 51, 1, 0, 0, 0, 298, 299, 5, 36, 0, 0, 299, 300, 5, 15, 0, 0, 300, 53, 1, 0, 0, 0, 301, 304, 3, 56, 28, 0, 302, 304, 3, 58, 29, 0, 303, 301, 1, 0, 0, 0, 303, 302, 1, 0, 0, 0, 304, 55, 1, 0, 0, 0, 305, 306, 5, 36, 0, 0, 306, 310, 5, 33, 0, 0, 307, 309, 3, 50, 25, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 57, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 24, 0, 0, 314, 315, 5, 33, 0, 0, 315, 320, 5, 31, 0, 0, 316, 319, 3, 50, 25, 0, 317, 319, 3, 48, 24, 0, 318, 316, 1, 0, 0, 0, 318, 317, 1, 0, 0, 0, 319, 322, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 59, 1, 0, 0, 0, 322, 320, 1, 0, 0, 0, 323, 326, 3, 62, 31, 0, 324, 326, 3, 64, 32, 0, 325, 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 61, 1, 0, 0, 0, 327, 328, 7, 5, 0, 0, 328, 329, 3, 14, 7, 0, 329, 63, 1, 0, 0, 0, 330, 333, 3, 14, 7, 0, 331, 333, 3, 62, 31, 0, 332, 330, 1, 0, 0, 0, 332, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 337, 3, 66, 33, 0, 335, 338, 3, 14, 7, 0, 336, 338, 3, 60, 30, 0, 337, 335, 1, 0, 0, 0, 337, 336, 1, 0, 0, 0, 338, 65, 1, 0, 0, 0, 339, 343, 3, 68, 34, 0, 340, 343, 3, 70, 35, 0, 341, 343, 3, 72, 36, 0, 342, 339, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 341, 1, 0, 0, 0, 343, 67, 1, 0, 0, 0, 344, 345, 7, 6, 0, 0, 345, 69, 1, 0, 0, 0, 346, 347, 7, 7, 0, 0, 347, 71, 1, 0, 0, 0, 348, 349, 7, 8, 0, 0, 349, 73, 1, 0, 0, 0, 350, 351, 5, 17, 0, 0, 351, 359, 5, 10, 0, 0, 352, 356, 5, 14, 0, 0, 353, 355, 3, 76, 38, 0, 354, 353, 1, 0, 0, 0, 355, 358, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 360, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 359, 352, 1, 0, 0, 0, 360, 361, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 361, 362, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 373, 5, 10, 0, 0, 364, 368, 5, 16, 0, 0, 365, 367, 3, 80, 40, 0, 366, 365, 1, 0, 0, 0, 367, 370, 1, 0, 0, 0, 368, 366, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 371, 1, 0, 0, 0, 370, 368, 1, 0, 0, 0, 371, 373, 5, 16, 0, 0, 372, 350, 1, 0, 0, 0, 372, 364, 1, 0, 0, 0, 373, 75, 1, 0, 0, 0, 374, 377, 3, 84, 42, 0, 375, 377, 3, 78, 39, 0, 376, 374, 1, 0, 0, 0, 376, 375, 1, 0, 0, 0, 377, 77, 1, 0, 0, 0, 378, 379, 5, 50, 0, 0, 379, 79, 1, 0, 0, 0, 380, 383, 3, 84, 42, 0, 381, 383, 3, 82, 41, 0, 382, 380, 1, 0, 0, 0, 382, 381, 1, 0, 0, 0, 383, 81, 1, 0, 0, 0, 384, 385, 5, 45, 0, 0, 385, 83, 1, 0, 0, 0, 386, 387, 5, 44, 0, 0, 387, 388, 3, 12, 6, 0, 388, 389, 5, 8, 0, 0, 389, 85, 1, 0, 0, 0, 41, 91, 96, 106, 116, 121, 131, 145, 155, 157, 168, 176, 180, 182, 190, 205, 210, 215, 222, 227, 234, 245, 248, 255, 268, 277, 285, 289, 303, 310, 318, 320, 325, 332, 337, 342, 356, 361, 368, 372, 376, 382] \ No newline at end of file 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 7e93f4c2d5f..a3ba57454c9 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 @@ -225,7 +225,7 @@ public final BodyContext body() throws RecognitionException { setState(91); _errHandler.sync(this); _la = _input.LA(1); - while (_la==NULL || _la==Identifier) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1112L) != 0)) { { { setState(88); @@ -318,6 +318,8 @@ public ExpressionContext expression() { } public TerminalNode Identifier() { return getToken(HCLParser.Identifier, 0); } public TerminalNode NULL() { return getToken(HCLParser.NULL, 0); } + public TerminalNode IF() { return getToken(HCLParser.IF, 0); } + public TerminalNode IN() { return getToken(HCLParser.IN, 0); } public AttributeContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -346,7 +348,7 @@ public final AttributeContext attribute() throws RecognitionException { { setState(98); _la = _input.LA(1); - if ( !(_la==NULL || _la==Identifier) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1112L) != 0)) ) { _errHandler.recoverInline(this); } else { @@ -1378,7 +1380,7 @@ public final ObjectContext object() throws RecognitionException { setState(190); _errHandler.sync(this); _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 17297540326L) != 0)) { + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 17297540350L) != 0)) { { { setState(187); @@ -1552,6 +1554,14 @@ public static class QualifiedIdentifierContext extends ParserRuleContext { public TerminalNode Identifier(int i) { return getToken(HCLParser.Identifier, i); } + public List IF() { return getTokens(HCLParser.IF); } + public TerminalNode IF(int i) { + return getToken(HCLParser.IF, i); + } + public List IN() { return getTokens(HCLParser.IN); } + public TerminalNode IN(int i) { + return getToken(HCLParser.IN, i); + } public List DOT() { return getTokens(HCLParser.DOT); } public TerminalNode DOT(int i) { return getToken(HCLParser.DOT, i); @@ -1583,7 +1593,15 @@ public final QualifiedIdentifierContext qualifiedIdentifier() throws Recognition enterOuterAlt(_localctx, 1); { setState(217); - match(Identifier); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1048L) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } setState(222); _errHandler.sync(this); _la = _input.LA(1); @@ -1593,7 +1611,15 @@ public final QualifiedIdentifierContext qualifiedIdentifier() throws Recognition setState(218); match(DOT); setState(219); - match(Identifier); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1048L) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } } } setState(224); @@ -3571,101 +3597,102 @@ private boolean exprTerm_sempred(ExprTermContext _localctx, int predIndex) { "\u0003&\u0179\b&\u0001\'\u0001\'\u0001(\u0001(\u0003(\u017f\b(\u0001)"+ "\u0001)\u0001*\u0001*\u0001*\u0001*\u0001*\u0000\u0002\f\u000e+\u0000"+ "\u0002\u0004\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c"+ - "\u001e \"$&(*,.02468:<>@BDFHJLNPRT\u0000\b\u0002\u0000\u0006\u0006\n\n"+ - "\u0002\u0000\u0005\u0006\u000f\u000f\u0002\u0000\t\t\u0017\u0017\u0002"+ - "\u0000((**\u0002\u0000\u001a\u001a\"\"\u0004\u0000\u0014\u0015\u001c\u001d"+ - "##&&\u0005\u0000\u0012\u0012\u001a\u001a!!%%))\u0002\u0000\u0013\u0013"+ - "\u001b\u001b\u018f\u0000V\u0001\u0000\u0000\u0000\u0002[\u0001\u0000\u0000"+ - "\u0000\u0004`\u0001\u0000\u0000\u0000\u0006b\u0001\u0000\u0000\u0000\b"+ - "f\u0001\u0000\u0000\u0000\nt\u0001\u0000\u0000\u0000\fy\u0001\u0000\u0000"+ - "\u0000\u000e\u0091\u0001\u0000\u0000\u0000\u0010\u00a0\u0001\u0000\u0000"+ - "\u0000\u0012\u00a4\u0001\u0000\u0000\u0000\u0014\u00a8\u0001\u0000\u0000"+ - "\u0000\u0016\u00aa\u0001\u0000\u0000\u0000\u0018\u00ba\u0001\u0000\u0000"+ - "\u0000\u001a\u00d2\u0001\u0000\u0000\u0000\u001c\u00d9\u0001\u0000\u0000"+ - "\u0000\u001e\u00e3\u0001\u0000\u0000\u0000 \u00e5\u0001\u0000\u0000\u0000"+ - "\"\u00ee\u0001\u0000\u0000\u0000$\u00fc\u0001\u0000\u0000\u0000&\u0104"+ - "\u0001\u0000\u0000\u0000(\u0107\u0001\u0000\u0000\u0000*\u0109\u0001\u0000"+ - "\u0000\u0000,\u0110\u0001\u0000\u0000\u0000.\u0118\u0001\u0000\u0000\u0000"+ - "0\u0123\u0001\u0000\u0000\u00002\u0127\u0001\u0000\u0000\u00004\u012a"+ - "\u0001\u0000\u0000\u00006\u012f\u0001\u0000\u0000\u00008\u0131\u0001\u0000"+ - "\u0000\u0000:\u0139\u0001\u0000\u0000\u0000<\u0145\u0001\u0000\u0000\u0000"+ - ">\u0147\u0001\u0000\u0000\u0000@\u014c\u0001\u0000\u0000\u0000B\u0156"+ - "\u0001\u0000\u0000\u0000D\u0158\u0001\u0000\u0000\u0000F\u015a\u0001\u0000"+ - "\u0000\u0000H\u015c\u0001\u0000\u0000\u0000J\u0174\u0001\u0000\u0000\u0000"+ - "L\u0178\u0001\u0000\u0000\u0000N\u017a\u0001\u0000\u0000\u0000P\u017e"+ - "\u0001\u0000\u0000\u0000R\u0180\u0001\u0000\u0000\u0000T\u0182\u0001\u0000"+ - "\u0000\u0000VW\u0003\u0002\u0001\u0000W\u0001\u0001\u0000\u0000\u0000"+ - "XZ\u0003\u0004\u0002\u0000YX\u0001\u0000\u0000\u0000Z]\u0001\u0000\u0000"+ - "\u0000[Y\u0001\u0000\u0000\u0000[\\\u0001\u0000\u0000\u0000\\\u0003\u0001"+ - "\u0000\u0000\u0000][\u0001\u0000\u0000\u0000^a\u0003\u0006\u0003\u0000"+ - "_a\u0003\b\u0004\u0000`^\u0001\u0000\u0000\u0000`_\u0001\u0000\u0000\u0000"+ - "a\u0005\u0001\u0000\u0000\u0000bc\u0007\u0000\u0000\u0000cd\u0005\t\u0000"+ - "\u0000de\u0003\f\u0006\u0000e\u0007\u0001\u0000\u0000\u0000fj\u0005\n"+ - "\u0000\u0000gi\u0003\n\u0005\u0000hg\u0001\u0000\u0000\u0000il\u0001\u0000"+ - "\u0000\u0000jh\u0001\u0000\u0000\u0000jk\u0001\u0000\u0000\u0000km\u0001"+ - "\u0000\u0000\u0000lj\u0001\u0000\u0000\u0000mn\u0003\u0010\b\u0000n\t"+ - "\u0001\u0000\u0000\u0000op\u0005\u0010\u0000\u0000pq\u0003R)\u0000qr\u0005"+ - "\u0010\u0000\u0000ru\u0001\u0000\u0000\u0000su\u0005\n\u0000\u0000to\u0001"+ - "\u0000\u0000\u0000ts\u0001\u0000\u0000\u0000u\u000b\u0001\u0000\u0000"+ - "\u0000vw\u0006\u0006\uffff\uffff\u0000wz\u0003\u000e\u0007\u0000xz\u0003"+ - "<\u001e\u0000yv\u0001\u0000\u0000\u0000yx\u0001\u0000\u0000\u0000z\u0083"+ - "\u0001\u0000\u0000\u0000{|\n\u0001\u0000\u0000|}\u0005\u001e\u0000\u0000"+ - "}~\u0003\f\u0006\u0000~\u007f\u0005\u0017\u0000\u0000\u007f\u0080\u0003"+ - "\f\u0006\u0002\u0080\u0082\u0001\u0000\u0000\u0000\u0081{\u0001\u0000"+ - "\u0000\u0000\u0082\u0085\u0001\u0000\u0000\u0000\u0083\u0081\u0001\u0000"+ - "\u0000\u0000\u0083\u0084\u0001\u0000\u0000\u0000\u0084\r\u0001\u0000\u0000"+ - "\u0000\u0085\u0083\u0001\u0000\u0000\u0000\u0086\u0087\u0006\u0007\uffff"+ - "\uffff\u0000\u0087\u0092\u0003J%\u0000\u0088\u0092\u0003\u0012\t\u0000"+ - "\u0089\u0092\u0003\u001e\u000f\u0000\u008a\u0092\u0003\u0014\n\u0000\u008b"+ - "\u0092\u0003(\u0014\u0000\u008c\u0092\u0003*\u0015\u0000\u008d\u008e\u0005"+ - "\u0019\u0000\u0000\u008e\u008f\u0003\f\u0006\u0000\u008f\u0090\u0005 "+ - "\u0000\u0000\u0090\u0092\u0001\u0000\u0000\u0000\u0091\u0086\u0001\u0000"+ - "\u0000\u0000\u0091\u0088\u0001\u0000\u0000\u0000\u0091\u0089\u0001\u0000"+ - "\u0000\u0000\u0091\u008a\u0001\u0000\u0000\u0000\u0091\u008b\u0001\u0000"+ - "\u0000\u0000\u0091\u008c\u0001\u0000\u0000\u0000\u0091\u008d\u0001\u0000"+ - "\u0000\u0000\u0092\u009d\u0001\u0000\u0000\u0000\u0093\u0094\n\u0005\u0000"+ - "\u0000\u0094\u009c\u00030\u0018\u0000\u0095\u0096\n\u0004\u0000\u0000"+ - "\u0096\u009c\u00032\u0019\u0000\u0097\u0098\n\u0003\u0000\u0000\u0098"+ - "\u009c\u00034\u001a\u0000\u0099\u009a\n\u0002\u0000\u0000\u009a\u009c"+ - "\u00036\u001b\u0000\u009b\u0093\u0001\u0000\u0000\u0000\u009b\u0095\u0001"+ - "\u0000\u0000\u0000\u009b\u0097\u0001\u0000\u0000\u0000\u009b\u0099\u0001"+ - "\u0000\u0000\u0000\u009c\u009f\u0001\u0000\u0000\u0000\u009d\u009b\u0001"+ - "\u0000\u0000\u0000\u009d\u009e\u0001\u0000\u0000\u0000\u009e\u000f\u0001"+ - "\u0000\u0000\u0000\u009f\u009d\u0001\u0000\u0000\u0000\u00a0\u00a1\u0005"+ - "\u0007\u0000\u0000\u00a1\u00a2\u0003\u0002\u0001\u0000\u00a2\u00a3\u0005"+ - "\b\u0000\u0000\u00a3\u0011\u0001\u0000\u0000\u0000\u00a4\u00a5\u0007\u0001"+ - "\u0000\u0000\u00a5\u0013\u0001\u0000\u0000\u0000\u00a6\u00a9\u0003\u0016"+ - "\u000b\u0000\u00a7\u00a9\u0003\u0018\f\u0000\u00a8\u00a6\u0001\u0000\u0000"+ - "\u0000\u00a8\u00a7\u0001\u0000\u0000\u0000\u00a9\u0015\u0001\u0000\u0000"+ - "\u0000\u00aa\u00b6\u0005\u0018\u0000\u0000\u00ab\u00b0\u0003\f\u0006\u0000"+ - "\u00ac\u00ad\u0005(\u0000\u0000\u00ad\u00af\u0003\f\u0006\u0000\u00ae"+ - "\u00ac\u0001\u0000\u0000\u0000\u00af\u00b2\u0001\u0000\u0000\u0000\u00b0"+ - "\u00ae\u0001\u0000\u0000\u0000\u00b0\u00b1\u0001\u0000\u0000\u0000\u00b1"+ - "\u00b4\u0001\u0000\u0000\u0000\u00b2\u00b0\u0001\u0000\u0000\u0000\u00b3"+ - "\u00b5\u0005(\u0000\u0000\u00b4\u00b3\u0001\u0000\u0000\u0000\u00b4\u00b5"+ - "\u0001\u0000\u0000\u0000\u00b5\u00b7\u0001\u0000\u0000\u0000\u00b6\u00ab"+ - "\u0001\u0000\u0000\u0000\u00b6\u00b7\u0001\u0000\u0000\u0000\u00b7\u00b8"+ - "\u0001\u0000\u0000\u0000\u00b8\u00b9\u0005\u001f\u0000\u0000\u00b9\u0017"+ - "\u0001\u0000\u0000\u0000\u00ba\u00be\u0005\u0007\u0000\u0000\u00bb\u00bd"+ - "\u0003\u001a\r\u0000\u00bc\u00bb\u0001\u0000\u0000\u0000\u00bd\u00c0\u0001"+ - "\u0000\u0000\u0000\u00be\u00bc\u0001\u0000\u0000\u0000\u00be\u00bf\u0001"+ - "\u0000\u0000\u0000\u00bf\u00c1\u0001\u0000\u0000\u0000\u00c0\u00be\u0001"+ - "\u0000\u0000\u0000\u00c1\u00c2\u0005\b\u0000\u0000\u00c2\u0019\u0001\u0000"+ - "\u0000\u0000\u00c3\u00d3\u0003\u001c\u000e\u0000\u00c4\u00d3\u0005\u0006"+ - "\u0000\u0000\u00c5\u00c6\u0005\u0019\u0000\u0000\u00c6\u00c7\u0003\u001c"+ - "\u000e\u0000\u00c7\u00c8\u0005 \u0000\u0000\u00c8\u00d3\u0001\u0000\u0000"+ - "\u0000\u00c9\u00cd\u0005\u0010\u0000\u0000\u00ca\u00cc\u0003P(\u0000\u00cb"+ - "\u00ca\u0001\u0000\u0000\u0000\u00cc\u00cf\u0001\u0000\u0000\u0000\u00cd"+ - "\u00cb\u0001\u0000\u0000\u0000\u00cd\u00ce\u0001\u0000\u0000\u0000\u00ce"+ - "\u00d0\u0001\u0000\u0000\u0000\u00cf\u00cd\u0001\u0000\u0000\u0000\u00d0"+ - "\u00d3\u0005\u0010\u0000\u0000\u00d1\u00d3\u0003\f\u0006\u0000\u00d2\u00c3"+ - "\u0001\u0000\u0000\u0000\u00d2\u00c4\u0001\u0000\u0000\u0000\u00d2\u00c5"+ - "\u0001\u0000\u0000\u0000\u00d2\u00c9\u0001\u0000\u0000\u0000\u00d2\u00d1"+ - "\u0001\u0000\u0000\u0000\u00d3\u00d4\u0001\u0000\u0000\u0000\u00d4\u00d5"+ - "\u0007\u0002\u0000\u0000\u00d5\u00d7\u0003\f\u0006\u0000\u00d6\u00d8\u0005"+ - "(\u0000\u0000\u00d7\u00d6\u0001\u0000\u0000\u0000\u00d7\u00d8\u0001\u0000"+ - "\u0000\u0000\u00d8\u001b\u0001\u0000\u0000\u0000\u00d9\u00de\u0005\n\u0000"+ - "\u0000\u00da\u00db\u0005$\u0000\u0000\u00db\u00dd\u0005\n\u0000\u0000"+ + "\u001e \"$&(*,.02468:<>@BDFHJLNPRT\u0000\t\u0003\u0000\u0003\u0004\u0006"+ + "\u0006\n\n\u0002\u0000\u0005\u0006\u000f\u000f\u0002\u0000\t\t\u0017\u0017"+ + "\u0002\u0000\u0003\u0004\n\n\u0002\u0000((**\u0002\u0000\u001a\u001a\""+ + "\"\u0004\u0000\u0014\u0015\u001c\u001d##&&\u0005\u0000\u0012\u0012\u001a"+ + "\u001a!!%%))\u0002\u0000\u0013\u0013\u001b\u001b\u018f\u0000V\u0001\u0000"+ + "\u0000\u0000\u0002[\u0001\u0000\u0000\u0000\u0004`\u0001\u0000\u0000\u0000"+ + "\u0006b\u0001\u0000\u0000\u0000\bf\u0001\u0000\u0000\u0000\nt\u0001\u0000"+ + "\u0000\u0000\fy\u0001\u0000\u0000\u0000\u000e\u0091\u0001\u0000\u0000"+ + "\u0000\u0010\u00a0\u0001\u0000\u0000\u0000\u0012\u00a4\u0001\u0000\u0000"+ + "\u0000\u0014\u00a8\u0001\u0000\u0000\u0000\u0016\u00aa\u0001\u0000\u0000"+ + "\u0000\u0018\u00ba\u0001\u0000\u0000\u0000\u001a\u00d2\u0001\u0000\u0000"+ + "\u0000\u001c\u00d9\u0001\u0000\u0000\u0000\u001e\u00e3\u0001\u0000\u0000"+ + "\u0000 \u00e5\u0001\u0000\u0000\u0000\"\u00ee\u0001\u0000\u0000\u0000"+ + "$\u00fc\u0001\u0000\u0000\u0000&\u0104\u0001\u0000\u0000\u0000(\u0107"+ + "\u0001\u0000\u0000\u0000*\u0109\u0001\u0000\u0000\u0000,\u0110\u0001\u0000"+ + "\u0000\u0000.\u0118\u0001\u0000\u0000\u00000\u0123\u0001\u0000\u0000\u0000"+ + "2\u0127\u0001\u0000\u0000\u00004\u012a\u0001\u0000\u0000\u00006\u012f"+ + "\u0001\u0000\u0000\u00008\u0131\u0001\u0000\u0000\u0000:\u0139\u0001\u0000"+ + "\u0000\u0000<\u0145\u0001\u0000\u0000\u0000>\u0147\u0001\u0000\u0000\u0000"+ + "@\u014c\u0001\u0000\u0000\u0000B\u0156\u0001\u0000\u0000\u0000D\u0158"+ + "\u0001\u0000\u0000\u0000F\u015a\u0001\u0000\u0000\u0000H\u015c\u0001\u0000"+ + "\u0000\u0000J\u0174\u0001\u0000\u0000\u0000L\u0178\u0001\u0000\u0000\u0000"+ + "N\u017a\u0001\u0000\u0000\u0000P\u017e\u0001\u0000\u0000\u0000R\u0180"+ + "\u0001\u0000\u0000\u0000T\u0182\u0001\u0000\u0000\u0000VW\u0003\u0002"+ + "\u0001\u0000W\u0001\u0001\u0000\u0000\u0000XZ\u0003\u0004\u0002\u0000"+ + "YX\u0001\u0000\u0000\u0000Z]\u0001\u0000\u0000\u0000[Y\u0001\u0000\u0000"+ + "\u0000[\\\u0001\u0000\u0000\u0000\\\u0003\u0001\u0000\u0000\u0000][\u0001"+ + "\u0000\u0000\u0000^a\u0003\u0006\u0003\u0000_a\u0003\b\u0004\u0000`^\u0001"+ + "\u0000\u0000\u0000`_\u0001\u0000\u0000\u0000a\u0005\u0001\u0000\u0000"+ + "\u0000bc\u0007\u0000\u0000\u0000cd\u0005\t\u0000\u0000de\u0003\f\u0006"+ + "\u0000e\u0007\u0001\u0000\u0000\u0000fj\u0005\n\u0000\u0000gi\u0003\n"+ + "\u0005\u0000hg\u0001\u0000\u0000\u0000il\u0001\u0000\u0000\u0000jh\u0001"+ + "\u0000\u0000\u0000jk\u0001\u0000\u0000\u0000km\u0001\u0000\u0000\u0000"+ + "lj\u0001\u0000\u0000\u0000mn\u0003\u0010\b\u0000n\t\u0001\u0000\u0000"+ + "\u0000op\u0005\u0010\u0000\u0000pq\u0003R)\u0000qr\u0005\u0010\u0000\u0000"+ + "ru\u0001\u0000\u0000\u0000su\u0005\n\u0000\u0000to\u0001\u0000\u0000\u0000"+ + "ts\u0001\u0000\u0000\u0000u\u000b\u0001\u0000\u0000\u0000vw\u0006\u0006"+ + "\uffff\uffff\u0000wz\u0003\u000e\u0007\u0000xz\u0003<\u001e\u0000yv\u0001"+ + "\u0000\u0000\u0000yx\u0001\u0000\u0000\u0000z\u0083\u0001\u0000\u0000"+ + "\u0000{|\n\u0001\u0000\u0000|}\u0005\u001e\u0000\u0000}~\u0003\f\u0006"+ + "\u0000~\u007f\u0005\u0017\u0000\u0000\u007f\u0080\u0003\f\u0006\u0002"+ + "\u0080\u0082\u0001\u0000\u0000\u0000\u0081{\u0001\u0000\u0000\u0000\u0082"+ + "\u0085\u0001\u0000\u0000\u0000\u0083\u0081\u0001\u0000\u0000\u0000\u0083"+ + "\u0084\u0001\u0000\u0000\u0000\u0084\r\u0001\u0000\u0000\u0000\u0085\u0083"+ + "\u0001\u0000\u0000\u0000\u0086\u0087\u0006\u0007\uffff\uffff\u0000\u0087"+ + "\u0092\u0003J%\u0000\u0088\u0092\u0003\u0012\t\u0000\u0089\u0092\u0003"+ + "\u001e\u000f\u0000\u008a\u0092\u0003\u0014\n\u0000\u008b\u0092\u0003("+ + "\u0014\u0000\u008c\u0092\u0003*\u0015\u0000\u008d\u008e\u0005\u0019\u0000"+ + "\u0000\u008e\u008f\u0003\f\u0006\u0000\u008f\u0090\u0005 \u0000\u0000"+ + "\u0090\u0092\u0001\u0000\u0000\u0000\u0091\u0086\u0001\u0000\u0000\u0000"+ + "\u0091\u0088\u0001\u0000\u0000\u0000\u0091\u0089\u0001\u0000\u0000\u0000"+ + "\u0091\u008a\u0001\u0000\u0000\u0000\u0091\u008b\u0001\u0000\u0000\u0000"+ + "\u0091\u008c\u0001\u0000\u0000\u0000\u0091\u008d\u0001\u0000\u0000\u0000"+ + "\u0092\u009d\u0001\u0000\u0000\u0000\u0093\u0094\n\u0005\u0000\u0000\u0094"+ + "\u009c\u00030\u0018\u0000\u0095\u0096\n\u0004\u0000\u0000\u0096\u009c"+ + "\u00032\u0019\u0000\u0097\u0098\n\u0003\u0000\u0000\u0098\u009c\u0003"+ + "4\u001a\u0000\u0099\u009a\n\u0002\u0000\u0000\u009a\u009c\u00036\u001b"+ + "\u0000\u009b\u0093\u0001\u0000\u0000\u0000\u009b\u0095\u0001\u0000\u0000"+ + "\u0000\u009b\u0097\u0001\u0000\u0000\u0000\u009b\u0099\u0001\u0000\u0000"+ + "\u0000\u009c\u009f\u0001\u0000\u0000\u0000\u009d\u009b\u0001\u0000\u0000"+ + "\u0000\u009d\u009e\u0001\u0000\u0000\u0000\u009e\u000f\u0001\u0000\u0000"+ + "\u0000\u009f\u009d\u0001\u0000\u0000\u0000\u00a0\u00a1\u0005\u0007\u0000"+ + "\u0000\u00a1\u00a2\u0003\u0002\u0001\u0000\u00a2\u00a3\u0005\b\u0000\u0000"+ + "\u00a3\u0011\u0001\u0000\u0000\u0000\u00a4\u00a5\u0007\u0001\u0000\u0000"+ + "\u00a5\u0013\u0001\u0000\u0000\u0000\u00a6\u00a9\u0003\u0016\u000b\u0000"+ + "\u00a7\u00a9\u0003\u0018\f\u0000\u00a8\u00a6\u0001\u0000\u0000\u0000\u00a8"+ + "\u00a7\u0001\u0000\u0000\u0000\u00a9\u0015\u0001\u0000\u0000\u0000\u00aa"+ + "\u00b6\u0005\u0018\u0000\u0000\u00ab\u00b0\u0003\f\u0006\u0000\u00ac\u00ad"+ + "\u0005(\u0000\u0000\u00ad\u00af\u0003\f\u0006\u0000\u00ae\u00ac\u0001"+ + "\u0000\u0000\u0000\u00af\u00b2\u0001\u0000\u0000\u0000\u00b0\u00ae\u0001"+ + "\u0000\u0000\u0000\u00b0\u00b1\u0001\u0000\u0000\u0000\u00b1\u00b4\u0001"+ + "\u0000\u0000\u0000\u00b2\u00b0\u0001\u0000\u0000\u0000\u00b3\u00b5\u0005"+ + "(\u0000\u0000\u00b4\u00b3\u0001\u0000\u0000\u0000\u00b4\u00b5\u0001\u0000"+ + "\u0000\u0000\u00b5\u00b7\u0001\u0000\u0000\u0000\u00b6\u00ab\u0001\u0000"+ + "\u0000\u0000\u00b6\u00b7\u0001\u0000\u0000\u0000\u00b7\u00b8\u0001\u0000"+ + "\u0000\u0000\u00b8\u00b9\u0005\u001f\u0000\u0000\u00b9\u0017\u0001\u0000"+ + "\u0000\u0000\u00ba\u00be\u0005\u0007\u0000\u0000\u00bb\u00bd\u0003\u001a"+ + "\r\u0000\u00bc\u00bb\u0001\u0000\u0000\u0000\u00bd\u00c0\u0001\u0000\u0000"+ + "\u0000\u00be\u00bc\u0001\u0000\u0000\u0000\u00be\u00bf\u0001\u0000\u0000"+ + "\u0000\u00bf\u00c1\u0001\u0000\u0000\u0000\u00c0\u00be\u0001\u0000\u0000"+ + "\u0000\u00c1\u00c2\u0005\b\u0000\u0000\u00c2\u0019\u0001\u0000\u0000\u0000"+ + "\u00c3\u00d3\u0003\u001c\u000e\u0000\u00c4\u00d3\u0005\u0006\u0000\u0000"+ + "\u00c5\u00c6\u0005\u0019\u0000\u0000\u00c6\u00c7\u0003\u001c\u000e\u0000"+ + "\u00c7\u00c8\u0005 \u0000\u0000\u00c8\u00d3\u0001\u0000\u0000\u0000\u00c9"+ + "\u00cd\u0005\u0010\u0000\u0000\u00ca\u00cc\u0003P(\u0000\u00cb\u00ca\u0001"+ + "\u0000\u0000\u0000\u00cc\u00cf\u0001\u0000\u0000\u0000\u00cd\u00cb\u0001"+ + "\u0000\u0000\u0000\u00cd\u00ce\u0001\u0000\u0000\u0000\u00ce\u00d0\u0001"+ + "\u0000\u0000\u0000\u00cf\u00cd\u0001\u0000\u0000\u0000\u00d0\u00d3\u0005"+ + "\u0010\u0000\u0000\u00d1\u00d3\u0003\f\u0006\u0000\u00d2\u00c3\u0001\u0000"+ + "\u0000\u0000\u00d2\u00c4\u0001\u0000\u0000\u0000\u00d2\u00c5\u0001\u0000"+ + "\u0000\u0000\u00d2\u00c9\u0001\u0000\u0000\u0000\u00d2\u00d1\u0001\u0000"+ + "\u0000\u0000\u00d3\u00d4\u0001\u0000\u0000\u0000\u00d4\u00d5\u0007\u0002"+ + "\u0000\u0000\u00d5\u00d7\u0003\f\u0006\u0000\u00d6\u00d8\u0005(\u0000"+ + "\u0000\u00d7\u00d6\u0001\u0000\u0000\u0000\u00d7\u00d8\u0001\u0000\u0000"+ + "\u0000\u00d8\u001b\u0001\u0000\u0000\u0000\u00d9\u00de\u0007\u0003\u0000"+ + "\u0000\u00da\u00db\u0005$\u0000\u0000\u00db\u00dd\u0007\u0003\u0000\u0000"+ "\u00dc\u00da\u0001\u0000\u0000\u0000\u00dd\u00e0\u0001\u0000\u0000\u0000"+ "\u00de\u00dc\u0001\u0000\u0000\u0000\u00de\u00df\u0001\u0000\u0000\u0000"+ "\u00df\u001d\u0001\u0000\u0000\u0000\u00e0\u00de\u0001\u0000\u0000\u0000"+ @@ -3702,7 +3729,7 @@ private boolean exprTerm_sempred(ExprTermContext _localctx, int predIndex) { "\u0000\u011a\u011c\u0003\f\u0006\u0000\u011b\u0119\u0001\u0000\u0000\u0000"+ "\u011c\u011f\u0001\u0000\u0000\u0000\u011d\u011b\u0001\u0000\u0000\u0000"+ "\u011d\u011e\u0001\u0000\u0000\u0000\u011e\u0121\u0001\u0000\u0000\u0000"+ - "\u011f\u011d\u0001\u0000\u0000\u0000\u0120\u0122\u0007\u0003\u0000\u0000"+ + "\u011f\u011d\u0001\u0000\u0000\u0000\u0120\u0122\u0007\u0004\u0000\u0000"+ "\u0121\u0120\u0001\u0000\u0000\u0000\u0121\u0122\u0001\u0000\u0000\u0000"+ "\u0122/\u0001\u0000\u0000\u0000\u0123\u0124\u0005\u0018\u0000\u0000\u0124"+ "\u0125\u0003\f\u0006\u0000\u0125\u0126\u0005\u001f\u0000\u0000\u01261"+ @@ -3723,7 +3750,7 @@ private boolean exprTerm_sempred(ExprTermContext _localctx, int predIndex) { "\u0000\u0000\u0141;\u0001\u0000\u0000\u0000\u0142\u0140\u0001\u0000\u0000"+ "\u0000\u0143\u0146\u0003>\u001f\u0000\u0144\u0146\u0003@ \u0000\u0145"+ "\u0143\u0001\u0000\u0000\u0000\u0145\u0144\u0001\u0000\u0000\u0000\u0146"+ - "=\u0001\u0000\u0000\u0000\u0147\u0148\u0007\u0004\u0000\u0000\u0148\u0149"+ + "=\u0001\u0000\u0000\u0000\u0147\u0148\u0007\u0005\u0000\u0000\u0148\u0149"+ "\u0003\u000e\u0007\u0000\u0149?\u0001\u0000\u0000\u0000\u014a\u014d\u0003"+ "\u000e\u0007\u0000\u014b\u014d\u0003>\u001f\u0000\u014c\u014a\u0001\u0000"+ "\u0000\u0000\u014c\u014b\u0001\u0000\u0000\u0000\u014d\u014e\u0001\u0000"+ @@ -3733,8 +3760,8 @@ private boolean exprTerm_sempred(ExprTermContext _localctx, int predIndex) { "\u0003D\"\u0000\u0154\u0157\u0003F#\u0000\u0155\u0157\u0003H$\u0000\u0156"+ "\u0153\u0001\u0000\u0000\u0000\u0156\u0154\u0001\u0000\u0000\u0000\u0156"+ "\u0155\u0001\u0000\u0000\u0000\u0157C\u0001\u0000\u0000\u0000\u0158\u0159"+ - "\u0007\u0005\u0000\u0000\u0159E\u0001\u0000\u0000\u0000\u015a\u015b\u0007"+ - "\u0006\u0000\u0000\u015bG\u0001\u0000\u0000\u0000\u015c\u015d\u0007\u0007"+ + "\u0007\u0006\u0000\u0000\u0159E\u0001\u0000\u0000\u0000\u015a\u015b\u0007"+ + "\u0007\u0000\u0000\u015bG\u0001\u0000\u0000\u0000\u015c\u015d\u0007\b"+ "\u0000\u0000\u015dI\u0001\u0000\u0000\u0000\u015e\u015f\u0005\u0011\u0000"+ "\u0000\u015f\u0167\u0005\n\u0000\u0000\u0160\u0164\u0005\u000e\u0000\u0000"+ "\u0161\u0163\u0003L&\u0000\u0162\u0161\u0001\u0000\u0000\u0000\u0163\u0166"+ diff --git a/rewrite-hcl/src/test/java/org/openrewrite/hcl/HclParserTest.java b/rewrite-hcl/src/test/java/org/openrewrite/hcl/HclParserTest.java index 8f8a5c4fbb2..8065f722faa 100644 --- a/rewrite-hcl/src/test/java/org/openrewrite/hcl/HclParserTest.java +++ b/rewrite-hcl/src/test/java/org/openrewrite/hcl/HclParserTest.java @@ -16,6 +16,7 @@ package org.openrewrite.hcl; import org.junit.jupiter.api.Test; +import org.openrewrite.Issue; import org.openrewrite.test.RewriteTest; import static org.openrewrite.hcl.Assertions.hcl; @@ -36,6 +37,107 @@ void unicode() { ); } + @Issue("https://github.com/openrewrite/rewrite/issues/6446") + @Test + void usingIfAsAttributeName() { + rewriteRun( + hcl( + """ + resource "not_a_real_one_for_sure" deny { + if = "a" + } + """ + ) + ); + } + + @Issue("https://github.com/openrewrite/rewrite/issues/6446") + @Test + void usingInAsAttributeName() { + rewriteRun( + hcl( + """ + resource "not_a_real_one_for_sure" deny { + in = "a" + } + """ + ) + ); + } + + @Issue("https://github.com/openrewrite/rewrite/issues/6446") + @Test + void keywordsAsTopLevelAttributes() { + rewriteRun( + hcl( + """ + if = "a" + in = "b" + """ + ) + ); + } + + @Issue("https://github.com/openrewrite/rewrite/issues/6446") + @Test + void keywordAttributeAlongsideForExpression() { + rewriteRun( + hcl( + """ + filtered = [for x in items : x if x > 0] + if = "still works" + """ + ) + ); + } + + @Issue("https://github.com/openrewrite/rewrite/issues/6446") + @Test + void keywordsAsObjectKeys() { + rewriteRun( + hcl( + """ + tags = { + if = "a" + in = "b" + } + """ + ) + ); + } + + @Issue("https://github.com/openrewrite/rewrite/issues/6446") + @Test + void keywordObjectKeyMixedWithRegularKeys() { + rewriteRun( + hcl( + """ + tags = { + name = "x" + if = "y" + env = "z" + } + """ + ) + ); + } + + @Issue("https://github.com/openrewrite/rewrite/issues/6446") + @Test + void keywordAttributeWithCommentAndUnusualSpacing() { + rewriteRun( + hcl( + """ + # condition placeholder + block "x" { + if = "a" + /* trailing */ in = "b" + } + """ + ) + ); + } + @Test void escapes() { rewriteRun(