Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(hogql): two-sided rejection parity for the PBT diagnostic (#59628)

Robbiea6214d642f1b
diff --git a/common/hogql_parser/HogQLParser.cpp b/common/hogql_parser/HogQLParser.cpp
index 3a1590454c52..e6767c45744d 100644
--- a/common/hogql_parser/HogQLParser.cpp
+++ b/common/hogql_parser/HogQLParser.cpp
@@ -633,54 +633,54 @@ void hogqlparserParserInitialize() {
0,0,1197,1198,3,138,69,0,1198,1199,5,185,0,0,1199,1523,1,0,0,0,1200,1201,
5,119,0,0,1201,1202,5,165,0,0,1202,1203,3,154,77,0,1203,1204,5,6,0,0,
1204,1205,3,138,69,0,1205,1206,5,185,0,0,1206,1523,1,0,0,0,1207,1208,
- 5,21,0,0,1208,1523,5,143,0,0,1209,1210,5,56,0,0,1210,1523,5,143,0,0,1211,
- 1212,5,56,0,0,1212,1213,3,154,77,0,1213,1214,3,208,104,0,1214,1523,1,
- 0,0,0,1215,1216,5,104,0,0,1216,1217,5,165,0,0,1217,1218,3,154,77,0,1218,
- 1219,5,39,0,0,1219,1222,3,154,77,0,1220,1221,5,38,0,0,1221,1223,3,154,
- 77,0,1222,1220,1,0,0,0,1222,1223,1,0,0,0,1223,1224,1,0,0,0,1224,1225,
- 5,185,0,0,1225,1523,1,0,0,0,1226,1227,5,108,0,0,1227,1523,5,143,0,0,1228,
- 1229,5,116,0,0,1229,1230,5,165,0,0,1230,1231,7,12,0,0,1231,1232,3,226,
- 113,0,1232,1233,5,39,0,0,1233,1234,3,154,77,0,1234,1235,5,185,0,0,1235,
- 1523,1,0,0,0,1236,1237,5,17,0,0,1237,1238,5,165,0,0,1238,1239,5,143,0,
- 0,1239,1523,5,185,0,0,1240,1241,5,17,0,0,1241,1242,5,165,0,0,1242,1243,
- 3,146,73,0,1243,1244,5,185,0,0,1244,1523,1,0,0,0,1245,1246,5,17,0,0,1246,
- 1247,5,165,0,0,1247,1248,5,145,0,0,1248,1249,5,29,0,0,1249,1250,5,165,
- 0,0,1250,1251,3,8,4,0,1251,1252,5,185,0,0,1252,1253,5,91,0,0,1253,1254,
- 5,165,0,0,1254,1255,3,158,79,0,1255,1256,5,185,0,0,1256,1257,5,185,0,
- 0,1257,1271,1,0,0,0,1258,1259,5,165,0,0,1259,1260,5,145,0,0,1260,1261,
- 5,29,0,0,1261,1262,5,165,0,0,1262,1263,3,8,4,0,1263,1264,5,185,0,0,1264,
- 1265,5,91,0,0,1265,1266,5,165,0,0,1266,1267,3,158,79,0,1267,1268,5,185,
- 0,0,1268,1269,5,185,0,0,1269,1271,1,0,0,0,1270,1245,1,0,0,0,1270,1258,
- 1,0,0,0,1271,1523,1,0,0,0,1272,1273,5,17,0,0,1273,1274,5,165,0,0,1274,
- 1275,5,145,0,0,1275,1276,5,29,0,0,1276,1277,5,165,0,0,1277,1278,3,8,4,
- 0,1278,1279,5,185,0,0,1279,1280,5,185,0,0,1280,1523,1,0,0,0,1281,1282,
- 5,17,0,0,1282,1283,5,165,0,0,1283,1284,5,145,0,0,1284,1285,5,91,0,0,1285,
- 1286,5,165,0,0,1286,1287,3,158,79,0,1287,1288,5,185,0,0,1288,1289,5,185,
- 0,0,1289,1299,1,0,0,0,1290,1291,5,165,0,0,1291,1292,5,145,0,0,1292,1293,
- 5,91,0,0,1293,1294,5,165,0,0,1294,1295,3,158,79,0,1295,1296,5,185,0,0,
- 1296,1297,5,185,0,0,1297,1299,1,0,0,0,1298,1281,1,0,0,0,1298,1290,1,0,
- 0,0,1299,1523,1,0,0,0,1300,1301,5,17,0,0,1301,1302,5,165,0,0,1302,1303,
- 5,145,0,0,1303,1523,5,185,0,0,1304,1305,5,17,0,0,1305,1306,5,165,0,0,
- 1306,1307,3,220,110,0,1307,1308,5,155,0,0,1308,1309,5,145,0,0,1309,1310,
- 5,29,0,0,1310,1311,5,165,0,0,1311,1312,3,8,4,0,1312,1313,5,185,0,0,1313,
- 1314,5,91,0,0,1314,1315,5,165,0,0,1315,1316,3,158,79,0,1316,1317,5,185,
- 0,0,1317,1318,5,185,0,0,1318,1523,1,0,0,0,1319,1320,5,17,0,0,1320,1321,
- 5,165,0,0,1321,1322,3,220,110,0,1322,1323,5,155,0,0,1323,1324,5,145,0,
- 0,1324,1325,5,29,0,0,1325,1326,5,165,0,0,1326,1327,3,8,4,0,1327,1328,
- 5,185,0,0,1328,1329,5,185,0,0,1329,1523,1,0,0,0,1330,1331,5,17,0,0,1331,
- 1332,5,165,0,0,1332,1333,3,220,110,0,1333,1334,5,155,0,0,1334,1335,5,
- 145,0,0,1335,1336,5,91,0,0,1336,1337,5,165,0,0,1337,1338,3,158,79,0,1338,
- 1339,5,185,0,0,1339,1340,5,185,0,0,1340,1523,1,0,0,0,1341,1342,5,17,0,
- 0,1342,1343,5,165,0,0,1343,1344,3,220,110,0,1344,1345,5,155,0,0,1345,
- 1346,5,145,0,0,1346,1347,5,185,0,0,1347,1523,1,0,0,0,1348,1349,5,145,
- 0,0,1349,1350,5,17,0,0,1350,1351,5,165,0,0,1351,1352,5,143,0,0,1352,1523,
- 5,185,0,0,1353,1354,5,145,0,0,1354,1355,5,17,0,0,1355,1356,5,165,0,0,
- 1356,1357,3,146,73,0,1357,1358,5,185,0,0,1358,1523,1,0,0,0,1359,1360,
- 3,220,110,0,1360,1362,5,165,0,0,1361,1363,3,146,73,0,1362,1361,1,0,0,
- 0,1362,1363,1,0,0,0,1363,1364,1,0,0,0,1364,1365,5,185,0,0,1365,1366,3,
- 128,64,0,1366,1523,1,0,0,0,1367,1368,3,220,110,0,1368,1370,5,165,0,0,
- 1369,1371,3,146,73,0,1370,1369,1,0,0,0,1370,1371,1,0,0,0,1371,1372,1,
- 0,0,0,1372,1373,5,185,0,0,1373,1382,1,0,0,0,1374,1376,5,165,0,0,1375,
+ 5,21,0,0,1208,1523,5,143,0,0,1209,1210,5,56,0,0,1210,1211,3,154,77,0,
+ 1211,1212,3,208,104,0,1212,1523,1,0,0,0,1213,1214,5,56,0,0,1214,1523,
+ 5,143,0,0,1215,1216,5,104,0,0,1216,1217,5,165,0,0,1217,1218,3,154,77,
+ 0,1218,1219,5,39,0,0,1219,1222,3,154,77,0,1220,1221,5,38,0,0,1221,1223,
+ 3,154,77,0,1222,1220,1,0,0,0,1222,1223,1,0,0,0,1223,1224,1,0,0,0,1224,
+ 1225,5,185,0,0,1225,1523,1,0,0,0,1226,1227,5,108,0,0,1227,1523,5,143,
+ 0,0,1228,1229,5,116,0,0,1229,1230,5,165,0,0,1230,1231,7,12,0,0,1231,1232,
+ 3,226,113,0,1232,1233,5,39,0,0,1233,1234,3,154,77,0,1234,1235,5,185,0,
+ 0,1235,1523,1,0,0,0,1236,1237,5,17,0,0,1237,1238,5,165,0,0,1238,1239,
+ 5,143,0,0,1239,1523,5,185,0,0,1240,1241,5,17,0,0,1241,1242,5,165,0,0,
+ 1242,1243,3,146,73,0,1243,1244,5,185,0,0,1244,1523,1,0,0,0,1245,1246,
+ 5,17,0,0,1246,1247,5,165,0,0,1247,1248,5,145,0,0,1248,1249,5,29,0,0,1249,
+ 1250,5,165,0,0,1250,1251,3,8,4,0,1251,1252,5,185,0,0,1252,1253,5,91,0,
+ 0,1253,1254,5,165,0,0,1254,1255,3,158,79,0,1255,1256,5,185,0,0,1256,1257,
+ 5,185,0,0,1257,1271,1,0,0,0,1258,1259,5,165,0,0,1259,1260,5,145,0,0,1260,
+ 1261,5,29,0,0,1261,1262,5,165,0,0,1262,1263,3,8,4,0,1263,1264,5,185,0,
+ 0,1264,1265,5,91,0,0,1265,1266,5,165,0,0,1266,1267,3,158,79,0,1267,1268,
+ 5,185,0,0,1268,1269,5,185,0,0,1269,1271,1,0,0,0,1270,1245,1,0,0,0,1270,
+ 1258,1,0,0,0,1271,1523,1,0,0,0,1272,1273,5,17,0,0,1273,1274,5,165,0,0,
+ 1274,1275,5,145,0,0,1275,1276,5,29,0,0,1276,1277,5,165,0,0,1277,1278,
+ 3,8,4,0,1278,1279,5,185,0,0,1279,1280,5,185,0,0,1280,1523,1,0,0,0,1281,
+ 1282,5,17,0,0,1282,1283,5,165,0,0,1283,1284,5,145,0,0,1284,1285,5,91,
+ 0,0,1285,1286,5,165,0,0,1286,1287,3,158,79,0,1287,1288,5,185,0,0,1288,
+ 1289,5,185,0,0,1289,1299,1,0,0,0,1290,1291,5,165,0,0,1291,1292,5,145,
+ 0,0,1292,1293,5,91,0,0,1293,1294,5,165,0,0,1294,1295,3,158,79,0,1295,
+ 1296,5,185,0,0,1296,1297,5,185,0,0,1297,1299,1,0,0,0,1298,1281,1,0,0,
+ 0,1298,1290,1,0,0,0,1299,1523,1,0,0,0,1300,1301,5,17,0,0,1301,1302,5,
+ 165,0,0,1302,1303,5,145,0,0,1303,1523,5,185,0,0,1304,1305,5,17,0,0,1305,
+ 1306,5,165,0,0,1306,1307,3,220,110,0,1307,1308,5,155,0,0,1308,1309,5,
+ 145,0,0,1309,1310,5,29,0,0,1310,1311,5,165,0,0,1311,1312,3,8,4,0,1312,
+ 1313,5,185,0,0,1313,1314,5,91,0,0,1314,1315,5,165,0,0,1315,1316,3,158,
+ 79,0,1316,1317,5,185,0,0,1317,1318,5,185,0,0,1318,1523,1,0,0,0,1319,1320,
+ 5,17,0,0,1320,1321,5,165,0,0,1321,1322,3,220,110,0,1322,1323,5,155,0,
+ 0,1323,1324,5,145,0,0,1324,1325,5,29,0,0,1325,1326,5,165,0,0,1326,1327,
+ 3,8,4,0,1327,1328,5,185,0,0,1328,1329,5,185,0,0,1329,1523,1,0,0,0,1330,
+ 1331,5,17,0,0,1331,1332,5,165,0,0,1332,1333,3,220,110,0,1333,1334,5,155,
+ 0,0,1334,1335,5,145,0,0,1335,1336,5,91,0,0,1336,1337,5,165,0,0,1337,1338,
+ 3,158,79,0,1338,1339,5,185,0,0,1339,1340,5,185,0,0,1340,1523,1,0,0,0,
+ 1341,1342,5,17,0,0,1342,1343,5,165,0,0,1343,1344,3,220,110,0,1344,1345,
+ 5,155,0,0,1345,1346,5,145,0,0,1346,1347,5,185,0,0,1347,1523,1,0,0,0,1348,
+ 1349,5,145,0,0,1349,1350,5,17,0,0,1350,1351,5,165,0,0,1351,1352,5,143,
+ 0,0,1352,1523,5,185,0,0,1353,1354,5,145,0,0,1354,1355,5,17,0,0,1355,1356,
+ 5,165,0,0,1356,1357,3,146,73,0,1357,1358,5,185,0,0,1358,1523,1,0,0,0,
+ 1359,1360,3,220,110,0,1360,1362,5,165,0,0,1361,1363,3,146,73,0,1362,1361,
+ 1,0,0,0,1362,1363,1,0,0,0,1363,1364,1,0,0,0,1364,1365,5,185,0,0,1365,
+ 1366,3,128,64,0,1366,1523,1,0,0,0,1367,1368,3,220,110,0,1368,1370,5,165,
+ 0,0,1369,1371,3,146,73,0,1370,1369,1,0,0,0,1370,1371,1,0,0,0,1371,1372,
+ 1,0,0,0,1372,1373,5,185,0,0,1373,1382,1,0,0,0,1374,1376,5,165,0,0,1375,
1377,5,25,0,0,1376,1375,1,0,0,0,1376,1377,1,0,0,0,1377,1379,1,0,0,0,1378,
1380,3,146,73,0,1379,1378,1,0,0,0,1379,1380,1,0,0,0,1380,1381,1,0,0,0,
1381,1383,5,185,0,0,1382,1374,1,0,0,0,1382,1383,1,0,0,0,1383,1390,1,0,
@@ -728,7 +728,7 @@ void hogqlparserParserInitialize() {
110,0,1516,1517,5,149,0,0,1517,1518,3,154,77,3,1518,1523,1,0,0,0,1519,
1520,5,160,0,0,1520,1523,5,139,0,0,1521,1523,3,176,88,0,1522,1173,1,0,
0,0,1522,1193,1,0,0,0,1522,1200,1,0,0,0,1522,1207,1,0,0,0,1522,1209,1,
- 0,0,0,1522,1211,1,0,0,0,1522,1215,1,0,0,0,1522,1226,1,0,0,0,1522,1228,
+ 0,0,0,1522,1213,1,0,0,0,1522,1215,1,0,0,0,1522,1226,1,0,0,0,1522,1228,
1,0,0,0,1522,1236,1,0,0,0,1522,1240,1,0,0,0,1522,1270,1,0,0,0,1522,1272,
1,0,0,0,1522,1298,1,0,0,0,1522,1300,1,0,0,0,1522,1304,1,0,0,0,1522,1319,
1,0,0,0,1522,1330,1,0,0,0,1522,1341,1,0,0,0,1522,1348,1,0,0,0,1522,1353,
@@ -11641,26 +11641,26 @@ HogQLParser::ColumnExprContext* HogQLParser::columnExpr(int precedence) {
}
case 5: {
- _localctx = _tracker.createInstance<ColumnExprIntervalStringContext>(_localctx);
+ _localctx = _tracker.createInstance<ColumnExprIntervalContext>(_localctx);
_ctx = _localctx;
previousContext = _localctx;
setState(1209);
match(HogQLParser::INTERVAL);
setState(1210);
- match(HogQLParser::STRING_LITERAL);
+ columnExpr(0);
+ setState(1211);
+ interval();
break;
}
case 6: {
- _localctx = _tracker.createInstance<ColumnExprIntervalContext>(_localctx);
+ _localctx = _tracker.createInstance<ColumnExprIntervalStringContext>(_localctx);
_ctx = _localctx;
previousContext = _localctx;
- setState(1211);
- match(HogQLParser::INTERVAL);
- setState(1212);
- columnExpr(0);
setState(1213);
- interval();
+ match(HogQLParser::INTERVAL);
+ setState(1214);
+ match(HogQLParser::STRING_LITERAL);
break;
}
diff --git a/common/hogql_parser/HogQLParser.interp b/common/hogql_parser/HogQLParser.interp
index 9fe98608043b..479c27a552b0 100644
--- a/common/hogql_parser/HogQLParser.interp
+++ b/common/hogql_parser/HogQLParser.interp
@@ -536,4 +536,4 @@ stringContentsFull
atn:
-[4, 1, 205, 2081, 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, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 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, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1523, 5, 143, 0, 0, 1211, 1212, 5, 56, 0, 0, 1212, 1213, 3, 154, 77, 0, 1213, 1214, 3, 208, 104, 0, 1214, 1523, 1, 0, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1211, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 204, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
+[4, 1, 205, 2081, 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, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 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, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1211, 3, 154, 77, 0, 1211, 1212, 3, 208, 104, 0, 1212, 1523, 1, 0, 0, 0, 1213, 1214, 5, 56, 0, 0, 1214, 1523, 5, 143, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1213, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 204, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
diff --git a/common/hogql_parser/package.json b/common/hogql_parser/package.json
index 577e106b71a8..41900f330b4b 100644
--- a/common/hogql_parser/package.json
+++ b/common/hogql_parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@posthog/hogql-parser",
- "version": "1.3.66",
+ "version": "1.3.69",
"description": "WebAssembly HogQL Parser - Parse HogQL queries in JavaScript/TypeScript",
"keywords": [
"antlr4",
diff --git a/common/hogql_parser/parser_json_python.cpp b/common/hogql_parser/parser_json_python.cpp
index 2493c6e42f69..52db482bc495 100644
--- a/common/hogql_parser/parser_json_python.cpp
+++ b/common/hogql_parser/parser_json_python.cpp
@@ -30,9 +30,15 @@
HogQLParser::PASCAL_CASE##Context* parse_tree; \
try { \
parse_tree = parser->CAMEL_CASE(); \
- } catch HANDLE_HOGQL_ERROR( \
- SyntaxError, delete error_listener; delete parser; delete stream; delete lexer; delete input_stream; \
- ) catch (const antlr4::EmptyStackException& e) { \
+ } catch (const SyntaxError& e) { \
+ string err_json = buildJSONError("SyntaxError", e.what(), e.start, e.end).dump(); \
+ delete error_listener; \
+ delete parser; \
+ delete stream; \
+ delete lexer; \
+ delete input_stream; \
+ return PyUnicode_FromStringAndSize(err_json.data(), err_json.size()); \
+ } catch (const antlr4::EmptyStackException& e) { \
delete error_listener; \
delete parser; \
delete stream; \
@@ -41,6 +47,7 @@
PyObject* error_type = PyObject_GetAttrString(state->errors_module, "SyntaxError"); \
if (error_type) { \
PyErr_SetString(error_type, "Unmatched curly bracket"); \
+ Py_DECREF(error_type); \
} \
return NULL; \
} catch (...) { \
@@ -52,6 +59,7 @@
PyObject* error_type = PyObject_GetAttrString(state->errors_module, "ParsingError"); \
if (error_type) { \
PyErr_SetString(error_type, "Unexpected Antlr exception in C++ parser"); \
+ Py_DECREF(error_type); \
} \
return NULL; \
}; \
diff --git a/common/hogql_parser/parser_python.cpp b/common/hogql_parser/parser_python.cpp
index 2d85b798f9e6..367f98a71740 100644
--- a/common/hogql_parser/parser_python.cpp
+++ b/common/hogql_parser/parser_python.cpp
@@ -40,6 +40,7 @@
Py_XDECREF(py_end); \
Py_XDECREF(py_start); \
Py_XDECREF(py_err); \
+ Py_XDECREF(py_err_args); \
Py_XDECREF(error_type); \
OTHER_CLEANUP \
return NULL; \
diff --git a/common/hogql_parser/setup.py b/common/hogql_parser/setup.py
index 289d3d3a7d0f..b1a0053d9ede 100644
--- a/common/hogql_parser/setup.py
+++ b/common/hogql_parser/setup.py
@@ -36,7 +36,7 @@ module = Extension(
setup(
name="hogql_parser",
- version="1.3.66",
+ version="1.3.69",
url="https://github.com/PostHog/posthog/tree/master/common/hogql_parser",
description="HogQL parser for internal PostHog use",
author="PostHog Inc.",
diff --git a/frontend/package.json b/frontend/package.json
index 69a1a014707c..094dece46202 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -68,7 +68,7 @@
"@posthog/docs-onboarding": "workspace:*",
"@posthog/esbuilder": "workspace:*",
"@posthog/hedgehog-mode": "^0.0.48",
- "@posthog/hogql-parser": "1.3.61",
+ "@posthog/hogql-parser": "1.3.69",
"@posthog/hogvm": "workspace:*",
"@posthog/icons": "^0.36.6",
"@posthog/products-access-control": "workspace:*",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a3890f0fdd30..63a2bbf91888 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -284,7 +284,7 @@ importers:
version: 3.12.1
jest:
specifier: 'catalog:'
oxfmt:
specifier: 'catalog:'
version: 0.35.0
@@ -339,7 +339,7 @@ importers:
version: 0.25.10
jest:
specifier: ^29.7.0
puppeteer:
specifier: 19.0.0
version: 19.0.0([email protected])
@@ -367,7 +367,7 @@ importers:
version: 29.5.14
jest:
specifier: ^29.7.0
common/storybook:
dependencies:
@@ -448,7 +448,7 @@ importers:
'@storybook/react-webpack5':
specifier: ^7.6.4
'@storybook/test-runner':
specifier: ^0.16.0
version: 0.16.0([email protected])
@@ -502,7 +502,7 @@ importers:
version: 2.0.0([email protected])
webpack:
specifier: ^5.88.2
+ version: 5.88.2(@swc/[email protected])([email protected])
webpack-cli:
specifier: ^5.1.4
version: 5.1.4([email protected])
@@ -592,8 +592,8 @@ importers:
specifier: ^0.0.48
'@posthog/hogql-parser':
- specifier: 1.3.61
- version: 1.3.61
+ specifier: 1.3.69
+ version: 1.3.69
'@posthog/hogvm':
specifier: workspace:*
version: link:../common/hogvm/typescript
@@ -1803,7 +1803,7 @@ importers:
'@storybook/test-runner':
specifier: ^0.16.0
+ version: 0.16.0(@types/[email protected])([email protected])
'@storybook/theming':
specifier: ^7.6.20
@@ -1824,7 +1824,7 @@ importers:
jest-image-snapshot:
specifier: ^6.4.0
+ version: 6.4.0([email protected](@types/[email protected]))
storybook:
specifier: ^7.6.21
version: 7.6.21([email protected])
@@ -2932,7 +2932,7 @@ importers:
version: 3.1.3
jest:
specifier: '*'
kea:
specifier: 'catalog:'
version: 4.0.0-pre.5([email protected])
@@ -9063,8 +9063,8 @@ packages:
react: 18.3.1
react-dom: 18.3.1
- '@posthog/[email protected]':
- resolution: {integrity: sha512-QrTmMt2ztVqzN8bPifNG71sC1D6qCPiU5l9crC4JP+1t1Mj+ttZ//bJLphMGH2OWUtuhOdnyh65vxIncMPUELA==}
+ '@posthog/[email protected]':
+ resolution: {integrity: sha512-0U3FmWzwupXB+pFtH4xjmP4J2QaWVWQZnEwIm2jaJpl4SaToKCUu5kSuiwHWw1BXzwkS5X/2THwD3NJhy98RSw==}
'@posthog/[email protected]':
resolution: {integrity: sha512-xnusbGNz/5vSMUWdEViWuai7D/gxiMZSDDnP6s/acndMqzN+W4asPUgUNnTUps7OyAS1IKaO9zxhdikFrtooJA==}
@@ -29533,41 +29533,6 @@ snapshots:
- ts-node
- utf-8-validate
- dependencies:
- '@jest/console': 29.7.0
- '@jest/reporters': 29.7.0
- '@jest/test-result': 29.7.0
- '@jest/transform': 29.7.0
- '@jest/types': 29.6.3
- '@types/node': 22.18.8
- ansi-escapes: 4.3.2
- chalk: 4.1.2
- ci-info: 3.8.0
- exit: 0.1.2
- graceful-fs: 4.2.11
- jest-changed-files: 29.7.0
- jest-haste-map: 29.7.0
- jest-message-util: 29.7.0
- jest-regex-util: 29.6.3
- jest-resolve: 29.7.0
- jest-resolve-dependencies: 29.7.0
- jest-runner: 29.7.0
- jest-runtime: 29.7.0
- jest-snapshot: 29.7.0
- jest-util: 29.7.0
- jest-validate: 29.7.0
- jest-watcher: 29.7.0
- micromatch: 4.0.8
- pretty-format: 29.7.0
- slash: 3.0.0
- strip-ansi: 6.0.1
- transitivePeerDependencies:
- - babel-plugin-macros
- - supports-color
- - ts-node
-
dependencies:
'@jest/console': 29.7.0
@@ -29603,41 +29568,6 @@ snapshots:
- supports-color
- ts-node
- dependencies:
- '@jest/console': 29.7.0
- '@jest/reporters': 29.7.0
- '@jest/test-result': 29.7.0
- '@jest/transform': 29.7.0
- '@jest/types': 29.6.3
- '@types/node': 22.18.8
- ansi-escapes: 4.3.2
- chalk: 4.1.2
- ci-info: 3.8.0
- exit: 0.1.2
- graceful-fs: 4.2.11
- jest-changed-files: 29.7.0
- jest-haste-map: 29.7.0
- jest-message-util: 29.7.0
- jest-regex-util: 29.6.3
- jest-resolve: 29.7.0
- jest-resolve-dependencies: 29.7.0
- jest-runner: 29.7.0
- jest-runtime: 29.7.0
- jest-snapshot: 29.7.0
- jest-util: 29.7.0
- jest-validate: 29.7.0
- jest-watcher: 29.7.0
- micromatch: 4.0.8
- pretty-format: 29.7.0
- slash: 3.0.0
- strip-ansi: 6.0.1
- transitivePeerDependencies:
- - babel-plugin-macros
- - supports-color
- - ts-node
-
dependencies:
'@jest/console': 30.0.5
@@ -32281,7 +32211,7 @@ snapshots:
react-refresh: 0.14.0
schema-utils: 3.3.0
source-map: 0.7.6
+ webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
type-fest: 4.41.0
webpack-hot-middleware: 2.25.4
@@ -32327,7 +32257,7 @@ snapshots:
transitivePeerDependencies:
- prop-types
- '@posthog/[email protected]': {}
+ '@posthog/[email protected]': {}
dependencies:
@@ -34314,7 +34244,7 @@ snapshots:
- encoding
- supports-color
dependencies:
'@babel/core': 7.29.0
'@storybook/channels': 7.6.4
@@ -34344,12 +34274,12 @@ snapshots:
semver: 7.7.4
style-loader: 3.3.3([email protected])
swc-loader: 0.2.3(@swc/[email protected])([email protected])
- terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])([email protected])
+ terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])
ts-dedent: 2.2.0
url: 0.11.1
util: 0.12.5
util-deprecate: 1.0.2
+ webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-dev-middleware: 6.1.1([email protected])
webpack-hot-middleware: 2.25.4
webpack-virtual-modules: 0.5.0
@@ -34429,7 +34359,7 @@ snapshots:
get-port: 5.1.1
giget: 1.2.5
globby: 11.1.0
- jscodeshift: 0.15.2(@babel/[email protected](@babel/[email protected]))
+ jscodeshift: 0.15.2(@babel/[email protected](@babel/[email protected]))
leven: 3.1.0
ora: 5.4.1
prettier: 2.8.8
@@ -34475,7 +34405,7 @@ snapshots:
'@types/cross-spawn': 6.0.6
cross-spawn: 7.0.6
globby: 11.1.0
- jscodeshift: 0.15.2(@babel/[email protected](@babel/[email protected]))
+ jscodeshift: 0.15.2(@babel/[email protected](@babel/[email protected]))
lodash: 4.18.1
prettier: 2.8.8
recast: 0.23.11
@@ -34815,7 +34745,7 @@ snapshots:
'@storybook/[email protected]': {}
dependencies:
'@babel/preset-flow': 7.23.3(@babel/[email protected])
'@babel/preset-react': 7.23.3(@babel/[email protected])
@@ -34835,7 +34765,7 @@ snapshots:
react-dom: 18.3.1([email protected])
react-refresh: 0.14.0
semver: 7.7.4
+ webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
'@babel/core': 7.26.0
typescript: 6.0.3
@@ -34935,7 +34865,7 @@ snapshots:
react-docgen-typescript: 2.2.2([email protected])
tslib: 2.8.1
typescript: 6.0.3
+ webpack: 5.88.2(@swc/[email protected])([email protected])
transitivePeerDependencies:
- supports-color
@@ -34969,10 +34899,10 @@ snapshots:
- typescript
- vite-plugin-glimmerx
dependencies:
+ '@storybook/builder-webpack5': 7.6.4([email protected])([email protected])([email protected])
'@types/node': 18.19.130
react: 18.3.1
@@ -35091,7 +35021,7 @@ snapshots:
- encoding
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/generator': 7.29.1
@@ -35108,14 +35038,14 @@ snapshots:
commander: 9.4.1
expect-playwright: 0.8.0
glob: 10.4.5
+ jest: 29.7.0(@types/[email protected])
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-junit: 16.0.0
jest-runner: 29.7.0
jest-serializer-html: 7.1.0
+ jest-watch-typeahead: 2.2.2([email protected](@types/[email protected]))
node-fetch: 2.7.0([email protected])
playwright: 1.45.0
read-pkg-up: 7.0.1
@@ -37528,17 +37458,17 @@ snapshots:
dependencies:
+ webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-cli: 5.1.4([email protected])
dependencies:
+ webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-cli: 5.1.4([email protected])
dependencies:
+ webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-cli: 5.1.4([email protected])
'@xmldom/[email protected]': {}
@@ -38141,14 +38071,14 @@ snapshots:
loader-utils: 2.0.4
make-dir: 3.1.0
schema-utils: 2.7.1
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
'@babel/core': 7.29.0
find-cache-dir: 4.0.0
schema-utils: 4.2.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
@@ -39248,21 +39178,6 @@ snapshots:
safe-buffer: 5.2.1
sha.js: 2.4.12
- dependencies:
- '@jest/types': 29.6.3
- chalk: 4.1.2
- exit: 0.1.2
- graceful-fs: 4.2.11
- jest-util: 29.7.0
- prompts: 2.4.2
- transitivePeerDependencies:
- - '@types/node'
- - babel-plugin-macros
- - supports-color
- - ts-node
-
dependencies:
'@jest/types': 29.6.3
@@ -39278,13 +39193,13 @@ snapshots:
- supports-color
- ts-node
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
+ jest-config: 29.7.0(@types/[email protected])
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
@@ -39390,7 +39305,7 @@ snapshots:
postcss-value-parser: 4.2.0
schema-utils: 2.7.1
semver: 6.3.1
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -39402,7 +39317,7 @@ snapshots:
postcss-modules-values: 4.0.0([email protected])
postcss-value-parser: 4.2.0
semver: 7.8.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -41175,7 +41090,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -41336,7 +41251,7 @@ snapshots:
semver: 7.8.0
tapable: 2.3.0
typescript: 6.0.3
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -42037,7 +41952,7 @@ snapshots:
dependencies:
html-webpack-plugin: 5.5.3([email protected])
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -42046,7 +41961,7 @@ snapshots:
lodash: 4.17.21
pretty-error: 4.0.0
tapable: 2.2.1
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -42822,25 +42737,6 @@ snapshots:
- ts-node
- utf-8-validate
- dependencies:
- '@jest/test-result': 29.7.0
- '@jest/types': 29.6.3
- chalk: 4.1.2
- exit: 0.1.2
- import-local: 3.2.0
- jest-util: 29.7.0
- jest-validate: 29.7.0
- yargs: 17.7.2
- transitivePeerDependencies:
- - '@types/node'
- - babel-plugin-macros
- - supports-color
- - ts-node
-
dependencies:
@@ -42860,16 +42756,16 @@ snapshots:
- supports-color
- ts-node
dependencies:
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
+ create-jest: 29.7.0(@types/[email protected])
exit: 0.1.2
import-local: 3.2.0
+ jest-config: 29.7.0(@types/[email protected])
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.2
@@ -42932,37 +42828,6 @@ snapshots:
- supports-color
- utf-8-validate
- dependencies:
- '@babel/core': 7.29.0
- '@jest/test-sequencer': 29.7.0
- '@jest/types': 29.6.3
- babel-jest: 29.7.0(@babel/[email protected])
- chalk: 4.1.2
- ci-info: 3.8.0
- deepmerge: 4.3.1
- glob: 7.2.3
- graceful-fs: 4.2.11
- jest-circus: 29.7.0
- jest-environment-node: 29.7.0
- jest-get-type: 29.6.3
- jest-regex-util: 29.6.3
- jest-resolve: 29.7.0
- jest-runner: 29.7.0
- jest-util: 29.7.0
- jest-validate: 29.7.0
- micromatch: 4.0.8
- parse-json: 5.2.0
- pretty-format: 29.7.0
- slash: 3.0.0
- strip-json-comments: 3.1.1
- optionalDependencies:
- '@types/node': 22.18.8
- transitivePeerDependencies:
- - babel-plugin-macros
- - supports-color
-
dependencies:
'@babel/core': 7.29.0
@@ -42994,38 +42859,7 @@ snapshots:
- babel-plugin-macros
- supports-color
- dependencies:
- '@babel/core': 7.29.0
- '@jest/test-sequencer': 29.7.0
- '@jest/types': 29.6.3
- babel-jest: 29.7.0(@babel/[email protected])
- chalk: 4.1.2
- ci-info: 3.8.0
- deepmerge: 4.3.1
- glob: 7.2.3
- graceful-fs: 4.2.11
- jest-circus: 29.7.0
- jest-environment-node: 29.7.0
- jest-get-type: 29.6.3
- jest-regex-util: 29.6.3
- jest-resolve: 29.7.0
- jest-runner: 29.7.0
- jest-util: 29.7.0
- jest-validate: 29.7.0
- micromatch: 4.0.8
- parse-json: 5.2.0
- pretty-format: 29.7.0
- slash: 3.0.0
- strip-json-comments: 3.1.1
- optionalDependencies:
- '@types/node': 22.18.8
- transitivePeerDependencies:
- - babel-plugin-macros
- - supports-color
-
dependencies:
'@babel/core': 7.29.0
'@jest/test-sequencer': 29.7.0
@@ -43051,7 +42885,6 @@ snapshots:
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 25.8.0
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
@@ -43288,7 +43121,7 @@ snapshots:
optionalDependencies:
dependencies:
chalk: 4.1.2
get-stdin: 5.0.1
@@ -43299,7 +43132,7 @@ snapshots:
rimraf: 2.7.1
ssim.js: 3.5.0
optionalDependencies:
+ jest: 29.7.0(@types/[email protected])
dependencies:
@@ -43445,10 +43278,10 @@ snapshots:
'@types/node': 22.18.8
jest-util: 30.0.5
dependencies:
expect-playwright: 0.8.0
+ jest: 29.7.0(@types/[email protected])
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-process-manager: 0.4.0
@@ -43884,11 +43717,11 @@ snapshots:
leven: 3.1.0
pretty-format: 30.0.5
dependencies:
ansi-escapes: 6.0.0
chalk: 5.6.2
+ jest: 29.7.0(@types/[email protected])
jest-regex-util: 29.6.3
jest-watcher: 29.7.0
slash: 5.1.0
@@ -43971,18 +43804,6 @@ snapshots:
- ts-node
- utf-8-validate
- dependencies:
- '@jest/types': 29.6.3
- import-local: 3.2.0
- transitivePeerDependencies:
- - '@types/node'
- - babel-plugin-macros
- - supports-color
- - ts-node
-
dependencies:
@@ -43995,12 +43816,12 @@ snapshots:
- supports-color
- ts-node
dependencies:
'@jest/types': 29.6.3
import-local: 3.2.0
+ jest-cli: 29.7.0(@types/[email protected])
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
@@ -44065,7 +43886,7 @@ snapshots:
dependencies:
'@babel/core': 7.29.0
'@babel/parser': 7.29.3
@@ -44088,7 +43909,7 @@ snapshots:
temp: 0.8.4
write-file-atomic: 2.4.3
optionalDependencies:
- '@babel/preset-env': 7.23.5(@babel/[email protected])
+ '@babel/preset-env': 7.23.5(@babel/[email protected])
transitivePeerDependencies:
- supports-color
@@ -44368,7 +44189,7 @@ snapshots:
less: 4.2.2
loader-utils: 2.0.4
schema-utils: 3.3.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -46868,7 +46689,7 @@ snapshots:
postcss: 8.5.6
schema-utils: 3.3.0
semver: 7.7.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -47866,7 +47687,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -49003,7 +48824,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
semver: 7.7.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
sass: 1.56.0
@@ -49742,11 +49563,11 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
+ webpack: 5.88.2(@swc/[email protected])([email protected])
@@ -49950,7 +49771,7 @@ snapshots:
dependencies:
'@swc/core': 1.15.18
+ webpack: 5.88.2(@swc/[email protected])([email protected])
@@ -50149,17 +49970,16 @@ snapshots:
'@swc/core': 1.15.18
esbuild: 0.27.7
dependencies:
'@jridgewell/trace-mapping': 0.3.29
jest-worker: 27.5.1
schema-utils: 3.3.0
serialize-javascript: 6.0.1
terser: 5.19.1
+ webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
'@swc/core': 1.15.18
- esbuild: 0.18.20
dependencies:
@@ -50399,27 +50219,6 @@ snapshots:
tslib: 2.8.1
typescript: 6.0.3
- dependencies:
- '@cspotcode/source-map-support': 0.8.1
- '@tsconfig/node10': 1.0.9
- '@tsconfig/node12': 1.0.11
- '@tsconfig/node14': 1.0.3
- '@tsconfig/node16': 1.0.3
- '@types/node': 22.18.8
- acorn: 8.15.0
- acorn-walk: 8.3.2
- arg: 4.1.3
- create-require: 1.1.1
- diff: 4.0.2
- make-error: 1.3.6
- typescript: 6.0.3
- v8-compile-cache-lib: 3.0.1
- yn: 3.1.1
- optionalDependencies:
- '@swc/core': 1.11.4
- optional: true
-
dependencies:
'@cspotcode/source-map-support': 0.8.1
@@ -51400,7 +51199,7 @@ snapshots:
import-local: 3.1.0
interpret: 3.1.1
rechoir: 0.8.0
+ webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-merge: 5.8.0
@@ -51411,7 +51210,7 @@ snapshots:
range-parser: 1.2.1
schema-utils: 4.2.0
optionalDependencies:
+ webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -51462,7 +51261,7 @@ snapshots:
- esbuild
- uglify-js
dependencies:
'@types/eslint-scope': 3.7.4
'@types/estree': 1.0.1
@@ -51485,7 +51284,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
tapable: 2.2.1
- terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])([email protected])
+ terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])
watchpack: 2.4.0
webpack-sources: 3.2.3
optionalDependencies:
diff --git a/posthog/hogql/grammar/HogQLParser.g4 b/posthog/hogql/grammar/HogQLParser.g4
index c59ecdbcd304..3376a9f72ad0 100644
--- a/posthog/hogql/grammar/HogQLParser.g4
+++ b/posthog/hogql/grammar/HogQLParser.g4
@@ -210,8 +210,8 @@ columnExpr
| TRY_CAST LPAREN columnExpr AS columnTypeExpr RPAREN # ColumnExprTryCast
| DATE STRING_LITERAL # ColumnExprDate
// | EXTRACT LPAREN interval FROM columnExpr RPAREN # ColumnExprExtract // Interferes with a function call
- | INTERVAL STRING_LITERAL # ColumnExprIntervalString
| INTERVAL columnExpr interval # ColumnExprInterval
+ | INTERVAL STRING_LITERAL # ColumnExprIntervalString
| SUBSTRING LPAREN columnExpr FROM columnExpr (FOR columnExpr)? RPAREN # ColumnExprSubstring
| TIMESTAMP STRING_LITERAL # ColumnExprTimestamp
| TRIM LPAREN (BOTH | LEADING | TRAILING) string FROM columnExpr RPAREN # ColumnExprTrim
diff --git a/posthog/hogql/grammar/HogQLParser.interp b/posthog/hogql/grammar/HogQLParser.interp
index 9fe98608043b..479c27a552b0 100644
--- a/posthog/hogql/grammar/HogQLParser.interp
+++ b/posthog/hogql/grammar/HogQLParser.interp
@@ -536,4 +536,4 @@ stringContentsFull
atn:
-[4, 1, 205, 2081, 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, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 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, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1523, 5, 143, 0, 0, 1211, 1212, 5, 56, 0, 0, 1212, 1213, 3, 154, 77, 0, 1213, 1214, 3, 208, 104, 0, 1214, 1523, 1, 0, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1211, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 204, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
+[4, 1, 205, 2081, 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, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 1, 0, 5, 0, 238, 8, 0, 10, 0, 12, 0, 241, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 247, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 255, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 260, 8, 4, 10, 4, 12, 4, 263, 9, 4, 1, 4, 3, 4, 266, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 279, 8, 5, 1, 6, 1, 6, 3, 6, 283, 8, 6, 1, 6, 3, 6, 286, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 291, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 298, 8, 8, 1, 8, 1, 8, 3, 8, 302, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 309, 8, 9, 10, 9, 12, 9, 312, 9, 9, 1, 9, 1, 9, 3, 9, 316, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 325, 8, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 333, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 340, 8, 12, 1, 12, 1, 12, 3, 12, 344, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 350, 8, 12, 1, 12, 1, 12, 1, 12, 3, 12, 355, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 363, 8, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 370, 8, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 376, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 3, 16, 388, 8, 16, 1, 16, 3, 16, 391, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 5, 18, 397, 8, 18, 10, 18, 12, 18, 400, 9, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 411, 8, 20, 10, 20, 12, 20, 414, 9, 20, 1, 20, 3, 20, 417, 8, 20, 1, 21, 1, 21, 1, 21, 3, 21, 422, 8, 21, 1, 21, 3, 21, 425, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 440, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 446, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 451, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 457, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 463, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 468, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 474, 8, 23, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 480, 8, 23, 1, 23, 1, 23, 1, 23, 3, 23, 485, 8, 23, 3, 23, 487, 8, 23, 1, 23, 1, 23, 1, 24, 1, 24, 5, 24, 493, 8, 24, 10, 24, 12, 24, 496, 9, 24, 1, 24, 3, 24, 499, 8, 24, 1, 24, 3, 24, 502, 8, 24, 1, 25, 1, 25, 1, 25, 3, 25, 507, 8, 25, 1, 25, 1, 25, 3, 25, 511, 8, 25, 1, 25, 1, 25, 3, 25, 515, 8, 25, 1, 25, 1, 25, 1, 25, 3, 25, 520, 8, 25, 1, 25, 1, 25, 3, 25, 524, 8, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 531, 8, 25, 1, 26, 3, 26, 534, 8, 26, 1, 26, 1, 26, 3, 26, 538, 8, 26, 1, 26, 3, 26, 541, 8, 26, 1, 26, 1, 26, 3, 26, 545, 8, 26, 1, 26, 3, 26, 548, 8, 26, 1, 26, 3, 26, 551, 8, 26, 1, 26, 3, 26, 554, 8, 26, 1, 26, 3, 26, 557, 8, 26, 1, 26, 3, 26, 560, 8, 26, 1, 26, 3, 26, 563, 8, 26, 1, 26, 1, 26, 3, 26, 567, 8, 26, 1, 26, 1, 26, 3, 26, 571, 8, 26, 1, 26, 3, 26, 574, 8, 26, 1, 26, 3, 26, 577, 8, 26, 1, 26, 1, 26, 3, 26, 581, 8, 26, 1, 26, 3, 26, 584, 8, 26, 1, 26, 3, 26, 587, 8, 26, 1, 26, 3, 26, 590, 8, 26, 1, 26, 1, 26, 3, 26, 594, 8, 26, 1, 26, 3, 26, 597, 8, 26, 1, 27, 1, 27, 3, 27, 601, 8, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 609, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 3, 30, 615, 8, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 634, 8, 31, 10, 31, 12, 31, 637, 9, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 660, 8, 34, 1, 35, 1, 35, 1, 35, 5, 35, 665, 8, 35, 10, 35, 12, 35, 668, 9, 35, 1, 36, 1, 36, 3, 36, 672, 8, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 686, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 693, 8, 40, 10, 40, 12, 40, 696, 9, 40, 1, 40, 1, 40, 3, 40, 700, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 3, 43, 714, 8, 43, 1, 43, 1, 43, 3, 43, 718, 8, 43, 1, 43, 1, 43, 3, 43, 722, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 727, 8, 43, 1, 43, 1, 43, 3, 43, 731, 8, 43, 1, 43, 1, 43, 1, 43, 3, 43, 736, 8, 43, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 5, 46, 748, 8, 46, 10, 46, 12, 46, 751, 9, 46, 1, 47, 1, 47, 1, 47, 1, 47, 5, 47, 757, 8, 47, 10, 47, 12, 47, 760, 9, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 767, 8, 48, 1, 48, 3, 48, 770, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 776, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 784, 8, 48, 1, 48, 3, 48, 787, 8, 48, 1, 48, 1, 48, 1, 48, 3, 48, 792, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 799, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 809, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 817, 8, 48, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 823, 8, 48, 10, 48, 12, 48, 826, 9, 48, 1, 49, 3, 49, 829, 8, 49, 1, 49, 1, 49, 1, 49, 3, 49, 834, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 841, 8, 49, 1, 49, 3, 49, 844, 8, 49, 1, 49, 1, 49, 3, 49, 848, 8, 49, 1, 49, 1, 49, 3, 49, 852, 8, 49, 1, 49, 3, 49, 855, 8, 49, 1, 49, 1, 49, 1, 49, 1, 49, 3, 49, 861, 8, 49, 3, 49, 863, 8, 49, 1, 49, 3, 49, 866, 8, 49, 1, 49, 1, 49, 3, 49, 870, 8, 49, 1, 49, 1, 49, 3, 49, 874, 8, 49, 1, 49, 3, 49, 877, 8, 49, 3, 49, 879, 8, 49, 3, 49, 881, 8, 49, 1, 50, 1, 50, 1, 50, 3, 50, 886, 8, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 897, 8, 51, 1, 52, 1, 52, 1, 52, 3, 52, 902, 8, 52, 1, 52, 1, 52, 3, 52, 906, 8, 52, 1, 52, 1, 52, 1, 52, 1, 52, 3, 52, 912, 8, 52, 1, 53, 1, 53, 1, 53, 3, 53, 917, 8, 53, 1, 54, 1, 54, 1, 54, 5, 54, 922, 8, 54, 10, 54, 12, 54, 925, 9, 54, 1, 55, 1, 55, 3, 55, 929, 8, 55, 1, 55, 1, 55, 3, 55, 933, 8, 55, 1, 55, 1, 55, 3, 55, 937, 8, 55, 1, 55, 3, 55, 940, 8, 55, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 946, 8, 56, 1, 56, 1, 56, 3, 56, 950, 8, 56, 1, 56, 1, 56, 3, 56, 954, 8, 56, 1, 57, 1, 57, 1, 57, 3, 57, 959, 8, 57, 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 965, 8, 58, 3, 58, 967, 8, 58, 1, 59, 1, 59, 1, 59, 5, 59, 972, 8, 59, 10, 59, 12, 59, 975, 9, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 3, 61, 982, 8, 61, 1, 61, 3, 61, 985, 8, 61, 1, 61, 3, 61, 988, 8, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 1013, 8, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 3, 67, 1027, 8, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1041, 8, 69, 10, 69, 12, 69, 1044, 9, 69, 1, 69, 3, 69, 1047, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1056, 8, 69, 10, 69, 12, 69, 1059, 9, 69, 1, 69, 3, 69, 1062, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 5, 69, 1071, 8, 69, 10, 69, 12, 69, 1074, 9, 69, 1, 69, 3, 69, 1077, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1084, 8, 69, 1, 69, 1, 69, 1, 69, 1, 69, 4, 69, 1090, 8, 69, 11, 69, 12, 69, 1091, 1, 69, 3, 69, 1095, 8, 69, 1, 69, 1, 69, 1, 69, 3, 69, 1100, 8, 69, 1, 69, 5, 69, 1103, 8, 69, 10, 69, 12, 69, 1106, 9, 69, 1, 70, 1, 70, 1, 70, 3, 70, 1111, 8, 70, 1, 70, 1, 70, 1, 70, 1, 70, 3, 70, 1117, 8, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 1123, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 5, 73, 1130, 8, 73, 10, 73, 12, 73, 1133, 9, 73, 1, 73, 3, 73, 1136, 8, 73, 1, 74, 1, 74, 1, 74, 5, 74, 1141, 8, 74, 10, 74, 12, 74, 1144, 9, 74, 1, 74, 1, 74, 1, 74, 3, 74, 1149, 8, 74, 1, 75, 1, 75, 1, 75, 5, 75, 1154, 8, 75, 10, 75, 12, 75, 1157, 9, 75, 1, 75, 3, 75, 1160, 8, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 3, 76, 1172, 8, 76, 1, 77, 1, 77, 1, 77, 3, 77, 1177, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 4, 77, 1184, 8, 77, 11, 77, 12, 77, 1185, 1, 77, 1, 77, 3, 77, 1190, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1223, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1271, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1299, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1363, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1371, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1377, 8, 77, 1, 77, 3, 77, 1380, 8, 77, 1, 77, 3, 77, 1383, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1391, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1401, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1407, 8, 77, 1, 77, 3, 77, 1410, 8, 77, 1, 77, 3, 77, 1413, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1421, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1429, 8, 77, 1, 77, 3, 77, 1432, 8, 77, 1, 77, 1, 77, 3, 77, 1436, 8, 77, 1, 77, 3, 77, 1439, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1444, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1453, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1465, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1473, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 5, 77, 1479, 8, 77, 10, 77, 12, 77, 1482, 9, 77, 1, 77, 3, 77, 1485, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1503, 8, 77, 1, 77, 1, 77, 3, 77, 1507, 8, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1512, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1523, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1529, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1536, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1548, 8, 77, 1, 77, 1, 77, 3, 77, 1552, 8, 77, 1, 77, 3, 77, 1555, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1564, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1570, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1586, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1607, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1618, 8, 77, 1, 77, 1, 77, 3, 77, 1622, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1652, 8, 77, 1, 77, 1, 77, 1, 77, 1, 77, 1, 77, 3, 77, 1659, 8, 77, 5, 77, 1661, 8, 77, 10, 77, 12, 77, 1664, 9, 77, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1670, 8, 78, 10, 78, 12, 78, 1673, 9, 78, 1, 78, 3, 78, 1676, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1683, 8, 78, 10, 78, 12, 78, 1686, 9, 78, 1, 78, 3, 78, 1689, 8, 78, 1, 78, 1, 78, 3, 78, 1693, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1698, 8, 78, 1, 78, 1, 78, 1, 78, 1, 78, 5, 78, 1704, 8, 78, 10, 78, 12, 78, 1707, 9, 78, 1, 78, 3, 78, 1710, 8, 78, 1, 78, 1, 78, 1, 78, 3, 78, 1715, 8, 78, 1, 79, 1, 79, 1, 79, 5, 79, 1720, 8, 79, 10, 79, 12, 79, 1723, 9, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 3, 81, 1735, 8, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 5, 83, 1742, 8, 83, 10, 83, 12, 83, 1745, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 5, 83, 1752, 8, 83, 10, 83, 12, 83, 1755, 9, 83, 1, 83, 1, 83, 5, 83, 1759, 8, 83, 10, 83, 12, 83, 1762, 9, 83, 1, 83, 1, 83, 1, 83, 1, 83, 3, 83, 1768, 8, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 3, 84, 1781, 8, 84, 1, 85, 1, 85, 1, 85, 5, 85, 1786, 8, 85, 10, 85, 12, 85, 1789, 9, 85, 1, 85, 3, 85, 1792, 8, 85, 1, 86, 1, 86, 3, 86, 1796, 8, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1801, 8, 86, 1, 86, 1, 86, 3, 86, 1805, 8, 86, 1, 86, 3, 86, 1808, 8, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 3, 86, 1818, 8, 86, 1, 87, 1, 87, 1, 87, 1, 87, 5, 87, 1824, 8, 87, 10, 87, 12, 87, 1827, 9, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 3, 88, 1835, 8, 88, 1, 88, 3, 88, 1838, 8, 88, 1, 89, 1, 89, 1, 89, 5, 89, 1843, 8, 89, 10, 89, 12, 89, 1846, 9, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1861, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1871, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1879, 8, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 3, 90, 1889, 8, 90, 1, 90, 3, 90, 1892, 8, 90, 5, 90, 1894, 8, 90, 10, 90, 12, 90, 1897, 9, 90, 1, 91, 1, 91, 4, 91, 1901, 8, 91, 11, 91, 12, 91, 1902, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 5, 93, 1914, 8, 93, 10, 93, 12, 93, 1917, 9, 93, 1, 93, 3, 93, 1920, 8, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 94, 5, 94, 1935, 8, 94, 10, 94, 12, 94, 1938, 9, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 3, 95, 1945, 8, 95, 1, 96, 1, 96, 1, 96, 1, 96, 5, 96, 1951, 8, 96, 10, 96, 12, 96, 1954, 9, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1961, 8, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1968, 8, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 5, 99, 1975, 8, 99, 10, 99, 12, 99, 1978, 9, 99, 1, 99, 3, 99, 1981, 8, 99, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1991, 8, 101, 3, 101, 1993, 8, 101, 1, 102, 3, 102, 1996, 8, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 2006, 8, 102, 1, 103, 1, 103, 1, 103, 3, 103, 2011, 8, 103, 1, 104, 1, 104, 1, 105, 1, 105, 1, 106, 1, 106, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 3, 108, 2024, 8, 108, 1, 109, 1, 109, 1, 109, 3, 109, 2029, 8, 109, 1, 110, 1, 110, 1, 110, 1, 110, 3, 110, 2035, 8, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 3, 113, 2047, 8, 113, 1, 114, 1, 114, 5, 114, 2051, 8, 114, 10, 114, 12, 114, 2054, 9, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 3, 115, 2063, 8, 115, 1, 116, 1, 116, 5, 116, 2067, 8, 116, 10, 116, 12, 116, 2070, 9, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 117, 3, 117, 2079, 8, 117, 1, 117, 0, 4, 96, 138, 154, 180, 118, 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, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 0, 20, 2, 0, 36, 36, 41, 41, 2, 0, 19, 19, 94, 94, 2, 0, 53, 53, 63, 63, 3, 0, 1, 1, 4, 4, 8, 8, 2, 0, 3, 3, 100, 100, 4, 0, 1, 1, 3, 4, 8, 8, 100, 100, 2, 0, 63, 63, 93, 93, 2, 0, 76, 76, 151, 151, 2, 0, 7, 7, 23, 24, 2, 0, 35, 35, 61, 61, 2, 0, 89, 89, 96, 96, 3, 0, 21, 21, 56, 56, 108, 109, 3, 0, 10, 10, 62, 62, 115, 115, 2, 0, 48, 48, 65, 65, 1, 0, 138, 139, 2, 0, 153, 153, 175, 175, 7, 0, 22, 22, 45, 45, 68, 69, 88, 88, 98, 98, 125, 125, 132, 132, 20, 0, 1, 13, 15, 21, 23, 27, 29, 33, 35, 35, 37, 40, 42, 44, 46, 51, 53, 53, 55, 63, 65, 66, 70, 71, 73, 73, 75, 87, 89, 97, 99, 105, 107, 117, 119, 124, 126, 127, 129, 130, 4, 0, 21, 21, 35, 35, 46, 46, 59, 59, 8, 0, 7, 7, 15, 15, 21, 21, 24, 24, 31, 31, 46, 46, 92, 92, 113, 114, 2362, 0, 239, 1, 0, 0, 0, 2, 246, 1, 0, 0, 0, 4, 248, 1, 0, 0, 0, 6, 250, 1, 0, 0, 0, 8, 256, 1, 0, 0, 0, 10, 278, 1, 0, 0, 0, 12, 280, 1, 0, 0, 0, 14, 287, 1, 0, 0, 0, 16, 292, 1, 0, 0, 0, 18, 305, 1, 0, 0, 0, 20, 317, 1, 0, 0, 0, 22, 326, 1, 0, 0, 0, 24, 334, 1, 0, 0, 0, 26, 356, 1, 0, 0, 0, 28, 371, 1, 0, 0, 0, 30, 380, 1, 0, 0, 0, 32, 384, 1, 0, 0, 0, 34, 392, 1, 0, 0, 0, 36, 394, 1, 0, 0, 0, 38, 403, 1, 0, 0, 0, 40, 407, 1, 0, 0, 0, 42, 421, 1, 0, 0, 0, 44, 439, 1, 0, 0, 0, 46, 486, 1, 0, 0, 0, 48, 490, 1, 0, 0, 0, 50, 530, 1, 0, 0, 0, 52, 533, 1, 0, 0, 0, 54, 598, 1, 0, 0, 0, 56, 604, 1, 0, 0, 0, 58, 610, 1, 0, 0, 0, 60, 614, 1, 0, 0, 0, 62, 620, 1, 0, 0, 0, 64, 638, 1, 0, 0, 0, 66, 641, 1, 0, 0, 0, 68, 644, 1, 0, 0, 0, 70, 661, 1, 0, 0, 0, 72, 669, 1, 0, 0, 0, 74, 675, 1, 0, 0, 0, 76, 678, 1, 0, 0, 0, 78, 681, 1, 0, 0, 0, 80, 687, 1, 0, 0, 0, 82, 701, 1, 0, 0, 0, 84, 705, 1, 0, 0, 0, 86, 735, 1, 0, 0, 0, 88, 737, 1, 0, 0, 0, 90, 740, 1, 0, 0, 0, 92, 743, 1, 0, 0, 0, 94, 752, 1, 0, 0, 0, 96, 775, 1, 0, 0, 0, 98, 880, 1, 0, 0, 0, 100, 885, 1, 0, 0, 0, 102, 896, 1, 0, 0, 0, 104, 898, 1, 0, 0, 0, 106, 913, 1, 0, 0, 0, 108, 918, 1, 0, 0, 0, 110, 926, 1, 0, 0, 0, 112, 941, 1, 0, 0, 0, 114, 955, 1, 0, 0, 0, 116, 966, 1, 0, 0, 0, 118, 968, 1, 0, 0, 0, 120, 976, 1, 0, 0, 0, 122, 981, 1, 0, 0, 0, 124, 989, 1, 0, 0, 0, 126, 993, 1, 0, 0, 0, 128, 997, 1, 0, 0, 0, 130, 1003, 1, 0, 0, 0, 132, 1012, 1, 0, 0, 0, 134, 1026, 1, 0, 0, 0, 136, 1028, 1, 0, 0, 0, 138, 1094, 1, 0, 0, 0, 140, 1116, 1, 0, 0, 0, 142, 1122, 1, 0, 0, 0, 144, 1124, 1, 0, 0, 0, 146, 1126, 1, 0, 0, 0, 148, 1148, 1, 0, 0, 0, 150, 1150, 1, 0, 0, 0, 152, 1171, 1, 0, 0, 0, 154, 1522, 1, 0, 0, 0, 156, 1714, 1, 0, 0, 0, 158, 1716, 1, 0, 0, 0, 160, 1724, 1, 0, 0, 0, 162, 1734, 1, 0, 0, 0, 164, 1736, 1, 0, 0, 0, 166, 1767, 1, 0, 0, 0, 168, 1780, 1, 0, 0, 0, 170, 1782, 1, 0, 0, 0, 172, 1817, 1, 0, 0, 0, 174, 1819, 1, 0, 0, 0, 176, 1837, 1, 0, 0, 0, 178, 1839, 1, 0, 0, 0, 180, 1860, 1, 0, 0, 0, 182, 1898, 1, 0, 0, 0, 184, 1904, 1, 0, 0, 0, 186, 1910, 1, 0, 0, 0, 188, 1921, 1, 0, 0, 0, 190, 1944, 1, 0, 0, 0, 192, 1946, 1, 0, 0, 0, 194, 1957, 1, 0, 0, 0, 196, 1967, 1, 0, 0, 0, 198, 1971, 1, 0, 0, 0, 200, 1982, 1, 0, 0, 0, 202, 1992, 1, 0, 0, 0, 204, 1995, 1, 0, 0, 0, 206, 2010, 1, 0, 0, 0, 208, 2012, 1, 0, 0, 0, 210, 2014, 1, 0, 0, 0, 212, 2016, 1, 0, 0, 0, 214, 2018, 1, 0, 0, 0, 216, 2023, 1, 0, 0, 0, 218, 2028, 1, 0, 0, 0, 220, 2034, 1, 0, 0, 0, 222, 2036, 1, 0, 0, 0, 224, 2040, 1, 0, 0, 0, 226, 2046, 1, 0, 0, 0, 228, 2048, 1, 0, 0, 0, 230, 2062, 1, 0, 0, 0, 232, 2064, 1, 0, 0, 0, 234, 2078, 1, 0, 0, 0, 236, 238, 3, 2, 1, 0, 237, 236, 1, 0, 0, 0, 238, 241, 1, 0, 0, 0, 239, 237, 1, 0, 0, 0, 239, 240, 1, 0, 0, 0, 240, 242, 1, 0, 0, 0, 241, 239, 1, 0, 0, 0, 242, 243, 5, 0, 0, 1, 243, 1, 1, 0, 0, 0, 244, 247, 3, 6, 3, 0, 245, 247, 3, 10, 5, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 3, 1, 0, 0, 0, 248, 249, 3, 154, 77, 0, 249, 5, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 254, 3, 220, 110, 0, 252, 253, 5, 149, 0, 0, 253, 255, 3, 4, 2, 0, 254, 252, 1, 0, 0, 0, 254, 255, 1, 0, 0, 0, 255, 7, 1, 0, 0, 0, 256, 261, 3, 178, 89, 0, 257, 258, 5, 151, 0, 0, 258, 260, 3, 178, 89, 0, 259, 257, 1, 0, 0, 0, 260, 263, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 261, 262, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, 1, 0, 0, 0, 264, 266, 5, 151, 0, 0, 265, 264, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 9, 1, 0, 0, 0, 267, 279, 3, 12, 6, 0, 268, 279, 3, 14, 7, 0, 269, 279, 3, 18, 9, 0, 270, 279, 3, 20, 10, 0, 271, 279, 3, 22, 11, 0, 272, 279, 3, 26, 13, 0, 273, 279, 3, 24, 12, 0, 274, 279, 3, 28, 14, 0, 275, 279, 3, 36, 18, 0, 276, 279, 3, 32, 16, 0, 277, 279, 3, 34, 17, 0, 278, 267, 1, 0, 0, 0, 278, 268, 1, 0, 0, 0, 278, 269, 1, 0, 0, 0, 278, 270, 1, 0, 0, 0, 278, 271, 1, 0, 0, 0, 278, 272, 1, 0, 0, 0, 278, 273, 1, 0, 0, 0, 278, 274, 1, 0, 0, 0, 278, 275, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 278, 277, 1, 0, 0, 0, 279, 11, 1, 0, 0, 0, 280, 282, 5, 92, 0, 0, 281, 283, 3, 4, 2, 0, 282, 281, 1, 0, 0, 0, 282, 283, 1, 0, 0, 0, 283, 285, 1, 0, 0, 0, 284, 286, 5, 186, 0, 0, 285, 284, 1, 0, 0, 0, 285, 286, 1, 0, 0, 0, 286, 13, 1, 0, 0, 0, 287, 288, 5, 106, 0, 0, 288, 290, 3, 4, 2, 0, 289, 291, 5, 186, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 15, 1, 0, 0, 0, 292, 301, 5, 14, 0, 0, 293, 294, 5, 165, 0, 0, 294, 297, 3, 220, 110, 0, 295, 296, 5, 150, 0, 0, 296, 298, 3, 220, 110, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 300, 5, 185, 0, 0, 300, 302, 1, 0, 0, 0, 301, 293, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 303, 1, 0, 0, 0, 303, 304, 3, 36, 18, 0, 304, 17, 1, 0, 0, 0, 305, 306, 5, 118, 0, 0, 306, 310, 3, 36, 18, 0, 307, 309, 3, 16, 8, 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, 315, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 314, 5, 34, 0, 0, 314, 316, 3, 36, 18, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 19, 1, 0, 0, 0, 317, 318, 5, 47, 0, 0, 318, 319, 5, 165, 0, 0, 319, 320, 3, 4, 2, 0, 320, 321, 5, 185, 0, 0, 321, 324, 3, 10, 5, 0, 322, 323, 5, 26, 0, 0, 323, 325, 3, 10, 5, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 21, 1, 0, 0, 0, 326, 327, 5, 128, 0, 0, 327, 328, 5, 165, 0, 0, 328, 329, 3, 4, 2, 0, 329, 330, 5, 185, 0, 0, 330, 332, 3, 10, 5, 0, 331, 333, 5, 186, 0, 0, 332, 331, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 23, 1, 0, 0, 0, 334, 335, 5, 38, 0, 0, 335, 339, 5, 165, 0, 0, 336, 340, 3, 6, 3, 0, 337, 340, 3, 30, 15, 0, 338, 340, 3, 4, 2, 0, 339, 336, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 186, 0, 0, 342, 344, 3, 4, 2, 0, 343, 342, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 349, 5, 186, 0, 0, 346, 350, 3, 6, 3, 0, 347, 350, 3, 30, 15, 0, 348, 350, 3, 4, 2, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 351, 1, 0, 0, 0, 351, 352, 5, 185, 0, 0, 352, 354, 3, 10, 5, 0, 353, 355, 5, 186, 0, 0, 354, 353, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 25, 1, 0, 0, 0, 356, 357, 5, 38, 0, 0, 357, 358, 5, 165, 0, 0, 358, 359, 5, 64, 0, 0, 359, 362, 3, 220, 110, 0, 360, 361, 5, 151, 0, 0, 361, 363, 3, 220, 110, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 365, 5, 51, 0, 0, 365, 366, 3, 4, 2, 0, 366, 367, 5, 185, 0, 0, 367, 369, 3, 10, 5, 0, 368, 370, 5, 186, 0, 0, 369, 368, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 27, 1, 0, 0, 0, 371, 372, 7, 0, 0, 0, 372, 373, 3, 220, 110, 0, 373, 375, 5, 165, 0, 0, 374, 376, 3, 8, 4, 0, 375, 374, 1, 0, 0, 0, 375, 376, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 378, 5, 185, 0, 0, 378, 379, 3, 36, 18, 0, 379, 29, 1, 0, 0, 0, 380, 381, 3, 4, 2, 0, 381, 382, 5, 149, 0, 0, 382, 383, 3, 4, 2, 0, 383, 31, 1, 0, 0, 0, 384, 387, 3, 4, 2, 0, 385, 386, 5, 149, 0, 0, 386, 388, 3, 4, 2, 0, 387, 385, 1, 0, 0, 0, 387, 388, 1, 0, 0, 0, 388, 390, 1, 0, 0, 0, 389, 391, 5, 186, 0, 0, 390, 389, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 33, 1, 0, 0, 0, 392, 393, 5, 186, 0, 0, 393, 35, 1, 0, 0, 0, 394, 398, 5, 163, 0, 0, 395, 397, 3, 2, 1, 0, 396, 395, 1, 0, 0, 0, 397, 400, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 398, 399, 1, 0, 0, 0, 399, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 402, 5, 183, 0, 0, 402, 37, 1, 0, 0, 0, 403, 404, 3, 4, 2, 0, 404, 405, 5, 150, 0, 0, 405, 406, 3, 4, 2, 0, 406, 39, 1, 0, 0, 0, 407, 412, 3, 38, 19, 0, 408, 409, 5, 151, 0, 0, 409, 411, 3, 38, 19, 0, 410, 408, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 416, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 417, 5, 151, 0, 0, 416, 415, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 41, 1, 0, 0, 0, 418, 422, 3, 48, 24, 0, 419, 422, 3, 52, 26, 0, 420, 422, 3, 166, 83, 0, 421, 418, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 421, 420, 1, 0, 0, 0, 422, 424, 1, 0, 0, 0, 423, 425, 5, 186, 0, 0, 424, 423, 1, 0, 0, 0, 424, 425, 1, 0, 0, 0, 425, 426, 1, 0, 0, 0, 426, 427, 5, 0, 0, 1, 427, 43, 1, 0, 0, 0, 428, 440, 3, 52, 26, 0, 429, 430, 3, 54, 27, 0, 430, 431, 5, 165, 0, 0, 431, 432, 3, 48, 24, 0, 432, 433, 5, 185, 0, 0, 433, 440, 1, 0, 0, 0, 434, 435, 5, 165, 0, 0, 435, 436, 3, 48, 24, 0, 436, 437, 5, 185, 0, 0, 437, 440, 1, 0, 0, 0, 438, 440, 3, 224, 112, 0, 439, 428, 1, 0, 0, 0, 439, 429, 1, 0, 0, 0, 439, 434, 1, 0, 0, 0, 439, 438, 1, 0, 0, 0, 440, 45, 1, 0, 0, 0, 441, 442, 5, 28, 0, 0, 442, 445, 5, 1, 0, 0, 443, 444, 5, 11, 0, 0, 444, 446, 5, 70, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 487, 1, 0, 0, 0, 447, 450, 5, 28, 0, 0, 448, 449, 5, 11, 0, 0, 449, 451, 5, 70, 0, 0, 450, 448, 1, 0, 0, 0, 450, 451, 1, 0, 0, 0, 451, 487, 1, 0, 0, 0, 452, 453, 5, 121, 0, 0, 453, 456, 5, 1, 0, 0, 454, 455, 5, 11, 0, 0, 455, 457, 5, 70, 0, 0, 456, 454, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 487, 1, 0, 0, 0, 458, 459, 5, 121, 0, 0, 459, 462, 5, 25, 0, 0, 460, 461, 5, 11, 0, 0, 461, 463, 5, 70, 0, 0, 462, 460, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 487, 1, 0, 0, 0, 464, 467, 5, 121, 0, 0, 465, 466, 5, 11, 0, 0, 466, 468, 5, 70, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 487, 1, 0, 0, 0, 469, 470, 5, 54, 0, 0, 470, 473, 5, 1, 0, 0, 471, 472, 5, 11, 0, 0, 472, 474, 5, 70, 0, 0, 473, 471, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 487, 1, 0, 0, 0, 475, 476, 5, 54, 0, 0, 476, 479, 5, 25, 0, 0, 477, 478, 5, 11, 0, 0, 478, 480, 5, 70, 0, 0, 479, 477, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 487, 1, 0, 0, 0, 481, 484, 5, 54, 0, 0, 482, 483, 5, 11, 0, 0, 483, 485, 5, 70, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 441, 1, 0, 0, 0, 486, 447, 1, 0, 0, 0, 486, 452, 1, 0, 0, 0, 486, 458, 1, 0, 0, 0, 486, 464, 1, 0, 0, 0, 486, 469, 1, 0, 0, 0, 486, 475, 1, 0, 0, 0, 486, 481, 1, 0, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 3, 44, 22, 0, 489, 47, 1, 0, 0, 0, 490, 494, 3, 44, 22, 0, 491, 493, 3, 46, 23, 0, 492, 491, 1, 0, 0, 0, 493, 496, 1, 0, 0, 0, 494, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 498, 1, 0, 0, 0, 496, 494, 1, 0, 0, 0, 497, 499, 3, 78, 39, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 501, 1, 0, 0, 0, 500, 502, 3, 50, 25, 0, 501, 500, 1, 0, 0, 0, 501, 502, 1, 0, 0, 0, 502, 49, 1, 0, 0, 0, 503, 504, 5, 66, 0, 0, 504, 506, 3, 154, 77, 0, 505, 507, 5, 174, 0, 0, 506, 505, 1, 0, 0, 0, 506, 507, 1, 0, 0, 0, 507, 510, 1, 0, 0, 0, 508, 509, 5, 151, 0, 0, 509, 511, 3, 154, 77, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 514, 1, 0, 0, 0, 512, 513, 5, 130, 0, 0, 513, 515, 5, 107, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 531, 1, 0, 0, 0, 516, 517, 5, 66, 0, 0, 517, 519, 3, 154, 77, 0, 518, 520, 5, 174, 0, 0, 519, 518, 1, 0, 0, 0, 519, 520, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 522, 5, 130, 0, 0, 522, 524, 5, 107, 0, 0, 523, 521, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 5, 76, 0, 0, 526, 527, 3, 154, 77, 0, 527, 531, 1, 0, 0, 0, 528, 529, 5, 76, 0, 0, 529, 531, 3, 154, 77, 0, 530, 503, 1, 0, 0, 0, 530, 516, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 531, 51, 1, 0, 0, 0, 532, 534, 3, 54, 27, 0, 533, 532, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, 534, 535, 1, 0, 0, 0, 535, 537, 5, 99, 0, 0, 536, 538, 5, 25, 0, 0, 537, 536, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 540, 1, 0, 0, 0, 539, 541, 3, 56, 28, 0, 540, 539, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 544, 3, 148, 74, 0, 543, 545, 3, 58, 29, 0, 544, 543, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 547, 1, 0, 0, 0, 546, 548, 3, 60, 30, 0, 547, 546, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 550, 1, 0, 0, 0, 549, 551, 3, 64, 32, 0, 550, 549, 1, 0, 0, 0, 550, 551, 1, 0, 0, 0, 551, 553, 1, 0, 0, 0, 552, 554, 3, 66, 33, 0, 553, 552, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 559, 1, 0, 0, 0, 555, 557, 5, 123, 0, 0, 556, 555, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 560, 3, 104, 52, 0, 559, 556, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 562, 1, 0, 0, 0, 561, 563, 3, 68, 34, 0, 562, 561, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 566, 1, 0, 0, 0, 564, 565, 5, 130, 0, 0, 565, 567, 7, 1, 0, 0, 566, 564, 1, 0, 0, 0, 566, 567, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 569, 5, 130, 0, 0, 569, 571, 5, 114, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 573, 1, 0, 0, 0, 572, 574, 3, 74, 37, 0, 573, 572, 1, 0, 0, 0, 573, 574, 1, 0, 0, 0, 574, 576, 1, 0, 0, 0, 575, 577, 3, 76, 38, 0, 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 579, 5, 123, 0, 0, 579, 581, 3, 104, 52, 0, 580, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 583, 1, 0, 0, 0, 582, 584, 3, 62, 31, 0, 583, 582, 1, 0, 0, 0, 583, 584, 1, 0, 0, 0, 584, 586, 1, 0, 0, 0, 585, 587, 3, 78, 39, 0, 586, 585, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 589, 1, 0, 0, 0, 588, 590, 3, 84, 42, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1, 0, 0, 0, 590, 593, 1, 0, 0, 0, 591, 594, 3, 86, 43, 0, 592, 594, 3, 88, 44, 0, 593, 591, 1, 0, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 596, 1, 0, 0, 0, 595, 597, 3, 90, 45, 0, 596, 595, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 597, 53, 1, 0, 0, 0, 598, 600, 5, 130, 0, 0, 599, 601, 5, 90, 0, 0, 600, 599, 1, 0, 0, 0, 600, 601, 1, 0, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 3, 170, 85, 0, 603, 55, 1, 0, 0, 0, 604, 605, 5, 113, 0, 0, 605, 608, 5, 139, 0, 0, 606, 607, 5, 130, 0, 0, 607, 609, 5, 107, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 57, 1, 0, 0, 0, 610, 611, 5, 39, 0, 0, 611, 612, 3, 96, 48, 0, 612, 59, 1, 0, 0, 0, 613, 615, 7, 2, 0, 0, 614, 613, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 5, 5, 0, 0, 617, 618, 5, 58, 0, 0, 618, 619, 3, 146, 73, 0, 619, 61, 1, 0, 0, 0, 620, 621, 5, 129, 0, 0, 621, 622, 3, 220, 110, 0, 622, 623, 5, 6, 0, 0, 623, 624, 5, 165, 0, 0, 624, 625, 3, 122, 61, 0, 625, 635, 5, 185, 0, 0, 626, 627, 5, 151, 0, 0, 627, 628, 3, 220, 110, 0, 628, 629, 5, 6, 0, 0, 629, 630, 5, 165, 0, 0, 630, 631, 3, 122, 61, 0, 631, 632, 5, 185, 0, 0, 632, 634, 1, 0, 0, 0, 633, 626, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 63, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 639, 5, 86, 0, 0, 639, 640, 3, 154, 77, 0, 640, 65, 1, 0, 0, 0, 641, 642, 5, 127, 0, 0, 642, 643, 3, 154, 77, 0, 643, 67, 1, 0, 0, 0, 644, 645, 5, 42, 0, 0, 645, 659, 5, 11, 0, 0, 646, 660, 5, 1, 0, 0, 647, 648, 7, 1, 0, 0, 648, 649, 5, 165, 0, 0, 649, 650, 3, 146, 73, 0, 650, 651, 5, 185, 0, 0, 651, 660, 1, 0, 0, 0, 652, 653, 5, 43, 0, 0, 653, 654, 5, 101, 0, 0, 654, 655, 5, 165, 0, 0, 655, 656, 3, 70, 35, 0, 656, 657, 5, 185, 0, 0, 657, 660, 1, 0, 0, 0, 658, 660, 3, 146, 73, 0, 659, 646, 1, 0, 0, 0, 659, 647, 1, 0, 0, 0, 659, 652, 1, 0, 0, 0, 659, 658, 1, 0, 0, 0, 660, 69, 1, 0, 0, 0, 661, 666, 3, 72, 36, 0, 662, 663, 5, 151, 0, 0, 663, 665, 3, 72, 36, 0, 664, 662, 1, 0, 0, 0, 665, 668, 1, 0, 0, 0, 666, 664, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 71, 1, 0, 0, 0, 668, 666, 1, 0, 0, 0, 669, 671, 5, 165, 0, 0, 670, 672, 3, 146, 73, 0, 671, 670, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 673, 1, 0, 0, 0, 673, 674, 5, 185, 0, 0, 674, 73, 1, 0, 0, 0, 675, 676, 5, 44, 0, 0, 676, 677, 3, 154, 77, 0, 677, 75, 1, 0, 0, 0, 678, 679, 5, 87, 0, 0, 679, 680, 3, 154, 77, 0, 680, 77, 1, 0, 0, 0, 681, 682, 5, 79, 0, 0, 682, 683, 5, 11, 0, 0, 683, 685, 3, 108, 54, 0, 684, 686, 3, 80, 40, 0, 685, 684, 1, 0, 0, 0, 685, 686, 1, 0, 0, 0, 686, 79, 1, 0, 0, 0, 687, 699, 5, 55, 0, 0, 688, 689, 5, 165, 0, 0, 689, 694, 3, 114, 57, 0, 690, 691, 5, 151, 0, 0, 691, 693, 3, 114, 57, 0, 692, 690, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 698, 5, 185, 0, 0, 698, 700, 1, 0, 0, 0, 699, 688, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 81, 1, 0, 0, 0, 701, 702, 5, 79, 0, 0, 702, 703, 5, 11, 0, 0, 703, 704, 3, 146, 73, 0, 704, 83, 1, 0, 0, 0, 705, 706, 5, 66, 0, 0, 706, 707, 3, 106, 53, 0, 707, 708, 5, 11, 0, 0, 708, 709, 3, 146, 73, 0, 709, 85, 1, 0, 0, 0, 710, 711, 5, 66, 0, 0, 711, 713, 3, 154, 77, 0, 712, 714, 5, 174, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 717, 1, 0, 0, 0, 715, 716, 5, 151, 0, 0, 716, 718, 3, 154, 77, 0, 717, 715, 1, 0, 0, 0, 717, 718, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 720, 5, 130, 0, 0, 720, 722, 5, 107, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 736, 1, 0, 0, 0, 723, 724, 5, 66, 0, 0, 724, 726, 3, 154, 77, 0, 725, 727, 5, 174, 0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 729, 5, 130, 0, 0, 729, 731, 5, 107, 0, 0, 730, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 5, 76, 0, 0, 733, 734, 3, 154, 77, 0, 734, 736, 1, 0, 0, 0, 735, 710, 1, 0, 0, 0, 735, 723, 1, 0, 0, 0, 736, 87, 1, 0, 0, 0, 737, 738, 5, 76, 0, 0, 738, 739, 3, 154, 77, 0, 739, 89, 1, 0, 0, 0, 740, 741, 5, 102, 0, 0, 741, 742, 3, 118, 59, 0, 742, 91, 1, 0, 0, 0, 743, 744, 5, 124, 0, 0, 744, 749, 3, 94, 47, 0, 745, 746, 5, 151, 0, 0, 746, 748, 3, 94, 47, 0, 747, 745, 1, 0, 0, 0, 748, 751, 1, 0, 0, 0, 749, 747, 1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 93, 1, 0, 0, 0, 751, 749, 1, 0, 0, 0, 752, 753, 5, 165, 0, 0, 753, 758, 3, 154, 77, 0, 754, 755, 5, 151, 0, 0, 755, 757, 3, 154, 77, 0, 756, 754, 1, 0, 0, 0, 757, 760, 1, 0, 0, 0, 758, 756, 1, 0, 0, 0, 758, 759, 1, 0, 0, 0, 759, 761, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 761, 762, 5, 185, 0, 0, 762, 95, 1, 0, 0, 0, 763, 764, 6, 48, -1, 0, 764, 766, 3, 180, 90, 0, 765, 767, 5, 31, 0, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 769, 1, 0, 0, 0, 768, 770, 3, 104, 52, 0, 769, 768, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 776, 1, 0, 0, 0, 771, 772, 5, 165, 0, 0, 772, 773, 3, 96, 48, 0, 773, 774, 5, 185, 0, 0, 774, 776, 1, 0, 0, 0, 775, 763, 1, 0, 0, 0, 775, 771, 1, 0, 0, 0, 776, 824, 1, 0, 0, 0, 777, 778, 10, 5, 0, 0, 778, 779, 3, 100, 50, 0, 779, 780, 3, 96, 48, 6, 780, 823, 1, 0, 0, 0, 781, 783, 10, 7, 0, 0, 782, 784, 5, 71, 0, 0, 783, 782, 1, 0, 0, 0, 783, 784, 1, 0, 0, 0, 784, 786, 1, 0, 0, 0, 785, 787, 3, 98, 49, 0, 786, 785, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 1, 0, 0, 0, 788, 789, 5, 58, 0, 0, 789, 791, 3, 96, 48, 0, 790, 792, 3, 102, 51, 0, 791, 790, 1, 0, 0, 0, 791, 792, 1, 0, 0, 0, 792, 823, 1, 0, 0, 0, 793, 794, 10, 6, 0, 0, 794, 795, 5, 84, 0, 0, 795, 796, 5, 58, 0, 0, 796, 798, 3, 96, 48, 0, 797, 799, 3, 102, 51, 0, 798, 797, 1, 0, 0, 0, 798, 799, 1, 0, 0, 0, 799, 823, 1, 0, 0, 0, 800, 801, 10, 4, 0, 0, 801, 802, 5, 83, 0, 0, 802, 803, 5, 165, 0, 0, 803, 804, 3, 146, 73, 0, 804, 808, 3, 182, 91, 0, 805, 806, 5, 42, 0, 0, 806, 807, 5, 11, 0, 0, 807, 809, 3, 146, 73, 0, 808, 805, 1, 0, 0, 0, 808, 809, 1, 0, 0, 0, 809, 810, 1, 0, 0, 0, 810, 811, 5, 185, 0, 0, 811, 823, 1, 0, 0, 0, 812, 813, 10, 3, 0, 0, 813, 816, 5, 122, 0, 0, 814, 815, 5, 50, 0, 0, 815, 817, 5, 75, 0, 0, 816, 814, 1, 0, 0, 0, 816, 817, 1, 0, 0, 0, 817, 818, 1, 0, 0, 0, 818, 819, 5, 165, 0, 0, 819, 820, 3, 186, 93, 0, 820, 821, 5, 185, 0, 0, 821, 823, 1, 0, 0, 0, 822, 777, 1, 0, 0, 0, 822, 781, 1, 0, 0, 0, 822, 793, 1, 0, 0, 0, 822, 800, 1, 0, 0, 0, 822, 812, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 824, 825, 1, 0, 0, 0, 825, 97, 1, 0, 0, 0, 826, 824, 1, 0, 0, 0, 827, 829, 7, 3, 0, 0, 828, 827, 1, 0, 0, 0, 828, 829, 1, 0, 0, 0, 829, 830, 1, 0, 0, 0, 830, 841, 5, 53, 0, 0, 831, 833, 5, 53, 0, 0, 832, 834, 7, 3, 0, 0, 833, 832, 1, 0, 0, 0, 833, 834, 1, 0, 0, 0, 834, 841, 1, 0, 0, 0, 835, 841, 7, 3, 0, 0, 836, 841, 5, 3, 0, 0, 837, 841, 5, 100, 0, 0, 838, 839, 5, 8, 0, 0, 839, 841, 7, 4, 0, 0, 840, 828, 1, 0, 0, 0, 840, 831, 1, 0, 0, 0, 840, 835, 1, 0, 0, 0, 840, 836, 1, 0, 0, 0, 840, 837, 1, 0, 0, 0, 840, 838, 1, 0, 0, 0, 841, 881, 1, 0, 0, 0, 842, 844, 7, 5, 0, 0, 843, 842, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 845, 1, 0, 0, 0, 845, 847, 7, 6, 0, 0, 846, 848, 5, 80, 0, 0, 847, 846, 1, 0, 0, 0, 847, 848, 1, 0, 0, 0, 848, 863, 1, 0, 0, 0, 849, 851, 7, 6, 0, 0, 850, 852, 5, 80, 0, 0, 851, 850, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 855, 7, 5, 0, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 863, 1, 0, 0, 0, 856, 857, 5, 8, 0, 0, 857, 858, 7, 4, 0, 0, 858, 860, 7, 6, 0, 0, 859, 861, 5, 80, 0, 0, 860, 859, 1, 0, 0, 0, 860, 861, 1, 0, 0, 0, 861, 863, 1, 0, 0, 0, 862, 843, 1, 0, 0, 0, 862, 849, 1, 0, 0, 0, 862, 856, 1, 0, 0, 0, 863, 881, 1, 0, 0, 0, 864, 866, 7, 3, 0, 0, 865, 864, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 869, 5, 40, 0, 0, 868, 870, 5, 80, 0, 0, 869, 868, 1, 0, 0, 0, 869, 870, 1, 0, 0, 0, 870, 879, 1, 0, 0, 0, 871, 873, 5, 40, 0, 0, 872, 874, 5, 80, 0, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, 874, 876, 1, 0, 0, 0, 875, 877, 7, 3, 0, 0, 876, 875, 1, 0, 0, 0, 876, 877, 1, 0, 0, 0, 877, 879, 1, 0, 0, 0, 878, 865, 1, 0, 0, 0, 878, 871, 1, 0, 0, 0, 879, 881, 1, 0, 0, 0, 880, 840, 1, 0, 0, 0, 880, 862, 1, 0, 0, 0, 880, 878, 1, 0, 0, 0, 881, 99, 1, 0, 0, 0, 882, 883, 5, 18, 0, 0, 883, 886, 5, 58, 0, 0, 884, 886, 5, 151, 0, 0, 885, 882, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 101, 1, 0, 0, 0, 887, 888, 5, 77, 0, 0, 888, 897, 3, 146, 73, 0, 889, 890, 5, 123, 0, 0, 890, 891, 5, 165, 0, 0, 891, 892, 3, 146, 73, 0, 892, 893, 5, 185, 0, 0, 893, 897, 1, 0, 0, 0, 894, 895, 5, 123, 0, 0, 895, 897, 3, 146, 73, 0, 896, 887, 1, 0, 0, 0, 896, 889, 1, 0, 0, 0, 896, 894, 1, 0, 0, 0, 897, 103, 1, 0, 0, 0, 898, 899, 5, 97, 0, 0, 899, 901, 3, 116, 58, 0, 900, 902, 5, 174, 0, 0, 901, 900, 1, 0, 0, 0, 901, 902, 1, 0, 0, 0, 902, 905, 1, 0, 0, 0, 903, 904, 5, 76, 0, 0, 904, 906, 3, 116, 58, 0, 905, 903, 1, 0, 0, 0, 905, 906, 1, 0, 0, 0, 906, 911, 1, 0, 0, 0, 907, 908, 5, 165, 0, 0, 908, 909, 3, 220, 110, 0, 909, 910, 5, 185, 0, 0, 910, 912, 1, 0, 0, 0, 911, 907, 1, 0, 0, 0, 911, 912, 1, 0, 0, 0, 912, 105, 1, 0, 0, 0, 913, 916, 3, 154, 77, 0, 914, 915, 7, 7, 0, 0, 915, 917, 3, 154, 77, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 107, 1, 0, 0, 0, 918, 923, 3, 110, 55, 0, 919, 920, 5, 151, 0, 0, 920, 922, 3, 110, 55, 0, 921, 919, 1, 0, 0, 0, 922, 925, 1, 0, 0, 0, 923, 921, 1, 0, 0, 0, 923, 924, 1, 0, 0, 0, 924, 109, 1, 0, 0, 0, 925, 923, 1, 0, 0, 0, 926, 928, 3, 154, 77, 0, 927, 929, 7, 8, 0, 0, 928, 927, 1, 0, 0, 0, 928, 929, 1, 0, 0, 0, 929, 932, 1, 0, 0, 0, 930, 931, 5, 75, 0, 0, 931, 933, 7, 9, 0, 0, 932, 930, 1, 0, 0, 0, 932, 933, 1, 0, 0, 0, 933, 936, 1, 0, 0, 0, 934, 935, 5, 16, 0, 0, 935, 937, 5, 143, 0, 0, 936, 934, 1, 0, 0, 0, 936, 937, 1, 0, 0, 0, 937, 939, 1, 0, 0, 0, 938, 940, 3, 112, 56, 0, 939, 938, 1, 0, 0, 0, 939, 940, 1, 0, 0, 0, 940, 111, 1, 0, 0, 0, 941, 942, 5, 130, 0, 0, 942, 945, 5, 32, 0, 0, 943, 944, 5, 39, 0, 0, 944, 946, 3, 154, 77, 0, 945, 943, 1, 0, 0, 0, 945, 946, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 948, 5, 112, 0, 0, 948, 950, 3, 154, 77, 0, 949, 947, 1, 0, 0, 0, 949, 950, 1, 0, 0, 0, 950, 953, 1, 0, 0, 0, 951, 952, 5, 103, 0, 0, 952, 954, 3, 154, 77, 0, 953, 951, 1, 0, 0, 0, 953, 954, 1, 0, 0, 0, 954, 113, 1, 0, 0, 0, 955, 958, 3, 154, 77, 0, 956, 957, 5, 6, 0, 0, 957, 959, 3, 154, 77, 0, 958, 956, 1, 0, 0, 0, 958, 959, 1, 0, 0, 0, 959, 115, 1, 0, 0, 0, 960, 967, 3, 224, 112, 0, 961, 964, 3, 204, 102, 0, 962, 963, 5, 187, 0, 0, 963, 965, 3, 204, 102, 0, 964, 962, 1, 0, 0, 0, 964, 965, 1, 0, 0, 0, 965, 967, 1, 0, 0, 0, 966, 960, 1, 0, 0, 0, 966, 961, 1, 0, 0, 0, 967, 117, 1, 0, 0, 0, 968, 973, 3, 120, 60, 0, 969, 970, 5, 151, 0, 0, 970, 972, 3, 120, 60, 0, 971, 969, 1, 0, 0, 0, 972, 975, 1, 0, 0, 0, 973, 971, 1, 0, 0, 0, 973, 974, 1, 0, 0, 0, 974, 119, 1, 0, 0, 0, 975, 973, 1, 0, 0, 0, 976, 977, 3, 220, 110, 0, 977, 978, 5, 157, 0, 0, 978, 979, 3, 206, 103, 0, 979, 121, 1, 0, 0, 0, 980, 982, 3, 124, 62, 0, 981, 980, 1, 0, 0, 0, 981, 982, 1, 0, 0, 0, 982, 984, 1, 0, 0, 0, 983, 985, 3, 126, 63, 0, 984, 983, 1, 0, 0, 0, 984, 985, 1, 0, 0, 0, 985, 987, 1, 0, 0, 0, 986, 988, 3, 130, 65, 0, 987, 986, 1, 0, 0, 0, 987, 988, 1, 0, 0, 0, 988, 123, 1, 0, 0, 0, 989, 990, 5, 82, 0, 0, 990, 991, 5, 11, 0, 0, 991, 992, 3, 146, 73, 0, 992, 125, 1, 0, 0, 0, 993, 994, 5, 79, 0, 0, 994, 995, 5, 11, 0, 0, 995, 996, 3, 108, 54, 0, 996, 127, 1, 0, 0, 0, 997, 998, 5, 131, 0, 0, 998, 999, 5, 42, 0, 0, 999, 1000, 5, 165, 0, 0, 1000, 1001, 3, 78, 39, 0, 1001, 1002, 5, 185, 0, 0, 1002, 129, 1, 0, 0, 0, 1003, 1004, 7, 10, 0, 0, 1004, 1005, 3, 132, 66, 0, 1005, 131, 1, 0, 0, 0, 1006, 1013, 3, 134, 67, 0, 1007, 1008, 5, 9, 0, 0, 1008, 1009, 3, 134, 67, 0, 1009, 1010, 5, 2, 0, 0, 1010, 1011, 3, 134, 67, 0, 1011, 1013, 1, 0, 0, 0, 1012, 1006, 1, 0, 0, 0, 1012, 1007, 1, 0, 0, 0, 1013, 133, 1, 0, 0, 0, 1014, 1015, 5, 20, 0, 0, 1015, 1027, 5, 95, 0, 0, 1016, 1017, 5, 120, 0, 0, 1017, 1027, 5, 85, 0, 0, 1018, 1019, 5, 120, 0, 0, 1019, 1027, 5, 37, 0, 0, 1020, 1021, 3, 154, 77, 0, 1021, 1022, 5, 85, 0, 0, 1022, 1027, 1, 0, 0, 0, 1023, 1024, 3, 154, 77, 0, 1024, 1025, 5, 37, 0, 0, 1025, 1027, 1, 0, 0, 0, 1026, 1014, 1, 0, 0, 0, 1026, 1016, 1, 0, 0, 0, 1026, 1018, 1, 0, 0, 0, 1026, 1020, 1, 0, 0, 0, 1026, 1023, 1, 0, 0, 0, 1027, 135, 1, 0, 0, 0, 1028, 1029, 3, 154, 77, 0, 1029, 1030, 5, 0, 0, 1, 1030, 137, 1, 0, 0, 0, 1031, 1032, 6, 69, -1, 0, 1032, 1033, 3, 220, 110, 0, 1033, 1034, 5, 165, 0, 0, 1034, 1035, 3, 220, 110, 0, 1035, 1042, 3, 138, 69, 0, 1036, 1037, 5, 151, 0, 0, 1037, 1038, 3, 220, 110, 0, 1038, 1039, 3, 138, 69, 0, 1039, 1041, 1, 0, 0, 0, 1040, 1036, 1, 0, 0, 0, 1041, 1044, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1046, 1, 0, 0, 0, 1044, 1042, 1, 0, 0, 0, 1045, 1047, 5, 151, 0, 0, 1046, 1045, 1, 0, 0, 0, 1046, 1047, 1, 0, 0, 0, 1047, 1048, 1, 0, 0, 0, 1048, 1049, 5, 185, 0, 0, 1049, 1095, 1, 0, 0, 0, 1050, 1051, 3, 220, 110, 0, 1051, 1052, 5, 165, 0, 0, 1052, 1057, 3, 222, 111, 0, 1053, 1054, 5, 151, 0, 0, 1054, 1056, 3, 222, 111, 0, 1055, 1053, 1, 0, 0, 0, 1056, 1059, 1, 0, 0, 0, 1057, 1055, 1, 0, 0, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1061, 1, 0, 0, 0, 1059, 1057, 1, 0, 0, 0, 1060, 1062, 5, 151, 0, 0, 1061, 1060, 1, 0, 0, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 5, 185, 0, 0, 1064, 1095, 1, 0, 0, 0, 1065, 1066, 3, 220, 110, 0, 1066, 1067, 5, 165, 0, 0, 1067, 1072, 3, 138, 69, 0, 1068, 1069, 5, 151, 0, 0, 1069, 1071, 3, 138, 69, 0, 1070, 1068, 1, 0, 0, 0, 1071, 1074, 1, 0, 0, 0, 1072, 1070, 1, 0, 0, 0, 1072, 1073, 1, 0, 0, 0, 1073, 1076, 1, 0, 0, 0, 1074, 1072, 1, 0, 0, 0, 1075, 1077, 5, 151, 0, 0, 1076, 1075, 1, 0, 0, 0, 1076, 1077, 1, 0, 0, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 5, 185, 0, 0, 1079, 1095, 1, 0, 0, 0, 1080, 1081, 3, 220, 110, 0, 1081, 1083, 5, 165, 0, 0, 1082, 1084, 3, 146, 73, 0, 1083, 1082, 1, 0, 0, 0, 1083, 1084, 1, 0, 0, 0, 1084, 1085, 1, 0, 0, 0, 1085, 1086, 5, 185, 0, 0, 1086, 1095, 1, 0, 0, 0, 1087, 1089, 3, 220, 110, 0, 1088, 1090, 3, 220, 110, 0, 1089, 1088, 1, 0, 0, 0, 1090, 1091, 1, 0, 0, 0, 1091, 1089, 1, 0, 0, 0, 1091, 1092, 1, 0, 0, 0, 1092, 1095, 1, 0, 0, 0, 1093, 1095, 3, 220, 110, 0, 1094, 1031, 1, 0, 0, 0, 1094, 1050, 1, 0, 0, 0, 1094, 1065, 1, 0, 0, 0, 1094, 1080, 1, 0, 0, 0, 1094, 1087, 1, 0, 0, 0, 1094, 1093, 1, 0, 0, 0, 1095, 1104, 1, 0, 0, 0, 1096, 1097, 10, 7, 0, 0, 1097, 1099, 5, 164, 0, 0, 1098, 1100, 5, 139, 0, 0, 1099, 1098, 1, 0, 0, 0, 1099, 1100, 1, 0, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1103, 5, 184, 0, 0, 1102, 1096, 1, 0, 0, 0, 1103, 1106, 1, 0, 0, 0, 1104, 1102, 1, 0, 0, 0, 1104, 1105, 1, 0, 0, 0, 1105, 139, 1, 0, 0, 0, 1106, 1104, 1, 0, 0, 0, 1107, 1108, 3, 142, 71, 0, 1108, 1110, 5, 130, 0, 0, 1109, 1111, 5, 110, 0, 0, 1110, 1109, 1, 0, 0, 0, 1110, 1111, 1, 0, 0, 0, 1111, 1112, 1, 0, 0, 0, 1112, 1113, 5, 109, 0, 0, 1113, 1114, 5, 111, 0, 0, 1114, 1117, 1, 0, 0, 0, 1115, 1117, 3, 142, 71, 0, 1116, 1107, 1, 0, 0, 0, 1116, 1115, 1, 0, 0, 0, 1117, 141, 1, 0, 0, 0, 1118, 1123, 5, 134, 0, 0, 1119, 1123, 5, 135, 0, 0, 1120, 1123, 3, 208, 104, 0, 1121, 1123, 3, 144, 72, 0, 1122, 1118, 1, 0, 0, 0, 1122, 1119, 1, 0, 0, 0, 1122, 1120, 1, 0, 0, 0, 1122, 1121, 1, 0, 0, 0, 1123, 143, 1, 0, 0, 0, 1124, 1125, 7, 11, 0, 0, 1125, 145, 1, 0, 0, 0, 1126, 1131, 3, 154, 77, 0, 1127, 1128, 5, 151, 0, 0, 1128, 1130, 3, 154, 77, 0, 1129, 1127, 1, 0, 0, 0, 1130, 1133, 1, 0, 0, 0, 1131, 1129, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1135, 1, 0, 0, 0, 1133, 1131, 1, 0, 0, 0, 1134, 1136, 5, 151, 0, 0, 1135, 1134, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 147, 1, 0, 0, 0, 1137, 1142, 3, 152, 76, 0, 1138, 1139, 5, 151, 0, 0, 1139, 1141, 3, 152, 76, 0, 1140, 1138, 1, 0, 0, 0, 1141, 1144, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1143, 1, 0, 0, 0, 1143, 1145, 1, 0, 0, 0, 1144, 1142, 1, 0, 0, 0, 1145, 1146, 5, 151, 0, 0, 1146, 1149, 1, 0, 0, 0, 1147, 1149, 3, 150, 75, 0, 1148, 1137, 1, 0, 0, 0, 1148, 1147, 1, 0, 0, 0, 1149, 149, 1, 0, 0, 0, 1150, 1155, 3, 152, 76, 0, 1151, 1152, 5, 151, 0, 0, 1152, 1154, 3, 152, 76, 0, 1153, 1151, 1, 0, 0, 0, 1154, 1157, 1, 0, 0, 0, 1155, 1153, 1, 0, 0, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1159, 1, 0, 0, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1160, 5, 151, 0, 0, 1159, 1158, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 151, 1, 0, 0, 0, 1161, 1162, 3, 220, 110, 0, 1162, 1163, 5, 150, 0, 0, 1163, 1164, 3, 154, 77, 0, 1164, 1172, 1, 0, 0, 0, 1165, 1166, 5, 39, 0, 0, 1166, 1172, 3, 218, 109, 0, 1167, 1172, 3, 154, 77, 0, 1168, 1169, 3, 154, 77, 0, 1169, 1170, 3, 218, 109, 0, 1170, 1172, 1, 0, 0, 0, 1171, 1161, 1, 0, 0, 0, 1171, 1165, 1, 0, 0, 0, 1171, 1167, 1, 0, 0, 0, 1171, 1168, 1, 0, 0, 0, 1172, 153, 1, 0, 0, 0, 1173, 1174, 6, 77, -1, 0, 1174, 1176, 5, 12, 0, 0, 1175, 1177, 3, 154, 77, 0, 1176, 1175, 1, 0, 0, 0, 1176, 1177, 1, 0, 0, 0, 1177, 1183, 1, 0, 0, 0, 1178, 1179, 5, 126, 0, 0, 1179, 1180, 3, 154, 77, 0, 1180, 1181, 5, 105, 0, 0, 1181, 1182, 3, 154, 77, 0, 1182, 1184, 1, 0, 0, 0, 1183, 1178, 1, 0, 0, 0, 1184, 1185, 1, 0, 0, 0, 1185, 1183, 1, 0, 0, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1189, 1, 0, 0, 0, 1187, 1188, 5, 26, 0, 0, 1188, 1190, 3, 154, 77, 0, 1189, 1187, 1, 0, 0, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 1, 0, 0, 0, 1191, 1192, 5, 27, 0, 0, 1192, 1523, 1, 0, 0, 0, 1193, 1194, 5, 13, 0, 0, 1194, 1195, 5, 165, 0, 0, 1195, 1196, 3, 154, 77, 0, 1196, 1197, 5, 6, 0, 0, 1197, 1198, 3, 138, 69, 0, 1198, 1199, 5, 185, 0, 0, 1199, 1523, 1, 0, 0, 0, 1200, 1201, 5, 119, 0, 0, 1201, 1202, 5, 165, 0, 0, 1202, 1203, 3, 154, 77, 0, 1203, 1204, 5, 6, 0, 0, 1204, 1205, 3, 138, 69, 0, 1205, 1206, 5, 185, 0, 0, 1206, 1523, 1, 0, 0, 0, 1207, 1208, 5, 21, 0, 0, 1208, 1523, 5, 143, 0, 0, 1209, 1210, 5, 56, 0, 0, 1210, 1211, 3, 154, 77, 0, 1211, 1212, 3, 208, 104, 0, 1212, 1523, 1, 0, 0, 0, 1213, 1214, 5, 56, 0, 0, 1214, 1523, 5, 143, 0, 0, 1215, 1216, 5, 104, 0, 0, 1216, 1217, 5, 165, 0, 0, 1217, 1218, 3, 154, 77, 0, 1218, 1219, 5, 39, 0, 0, 1219, 1222, 3, 154, 77, 0, 1220, 1221, 5, 38, 0, 0, 1221, 1223, 3, 154, 77, 0, 1222, 1220, 1, 0, 0, 0, 1222, 1223, 1, 0, 0, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 5, 185, 0, 0, 1225, 1523, 1, 0, 0, 0, 1226, 1227, 5, 108, 0, 0, 1227, 1523, 5, 143, 0, 0, 1228, 1229, 5, 116, 0, 0, 1229, 1230, 5, 165, 0, 0, 1230, 1231, 7, 12, 0, 0, 1231, 1232, 3, 226, 113, 0, 1232, 1233, 5, 39, 0, 0, 1233, 1234, 3, 154, 77, 0, 1234, 1235, 5, 185, 0, 0, 1235, 1523, 1, 0, 0, 0, 1236, 1237, 5, 17, 0, 0, 1237, 1238, 5, 165, 0, 0, 1238, 1239, 5, 143, 0, 0, 1239, 1523, 5, 185, 0, 0, 1240, 1241, 5, 17, 0, 0, 1241, 1242, 5, 165, 0, 0, 1242, 1243, 3, 146, 73, 0, 1243, 1244, 5, 185, 0, 0, 1244, 1523, 1, 0, 0, 0, 1245, 1246, 5, 17, 0, 0, 1246, 1247, 5, 165, 0, 0, 1247, 1248, 5, 145, 0, 0, 1248, 1249, 5, 29, 0, 0, 1249, 1250, 5, 165, 0, 0, 1250, 1251, 3, 8, 4, 0, 1251, 1252, 5, 185, 0, 0, 1252, 1253, 5, 91, 0, 0, 1253, 1254, 5, 165, 0, 0, 1254, 1255, 3, 158, 79, 0, 1255, 1256, 5, 185, 0, 0, 1256, 1257, 5, 185, 0, 0, 1257, 1271, 1, 0, 0, 0, 1258, 1259, 5, 165, 0, 0, 1259, 1260, 5, 145, 0, 0, 1260, 1261, 5, 29, 0, 0, 1261, 1262, 5, 165, 0, 0, 1262, 1263, 3, 8, 4, 0, 1263, 1264, 5, 185, 0, 0, 1264, 1265, 5, 91, 0, 0, 1265, 1266, 5, 165, 0, 0, 1266, 1267, 3, 158, 79, 0, 1267, 1268, 5, 185, 0, 0, 1268, 1269, 5, 185, 0, 0, 1269, 1271, 1, 0, 0, 0, 1270, 1245, 1, 0, 0, 0, 1270, 1258, 1, 0, 0, 0, 1271, 1523, 1, 0, 0, 0, 1272, 1273, 5, 17, 0, 0, 1273, 1274, 5, 165, 0, 0, 1274, 1275, 5, 145, 0, 0, 1275, 1276, 5, 29, 0, 0, 1276, 1277, 5, 165, 0, 0, 1277, 1278, 3, 8, 4, 0, 1278, 1279, 5, 185, 0, 0, 1279, 1280, 5, 185, 0, 0, 1280, 1523, 1, 0, 0, 0, 1281, 1282, 5, 17, 0, 0, 1282, 1283, 5, 165, 0, 0, 1283, 1284, 5, 145, 0, 0, 1284, 1285, 5, 91, 0, 0, 1285, 1286, 5, 165, 0, 0, 1286, 1287, 3, 158, 79, 0, 1287, 1288, 5, 185, 0, 0, 1288, 1289, 5, 185, 0, 0, 1289, 1299, 1, 0, 0, 0, 1290, 1291, 5, 165, 0, 0, 1291, 1292, 5, 145, 0, 0, 1292, 1293, 5, 91, 0, 0, 1293, 1294, 5, 165, 0, 0, 1294, 1295, 3, 158, 79, 0, 1295, 1296, 5, 185, 0, 0, 1296, 1297, 5, 185, 0, 0, 1297, 1299, 1, 0, 0, 0, 1298, 1281, 1, 0, 0, 0, 1298, 1290, 1, 0, 0, 0, 1299, 1523, 1, 0, 0, 0, 1300, 1301, 5, 17, 0, 0, 1301, 1302, 5, 165, 0, 0, 1302, 1303, 5, 145, 0, 0, 1303, 1523, 5, 185, 0, 0, 1304, 1305, 5, 17, 0, 0, 1305, 1306, 5, 165, 0, 0, 1306, 1307, 3, 220, 110, 0, 1307, 1308, 5, 155, 0, 0, 1308, 1309, 5, 145, 0, 0, 1309, 1310, 5, 29, 0, 0, 1310, 1311, 5, 165, 0, 0, 1311, 1312, 3, 8, 4, 0, 1312, 1313, 5, 185, 0, 0, 1313, 1314, 5, 91, 0, 0, 1314, 1315, 5, 165, 0, 0, 1315, 1316, 3, 158, 79, 0, 1316, 1317, 5, 185, 0, 0, 1317, 1318, 5, 185, 0, 0, 1318, 1523, 1, 0, 0, 0, 1319, 1320, 5, 17, 0, 0, 1320, 1321, 5, 165, 0, 0, 1321, 1322, 3, 220, 110, 0, 1322, 1323, 5, 155, 0, 0, 1323, 1324, 5, 145, 0, 0, 1324, 1325, 5, 29, 0, 0, 1325, 1326, 5, 165, 0, 0, 1326, 1327, 3, 8, 4, 0, 1327, 1328, 5, 185, 0, 0, 1328, 1329, 5, 185, 0, 0, 1329, 1523, 1, 0, 0, 0, 1330, 1331, 5, 17, 0, 0, 1331, 1332, 5, 165, 0, 0, 1332, 1333, 3, 220, 110, 0, 1333, 1334, 5, 155, 0, 0, 1334, 1335, 5, 145, 0, 0, 1335, 1336, 5, 91, 0, 0, 1336, 1337, 5, 165, 0, 0, 1337, 1338, 3, 158, 79, 0, 1338, 1339, 5, 185, 0, 0, 1339, 1340, 5, 185, 0, 0, 1340, 1523, 1, 0, 0, 0, 1341, 1342, 5, 17, 0, 0, 1342, 1343, 5, 165, 0, 0, 1343, 1344, 3, 220, 110, 0, 1344, 1345, 5, 155, 0, 0, 1345, 1346, 5, 145, 0, 0, 1346, 1347, 5, 185, 0, 0, 1347, 1523, 1, 0, 0, 0, 1348, 1349, 5, 145, 0, 0, 1349, 1350, 5, 17, 0, 0, 1350, 1351, 5, 165, 0, 0, 1351, 1352, 5, 143, 0, 0, 1352, 1523, 5, 185, 0, 0, 1353, 1354, 5, 145, 0, 0, 1354, 1355, 5, 17, 0, 0, 1355, 1356, 5, 165, 0, 0, 1356, 1357, 3, 146, 73, 0, 1357, 1358, 5, 185, 0, 0, 1358, 1523, 1, 0, 0, 0, 1359, 1360, 3, 220, 110, 0, 1360, 1362, 5, 165, 0, 0, 1361, 1363, 3, 146, 73, 0, 1362, 1361, 1, 0, 0, 0, 1362, 1363, 1, 0, 0, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 5, 185, 0, 0, 1365, 1366, 3, 128, 64, 0, 1366, 1523, 1, 0, 0, 0, 1367, 1368, 3, 220, 110, 0, 1368, 1370, 5, 165, 0, 0, 1369, 1371, 3, 146, 73, 0, 1370, 1369, 1, 0, 0, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 5, 185, 0, 0, 1373, 1382, 1, 0, 0, 0, 1374, 1376, 5, 165, 0, 0, 1375, 1377, 5, 25, 0, 0, 1376, 1375, 1, 0, 0, 0, 1376, 1377, 1, 0, 0, 0, 1377, 1379, 1, 0, 0, 0, 1378, 1380, 3, 146, 73, 0, 1379, 1378, 1, 0, 0, 0, 1379, 1380, 1, 0, 0, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1383, 5, 185, 0, 0, 1382, 1374, 1, 0, 0, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1390, 1, 0, 0, 0, 1384, 1385, 5, 33, 0, 0, 1385, 1386, 5, 165, 0, 0, 1386, 1387, 5, 127, 0, 0, 1387, 1388, 3, 154, 77, 0, 1388, 1389, 5, 185, 0, 0, 1389, 1391, 1, 0, 0, 0, 1390, 1384, 1, 0, 0, 0, 1390, 1391, 1, 0, 0, 0, 1391, 1392, 1, 0, 0, 0, 1392, 1393, 5, 81, 0, 0, 1393, 1394, 5, 165, 0, 0, 1394, 1395, 3, 122, 61, 0, 1395, 1396, 5, 185, 0, 0, 1396, 1523, 1, 0, 0, 0, 1397, 1398, 3, 220, 110, 0, 1398, 1400, 5, 165, 0, 0, 1399, 1401, 3, 146, 73, 0, 1400, 1399, 1, 0, 0, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 1, 0, 0, 0, 1402, 1403, 5, 185, 0, 0, 1403, 1412, 1, 0, 0, 0, 1404, 1406, 5, 165, 0, 0, 1405, 1407, 5, 25, 0, 0, 1406, 1405, 1, 0, 0, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1409, 1, 0, 0, 0, 1408, 1410, 3, 146, 73, 0, 1409, 1408, 1, 0, 0, 0, 1409, 1410, 1, 0, 0, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1413, 5, 185, 0, 0, 1412, 1404, 1, 0, 0, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1420, 1, 0, 0, 0, 1414, 1415, 5, 33, 0, 0, 1415, 1416, 5, 165, 0, 0, 1416, 1417, 5, 127, 0, 0, 1417, 1418, 3, 154, 77, 0, 1418, 1419, 5, 185, 0, 0, 1419, 1421, 1, 0, 0, 0, 1420, 1414, 1, 0, 0, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 1, 0, 0, 0, 1422, 1423, 5, 81, 0, 0, 1423, 1424, 3, 220, 110, 0, 1424, 1523, 1, 0, 0, 0, 1425, 1431, 3, 220, 110, 0, 1426, 1428, 5, 165, 0, 0, 1427, 1429, 3, 146, 73, 0, 1428, 1427, 1, 0, 0, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 1, 0, 0, 0, 1430, 1432, 5, 185, 0, 0, 1431, 1426, 1, 0, 0, 0, 1431, 1432, 1, 0, 0, 0, 1432, 1433, 1, 0, 0, 0, 1433, 1435, 5, 165, 0, 0, 1434, 1436, 5, 25, 0, 0, 1435, 1434, 1, 0, 0, 0, 1435, 1436, 1, 0, 0, 0, 1436, 1438, 1, 0, 0, 0, 1437, 1439, 3, 146, 73, 0, 1438, 1437, 1, 0, 0, 0, 1438, 1439, 1, 0, 0, 0, 1439, 1443, 1, 0, 0, 0, 1440, 1441, 5, 79, 0, 0, 1441, 1442, 5, 11, 0, 0, 1442, 1444, 3, 108, 54, 0, 1443, 1440, 1, 0, 0, 0, 1443, 1444, 1, 0, 0, 0, 1444, 1445, 1, 0, 0, 0, 1445, 1452, 5, 185, 0, 0, 1446, 1447, 5, 33, 0, 0, 1447, 1448, 5, 165, 0, 0, 1448, 1449, 5, 127, 0, 0, 1449, 1450, 3, 154, 77, 0, 1450, 1451, 5, 185, 0, 0, 1451, 1453, 1, 0, 0, 0, 1452, 1446, 1, 0, 0, 0, 1452, 1453, 1, 0, 0, 0, 1453, 1523, 1, 0, 0, 0, 1454, 1523, 3, 166, 83, 0, 1455, 1523, 3, 228, 114, 0, 1456, 1523, 3, 206, 103, 0, 1457, 1458, 5, 153, 0, 0, 1458, 1523, 3, 154, 77, 25, 1459, 1460, 5, 73, 0, 0, 1460, 1523, 3, 154, 77, 17, 1461, 1462, 3, 196, 98, 0, 1462, 1463, 5, 155, 0, 0, 1463, 1465, 1, 0, 0, 0, 1464, 1461, 1, 0, 0, 0, 1464, 1465, 1, 0, 0, 0, 1465, 1466, 1, 0, 0, 0, 1466, 1472, 5, 145, 0, 0, 1467, 1468, 5, 29, 0, 0, 1468, 1469, 5, 165, 0, 0, 1469, 1470, 3, 8, 4, 0, 1470, 1471, 5, 185, 0, 0, 1471, 1473, 1, 0, 0, 0, 1472, 1467, 1, 0, 0, 0, 1472, 1473, 1, 0, 0, 0, 1473, 1523, 1, 0, 0, 0, 1474, 1475, 5, 60, 0, 0, 1475, 1480, 3, 220, 110, 0, 1476, 1477, 5, 151, 0, 0, 1477, 1479, 3, 220, 110, 0, 1478, 1476, 1, 0, 0, 0, 1479, 1482, 1, 0, 0, 0, 1480, 1478, 1, 0, 0, 0, 1480, 1481, 1, 0, 0, 0, 1481, 1484, 1, 0, 0, 0, 1482, 1480, 1, 0, 0, 0, 1483, 1485, 5, 151, 0, 0, 1484, 1483, 1, 0, 0, 0, 1484, 1485, 1, 0, 0, 0, 1485, 1486, 1, 0, 0, 0, 1486, 1487, 5, 150, 0, 0, 1487, 1488, 3, 154, 77, 10, 1488, 1523, 1, 0, 0, 0, 1489, 1490, 5, 165, 0, 0, 1490, 1491, 3, 48, 24, 0, 1491, 1492, 5, 185, 0, 0, 1492, 1523, 1, 0, 0, 0, 1493, 1494, 5, 165, 0, 0, 1494, 1495, 3, 154, 77, 0, 1495, 1496, 5, 185, 0, 0, 1496, 1523, 1, 0, 0, 0, 1497, 1498, 5, 165, 0, 0, 1498, 1499, 3, 146, 73, 0, 1499, 1500, 5, 185, 0, 0, 1500, 1523, 1, 0, 0, 0, 1501, 1503, 5, 5, 0, 0, 1502, 1501, 1, 0, 0, 0, 1502, 1503, 1, 0, 0, 0, 1503, 1504, 1, 0, 0, 0, 1504, 1506, 5, 164, 0, 0, 1505, 1507, 3, 146, 73, 0, 1506, 1505, 1, 0, 0, 0, 1506, 1507, 1, 0, 0, 0, 1507, 1508, 1, 0, 0, 0, 1508, 1523, 5, 184, 0, 0, 1509, 1511, 5, 163, 0, 0, 1510, 1512, 3, 40, 20, 0, 1511, 1510, 1, 0, 0, 0, 1511, 1512, 1, 0, 0, 0, 1512, 1513, 1, 0, 0, 0, 1513, 1523, 5, 183, 0, 0, 1514, 1523, 3, 156, 78, 0, 1515, 1516, 3, 220, 110, 0, 1516, 1517, 5, 149, 0, 0, 1517, 1518, 3, 154, 77, 3, 1518, 1523, 1, 0, 0, 0, 1519, 1520, 5, 160, 0, 0, 1520, 1523, 5, 139, 0, 0, 1521, 1523, 3, 176, 88, 0, 1522, 1173, 1, 0, 0, 0, 1522, 1193, 1, 0, 0, 0, 1522, 1200, 1, 0, 0, 0, 1522, 1207, 1, 0, 0, 0, 1522, 1209, 1, 0, 0, 0, 1522, 1213, 1, 0, 0, 0, 1522, 1215, 1, 0, 0, 0, 1522, 1226, 1, 0, 0, 0, 1522, 1228, 1, 0, 0, 0, 1522, 1236, 1, 0, 0, 0, 1522, 1240, 1, 0, 0, 0, 1522, 1270, 1, 0, 0, 0, 1522, 1272, 1, 0, 0, 0, 1522, 1298, 1, 0, 0, 0, 1522, 1300, 1, 0, 0, 0, 1522, 1304, 1, 0, 0, 0, 1522, 1319, 1, 0, 0, 0, 1522, 1330, 1, 0, 0, 0, 1522, 1341, 1, 0, 0, 0, 1522, 1348, 1, 0, 0, 0, 1522, 1353, 1, 0, 0, 0, 1522, 1359, 1, 0, 0, 0, 1522, 1367, 1, 0, 0, 0, 1522, 1397, 1, 0, 0, 0, 1522, 1425, 1, 0, 0, 0, 1522, 1454, 1, 0, 0, 0, 1522, 1455, 1, 0, 0, 0, 1522, 1456, 1, 0, 0, 0, 1522, 1457, 1, 0, 0, 0, 1522, 1459, 1, 0, 0, 0, 1522, 1464, 1, 0, 0, 0, 1522, 1474, 1, 0, 0, 0, 1522, 1489, 1, 0, 0, 0, 1522, 1493, 1, 0, 0, 0, 1522, 1497, 1, 0, 0, 0, 1522, 1502, 1, 0, 0, 0, 1522, 1509, 1, 0, 0, 0, 1522, 1514, 1, 0, 0, 0, 1522, 1515, 1, 0, 0, 0, 1522, 1519, 1, 0, 0, 0, 1522, 1521, 1, 0, 0, 0, 1523, 1662, 1, 0, 0, 0, 1524, 1528, 10, 24, 0, 0, 1525, 1529, 5, 145, 0, 0, 1526, 1529, 5, 187, 0, 0, 1527, 1529, 5, 174, 0, 0, 1528, 1525, 1, 0, 0, 0, 1528, 1526, 1, 0, 0, 0, 1528, 1527, 1, 0, 0, 0, 1529, 1530, 1, 0, 0, 0, 1530, 1661, 3, 154, 77, 25, 1531, 1535, 10, 23, 0, 0, 1532, 1536, 5, 175, 0, 0, 1533, 1536, 5, 153, 0, 0, 1534, 1536, 5, 152, 0, 0, 1535, 1532, 1, 0, 0, 0, 1535, 1533, 1, 0, 0, 0, 1535, 1534, 1, 0, 0, 0, 1536, 1537, 1, 0, 0, 0, 1537, 1661, 3, 154, 77, 24, 1538, 1563, 10, 22, 0, 0, 1539, 1564, 5, 156, 0, 0, 1540, 1564, 5, 157, 0, 0, 1541, 1564, 5, 169, 0, 0, 1542, 1564, 5, 166, 0, 0, 1543, 1564, 5, 167, 0, 0, 1544, 1564, 5, 158, 0, 0, 1545, 1564, 5, 159, 0, 0, 1546, 1548, 5, 73, 0, 0, 1547, 1546, 1, 0, 0, 0, 1547, 1548, 1, 0, 0, 0, 1548, 1549, 1, 0, 0, 0, 1549, 1551, 5, 51, 0, 0, 1550, 1552, 5, 15, 0, 0, 1551, 1550, 1, 0, 0, 0, 1551, 1552, 1, 0, 0, 0, 1552, 1564, 1, 0, 0, 0, 1553, 1555, 5, 73, 0, 0, 1554, 1553, 1, 0, 0, 0, 1554, 1555, 1, 0, 0, 0, 1555, 1556, 1, 0, 0, 0, 1556, 1564, 7, 13, 0, 0, 1557, 1564, 5, 181, 0, 0, 1558, 1564, 5, 182, 0, 0, 1559, 1564, 5, 171, 0, 0, 1560, 1564, 5, 161, 0, 0, 1561, 1564, 5, 162, 0, 0, 1562, 1564, 5, 170, 0, 0, 1563, 1539, 1, 0, 0, 0, 1563, 1540, 1, 0, 0, 0, 1563, 1541, 1, 0, 0, 0, 1563, 1542, 1, 0, 0, 0, 1563, 1543, 1, 0, 0, 0, 1563, 1544, 1, 0, 0, 0, 1563, 1545, 1, 0, 0, 0, 1563, 1547, 1, 0, 0, 0, 1563, 1554, 1, 0, 0, 0, 1563, 1557, 1, 0, 0, 0, 1563, 1558, 1, 0, 0, 0, 1563, 1559, 1, 0, 0, 0, 1563, 1560, 1, 0, 0, 0, 1563, 1561, 1, 0, 0, 0, 1563, 1562, 1, 0, 0, 0, 1564, 1565, 1, 0, 0, 0, 1565, 1661, 3, 154, 77, 23, 1566, 1567, 10, 19, 0, 0, 1567, 1569, 5, 57, 0, 0, 1568, 1570, 5, 73, 0, 0, 1569, 1568, 1, 0, 0, 0, 1569, 1570, 1, 0, 0, 0, 1570, 1571, 1, 0, 0, 0, 1571, 1572, 5, 25, 0, 0, 1572, 1573, 5, 39, 0, 0, 1573, 1661, 3, 154, 77, 20, 1574, 1575, 10, 18, 0, 0, 1575, 1576, 5, 173, 0, 0, 1576, 1661, 3, 154, 77, 19, 1577, 1578, 10, 16, 0, 0, 1578, 1579, 5, 2, 0, 0, 1579, 1661, 3, 154, 77, 17, 1580, 1581, 10, 15, 0, 0, 1581, 1582, 5, 78, 0, 0, 1582, 1661, 3, 154, 77, 16, 1583, 1585, 10, 14, 0, 0, 1584, 1586, 5, 73, 0, 0, 1585, 1584, 1, 0, 0, 0, 1585, 1586, 1, 0, 0, 0, 1586, 1587, 1, 0, 0, 0, 1587, 1588, 5, 9, 0, 0, 1588, 1589, 3, 154, 77, 0, 1589, 1590, 5, 2, 0, 0, 1590, 1591, 3, 154, 77, 15, 1591, 1661, 1, 0, 0, 0, 1592, 1593, 10, 13, 0, 0, 1593, 1594, 5, 176, 0, 0, 1594, 1595, 3, 154, 77, 0, 1595, 1596, 5, 150, 0, 0, 1596, 1597, 3, 154, 77, 13, 1597, 1661, 1, 0, 0, 0, 1598, 1599, 10, 38, 0, 0, 1599, 1600, 5, 165, 0, 0, 1600, 1601, 3, 48, 24, 0, 1601, 1602, 5, 185, 0, 0, 1602, 1661, 1, 0, 0, 0, 1603, 1604, 10, 37, 0, 0, 1604, 1606, 5, 165, 0, 0, 1605, 1607, 3, 146, 73, 0, 1606, 1605, 1, 0, 0, 0, 1606, 1607, 1, 0, 0, 0, 1607, 1608, 1, 0, 0, 0, 1608, 1661, 5, 185, 0, 0, 1609, 1610, 10, 33, 0, 0, 1610, 1611, 5, 164, 0, 0, 1611, 1612, 3, 154, 77, 0, 1612, 1613, 5, 184, 0, 0, 1613, 1661, 1, 0, 0, 0, 1614, 1615, 10, 32, 0, 0, 1615, 1617, 5, 164, 0, 0, 1616, 1618, 3, 154, 77, 0, 1617, 1616, 1, 0, 0, 0, 1617, 1618, 1, 0, 0, 0, 1618, 1619, 1, 0, 0, 0, 1619, 1621, 5, 150, 0, 0, 1620, 1622, 3, 154, 77, 0, 1621, 1620, 1, 0, 0, 0, 1621, 1622, 1, 0, 0, 0, 1622, 1623, 1, 0, 0, 0, 1623, 1661, 5, 184, 0, 0, 1624, 1625, 10, 31, 0, 0, 1625, 1626, 5, 155, 0, 0, 1626, 1661, 5, 139, 0, 0, 1627, 1628, 10, 30, 0, 0, 1628, 1629, 5, 155, 0, 0, 1629, 1661, 3, 220, 110, 0, 1630, 1631, 10, 29, 0, 0, 1631, 1632, 5, 172, 0, 0, 1632, 1633, 5, 164, 0, 0, 1633, 1634, 3, 154, 77, 0, 1634, 1635, 5, 184, 0, 0, 1635, 1661, 1, 0, 0, 0, 1636, 1637, 10, 28, 0, 0, 1637, 1638, 5, 172, 0, 0, 1638, 1661, 5, 139, 0, 0, 1639, 1640, 10, 27, 0, 0, 1640, 1641, 5, 172, 0, 0, 1641, 1661, 3, 220, 110, 0, 1642, 1643, 10, 26, 0, 0, 1643, 1644, 5, 148, 0, 0, 1644, 1661, 3, 140, 70, 0, 1645, 1646, 10, 21, 0, 0, 1646, 1647, 5, 49, 0, 0, 1647, 1661, 5, 75, 0, 0, 1648, 1649, 10, 20, 0, 0, 1649, 1651, 5, 57, 0, 0, 1650, 1652, 5, 73, 0, 0, 1651, 1650, 1, 0, 0, 0, 1651, 1652, 1, 0, 0, 0, 1652, 1653, 1, 0, 0, 0, 1653, 1661, 5, 74, 0, 0, 1654, 1655, 10, 12, 0, 0, 1655, 1658, 5, 6, 0, 0, 1656, 1659, 3, 220, 110, 0, 1657, 1659, 5, 143, 0, 0, 1658, 1656, 1, 0, 0, 0, 1658, 1657, 1, 0, 0, 0, 1659, 1661, 1, 0, 0, 0, 1660, 1524, 1, 0, 0, 0, 1660, 1531, 1, 0, 0, 0, 1660, 1538, 1, 0, 0, 0, 1660, 1566, 1, 0, 0, 0, 1660, 1574, 1, 0, 0, 0, 1660, 1577, 1, 0, 0, 0, 1660, 1580, 1, 0, 0, 0, 1660, 1583, 1, 0, 0, 0, 1660, 1592, 1, 0, 0, 0, 1660, 1598, 1, 0, 0, 0, 1660, 1603, 1, 0, 0, 0, 1660, 1609, 1, 0, 0, 0, 1660, 1614, 1, 0, 0, 0, 1660, 1624, 1, 0, 0, 0, 1660, 1627, 1, 0, 0, 0, 1660, 1630, 1, 0, 0, 0, 1660, 1636, 1, 0, 0, 0, 1660, 1639, 1, 0, 0, 0, 1660, 1642, 1, 0, 0, 0, 1660, 1645, 1, 0, 0, 0, 1660, 1648, 1, 0, 0, 0, 1660, 1654, 1, 0, 0, 0, 1661, 1664, 1, 0, 0, 0, 1662, 1660, 1, 0, 0, 0, 1662, 1663, 1, 0, 0, 0, 1663, 155, 1, 0, 0, 0, 1664, 1662, 1, 0, 0, 0, 1665, 1666, 5, 165, 0, 0, 1666, 1671, 3, 220, 110, 0, 1667, 1668, 5, 151, 0, 0, 1668, 1670, 3, 220, 110, 0, 1669, 1667, 1, 0, 0, 0, 1670, 1673, 1, 0, 0, 0, 1671, 1669, 1, 0, 0, 0, 1671, 1672, 1, 0, 0, 0, 1672, 1675, 1, 0, 0, 0, 1673, 1671, 1, 0, 0, 0, 1674, 1676, 5, 151, 0, 0, 1675, 1674, 1, 0, 0, 0, 1675, 1676, 1, 0, 0, 0, 1676, 1677, 1, 0, 0, 0, 1677, 1678, 5, 185, 0, 0, 1678, 1693, 1, 0, 0, 0, 1679, 1684, 3, 220, 110, 0, 1680, 1681, 5, 151, 0, 0, 1681, 1683, 3, 220, 110, 0, 1682, 1680, 1, 0, 0, 0, 1683, 1686, 1, 0, 0, 0, 1684, 1682, 1, 0, 0, 0, 1684, 1685, 1, 0, 0, 0, 1685, 1688, 1, 0, 0, 0, 1686, 1684, 1, 0, 0, 0, 1687, 1689, 5, 151, 0, 0, 1688, 1687, 1, 0, 0, 0, 1688, 1689, 1, 0, 0, 0, 1689, 1693, 1, 0, 0, 0, 1690, 1691, 5, 165, 0, 0, 1691, 1693, 5, 185, 0, 0, 1692, 1665, 1, 0, 0, 0, 1692, 1679, 1, 0, 0, 0, 1692, 1690, 1, 0, 0, 0, 1693, 1694, 1, 0, 0, 0, 1694, 1697, 5, 144, 0, 0, 1695, 1698, 3, 154, 77, 0, 1696, 1698, 3, 36, 18, 0, 1697, 1695, 1, 0, 0, 0, 1697, 1696, 1, 0, 0, 0, 1698, 1715, 1, 0, 0, 0, 1699, 1700, 5, 60, 0, 0, 1700, 1705, 3, 220, 110, 0, 1701, 1702, 5, 151, 0, 0, 1702, 1704, 3, 220, 110, 0, 1703, 1701, 1, 0, 0, 0, 1704, 1707, 1, 0, 0, 0, 1705, 1703, 1, 0, 0, 0, 1705, 1706, 1, 0, 0, 0, 1706, 1709, 1, 0, 0, 0, 1707, 1705, 1, 0, 0, 0, 1708, 1710, 5, 151, 0, 0, 1709, 1708, 1, 0, 0, 0, 1709, 1710, 1, 0, 0, 0, 1710, 1711, 1, 0, 0, 0, 1711, 1712, 5, 150, 0, 0, 1712, 1713, 3, 154, 77, 0, 1713, 1715, 1, 0, 0, 0, 1714, 1692, 1, 0, 0, 0, 1714, 1699, 1, 0, 0, 0, 1715, 157, 1, 0, 0, 0, 1716, 1721, 3, 160, 80, 0, 1717, 1718, 5, 151, 0, 0, 1718, 1720, 3, 160, 80, 0, 1719, 1717, 1, 0, 0, 0, 1720, 1723, 1, 0, 0, 0, 1721, 1719, 1, 0, 0, 0, 1721, 1722, 1, 0, 0, 0, 1722, 159, 1, 0, 0, 0, 1723, 1721, 1, 0, 0, 0, 1724, 1725, 3, 154, 77, 0, 1725, 1726, 5, 6, 0, 0, 1726, 1727, 3, 220, 110, 0, 1727, 161, 1, 0, 0, 0, 1728, 1735, 3, 166, 83, 0, 1729, 1735, 3, 164, 82, 0, 1730, 1731, 5, 163, 0, 0, 1731, 1732, 3, 154, 77, 0, 1732, 1733, 5, 183, 0, 0, 1733, 1735, 1, 0, 0, 0, 1734, 1728, 1, 0, 0, 0, 1734, 1729, 1, 0, 0, 0, 1734, 1730, 1, 0, 0, 0, 1735, 163, 1, 0, 0, 0, 1736, 1737, 5, 204, 0, 0, 1737, 165, 1, 0, 0, 0, 1738, 1739, 5, 167, 0, 0, 1739, 1743, 3, 220, 110, 0, 1740, 1742, 3, 168, 84, 0, 1741, 1740, 1, 0, 0, 0, 1742, 1745, 1, 0, 0, 0, 1743, 1741, 1, 0, 0, 0, 1743, 1744, 1, 0, 0, 0, 1744, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1747, 5, 188, 0, 0, 1747, 1768, 1, 0, 0, 0, 1748, 1749, 5, 167, 0, 0, 1749, 1753, 3, 220, 110, 0, 1750, 1752, 3, 168, 84, 0, 1751, 1750, 1, 0, 0, 0, 1752, 1755, 1, 0, 0, 0, 1753, 1751, 1, 0, 0, 0, 1753, 1754, 1, 0, 0, 0, 1754, 1756, 1, 0, 0, 0, 1755, 1753, 1, 0, 0, 0, 1756, 1760, 5, 159, 0, 0, 1757, 1759, 3, 162, 81, 0, 1758, 1757, 1, 0, 0, 0, 1759, 1762, 1, 0, 0, 0, 1760, 1758, 1, 0, 0, 0, 1760, 1761, 1, 0, 0, 0, 1761, 1763, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, 0, 1763, 1764, 5, 168, 0, 0, 1764, 1765, 3, 220, 110, 0, 1765, 1766, 5, 159, 0, 0, 1766, 1768, 1, 0, 0, 0, 1767, 1738, 1, 0, 0, 0, 1767, 1748, 1, 0, 0, 0, 1768, 167, 1, 0, 0, 0, 1769, 1770, 3, 220, 110, 0, 1770, 1771, 5, 157, 0, 0, 1771, 1772, 3, 226, 113, 0, 1772, 1781, 1, 0, 0, 0, 1773, 1774, 3, 220, 110, 0, 1774, 1775, 5, 157, 0, 0, 1775, 1776, 5, 163, 0, 0, 1776, 1777, 3, 154, 77, 0, 1777, 1778, 5, 183, 0, 0, 1778, 1781, 1, 0, 0, 0, 1779, 1781, 3, 220, 110, 0, 1780, 1769, 1, 0, 0, 0, 1780, 1773, 1, 0, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 169, 1, 0, 0, 0, 1782, 1787, 3, 172, 86, 0, 1783, 1784, 5, 151, 0, 0, 1784, 1786, 3, 172, 86, 0, 1785, 1783, 1, 0, 0, 0, 1786, 1789, 1, 0, 0, 0, 1787, 1785, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1791, 1, 0, 0, 0, 1789, 1787, 1, 0, 0, 0, 1790, 1792, 5, 151, 0, 0, 1791, 1790, 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 171, 1, 0, 0, 0, 1793, 1795, 3, 220, 110, 0, 1794, 1796, 3, 174, 87, 0, 1795, 1794, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1800, 1, 0, 0, 0, 1797, 1798, 5, 123, 0, 0, 1798, 1799, 5, 59, 0, 0, 1799, 1801, 3, 174, 87, 0, 1800, 1797, 1, 0, 0, 0, 1800, 1801, 1, 0, 0, 0, 1801, 1802, 1, 0, 0, 0, 1802, 1807, 5, 6, 0, 0, 1803, 1805, 5, 73, 0, 0, 1804, 1803, 1, 0, 0, 0, 1804, 1805, 1, 0, 0, 0, 1805, 1806, 1, 0, 0, 0, 1806, 1808, 5, 67, 0, 0, 1807, 1804, 1, 0, 0, 0, 1807, 1808, 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1810, 5, 165, 0, 0, 1810, 1811, 3, 48, 24, 0, 1811, 1812, 5, 185, 0, 0, 1812, 1818, 1, 0, 0, 0, 1813, 1814, 3, 154, 77, 0, 1814, 1815, 5, 6, 0, 0, 1815, 1816, 3, 220, 110, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1793, 1, 0, 0, 0, 1817, 1813, 1, 0, 0, 0, 1818, 173, 1, 0, 0, 0, 1819, 1820, 5, 165, 0, 0, 1820, 1825, 3, 220, 110, 0, 1821, 1822, 5, 151, 0, 0, 1822, 1824, 3, 220, 110, 0, 1823, 1821, 1, 0, 0, 0, 1824, 1827, 1, 0, 0, 0, 1825, 1823, 1, 0, 0, 0, 1825, 1826, 1, 0, 0, 0, 1826, 1828, 1, 0, 0, 0, 1827, 1825, 1, 0, 0, 0, 1828, 1829, 5, 185, 0, 0, 1829, 175, 1, 0, 0, 0, 1830, 1838, 3, 224, 112, 0, 1831, 1832, 3, 196, 98, 0, 1832, 1833, 5, 155, 0, 0, 1833, 1835, 1, 0, 0, 0, 1834, 1831, 1, 0, 0, 0, 1834, 1835, 1, 0, 0, 0, 1835, 1836, 1, 0, 0, 0, 1836, 1838, 3, 178, 89, 0, 1837, 1830, 1, 0, 0, 0, 1837, 1834, 1, 0, 0, 0, 1838, 177, 1, 0, 0, 0, 1839, 1844, 3, 220, 110, 0, 1840, 1841, 5, 155, 0, 0, 1841, 1843, 3, 220, 110, 0, 1842, 1840, 1, 0, 0, 0, 1843, 1846, 1, 0, 0, 0, 1844, 1842, 1, 0, 0, 0, 1844, 1845, 1, 0, 0, 0, 1845, 179, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, 0, 1847, 1848, 6, 90, -1, 0, 1848, 1861, 3, 196, 98, 0, 1849, 1861, 3, 194, 97, 0, 1850, 1851, 5, 165, 0, 0, 1851, 1852, 3, 48, 24, 0, 1852, 1853, 5, 185, 0, 0, 1853, 1861, 1, 0, 0, 0, 1854, 1855, 5, 165, 0, 0, 1855, 1856, 3, 92, 46, 0, 1856, 1857, 5, 185, 0, 0, 1857, 1861, 1, 0, 0, 0, 1858, 1861, 3, 166, 83, 0, 1859, 1861, 3, 224, 112, 0, 1860, 1847, 1, 0, 0, 0, 1860, 1849, 1, 0, 0, 0, 1860, 1850, 1, 0, 0, 0, 1860, 1854, 1, 0, 0, 0, 1860, 1858, 1, 0, 0, 0, 1860, 1859, 1, 0, 0, 0, 1861, 1895, 1, 0, 0, 0, 1862, 1863, 10, 5, 0, 0, 1863, 1864, 5, 83, 0, 0, 1864, 1865, 5, 165, 0, 0, 1865, 1866, 3, 146, 73, 0, 1866, 1870, 3, 182, 91, 0, 1867, 1868, 5, 42, 0, 0, 1868, 1869, 5, 11, 0, 0, 1869, 1871, 3, 146, 73, 0, 1870, 1867, 1, 0, 0, 0, 1870, 1871, 1, 0, 0, 0, 1871, 1872, 1, 0, 0, 0, 1872, 1873, 5, 185, 0, 0, 1873, 1894, 1, 0, 0, 0, 1874, 1875, 10, 4, 0, 0, 1875, 1878, 5, 122, 0, 0, 1876, 1877, 5, 50, 0, 0, 1877, 1879, 5, 75, 0, 0, 1878, 1876, 1, 0, 0, 0, 1878, 1879, 1, 0, 0, 0, 1879, 1880, 1, 0, 0, 0, 1880, 1881, 5, 165, 0, 0, 1881, 1882, 3, 186, 93, 0, 1882, 1883, 5, 185, 0, 0, 1883, 1894, 1, 0, 0, 0, 1884, 1888, 10, 3, 0, 0, 1885, 1889, 3, 216, 108, 0, 1886, 1887, 5, 6, 0, 0, 1887, 1889, 3, 220, 110, 0, 1888, 1885, 1, 0, 0, 0, 1888, 1886, 1, 0, 0, 0, 1889, 1891, 1, 0, 0, 0, 1890, 1892, 3, 192, 96, 0, 1891, 1890, 1, 0, 0, 0, 1891, 1892, 1, 0, 0, 0, 1892, 1894, 1, 0, 0, 0, 1893, 1862, 1, 0, 0, 0, 1893, 1874, 1, 0, 0, 0, 1893, 1884, 1, 0, 0, 0, 1894, 1897, 1, 0, 0, 0, 1895, 1893, 1, 0, 0, 0, 1895, 1896, 1, 0, 0, 0, 1896, 181, 1, 0, 0, 0, 1897, 1895, 1, 0, 0, 0, 1898, 1900, 5, 38, 0, 0, 1899, 1901, 3, 184, 92, 0, 1900, 1899, 1, 0, 0, 0, 1901, 1902, 1, 0, 0, 0, 1902, 1900, 1, 0, 0, 0, 1902, 1903, 1, 0, 0, 0, 1903, 183, 1, 0, 0, 0, 1904, 1905, 3, 190, 95, 0, 1905, 1906, 5, 51, 0, 0, 1906, 1907, 5, 165, 0, 0, 1907, 1908, 3, 146, 73, 0, 1908, 1909, 5, 185, 0, 0, 1909, 185, 1, 0, 0, 0, 1910, 1915, 3, 188, 94, 0, 1911, 1912, 5, 151, 0, 0, 1912, 1914, 3, 188, 94, 0, 1913, 1911, 1, 0, 0, 0, 1914, 1917, 1, 0, 0, 0, 1915, 1913, 1, 0, 0, 0, 1915, 1916, 1, 0, 0, 0, 1916, 1919, 1, 0, 0, 0, 1917, 1915, 1, 0, 0, 0, 1918, 1920, 5, 151, 0, 0, 1919, 1918, 1, 0, 0, 0, 1919, 1920, 1, 0, 0, 0, 1920, 187, 1, 0, 0, 0, 1921, 1922, 3, 190, 95, 0, 1922, 1923, 5, 38, 0, 0, 1923, 1924, 3, 190, 95, 0, 1924, 1925, 5, 51, 0, 0, 1925, 1926, 5, 165, 0, 0, 1926, 1927, 3, 146, 73, 0, 1927, 1936, 5, 185, 0, 0, 1928, 1929, 3, 190, 95, 0, 1929, 1930, 5, 51, 0, 0, 1930, 1931, 5, 165, 0, 0, 1931, 1932, 3, 146, 73, 0, 1932, 1933, 5, 185, 0, 0, 1933, 1935, 1, 0, 0, 0, 1934, 1928, 1, 0, 0, 0, 1935, 1938, 1, 0, 0, 0, 1936, 1934, 1, 0, 0, 0, 1936, 1937, 1, 0, 0, 0, 1937, 189, 1, 0, 0, 0, 1938, 1936, 1, 0, 0, 0, 1939, 1940, 5, 165, 0, 0, 1940, 1941, 3, 146, 73, 0, 1941, 1942, 5, 185, 0, 0, 1942, 1945, 1, 0, 0, 0, 1943, 1945, 3, 154, 77, 0, 1944, 1939, 1, 0, 0, 0, 1944, 1943, 1, 0, 0, 0, 1945, 191, 1, 0, 0, 0, 1946, 1947, 5, 165, 0, 0, 1947, 1952, 3, 220, 110, 0, 1948, 1949, 5, 151, 0, 0, 1949, 1951, 3, 220, 110, 0, 1950, 1948, 1, 0, 0, 0, 1951, 1954, 1, 0, 0, 0, 1952, 1950, 1, 0, 0, 0, 1952, 1953, 1, 0, 0, 0, 1953, 1955, 1, 0, 0, 0, 1954, 1952, 1, 0, 0, 0, 1955, 1956, 5, 185, 0, 0, 1956, 193, 1, 0, 0, 0, 1957, 1958, 3, 220, 110, 0, 1958, 1960, 5, 165, 0, 0, 1959, 1961, 3, 198, 99, 0, 1960, 1959, 1, 0, 0, 0, 1960, 1961, 1, 0, 0, 0, 1961, 1962, 1, 0, 0, 0, 1962, 1963, 5, 185, 0, 0, 1963, 195, 1, 0, 0, 0, 1964, 1965, 3, 200, 100, 0, 1965, 1966, 5, 155, 0, 0, 1966, 1968, 1, 0, 0, 0, 1967, 1964, 1, 0, 0, 0, 1967, 1968, 1, 0, 0, 0, 1968, 1969, 1, 0, 0, 0, 1969, 1970, 3, 178, 89, 0, 1970, 197, 1, 0, 0, 0, 1971, 1976, 3, 154, 77, 0, 1972, 1973, 5, 151, 0, 0, 1973, 1975, 3, 154, 77, 0, 1974, 1972, 1, 0, 0, 0, 1975, 1978, 1, 0, 0, 0, 1976, 1974, 1, 0, 0, 0, 1976, 1977, 1, 0, 0, 0, 1977, 1980, 1, 0, 0, 0, 1978, 1976, 1, 0, 0, 0, 1979, 1981, 5, 151, 0, 0, 1980, 1979, 1, 0, 0, 0, 1980, 1981, 1, 0, 0, 0, 1981, 199, 1, 0, 0, 0, 1982, 1983, 3, 220, 110, 0, 1983, 201, 1, 0, 0, 0, 1984, 1993, 5, 136, 0, 0, 1985, 1986, 5, 155, 0, 0, 1986, 1993, 7, 14, 0, 0, 1987, 1988, 5, 139, 0, 0, 1988, 1990, 5, 155, 0, 0, 1989, 1991, 7, 14, 0, 0, 1990, 1989, 1, 0, 0, 0, 1990, 1991, 1, 0, 0, 0, 1991, 1993, 1, 0, 0, 0, 1992, 1984, 1, 0, 0, 0, 1992, 1985, 1, 0, 0, 0, 1992, 1987, 1, 0, 0, 0, 1993, 203, 1, 0, 0, 0, 1994, 1996, 7, 15, 0, 0, 1995, 1994, 1, 0, 0, 0, 1995, 1996, 1, 0, 0, 0, 1996, 2005, 1, 0, 0, 0, 1997, 2006, 3, 202, 101, 0, 1998, 2006, 5, 137, 0, 0, 1999, 2006, 5, 138, 0, 0, 2000, 2006, 5, 141, 0, 0, 2001, 2006, 5, 139, 0, 0, 2002, 2006, 5, 140, 0, 0, 2003, 2006, 5, 52, 0, 0, 2004, 2006, 5, 72, 0, 0, 2005, 1997, 1, 0, 0, 0, 2005, 1998, 1, 0, 0, 0, 2005, 1999, 1, 0, 0, 0, 2005, 2000, 1, 0, 0, 0, 2005, 2001, 1, 0, 0, 0, 2005, 2002, 1, 0, 0, 0, 2005, 2003, 1, 0, 0, 0, 2005, 2004, 1, 0, 0, 0, 2006, 205, 1, 0, 0, 0, 2007, 2011, 3, 204, 102, 0, 2008, 2011, 5, 143, 0, 0, 2009, 2011, 5, 74, 0, 0, 2010, 2007, 1, 0, 0, 0, 2010, 2008, 1, 0, 0, 0, 2010, 2009, 1, 0, 0, 0, 2011, 207, 1, 0, 0, 0, 2012, 2013, 7, 16, 0, 0, 2013, 209, 1, 0, 0, 0, 2014, 2015, 7, 17, 0, 0, 2015, 211, 1, 0, 0, 0, 2016, 2017, 7, 18, 0, 0, 2017, 213, 1, 0, 0, 0, 2018, 2019, 7, 19, 0, 0, 2019, 215, 1, 0, 0, 0, 2020, 2024, 5, 134, 0, 0, 2021, 2024, 5, 135, 0, 0, 2022, 2024, 3, 212, 106, 0, 2023, 2020, 1, 0, 0, 0, 2023, 2021, 1, 0, 0, 0, 2023, 2022, 1, 0, 0, 0, 2024, 217, 1, 0, 0, 0, 2025, 2029, 5, 134, 0, 0, 2026, 2029, 5, 135, 0, 0, 2027, 2029, 3, 214, 107, 0, 2028, 2025, 1, 0, 0, 0, 2028, 2026, 1, 0, 0, 0, 2028, 2027, 1, 0, 0, 0, 2029, 219, 1, 0, 0, 0, 2030, 2035, 5, 134, 0, 0, 2031, 2035, 5, 135, 0, 0, 2032, 2035, 3, 208, 104, 0, 2033, 2035, 3, 210, 105, 0, 2034, 2030, 1, 0, 0, 0, 2034, 2031, 1, 0, 0, 0, 2034, 2032, 1, 0, 0, 0, 2034, 2033, 1, 0, 0, 0, 2035, 221, 1, 0, 0, 0, 2036, 2037, 3, 226, 113, 0, 2037, 2038, 5, 157, 0, 0, 2038, 2039, 3, 204, 102, 0, 2039, 223, 1, 0, 0, 0, 2040, 2041, 5, 163, 0, 0, 2041, 2042, 3, 154, 77, 0, 2042, 2043, 5, 183, 0, 0, 2043, 225, 1, 0, 0, 0, 2044, 2047, 5, 143, 0, 0, 2045, 2047, 3, 228, 114, 0, 2046, 2044, 1, 0, 0, 0, 2046, 2045, 1, 0, 0, 0, 2047, 227, 1, 0, 0, 0, 2048, 2052, 5, 178, 0, 0, 2049, 2051, 3, 230, 115, 0, 2050, 2049, 1, 0, 0, 0, 2051, 2054, 1, 0, 0, 0, 2052, 2050, 1, 0, 0, 0, 2052, 2053, 1, 0, 0, 0, 2053, 2055, 1, 0, 0, 0, 2054, 2052, 1, 0, 0, 0, 2055, 2056, 5, 180, 0, 0, 2056, 229, 1, 0, 0, 0, 2057, 2058, 5, 195, 0, 0, 2058, 2059, 3, 154, 77, 0, 2059, 2060, 5, 183, 0, 0, 2060, 2063, 1, 0, 0, 0, 2061, 2063, 5, 194, 0, 0, 2062, 2057, 1, 0, 0, 0, 2062, 2061, 1, 0, 0, 0, 2063, 231, 1, 0, 0, 0, 2064, 2068, 5, 179, 0, 0, 2065, 2067, 3, 234, 117, 0, 2066, 2065, 1, 0, 0, 0, 2067, 2070, 1, 0, 0, 0, 2068, 2066, 1, 0, 0, 0, 2068, 2069, 1, 0, 0, 0, 2069, 2071, 1, 0, 0, 0, 2070, 2068, 1, 0, 0, 0, 2071, 2072, 5, 0, 0, 1, 2072, 233, 1, 0, 0, 0, 2073, 2074, 5, 197, 0, 0, 2074, 2075, 3, 154, 77, 0, 2075, 2076, 5, 183, 0, 0, 2076, 2079, 1, 0, 0, 0, 2077, 2079, 5, 196, 0, 0, 2078, 2073, 1, 0, 0, 0, 2078, 2077, 1, 0, 0, 0, 2079, 235, 1, 0, 0, 0, 259, 239, 246, 254, 261, 265, 278, 282, 285, 290, 297, 301, 310, 315, 324, 332, 339, 343, 349, 354, 362, 369, 375, 387, 390, 398, 412, 416, 421, 424, 439, 445, 450, 456, 462, 467, 473, 479, 484, 486, 494, 498, 501, 506, 510, 514, 519, 523, 530, 533, 537, 540, 544, 547, 550, 553, 556, 559, 562, 566, 570, 573, 576, 580, 583, 586, 589, 593, 596, 600, 608, 614, 635, 659, 666, 671, 685, 694, 699, 713, 717, 721, 726, 730, 735, 749, 758, 766, 769, 775, 783, 786, 791, 798, 808, 816, 822, 824, 828, 833, 840, 843, 847, 851, 854, 860, 862, 865, 869, 873, 876, 878, 880, 885, 896, 901, 905, 911, 916, 923, 928, 932, 936, 939, 945, 949, 953, 958, 964, 966, 973, 981, 984, 987, 1012, 1026, 1042, 1046, 1057, 1061, 1072, 1076, 1083, 1091, 1094, 1099, 1104, 1110, 1116, 1122, 1131, 1135, 1142, 1148, 1155, 1159, 1171, 1176, 1185, 1189, 1222, 1270, 1298, 1362, 1370, 1376, 1379, 1382, 1390, 1400, 1406, 1409, 1412, 1420, 1428, 1431, 1435, 1438, 1443, 1452, 1464, 1472, 1480, 1484, 1502, 1506, 1511, 1522, 1528, 1535, 1547, 1551, 1554, 1563, 1569, 1585, 1606, 1617, 1621, 1651, 1658, 1660, 1662, 1671, 1675, 1684, 1688, 1692, 1697, 1705, 1709, 1714, 1721, 1734, 1743, 1753, 1760, 1767, 1780, 1787, 1791, 1795, 1800, 1804, 1807, 1817, 1825, 1834, 1837, 1844, 1860, 1870, 1878, 1888, 1891, 1893, 1895, 1902, 1915, 1919, 1936, 1944, 1952, 1960, 1967, 1976, 1980, 1990, 1992, 1995, 2005, 2010, 2023, 2028, 2034, 2046, 2052, 2062, 2068, 2078]
\ No newline at end of file
diff --git a/posthog/hogql/grammar/HogQLParser.py b/posthog/hogql/grammar/HogQLParser.py
index 872d4f09e6cd..966959805062 100644
--- a/posthog/hogql/grammar/HogQLParser.py
+++ b/posthog/hogql/grammar/HogQLParser.py
@@ -548,8 +548,8 @@ def serializedATN():
0,1200,1201,5,119,0,0,1201,1202,5,165,0,0,1202,1203,3,154,77,0,1203,
1204,5,6,0,0,1204,1205,3,138,69,0,1205,1206,5,185,0,0,1206,1523,
1,0,0,0,1207,1208,5,21,0,0,1208,1523,5,143,0,0,1209,1210,5,56,0,
- 0,1210,1523,5,143,0,0,1211,1212,5,56,0,0,1212,1213,3,154,77,0,1213,
- 1214,3,208,104,0,1214,1523,1,0,0,0,1215,1216,5,104,0,0,1216,1217,
+ 0,1210,1211,3,154,77,0,1211,1212,3,208,104,0,1212,1523,1,0,0,0,1213,
+ 1214,5,56,0,0,1214,1523,5,143,0,0,1215,1216,5,104,0,0,1216,1217,
5,165,0,0,1217,1218,3,154,77,0,1218,1219,5,39,0,0,1219,1222,3,154,
77,0,1220,1221,5,38,0,0,1221,1223,3,154,77,0,1222,1220,1,0,0,0,1222,
1223,1,0,0,0,1223,1224,1,0,0,0,1224,1225,5,185,0,0,1225,1523,1,0,
@@ -649,7 +649,7 @@ def serializedATN():
1523,3,156,78,0,1515,1516,3,220,110,0,1516,1517,5,149,0,0,1517,1518,
3,154,77,3,1518,1523,1,0,0,0,1519,1520,5,160,0,0,1520,1523,5,139,
0,0,1521,1523,3,176,88,0,1522,1173,1,0,0,0,1522,1193,1,0,0,0,1522,
- 1200,1,0,0,0,1522,1207,1,0,0,0,1522,1209,1,0,0,0,1522,1211,1,0,0,
+ 1200,1,0,0,0,1522,1207,1,0,0,0,1522,1209,1,0,0,0,1522,1213,1,0,0,
0,1522,1215,1,0,0,0,1522,1226,1,0,0,0,1522,1228,1,0,0,0,1522,1236,
1,0,0,0,1522,1240,1,0,0,0,1522,1270,1,0,0,0,1522,1272,1,0,0,0,1522,
1298,1,0,0,0,1522,1300,1,0,0,0,1522,1304,1,0,0,0,1522,1319,1,0,0,
@@ -10097,25 +10097,25 @@ class HogQLParser ( Parser ):
pass
elif la_ == 5:
- localctx = HogQLParser.ColumnExprIntervalStringContext(self, localctx)
+ localctx = HogQLParser.ColumnExprIntervalContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 1209
self.match(HogQLParser.INTERVAL)
self.state = 1210
- self.match(HogQLParser.STRING_LITERAL)
+ self.columnExpr(0)
+ self.state = 1211
+ self.interval()
pass
elif la_ == 6:
- localctx = HogQLParser.ColumnExprIntervalContext(self, localctx)
+ localctx = HogQLParser.ColumnExprIntervalStringContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
- self.state = 1211
- self.match(HogQLParser.INTERVAL)
- self.state = 1212
- self.columnExpr(0)
self.state = 1213
- self.interval()
+ self.match(HogQLParser.INTERVAL)
+ self.state = 1214
+ self.match(HogQLParser.STRING_LITERAL)
pass
elif la_ == 7:
diff --git a/posthog/hogql/scripts/_diagnostic_common.py b/posthog/hogql/scripts/_diagnostic_common.py
index ce1277f7c8d8..fd9eeb1bdde3 100644
--- a/posthog/hogql/scripts/_diagnostic_common.py
+++ b/posthog/hogql/scripts/_diagnostic_common.py
@@ -37,10 +37,10 @@ import dataclasses
from collections import Counter
from collections.abc import Callable
from pathlib import Path
-from typing import Any
+from typing import Any, NoReturn
from posthog.hogql.errors import BaseHogQLError
-from posthog.hogql.parser import parse_expr, parse_program, parse_select
+from posthog.hogql.parser import HogQLParserShadowMismatch, parse_expr, parse_program, parse_select
from posthog.hogql.visitor import clear_locations
# Maps a diagnostic `--rule` value to its parser entry point. `program`
@@ -218,6 +218,27 @@ def _strip_locations() -> bool:
return os.environ.get("CLEAR_LOCATIONS", "").lower() in ("1", "true", "yes")
+def _abort_on_shadow_mismatch(backend: str, exc: HogQLParserShadowMismatch) -> NoReturn:
+ """Abort the whole diagnostic when a backend raises HogQLParserShadowMismatch.
+
+ A `*_shadow` parser mode means `backend` is not a single pure parser: it ran the
+ primary plus a shadow comparison and the two disagreed. An oracle/candidate that
+ silently shadow-compares cannot be trusted because a genuine cpp-vs-rust ast_mismatch
+ surfaces here as a backend crash instead of being categorized. Fail loud so the
+ operator fixes the setup rather than recording masked results. Root cause is almost
+ always `TEST=1`: parser.py routes the default 'cpp-json' backend to CPP_WITH_RUST_SHADOW
+ whenever settings.TEST is truthy."""
+ raise SystemExit(
+ f"\nFATAL: backend {backend!r} raised HogQLParserShadowMismatch during the grind.\n"
+ f"It is running a built-in shadow comparison, not a single pure parser, so the "
+ f"diagnostic cannot trust it: real cpp-vs-rust AST divergences get masked as a crash "
+ f"rather than surfacing as ast_mismatch.\n"
+ f"Fix: re-run WITHOUT TEST=1. parser.py routes the default 'cpp-json' backend to "
+ f"CPP_WITH_RUST_SHADOW when settings.TEST is set; with TEST unset the oracle is pure.\n"
+ f"Shadow detail: {exc}"
+ )
+
+
def _safe_parse(query: str, rule: str, backend: str) -> tuple[str, Any, str | None]:
"""Parse `query` for a diagnostic that must not abort mid-grind.
Returns `(status, ast_or_none, detail)`:
@@ -238,6 +259,8 @@ def _safe_parse(query: str, rule: str, backend: str) -> tuple[str, Any, str | No
parser_fn = _PARSER_FOR_RULE[rule]
try:
node = parser_fn(query, backend=backend)
+ except HogQLParserShadowMismatch as e:
+ _abort_on_shadow_mismatch(backend, e)
except BaseHogQLError as e:
return "reject", None, _normalize_error(str(e))
except Exception as e:
@@ -275,14 +298,22 @@ def _shape_for(
candidate_backend: str,
) -> DivergenceShape | None:
"""Determine the divergence shape of `query`, or None if there's no
- divergence to track. Returns None when the oracle doesn't cleanly
- accept (reject or crash — nothing to compare against) and when the
- candidate crashes (a crash isn't a stable `DivergenceShape`, so the
- shrinker simply won't reduce toward one)."""
+ divergence to track. Returns None when the oracle crashes (nothing
+ to compare against) and when the candidate crashes (a crash isn't a
+ stable `DivergenceShape`, so the shrinker won't reduce toward one).
+
+ Two-sided contract: when the oracle *rejects*, a candidate that
+ *accepts* is the divergence (the candidate took an invalid query) —
+ shape `candidate_accepts_oracle_reject`. Both rejecting is agreement,
+ so there's nothing to shrink toward."""
o_status, o_ast, _ = _safe_parse(query, rule, oracle_backend)
- if o_status != "ok":
+ if o_status == "crash":
return None
c_status, c_ast, c_detail = _safe_parse(query, rule, candidate_backend)
+ if o_status == "reject":
+ if c_status == "ok":
+ return DivergenceShape(kind="candidate_accepts_oracle_reject")
+ return None
if c_status == "reject":
return DivergenceShape(kind="candidate_reject", reject_signature=c_detail)
if c_status == "crash":
@@ -515,6 +546,8 @@ def corpus_try_parse(query: str, rule: str, backend: str) -> tuple[str, Any, str
try:
node = parser_fn(query, backend=backend)
return "ok", clear_locations(node) if _strip_locations() else node, None
+ except HogQLParserShadowMismatch as e:
+ _abort_on_shadow_mismatch(backend, e)
except BaseHogQLError as e:
return "reject", None, str(e)
except Exception:
diff --git a/posthog/hogql/scripts/build_grammar_strategies.py b/posthog/hogql/scripts/build_grammar_strategies.py
index 65c8fc9e2b7e..afea2650b456 100755
--- a/posthog/hogql/scripts/build_grammar_strategies.py
+++ b/posthog/hogql/scripts/build_grammar_strategies.py
@@ -614,52 +614,26 @@ EXCLUDED_RULES: frozenset[str] = frozenset(
# are intentionally NOT excluded — the grammar PBT drives Hog-program
# parity via the generated `program_strategy`.
-# Alternatives the cpp-json backend (ANTLR parser + Python visitor)
-# unconditionally rejects. The PBT contract is one-sided — we only
-# assert when cpp accepts — so generating these productions produces
-# zero test signal: every example gets discarded. We hard-exclude them
-# to keep the discard rate sane.
+# Alternatives the cpp-json oracle unconditionally rejects — error-message
+# productions (e.g. ``ColumnExprInvalidFromImplicitAlias``, which exists only
+# to raise on ``SELECT FROM x`` typos) and visitor-NotImplementedError
+# productions the AST builder doesn't support (``ColumnExprDate`` /
+# ``ColumnExprTimestamp`` / ``ColumnExprSubstring`` / ``ColumnTypeExprEnum`` /
+# ``ColumnExprIntervalString``).
#
-# Two sources of unconditional rejection are excluded here:
-#
-# 1. Error-message productions: the grammar declares an alternative
-# *intentionally* invalid so the parser can attach a nice error
-# (e.g. ``ColumnExprInvalidFromImplicitAlias`` catches
-# ``SELECT FROM x`` typos and exists only to raise).
-#
-# 2. Visitor-NotImplementedError productions: the Python ANTLR visitor
-# in ``posthog/hogql/parser.py`` raises ``NotImplementedError`` for
-# productions the grammar accepts but HogQL's Python AST builder
-# doesn't support. Until the visitor grows support, these are dead
-# productions from cpp-json's point of view.
-EXCLUDED_ALT_NAMES: frozenset[str] = frozenset(
- {
- # Error-message alts (always invalid by grammar author's intent)
- "ColumnExprInvalidFromImplicitAlias",
- # Visitor-NotImplementedError alts (Python-side product gap)
- "ColumnExprDate",
- "ColumnExprTimestamp",
- "ColumnExprSubstring",
- "ColumnTypeExprEnum",
- # ``INTERVAL 'literal'`` requires the string to be a well-formed
- # ``<count> <unit>`` — our random STRING_LITERAL strategy never
- # produces a valid one. The typed form ``INTERVAL <expr> <unit>``
- # (alt ``ColumnExprInterval``) covers the same surface generically
- # and gets exercised. Re-enable if we add a context-aware
- # STRING_LITERAL strategy that produces ``'1 day'`` shapes inside
- # INTERVAL.
- "ColumnExprIntervalString",
- }
-)
-
-# Whole rules the cpp-json visitor rejects unconditionally — same
-# rationale as ``EXCLUDED_ALT_NAMES`` but at rule granularity.
-EXCLUDED_BY_VISITOR_RULES: frozenset[str] = frozenset(
- {
- "topClause",
- "settingsClause",
- }
-)
+# These were hard-excluded while the diagnostic contract was one-sided (assert
+# only when cpp accepts), since an oracle-rejected production carried zero
+# signal. Under the two-sided contract they're the point: a query the oracle
+# rejects must be rejected by the candidate too, so generating them is exactly
+# how we catch the candidate accepting an invalid query. Empty by default;
+# the hook stays for any future production that genuinely shouldn't generate.
+EXCLUDED_ALT_NAMES: frozenset[str] = frozenset()
+
+# Whole rules the cpp-json oracle rejects unconditionally (``topClause`` /
+# ``settingsClause``). Same rationale as ``EXCLUDED_ALT_NAMES`` at rule
+# granularity — now generated so the two-sided contract checks the candidate
+# rejects them too.
+EXCLUDED_BY_VISITOR_RULES: frozenset[str] = frozenset()
# Soft-weighting hooks remain (empty by default) for future
# productions where we want rare-fire coverage without exclusion.
diff --git a/posthog/hogql/scripts/parser_bench.py b/posthog/hogql/scripts/parser_bench.py
index e7d169717c1e..f147c71ad50b 100644
--- a/posthog/hogql/scripts/parser_bench.py
+++ b/posthog/hogql/scripts/parser_bench.py
@@ -67,8 +67,8 @@ import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "posthog.settings")
django.setup()
-from posthog.hogql.parser import clear_parse_caches, parse_expr, parse_select
-from posthog.hogql.scripts._diagnostic_common import _probe_backend
+from posthog.hogql.parser import HogQLParserShadowMismatch, clear_parse_caches, parse_expr, parse_select
+from posthog.hogql.scripts._diagnostic_common import _abort_on_shadow_mismatch, _probe_backend
DEFAULT_N = 1_000 # iterations per batch; override with --n
DEFAULT_REPEAT = 5 # batches per query; override with --repeat
@@ -372,6 +372,8 @@ def bench(
try:
oracle_stat = run_query(parse_fn, q, oracle, nq, repeat)
row["oracle"] = oracle_stat.to_json()
+ except HogQLParserShadowMismatch as e:
+ _abort_on_shadow_mismatch(oracle, e)
except Exception as e:
row["error"] = f"oracle ({oracle}): {e}"
results[name] = row
@@ -380,6 +382,8 @@ def bench(
try:
cand_stat = run_query(parse_fn, q, candidate, nq, repeat)
row["candidate"] = cand_stat.to_json()
+ except HogQLParserShadowMismatch as e:
+ _abort_on_shadow_mismatch(candidate, e)
except Exception as e:
row["error"] = f"candidate ({candidate}): {e}"
results[name] = row
diff --git a/posthog/hogql/scripts/pbt_diagnostic.py b/posthog/hogql/scripts/pbt_diagnostic.py
index 56f0fc3ee5eb..09c6c5abf5dd 100644
--- a/posthog/hogql/scripts/pbt_diagnostic.py
+++ b/posthog/hogql/scripts/pbt_diagnostic.py
@@ -46,6 +46,16 @@ Typical usage:
# Persist for later analysis / corpus extraction
PYTHONPATH=. python posthog/hogql/scripts/pbt_diagnostic.py \\
--write-divergences /tmp/divergences.jsonl --shrink-failures
+
+ # While iterating on a parser version bump the pyproject pin references a
+ # not-yet-published wheel, so `flox activate` is blocked. Run via the
+ # worktree venv python directly, having rebuilt the parser .so locally
+ # first (rust: `uv pip install -e rust/hogql/parser`; cpp: rebuild
+ # `common/hogql_parser` and copy the built .so into `.flox/cache/venv`).
+ # `--write-divergences` streams each finding as it's found, so a long run
+ # that gets killed still leaves its divergences on disk:
+ PYTHONPATH=. .flox/cache/venv/bin/python posthog/hogql/scripts/pbt_diagnostic.py \\
+ --rule program --grammar-mutate --n 10000 --write-divergences /tmp/div.jsonl
"""
# ruff: noqa: T201 (this is a CLI script — print is the output channel)
@@ -81,7 +91,12 @@ from posthog.hogql.scripts._diagnostic_common import (
_shape_for,
)
from posthog.hogql.test._generated_grammar_strategies import expr_strategy, program_strategy, select_strategy
-from posthog.hogql.test.test_parser_grammar_pbt import _PBT_SETTINGS, _apply_jiggle
+from posthog.hogql.test.test_parser_grammar_pbt import (
+ _PBT_SETTINGS,
+ _apply_grammar_mutation,
+ _apply_jiggle,
+ _apply_mutation,
+)
# ---------------------------------------------------------------------------
# Auto-shrinker
@@ -193,6 +208,27 @@ def main() -> int:
parser.add_argument("--n", type=int, default=int(os.environ.get("N", "500")))
parser.add_argument("--rule", choices=("expr", "select", "program"), default="expr")
parser.add_argument("--jiggle", action="store_true")
+ parser.add_argument(
+ "--mutate",
+ action="store_true",
+ help=(
+ "Perturb each generated query into a near-miss invalid one "
+ "(delete/duplicate/swap/inject/unbalance/truncate tokens). Floods "
+ "the rejection path so the two-sided contract gets exercised — most "
+ "outputs are queries the oracle rejects, surfacing any the candidate accepts."
+ ),
+ )
+ parser.add_argument(
+ "--grammar-mutate",
+ action="store_true",
+ help=(
+ "Perturb each generated query into a structurally-plausible invalid one "
+ "using grammar knowledge (empty a bracketed list, dictify a `{x}` "
+ "placeholder, swap/duplicate a keyword, retype a literal, mismatch a "
+ "bracket). Aimed at over-acceptance: near-miss shapes a parser is more "
+ "likely to wrongly accept than the lexical junk `--mutate` mostly yields."
+ ),
+ )
parser.add_argument(
"--accepted-only",
action="store_true",
@@ -258,6 +294,10 @@ def main() -> int:
# different "minimal" repros for the same bug.
mismatch_buckets: dict[tuple[str, str], list[tuple[str, str | None, list]]] = {}
reject_buckets: dict[str, list[tuple[str, str | None]]] = {}
+ # Two-sided contract: the oracle rejected but the candidate accepted —
+ # the candidate took an invalid query. Bucketed by the candidate AST's
+ # root node type so the dominant over-acceptance shapes surface.
+ accept_reject_buckets: dict[str, list[tuple[str, str | None]]] = {}
# A candidate that raises a non-HogQL exception (RecursionError, a
# half-built backend's RuntimeError, …) is a finding in its own
# right — `_safe_parse` catches it so one crashing query can't
@@ -269,7 +309,15 @@ def main() -> int:
"select": select_strategy,
"program": program_strategy,
}[args.rule]()
- strategy = base_strategy.flatmap(_apply_jiggle) if args.jiggle else base_strategy
+ strategy = base_strategy
+ # Grammar-aware mutation runs first, on the clean space-separated query —
+ # the whitespace jiggle below would otherwise break its tokenisation.
+ if args.grammar_mutate:
+ strategy = strategy.flatmap(_apply_grammar_mutation)
+ if args.jiggle:
+ strategy = strategy.flatmap(_apply_jiggle)
+ if args.mutate:
+ strategy = strategy.flatmap(_apply_mutation)
# Stream JSONL during the run rather than collecting everything in
# memory. Opened in the try-block below so the strategy
@@ -299,14 +347,6 @@ def main() -> int:
counts["total"] += 1
o_status, o_ast, _ = _safe_parse(query, args.rule, oracle)
- if o_status == "reject":
- counts["oracle_reject"] += 1
- # `--accepted-only`: discard so this doesn't count toward
- # `max_examples` — Hypothesis regenerates until `--n`
- # oracle-accepted examples land.
- if args.accepted_only:
- assume(False)
- return
if o_status == "crash":
# The oracle (source of truth) crashing is its own kind of
# finding — count it, but with no oracle AST there's
@@ -315,6 +355,53 @@ def main() -> int:
if args.accepted_only:
assume(False)
return
+ if o_status == "reject":
+ # Two-sided contract: the oracle rejected, so the candidate
+ # must reject too. A candidate that *accepts* took an invalid
+ # query — the headline failure this contract exists to catch.
+ counts["oracle_reject"] += 1
+ rc_status, rc_ast, rc_detail = _safe_parse(query, args.rule, candidate)
+ if rc_status == "ok":
+ counts["candidate_accepts_oracle_reject"] += 1
+ bucket = _node_type(rc_ast)
+ shape = DivergenceShape(kind="candidate_accepts_oracle_reject")
+ shrunk = _shrink_query(query, args.rule, oracle, candidate, shape) if args.shrink_failures else None
+ accept_reject_buckets.setdefault(bucket, []).append((query, shrunk))
+ write_record(
+ {
+ "kind": "candidate_accepts_oracle_reject",
+ "rule": args.rule,
+ "oracle": oracle,
+ "candidate": candidate,
+ "query": query,
+ "candidate_root": bucket,
+ },
+ shrunk,
+ )
+ elif rc_status == "crash":
+ counts["candidate_crash"] += 1
+ sig = rc_detail or "<no message>"
+ crash_buckets.setdefault(sig, []).append(query)
+ write_record(
+ {
+ "kind": "candidate_crash",
+ "rule": args.rule,
+ "oracle": oracle,
+ "candidate": candidate,
+ "query": query,
+ "crash_signature": sig,
+ },
+ None,
+ )
+ else:
+ # Both rejected — the contract is satisfied.
+ counts["both_reject"] += 1
+ # `--accepted-only`: discard so this doesn't count toward
+ # `max_examples` — Hypothesis regenerates until `--n`
+ # oracle-accepted examples land.
+ if args.accepted_only:
+ assume(False)
+ return
c_status, c_ast, c_detail = _safe_parse(query, args.rule, candidate)
if c_status == "reject":
@@ -359,11 +446,11 @@ def main() -> int:
return
counts["ast_mismatch"] += 1
- bucket = (_node_type(o_ast), _node_type(c_ast))
+ mismatch_bucket = (_node_type(o_ast), _node_type(c_ast))
steps = _diff_path(o_ast, c_ast)
- shape = _ast_mismatch_shape(bucket, steps)
+ shape = _ast_mismatch_shape(mismatch_bucket, steps)
shrunk = _shrink_query(query, args.rule, oracle, candidate, shape) if args.shrink_failures else None
- mismatch_buckets.setdefault(bucket, []).append((query, shrunk, steps))
+ mismatch_buckets.setdefault(mismatch_bucket, []).append((query, shrunk, steps))
write_record(
{
"kind": "ast_mismatch",
@@ -405,6 +492,25 @@ def main() -> int:
for k, v in sorted(counts.items(), key=lambda kv: (-kv[1], kv[0])):
print(f" {k:32s} {v}")
+ # ---- rejection-parity: candidate accepted what the oracle rejected ----
+ # The headline failure of the two-sided contract — a candidate that
+ # parses an invalid query. Printed first (and samples shown by default,
+ # not gated behind `--print-rejects`) because it's a correctness bug,
+ # not the noisier "candidate is stricter than the oracle" reject class.
+ if accept_reject_buckets:
+ total = sum(len(v) for v in accept_reject_buckets.values())
+ print()
+ print(f"=== candidate_accepts_oracle_reject ({total} total — candidate took an INVALID query) ===")
+ sorted_ar_buckets = sorted(accept_reject_buckets.items(), key=lambda kv: -len(kv[1]))
+ for root, queries in sorted_ar_buckets:
+ print(f" candidate root {root}: {len(queries)}")
+ print()
+ print(f"=== Sample candidate_accepts_oracle_reject (up to {args.max_mismatch_samples} per root) ===")
+ for root, queries in sorted_ar_buckets:
+ print(f"\n--- candidate root {root} ({len(queries)} total) ---")
+ for query, shrunk in queries[: args.max_mismatch_samples]:
+ _print_failure_sample(query, shrunk, args.rule, oracle, candidate)
+
# ---- ast_mismatch categorization + samples ----------------------------
if mismatch_buckets:
total = sum(len(v) for v in mismatch_buckets.values())
diff --git a/posthog/hogql/test/__snapshots__/parser_ast.ambr b/posthog/hogql/test/__snapshots__/parser_ast.ambr
new file mode 100644
index 000000000000..9c89156166d5
--- /dev/null
+++ b/posthog/hogql/test/__snapshots__/parser_ast.ambr
@@ -0,0 +1,16903 @@
+# serializer version: 1
+# name: test_assignment_lhs_is_any_expression[1-f711f0d2]
+ '''
+ {
+ declarations: [
+ {
+ end: 7
+ left: {
+ end: 2
+ items: []
+ start: 0
+ }
+ right: {
+ end: 7
+ start: 6
+ value: 1
+ }
+ start: 0
+ }
+ ]
+ end: 7
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_lhs_is_any_expression[1-fc0a5713]
+ '''
+ {
+ declarations: [
+ {
+ end: 7
+ left: {
+ end: 2
+ exprs: []
+ start: 0
+ }
+ right: {
+ end: 7
+ start: 6
+ value: 1
+ }
+ start: 0
+ }
+ ]
+ end: 7
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_lhs_is_any_expression[1_1-e28350db]
+ '''
+ {
+ declarations: [
+ {
+ end: 6
+ left: {
+ end: 1
+ start: 0
+ value: 1
+ }
+ right: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ start: 0
+ }
+ ]
+ end: 6
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_lhs_is_any_expression[for_let_m_in_488614_1_1-2172d5ea]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ end: 28
+ left: {
+ end: 23
+ start: 22
+ value: 1
+ }
+ right: {
+ end: 28
+ start: 27
+ value: 1
+ }
+ start: 22
+ }
+ end: 28
+ expr: {
+ end: 20
+ start: 14
+ value: 488614
+ }
+ start: 0
+ valueVar: "m"
+ }
+ ]
+ end: 28
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_lhs_is_any_expression[return_1_1-05f9ec5a]
+ '''
+ {
+ declarations: [
+ {
+ end: 6
+ start: 0
+ },
+ {
+ end: 13
+ left: {
+ end: 8
+ start: 7
+ value: 1
+ }
+ right: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ start: 7
+ }
+ ]
+ end: 13
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_lhs_is_any_expression[s_1-a8f48ac8]
+ '''
+ {
+ declarations: [
+ {
+ end: 8
+ left: {
+ end: 3
+ start: 0
+ value: "s"
+ }
+ right: {
+ end: 8
+ start: 7
+ value: 1
+ }
+ start: 0
+ }
+ ]
+ end: 8
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_statement_consumes_trailing_semicolon[if_c_a_b_else_d-148d8eff]
+ '''
+ {
+ declarations: [
+ {
+ else_: {
+ end: 24
+ expr: {
+ chain: [
+ "d"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ start: 23
+ }
+ end: 24
+ expr: {
+ chain: [
+ "c"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ then: {
+ end: 17
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ start: 7
+ }
+ }
+ ]
+ end: 24
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_statement_consumes_trailing_semicolon[if_c_a_b_else_d-33c16a30]
+ '''
+ {
+ declarations: [
+ {
+ end: 15
+ expr: {
+ chain: [
+ "c"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ then: {
+ end: 15
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ start: 7
+ }
+ },
+ {
+ end: 21
+ expr: {
+ chain: [
+ "else"
+ ]
+ end: 21
+ from_asterisk: False
+ start: 17
+ }
+ start: 17
+ },
+ {
+ end: 23
+ expr: {
+ chain: [
+ "d"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ start: 22
+ }
+ ]
+ end: 23
+ start: 0
+ }
+ '''
+# ---
+# name: test_assignment_statement_consumes_trailing_semicolon[if_c_a_b_else_d-7613f05c]
+ '''
+ {
+ declarations: [
+ {
+ else_: {
+ end: 22
+ expr: {
+ chain: [
+ "d"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ start: 21
+ }
+ end: 22
+ expr: {
+ chain: [
+ "c"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ then: {
+ end: 15
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ start: 7
+ }
+ }
+ ]
+ end: 22
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_1-fa80572d]
+ '''
+ {
+ declarations: [
+ {
+ end: 6
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ right: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ start: 0
+ }
+ ]
+ end: 6
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_1_2-914064e1]
+ '''
+ {
+ declarations: [
+ {
+ end: 11
+ left: {
+ name: "a"
+ value: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ }
+ right: {
+ end: 11
+ start: 10
+ value: 2
+ }
+ start: 0
+ }
+ ]
+ end: 11
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_1_2_3-1f52188e]
+ '''
+ {
+ declarations: [
+ {
+ end: 15
+ left: {
+ name: "a"
+ value: {
+ end: 10
+ left: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ op: "*"
+ right: {
+ end: 10
+ start: 9
+ value: 2
+ }
+ start: 5
+ }
+ }
+ right: {
+ end: 15
+ start: 14
+ value: 3
+ }
+ start: 0
+ }
+ ]
+ end: 15
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_1_2_3-2223729e]
+ '''
+ {
+ declarations: [
+ {
+ end: 15
+ left: {
+ name: "a"
+ value: {
+ end: 10
+ left: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 10
+ start: 9
+ value: 2
+ }
+ start: 5
+ }
+ }
+ right: {
+ end: 15
+ start: 14
+ value: 3
+ }
+ start: 0
+ }
+ ]
+ end: 15
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_2-91e7d393]
+ '''
+ {
+ declarations: [
+ {
+ end: 12
+ left: {
+ name: "a"
+ value: {
+ end: 7
+ items: []
+ start: 5
+ }
+ }
+ right: {
+ end: 12
+ start: 11
+ value: 2
+ }
+ start: 0
+ }
+ ]
+ end: 12
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_b-5a9e4ac2]
+ '''
+ {
+ declarations: [
+ {
+ end: 6
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ }
+ ]
+ end: 6
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_b_c-7b6842d0]
+ '''
+ {
+ declarations: [
+ {
+ end: 11
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ right: {
+ name: "b"
+ value: {
+ chain: [
+ "c"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 10
+ }
+ }
+ start: 0
+ }
+ ]
+ end: 11
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_b_c_d-c5384b1c]
+ '''
+ {
+ declarations: [
+ {
+ end: 16
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ right: {
+ name: "b"
+ value: {
+ name: "c"
+ value: {
+ chain: [
+ "d"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ }
+ }
+ start: 0
+ }
+ ]
+ end: 16
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_str_2-1014ae21]
+ '''
+ {
+ declarations: [
+ {
+ end: 15
+ left: {
+ name: "a"
+ value: {
+ end: 10
+ start: 5
+ value: "str"
+ }
+ }
+ right: {
+ end: 15
+ start: 14
+ value: 2
+ }
+ start: 0
+ }
+ ]
+ end: 15
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[a_str_2-b7766b9a]
+ '''
+ {
+ declarations: [
+ {
+ end: 15
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ right: {
+ name: "str"
+ value: {
+ end: 15
+ start: 14
+ value: 2
+ }
+ }
+ start: 0
+ }
+ ]
+ end: 15
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[if_c_a_b-5e60195c]
+ '''
+ {
+ declarations: [
+ {
+ end: 13
+ expr: {
+ chain: [
+ "c"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ then: {
+ end: 13
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ start: 7
+ }
+ }
+ ]
+ end: 13
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_assignment_lead_chains_through_second_colon_equals[if_c_a_b_else_d-7613f05c]
+ '''
+ {
+ declarations: [
+ {
+ else_: {
+ end: 22
+ expr: {
+ chain: [
+ "d"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ start: 21
+ }
+ end: 22
+ expr: {
+ chain: [
+ "c"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ then: {
+ end: 15
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ start: 7
+ }
+ }
+ ]
+ end: 22
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_asterisk_clause_body_after_comma[select_a_having_limit_1-28f5c7b6]
+ '''
+ {
+ end: 26
+ having: {
+ chain: [
+ "*"
+ ]
+ end: 18
+ from_asterisk: False
+ start: 17
+ }
+ limit: {
+ end: 26
+ start: 25
+ value: 1
+ }
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_asterisk_clause_body_after_comma[select_a_prewhere_with_totals-5955e13a]
+ '''
+ {
+ end: 32
+ prewhere: {
+ chain: [
+ "*"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_asterisk_clause_body_after_comma[select_a_qualify_limit_1-08b68ac2]
+ '''
+ {
+ end: 27
+ limit: {
+ end: 27
+ start: 26
+ value: 1
+ }
+ qualify: {
+ chain: [
+ "*"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_asterisk_clause_body_after_comma[select_a_where_group_by_x-710ce8a8]
+ '''
+ {
+ end: 28
+ group_by: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ where: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ }
+ '''
+# ---
+# name: test_bare_asterisk_clause_body_after_comma[select_a_where_limit_1-fad6deb4]
+ '''
+ {
+ end: 25
+ limit: {
+ end: 25
+ start: 24
+ value: 1
+ }
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ where: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ }
+ '''
+# ---
+# name: test_bare_asterisk_clause_body_after_comma[select_a_where_order_by_x-0b4ab778]
+ '''
+ {
+ end: 28
+ order_by: [
+ {
+ end: 28
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ order: "ASC"
+ start: 27
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ where: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ }
+ '''
+# ---
+# name: test_bare_asterisk_clause_body_after_comma[select_a_where_with_totals-5bae1a91]
+ '''
+ {
+ end: 29
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ where: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ }
+ '''
+# ---
+# name: test_bare_asterisk_replace_only_inside_parens[EXCLUDE_a-d7cbd9f3]
+ '''
+ {
+ all_columns: True
+ end: 13
+ exclude: [
+ "a"
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_asterisk_replace_only_inside_parens[EXCLUDE_a_REPLACE_b_AS_c-81176873]
+ '''
+ {
+ all_columns: True
+ end: 32
+ exclude: [
+ "a"
+ ]
+ replace: {
+ c: {
+ chain: [
+ "b"
+ ]
+ end: 25
+ from_asterisk: False
+ start: 24
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_asterisk_replace_only_inside_parens[REPLACE_1_AS_event-d874a541]
+ '''
+ {
+ all_columns: True
+ end: 24
+ replace: {
+ event: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_zero_x_prefix_lexes_as_zero_plus_ident[SELECT_0x1-965e51e6]
+ '''
+ {
+ end: 10
+ select: [
+ {
+ end: 10
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_zero_x_prefix_lexes_as_zero_plus_ident[SELECT_0xFF-725ebad8]
+ '''
+ {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 7
+ value: 255
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_bare_zero_x_prefix_lexes_as_zero_plus_ident[SELECT_0xaB-c5627471]
+ '''
+ {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 7
+ value: 171
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_between_not_lambda_lower_bound[a_between_not_lambda_x_b_and_c-6ea2de79]
+ '''
+ {
+ end: 31
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ high: {
+ chain: [
+ "c"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ low: {
+ end: 25
+ expr: {
+ args: [
+ "x"
+ ]
+ end: 25
+ expr: {
+ chain: [
+ "b"
+ ]
+ end: 25
+ from_asterisk: False
+ start: 24
+ }
+ start: 14
+ }
+ start: 10
+ }
+ negated: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_between_not_lambda_lower_bound[a_between_not_x_y_and_z-213ef5f4]
+ '''
+ {
+ end: 26
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ high: {
+ chain: [
+ "z"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ low: {
+ end: 20
+ expr: {
+ args: [
+ "x"
+ ]
+ end: 20
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ start: 14
+ }
+ start: 10
+ }
+ negated: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[TRUE_x-755d392d]
+ '''
+ {
+ chain: [
+ "TRUE",
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[false-7cb6efb9]
+ '''
+ {
+ end: 5
+ start: 0
+ value: False
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[false_foo_bar-a9d34395]
+ '''
+ {
+ chain: [
+ "false",
+ "foo",
+ "bar"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[false_x-b7a670a1]
+ '''
+ {
+ chain: [
+ "false",
+ "x"
+ ]
+ end: 7
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[true-5ffe533b]
+ '''
+ {
+ end: 4
+ start: 0
+ value: True
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[true_1-b68b4c23]
+ '''
+ {
+ args: [
+ {
+ end: 6
+ start: 5
+ value: 1
+ }
+ ]
+ distinct: False
+ end: 7
+ name: "true"
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[true_x-a0490f70]
+ '''
+ {
+ chain: [
+ "true",
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_dot_chain_is_field_not_array_access[true_x_y-86fa63a5]
+ '''
+ {
+ chain: [
+ "true",
+ "x",
+ "y"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_keyword_as_call_name[false_1-87a7eb42]
+ '''
+ {
+ args: [
+ {
+ end: 7
+ start: 6
+ value: 1
+ }
+ ]
+ distinct: False
+ end: 8
+ name: "false"
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_keyword_as_call_name[null_1-d6599da1]
+ '''
+ {
+ args: [
+ {
+ end: 6
+ start: 5
+ value: 1
+ }
+ ]
+ end: 7
+ expr: {
+ end: 4
+ start: 0
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_boolean_keyword_as_call_name[true_1-b68b4c23]
+ '''
+ {
+ args: [
+ {
+ end: 6
+ start: 5
+ value: 1
+ }
+ ]
+ distinct: False
+ end: 7
+ name: "true"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1-bc5c7d75]
+ '''
+ {
+ args: [
+ {
+ end: 10
+ select: [
+ {
+ end: 10
+ start: 9
+ value: 1
+ }
+ ]
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 11
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1-ce38640c]
+ '''
+ {
+ args: [
+ {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ ]
+ distinct: False
+ end: 13
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_BETWEEN_1_AND_2-4e306037]
+ '''
+ {
+ args: [
+ {
+ end: 28
+ expr: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ high: {
+ end: 28
+ start: 27
+ value: 2
+ }
+ low: {
+ end: 22
+ start: 21
+ value: 1
+ }
+ negated: False
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 29
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_ILIKE_x-eb952d47]
+ '''
+ {
+ args: [
+ {
+ end: 22
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "ilike"
+ right: {
+ end: 22
+ start: 19
+ value: "x"
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 23
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_IN_1_2-130a53b2]
+ '''
+ {
+ args: [
+ {
+ end: 22
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "in"
+ right: {
+ end: 22
+ exprs: [
+ {
+ end: 18
+ start: 17
+ value: 1
+ },
+ {
+ end: 21
+ start: 20
+ value: 2
+ }
+ ]
+ start: 16
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 23
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_IS_NOT_NULL-7142693f]
+ '''
+ {
+ args: [
+ {
+ end: 24
+ is_null_comparison_style: True
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "!="
+ right: {
+
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 25
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_IS_NULL-72886a4b]
+ '''
+ {
+ args: [
+ {
+ end: 20
+ is_null_comparison_style: True
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "=="
+ right: {
+
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 21
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_LIKE_x-010dc124]
+ '''
+ {
+ args: [
+ {
+ end: 21
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "like"
+ right: {
+ end: 21
+ start: 18
+ value: "x"
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 22
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_NOT_BETWEEN_1_AND_2-8362333f]
+ '''
+ {
+ args: [
+ {
+ end: 32
+ expr: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ high: {
+ end: 32
+ start: 31
+ value: 2
+ }
+ low: {
+ end: 26
+ start: 25
+ value: 1
+ }
+ negated: True
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 33
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_NOT_ILIKE_x-2fd9947a]
+ '''
+ {
+ args: [
+ {
+ end: 26
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "not ilike"
+ right: {
+ end: 26
+ start: 23
+ value: "x"
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 27
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_NOT_IN_1_2-1c5c9adc]
+ '''
+ {
+ args: [
+ {
+ end: 26
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "not in"
+ right: {
+ end: 26
+ exprs: [
+ {
+ end: 22
+ start: 21
+ value: 1
+ },
+ {
+ end: 25
+ start: 24
+ value: 2
+ }
+ ]
+ start: 20
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 27
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_arg_select_releases_when_followed_by_keyword_infix[f_SELECT_1_NOT_LIKE_x-1488d290]
+ '''
+ {
+ args: [
+ {
+ end: 25
+ left: {
+ end: 11
+ select: [
+ {
+ end: 11
+ start: 10
+ value: 1
+ }
+ ]
+ start: 3
+ }
+ op: "not like"
+ right: {
+ end: 25
+ start: 22
+ value: "x"
+ }
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 26
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_as_assignment_target[a_b_c_d-ff70ecbc]
+ '''
+ {
+ declarations: [
+ {
+ end: 10
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 2
+ from_asterisk: False
+ start: 1
+ }
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ start: 0
+ },
+ {
+ end: 21
+ left: {
+ chain: [
+ "c"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ right: {
+ chain: [
+ "d"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ start: 11
+ }
+ ]
+ end: 21
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_as_assignment_target[f_1-339f38f9]
+ '''
+ {
+ declarations: [
+ {
+ end: 8
+ left: {
+ args: []
+ distinct: False
+ end: 3
+ name: "f"
+ start: 0
+ }
+ right: {
+ end: 8
+ start: 7
+ value: 1
+ }
+ start: 0
+ }
+ ]
+ end: 8
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_as_assignment_target[f_g_h-2a0479a2]
+ '''
+ {
+ declarations: [
+ {
+ end: 11
+ left: {
+ args: [
+ {
+ chain: [
+ "g"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ ]
+ distinct: False
+ end: 6
+ name: "f"
+ params: []
+ start: 0
+ }
+ right: {
+ chain: [
+ "h"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 10
+ }
+ start: 0
+ }
+ ]
+ end: 11
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_as_assignment_target[f_x_1-0adf7101]
+ '''
+ {
+ declarations: [
+ {
+ end: 9
+ left: {
+ args: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 4
+ name: "f"
+ start: 0
+ }
+ right: {
+ end: 9
+ start: 8
+ value: 1
+ }
+ start: 0
+ }
+ ]
+ end: 9
+ start: 0
+ }
+ '''
+# ---
+# name: test_call_as_assignment_target[if_x_y-48a54f90]
+ '''
+ {
+ declarations: [
+ {
+ end: 10
+ left: {
+ args: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 3
+ }
+ ]
+ distinct: False
+ end: 5
+ name: "if"
+ start: 0
+ }
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 10
+ from_asterisk: False
+ start: 9
+ }
+ start: 0
+ }
+ ]
+ end: 10
+ start: 0
+ }
+ '''
+# ---
+# name: test_capital_F_template_string_only_in_full_template_context[f_1_2-212eab57]
+ '''
+ {
+ end: 6
+ left: {
+ end: 4
+ start: 3
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 6
+ start: 5
+ value: 2
+ }
+ start: 3
+ }
+ '''
+# ---
+# name: test_capital_F_template_string_only_in_full_template_context[f_hello-fa3ef692]
+ '''
+ {
+ end: 7
+ start: 2
+ value: "hello"
+ }
+ '''
+# ---
+# name: test_cast_type_arg_with_parenthesized_expr[cast_x_as_a_b-40a668cc]
+ '''
+ {
+ end: 17
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "a((b))"
+ }
+ '''
+# ---
+# name: test_cast_type_arg_with_parenthesized_expr[cast_x_as_a_case_when_c_then_d_end-cb5762d2]
+ '''
+ {
+ end: 38
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "a(casewhen(c)thendend)"
+ }
+ '''
+# ---
+# name: test_cast_type_arg_with_parenthesized_expr[cast_x_as_a_if_c_d_e-93ccc1fb]
+ '''
+ {
+ end: 27
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "a(if((c), d, e))"
+ }
+ '''
+# ---
+# name: test_cast_type_compound_loop_stops_at_non_identifier_keyword[cast_x_as_Array_Int-b2f1741f]
+ '''
+ {
+ end: 21
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "array(int)"
+ }
+ '''
+# ---
+# name: test_cast_type_compound_loop_stops_at_non_identifier_keyword[cast_x_as_Decimal_10_2-f3f09ba9]
+ '''
+ {
+ end: 25
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "decimal(10, 2)"
+ }
+ '''
+# ---
+# name: test_cast_type_compound_loop_stops_at_non_identifier_keyword[cast_x_as_Foo_Bar_Baz-2e45ad76]
+ '''
+ {
+ end: 22
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo bar baz"
+ }
+ '''
+# ---
+# name: test_cast_type_compound_loop_stops_at_non_identifier_keyword[cast_x_as_Foo_Not_Bar-0c1f96f0]
+ '''
+ {
+ end: 22
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo not bar"
+ }
+ '''
+# ---
+# name: test_cast_type_compound_loop_stops_at_non_identifier_keyword[cast_x_as_Int-3e38fd9f]
+ '''
+ {
+ end: 14
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "int"
+ }
+ '''
+# ---
+# name: test_cast_type_compound_loop_stops_at_non_identifier_keyword[cast_x_as_Time_With_Time_Zone-870f4396]
+ '''
+ {
+ end: 30
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "time with time zone"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_DateTime64_3_UTC-416fe76a]
+ '''
+ {
+ end: 31
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "datetime64(3, \"UTC\")"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_DateTime64_3_UTC-f5f2da92]
+ '''
+ {
+ end: 31
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "datetime64(3, 'UTC')"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_1_ABC-40566fbc]
+ '''
+ {
+ end: 23
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(#1, ABC)"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_1_Bar_a_b-5573dbfa]
+ '''
+ {
+ end: 29
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(#1, Bar(a,b))"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_1_f_g_a_b_h_c_d-6bdcc45c]
+ '''
+ {
+ end: 39
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(#1, f(g(a,b),h(c,d)))"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_Bar_a_b_1-55973708]
+ '''
+ {
+ end: 29
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(Bar(a,b), #1)"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_FixedString_8-382e3e99]
+ '''
+ {
+ end: 30
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(fixedstring(8))"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_a_b_c-ee3f7564]
+ '''
+ {
+ end: 22
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(a, b*c)"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_a_b_c_d-36d12be3]
+ '''
+ {
+ end: 26
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(a(b, c), d)"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_case_when_c_then_d_end-d3b30f8f]
+ '''
+ {
+ end: 40
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(casewhen(c)thendend)"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Foo_g_1-351f6009]
+ '''
+ {
+ end: 21
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "foo(g(#1))"
+ }
+ '''
+# ---
+# name: test_cast_type_param_group_mode_classification[cast_x_as_Tuple_a_Int_b_Int-b3883496]
+ '''
+ {
+ end: 30
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "tuple(a int, b int)"
+ }
+ '''
+# ---
+# name: test_column_cte_requires_identifier_after_as[WITH_a_AS_b_SELECT_b-86491acd]
+ '''
+ {
+ ctes: {
+ b: {
+ cte_type: "column"
+ end: 11
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ name: "b"
+ recursive: False
+ start: 5
+ }
+ }
+ end: 20
+ select: [
+ {
+ chain: [
+ "b"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_exclude_replace_reject_reserved_keywords[SELECT_COLUMNS_REPLACE_a_AS_b_FROM_t-8e98b241]
+ '''
+ {
+ end: 41
+ select: [
+ {
+ all_columns: True
+ end: 34
+ replace: {
+ b: {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 41
+ start: 40
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 41
+ from_asterisk: False
+ start: 40
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_exclude_replace_reject_reserved_keywords[SELECT_EXCLUDE_a_FROM_t-13668641]
+ '''
+ {
+ end: 27
+ select: [
+ {
+ all_columns: True
+ end: 20
+ exclude: [
+ "a"
+ ]
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 27
+ start: 26
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_exclude_replace_reject_reserved_keywords[SELECT_EXCLUDE_a_b_FROM_t-1febbebb]
+ '''
+ {
+ end: 29
+ select: [
+ {
+ all_columns: True
+ end: 22
+ exclude: [
+ "a.b"
+ ]
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 29
+ start: 28
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_macro_asterisk_form_as_list_element[columns-27928d5b]
+ '''
+ {
+ all_columns: False
+ columns: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ ]
+ end: 10
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_macro_asterisk_form_as_list_element[columns_a_b-6279e6b5]
+ '''
+ {
+ all_columns: False
+ columns: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 12
+ from_asterisk: False
+ start: 11
+ }
+ ]
+ end: 13
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_macro_asterisk_form_as_list_element[columns_exclude_a-a009b8b7]
+ '''
+ {
+ all_columns: False
+ columns: [
+ {
+ all_columns: True
+ end: 20
+ exclude: [
+ "a"
+ ]
+ start: 8
+ }
+ ]
+ end: 21
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_macro_asterisk_form_as_list_element[columns_exclude_a-fdaff3d4]
+ '''
+ {
+ all_columns: False
+ columns: [
+ {
+ args: []
+ end: 23
+ expr: {
+ all_columns: True
+ end: 20
+ exclude: [
+ "a"
+ ]
+ start: 8
+ }
+ start: 8
+ }
+ ]
+ end: 24
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_macro_asterisk_form_as_list_element[columns_q-bb1e1dce]
+ '''
+ {
+ all_columns: False
+ columns: [
+ {
+ chain: [
+ "q",
+ "*"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 8
+ }
+ ]
+ end: 12
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_macro_asterisk_form_as_list_element[columns_q-dbadacf5]
+ '''
+ {
+ all_columns: False
+ columns: [
+ {
+ args: []
+ end: 13
+ expr: {
+ chain: [
+ "q",
+ "*"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 8
+ }
+ start: 8
+ }
+ ]
+ end: 14
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_macro_asterisk_form_as_list_element[columns_re-b0209787]
+ '''
+ {
+ all_columns: False
+ end: 13
+ regex: "re"
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_replace_item_name_is_the_as_keyword[columns_replace_a_as_as-c73f331d]
+ '''
+ {
+ all_columns: True
+ end: 27
+ replace: {
+ as: {
+ chain: [
+ "a"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_replace_item_name_is_the_as_keyword[columns_replace_x_as_y_z_as_as-1303ec72]
+ '''
+ {
+ all_columns: True
+ end: 35
+ replace: {
+ as: {
+ chain: [
+ "z"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ },
+ y: {
+ chain: [
+ "x"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_replace_item_name_is_the_as_keyword[replace_a_as_as-a6298e75]
+ '''
+ {
+ all_columns: True
+ end: 20
+ replace: {
+ as: {
+ chain: [
+ "a"
+ ]
+ end: 12
+ from_asterisk: False
+ start: 11
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_replace_item_name_is_the_as_keyword[replace_a_as_b-b4045b35]
+ '''
+ {
+ all_columns: True
+ end: 19
+ replace: {
+ b: {
+ chain: [
+ "a"
+ ]
+ end: 12
+ from_asterisk: False
+ start: 11
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_columns_replace_item_name_is_the_as_keyword[replace_a_as_b_as_as-26f77129]
+ '''
+ {
+ all_columns: True
+ end: 25
+ replace: {
+ as: {
+ alias: "b"
+ end: 17
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 12
+ from_asterisk: False
+ start: 11
+ }
+ from_asterisk: False
+ hidden: False
+ start: 11
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_cte_list_paren_after_non_paren_cte[WITH_1_AS_a_x_x_1_AS_f_SELECT_f_a-92e4cd4c]
+ '''
+ {
+ ctes: {
+ a: {
+ cte_type: "column"
+ end: 11
+ expr: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ name: "a"
+ recursive: False
+ start: 5
+ },
+ f: {
+ cte_type: "column"
+ end: 30
+ expr: {
+ args: [
+ "x"
+ ]
+ end: 24
+ expr: {
+ end: 24
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ op: "+"
+ right: {
+ end: 24
+ start: 23
+ value: 1
+ }
+ start: 19
+ }
+ start: 14
+ }
+ name: "f"
+ recursive: False
+ start: 13
+ }
+ }
+ end: 42
+ select: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 41
+ from_asterisk: False
+ start: 40
+ }
+ ]
+ distinct: False
+ end: 42
+ name: "f"
+ start: 38
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_cte_list_paren_after_non_paren_cte[WITH_1_AS_x_1_AS_y_SELECT_y-00df7fad]
+ '''
+ {
+ ctes: {
+ x: {
+ cte_type: "column"
+ end: 11
+ expr: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ name: "x"
+ recursive: False
+ start: 5
+ },
+ y: {
+ cte_type: "column"
+ end: 21
+ expr: {
+ end: 15
+ start: 14
+ value: 1
+ }
+ name: "y"
+ recursive: False
+ start: 13
+ }
+ }
+ end: 30
+ select: [
+ {
+ chain: [
+ "y"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_cte_list_paren_after_non_paren_cte[WITH_1_AS_x_SELECT_1_AS_y_SELECT_x_y-7724fb58]
+ '''
+ {
+ ctes: {
+ x: {
+ cte_type: "column"
+ end: 11
+ expr: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ name: "x"
+ recursive: False
+ start: 5
+ },
+ y: {
+ cte_type: "column"
+ end: 28
+ expr: {
+ end: 22
+ select: [
+ {
+ end: 22
+ start: 21
+ value: 1
+ }
+ ]
+ start: 14
+ }
+ name: "y"
+ recursive: False
+ start: 13
+ }
+ }
+ end: 40
+ select: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 37
+ from_asterisk: False
+ start: 36
+ },
+ {
+ chain: [
+ "y"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 39
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_cte_list_paren_after_non_paren_cte[WITH_1_AS_x_a_b_AS_y_SELECT_y-6e9b5f41]
+ '''
+ {
+ ctes: {
+ x: {
+ cte_type: "column"
+ end: 11
+ expr: {
+ end: 6
+ start: 5
+ value: 1
+ }
+ name: "x"
+ recursive: False
+ start: 5
+ },
+ y: {
+ cte_type: "column"
+ end: 25
+ expr: {
+ end: 19
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ op: "+"
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ start: 14
+ }
+ name: "y"
+ recursive: False
+ start: 13
+ }
+ }
+ end: 34
+ select: [
+ {
+ chain: [
+ "y"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_cte_list_paren_after_non_paren_cte[WITH_SELECT_1_AS_x_SELECT_2_AS_y_SELECT_x_y-84ad965c]
+ '''
+ {
+ ctes: {
+ x: {
+ cte_type: "column"
+ end: 20
+ expr: {
+ end: 14
+ select: [
+ {
+ end: 14
+ start: 13
+ value: 1
+ }
+ ]
+ start: 6
+ }
+ name: "x"
+ recursive: False
+ start: 5
+ },
+ y: {
+ cte_type: "column"
+ end: 37
+ expr: {
+ end: 31
+ select: [
+ {
+ end: 31
+ start: 30
+ value: 2
+ }
+ ]
+ start: 23
+ }
+ name: "y"
+ recursive: False
+ start: 22
+ }
+ }
+ end: 49
+ select: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 46
+ from_asterisk: False
+ start: 45
+ },
+ {
+ chain: [
+ "y"
+ ]
+ end: 49
+ from_asterisk: False
+ start: 48
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_cte_list_paren_after_non_paren_cte[WITH_count_AS_c_x_x_1_AS_f_SELECT_f_c-81508175]
+ '''
+ {
+ ctes: {
+ c: {
+ cte_type: "column"
+ end: 17
+ expr: {
+ args: []
+ distinct: False
+ end: 12
+ name: "count"
+ start: 5
+ }
+ name: "c"
+ recursive: False
+ start: 5
+ },
+ f: {
+ cte_type: "column"
+ end: 36
+ expr: {
+ args: [
+ "x"
+ ]
+ end: 30
+ expr: {
+ end: 30
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ op: "+"
+ right: {
+ end: 30
+ start: 29
+ value: 1
+ }
+ start: 25
+ }
+ start: 20
+ }
+ name: "f"
+ recursive: False
+ start: 19
+ }
+ }
+ end: 48
+ select: [
+ {
+ args: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 47
+ from_asterisk: False
+ start: 46
+ }
+ ]
+ distinct: False
+ end: 48
+ name: "f"
+ start: 44
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_PIVOT_a_FOR_b_IN_c_AS_x-4d7a2564]
+ '''
+ {
+ end: 43
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ alias: "x"
+ end: 43
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ ]
+ }
+ ]
+ end: 38
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_PIVOT_a_FOR_b_IN_c_AS_x_PIVOT_d_FOR_e_IN_f-7713d05c]
+ '''
+ {
+ end: 66
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 66
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 52
+ from_asterisk: False
+ start: 51
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "e"
+ ]
+ end: 58
+ from_asterisk: False
+ start: 57
+ }
+ values: [
+ {
+ chain: [
+ "f"
+ ]
+ end: 64
+ from_asterisk: False
+ start: 63
+ }
+ ]
+ }
+ ]
+ end: 66
+ start: 14
+ table: {
+ alias: "x"
+ end: 43
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ ]
+ }
+ ]
+ end: 38
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_PIVOT_a_FOR_b_IN_c_FINAL-a664a5ee]
+ '''
+ {
+ end: 46
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 45
+ start: 15
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 25
+ from_asterisk: False
+ start: 24
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 37
+ from_asterisk: False
+ start: 36
+ }
+ ]
+ }
+ ]
+ end: 39
+ start: 15
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ }
+ table_final: True
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_PIVOT_a_FOR_b_IN_c_FINAL-ea52f014]
+ '''
+ {
+ end: 44
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 44
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ ]
+ }
+ ]
+ end: 38
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ table_final: True
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_PIVOT_a_FOR_b_IN_c_JOIN_u_ON_x-5d7f0f14]
+ '''
+ {
+ end: 50
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 38
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 50
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 50
+ from_asterisk: False
+ start: 49
+ }
+ start: 46
+ }
+ end: 45
+ join_type: "JOIN"
+ start: 44
+ table: {
+ chain: [
+ "u"
+ ]
+ end: 45
+ from_asterisk: False
+ start: 44
+ }
+ }
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ ]
+ }
+ ]
+ end: 38
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_PIVOT_a_FOR_b_IN_c_SAMPLE_1-3de125a3]
+ '''
+ {
+ end: 49
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 48
+ sample: {
+ end: 48
+ sample_value: {
+ end: 48
+ left: {
+ end: 48
+ start: 47
+ value: 1
+ }
+ start: 47
+ }
+ start: 40
+ }
+ start: 15
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 25
+ from_asterisk: False
+ start: 24
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 37
+ from_asterisk: False
+ start: 36
+ }
+ ]
+ }
+ ]
+ end: 39
+ start: 15
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_PIVOT_a_FOR_b_IN_c_x-0a93efb3]
+ '''
+ {
+ end: 40
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ alias: "x"
+ end: 40
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ ]
+ }
+ ]
+ end: 38
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_decoration_after_pivot[SELECT_1_FROM_t_UNPIVOT_a_FOR_b_IN_c_FINAL-61d1b46e]
+ '''
+ {
+ end: 48
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 47
+ start: 15
+ table: {
+ columns: [
+ {
+ name_columns: {
+ chain: [
+ "b"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 39
+ from_asterisk: False
+ start: 38
+ }
+ ]
+ value_columns: {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ ]
+ end: 41
+ include_nulls: False
+ start: 15
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ }
+ table_final: True
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_empty_paren_only_clauses_rejected[COLUMNS_REPLACE_a_AS_b-2108574c]
+ '''
+ {
+ all_columns: True
+ end: 27
+ replace: {
+ b: {
+ chain: [
+ "a"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_empty_paren_only_clauses_rejected[COLUMNS_REPLACE_a_AS_b_c_AS_d-8a8f1eac]
+ '''
+ {
+ all_columns: True
+ end: 35
+ replace: {
+ b: {
+ chain: [
+ "a"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ },
+ d: {
+ chain: [
+ "c"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_empty_paren_only_clauses_rejected[SELECT_1_ORDER_BY_x_INTERPOLATE-5846cc59]
+ '''
+ {
+ end: 31
+ interpolate: []
+ order_by: [
+ {
+ end: 19
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ order: "ASC"
+ start: 18
+ }
+ ]
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_empty_paren_only_clauses_rejected[SELECT_1_ORDER_BY_x_INTERPOLATE_a_AS_b-880042e7]
+ '''
+ {
+ end: 40
+ interpolate: [
+ {
+ end: 39
+ expr: {
+ alias: "b"
+ end: 39
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ from_asterisk: False
+ hidden: False
+ start: 33
+ }
+ start: 33
+ }
+ ]
+ order_by: [
+ {
+ end: 19
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ order: "ASC"
+ start: 18
+ }
+ ]
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_empty_paren_only_clauses_rejected[SELECT_FROM_t_AS_x_a-2aac729d]
+ '''
+ {
+ end: 24
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ alias: "x"
+ column_aliases: [
+ "a"
+ ]
+ end: 24
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_empty_paren_only_clauses_rejected[SELECT_FROM_t_AS_x_a_b-13668d25]
+ '''
+ {
+ end: 27
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ alias: "x"
+ column_aliases: [
+ "a",
+ "b"
+ ]
+ end: 27
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_filter_clause_invalid_before_within_group[median_x_WITHIN_GROUP_ORDER_BY_y-15dfae4f]
+ '''
+ {
+ args: []
+ distinct: False
+ end: 35
+ name: "median"
+ params: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ within_group: [
+ {
+ end: 34
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ order: "ASC"
+ start: 33
+ }
+ ]
+ }
+ '''
+# ---
+# name: test_group_by_all_falls_back_to_columns_on_postfix[SELECT_a_FROM_t_GROUP_BY_ALL-b4b19bc3]
+ '''
+ {
+ end: 30
+ group_by: [
+ {
+ args: []
+ distinct: False
+ end: 30
+ name: "ALL"
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_all_falls_back_to_columns_on_postfix[SELECT_a_FROM_t_GROUP_BY_ALL-fcbd3eca]
+ '''
+ {
+ end: 28
+ group_by_mode: "all"
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_all_falls_back_to_columns_on_postfix[SELECT_a_FROM_t_GROUP_BY_ALL_1-98cd69b4]
+ '''
+ {
+ end: 32
+ group_by: [
+ {
+ end: 32
+ left: {
+ chain: [
+ "ALL"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 25
+ }
+ op: "+"
+ right: {
+ end: 32
+ start: 31
+ value: 1
+ }
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_all_falls_back_to_columns_on_postfix[SELECT_a_FROM_t_GROUP_BY_ALL_1-bdc68e8e]
+ '''
+ {
+ end: 31
+ group_by: [
+ {
+ array: {
+ chain: [
+ "ALL"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 25
+ }
+ end: 31
+ nullish: False
+ property: {
+ end: 30
+ start: 29
+ value: 1
+ }
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_all_falls_back_to_columns_on_postfix[SELECT_a_FROM_t_GROUP_BY_ALL_b-f287192a]
+ '''
+ {
+ end: 31
+ group_by: [
+ {
+ chain: [
+ "ALL"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 25
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_all_falls_back_to_columns_on_postfix[SELECT_a_FROM_t_GROUP_BY_ALL_x-3148a2a1]
+ '''
+ {
+ end: 30
+ group_by: [
+ {
+ chain: [
+ "ALL",
+ "x"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_continues_list[SELECT_FROM_t_GROUP_BY_CUBE_a-82d226fe]
+ '''
+ {
+ end: 32
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ ]
+ group_by_mode: "cube"
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_continues_list[SELECT_FROM_t_GROUP_BY_CUBE_a_ROLLUP_b-6056aeeb]
+ '''
+ {
+ end: 43
+ group_by: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ ]
+ distinct: False
+ end: 32
+ name: "CUBE"
+ start: 25
+ },
+ {
+ args: [
+ {
+ chain: [
+ "b"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 41
+ }
+ ]
+ distinct: False
+ end: 43
+ name: "ROLLUP"
+ start: 34
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_continues_list[SELECT_FROM_t_GROUP_BY_CUBE_a_b-c876f9da]
+ '''
+ {
+ end: 35
+ group_by: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ ]
+ distinct: False
+ end: 32
+ name: "CUBE"
+ start: 25
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_continues_list[SELECT_FROM_t_GROUP_BY_ROLLUP_a-6cc9d74f]
+ '''
+ {
+ end: 34
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ ]
+ group_by_mode: "rollup"
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_continues_list[SELECT_FROM_t_GROUP_BY_ROLLUP_a_b-beb7ab9f]
+ '''
+ {
+ end: 37
+ group_by: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ ]
+ distinct: False
+ end: 34
+ name: "ROLLUP"
+ start: 25
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 37
+ from_asterisk: False
+ start: 36
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_continues_list[SELECT_FROM_t_GROUP_BY_a_CUBE_b-755f34ce]
+ '''
+ {
+ end: 35
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ },
+ {
+ args: [
+ {
+ chain: [
+ "b"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ ]
+ distinct: False
+ end: 35
+ name: "CUBE"
+ start: 28
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_empty_is_function_call[SELECT_1_GROUP_BY_CUBE-f5fd03a9]
+ '''
+ {
+ end: 24
+ group_by: [
+ {
+ args: []
+ distinct: False
+ end: 24
+ name: "CUBE"
+ start: 18
+ }
+ ]
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_empty_is_function_call[SELECT_1_GROUP_BY_CUBE_a_b-90efc502]
+ '''
+ {
+ end: 28
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ ]
+ group_by_mode: "cube"
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_group_by_cube_rollup_empty_is_function_call[SELECT_1_GROUP_BY_ROLLUP-72e68faf]
+ '''
+ {
+ end: 26
+ group_by: [
+ {
+ args: []
+ distinct: False
+ end: 26
+ name: "ROLLUP"
+ start: 18
+ }
+ ]
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_comments_skipped_between_attributes[a_c-db7abf55]
+ '''
+ {
+ attributes: []
+ end: 11
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_comments_skipped_between_attributes[a_c_b_1-c1c05cd2]
+ '''
+ {
+ attributes: [
+ {
+ end: 15
+ name: "b"
+ start: 10
+ value: {
+ end: 14
+ start: 13
+ value: 1
+ }
+ }
+ ]
+ end: 17
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_comments_skipped_between_attributes[a_c_b_1-fba54dee]
+ '''
+ {
+ attributes: [
+ {
+ end: 14
+ name: "b"
+ start: 9
+ value: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ }
+ ]
+ end: 16
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_comments_skipped_between_attributes[a_comment_b_1-83e871fa]
+ '''
+ {
+ attributes: [
+ {
+ end: 20
+ name: "b"
+ start: 15
+ value: {
+ end: 19
+ start: 18
+ value: 1
+ }
+ }
+ ]
+ end: 22
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_comments_skipped_between_attributes[a_comment_b_1-909a0928]
+ '''
+ {
+ attributes: [
+ {
+ end: 20
+ name: "b"
+ start: 15
+ value: {
+ end: 19
+ start: 18
+ value: 1
+ }
+ }
+ ]
+ end: 22
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a-db9aa866]
+ '''
+ {
+ attributes: []
+ end: 4
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_a-0998f016]
+ '''
+ {
+ attributes: []
+ end: 9
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_a-8d4df5f1]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 4
+ start: 3
+ value: "\t"
+ }
+ ]
+ }
+ ]
+ end: 8
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_a-c1b9c988]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 4
+ start: 3
+ value: " "
+ }
+ ]
+ }
+ ]
+ end: 8
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_a-eabb5f24]
+ '''
+ {
+ attributes: []
+ end: 8
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_a-f61bc7e2]
+ '''
+ {
+ attributes: []
+ end: 7
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_b_a-0a635521]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ attributes: []
+ end: 10
+ kind: "b"
+ start: 6
+ }
+ ]
+ }
+ ]
+ end: 15
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_hello_a-72d5b149]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 12
+ start: 3
+ value: "\n hello \n"
+ }
+ ]
+ }
+ ]
+ end: 16
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_hello_world_a-7bc4a38a]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 14
+ start: 3
+ value: "hello world"
+ }
+ ]
+ }
+ ]
+ end: 18
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_drops_whitespace_only_children_containing_newline[a_x_a-52ee2b35]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ ]
+ }
+ ]
+ end: 11
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_identifier_allows_hyphens[a_b-f8f777f6]
+ '''
+ {
+ attributes: []
+ end: 7
+ kind: "a-b"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_identifier_allows_hyphens[a_b_1_a_b-7526c85d]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 7
+ start: 6
+ value: 1
+ }
+ ]
+ }
+ ]
+ end: 14
+ kind: "a-b"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_identifier_allows_hyphens[a_b_c-d57bc5ae]
+ '''
+ {
+ attributes: []
+ end: 9
+ kind: "a-b-c"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_identifier_allows_hyphens[my_tag_a_b_1_x_my_tag-7a4a21bb]
+ '''
+ {
+ attributes: [
+ {
+ end: 15
+ name: "a-b"
+ start: 8
+ value: {
+ end: 14
+ start: 13
+ value: 1
+ }
+ },
+ {
+ name: "children"
+ value: [
+ {
+ end: 17
+ start: 16
+ value: "x"
+ }
+ ]
+ }
+ ]
+ end: 26
+ kind: "my-tag"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_identifier_allows_hyphens[tag_a_b_1-164cdb6a]
+ '''
+ {
+ attributes: [
+ {
+ end: 12
+ name: "a-b"
+ start: 5
+ value: {
+ end: 11
+ start: 10
+ value: 1
+ }
+ }
+ ]
+ end: 14
+ kind: "tag"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_identifier_allows_hyphens[tag_my_child_tag-3cfcb17a]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ attributes: []
+ end: 16
+ kind: "my-child"
+ start: 5
+ }
+ ]
+ }
+ ]
+ end: 22
+ kind: "tag"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_in_from_paren_decorations[SELECT_1_FROM_Tag_AS_y-3b34a713]
+ '''
+ {
+ end: 28
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ alias: "y"
+ end: 27
+ start: 15
+ table: {
+ attributes: []
+ end: 22
+ kind: "Tag"
+ start: 15
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_in_from_paren_decorations[SELECT_1_FROM_Tag_FINAL-0f9f5dda]
+ '''
+ {
+ end: 29
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 28
+ start: 15
+ table: {
+ attributes: []
+ end: 22
+ kind: "Tag"
+ start: 15
+ }
+ table_final: True
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_in_from_paren_decorations[SELECT_1_FROM_Tag_JOIN_b_ON_x-508edab2]
+ '''
+ {
+ end: 35
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 22
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 34
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ start: 30
+ }
+ end: 29
+ join_type: "JOIN"
+ start: 28
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 15
+ table: {
+ attributes: []
+ end: 22
+ kind: "Tag"
+ start: 15
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt[a_1_2_a-89f59c93]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 8
+ start: 3
+ value: "1 + 2"
+ }
+ ]
+ }
+ ]
+ end: 12
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt[a_a-ce80326f]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 11
+ start: 3
+ value: "!@#%^*()"
+ }
+ ]
+ }
+ ]
+ end: 15
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt[a_foo_a-016dc367]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 7
+ start: 3
+ value: "foo!"
+ }
+ ]
+ }
+ ]
+ end: 11
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt[a_foo_bar_a-2724e3a6]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 10
+ start: 3
+ value: "foo@bar"
+ }
+ ]
+ }
+ ]
+ end: 14
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt[a_foo_bar_a-44116ebf]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 10
+ start: 3
+ value: "foo&bar"
+ }
+ ]
+ }
+ ]
+ end: 14
+ kind: "a"
+ start: 0
+ }
+ '''
+# ---
+# name: test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt[outer_inner_foo_bar_inner_baz_qux_outer-ed8b2082]
+ '''
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ attributes: [
+ {
+ name: "children"
+ value: [
+ {
+ end: 21
+ start: 14
+ value: "foo!bar"
+ }
+ ]
+ }
+ ]
+ end: 29
+ kind: "inner"
+ start: 7
+ },
+ {
+ end: 36
+ start: 29
+ value: "baz&qux"
+ }
+ ]
+ }
+ ]
+ end: 44
+ kind: "outer"
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[SELECT_FROM_t_WHERE_x_IN_cohort-78eccabf]
+ '''
+ {
+ end: 33
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ where: {
+ end: 33
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ op: "in"
+ right: {
+ chain: [
+ "cohort"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 27
+ }
+ start: 22
+ }
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[SELECT_FROM_t_WHERE_x_IN_cohort_GROUP_BY_y-0e86dabc]
+ '''
+ {
+ end: 44
+ group_by: [
+ {
+ chain: [
+ "y"
+ ]
+ end: 44
+ from_asterisk: False
+ start: 43
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ where: {
+ end: 33
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ op: "in"
+ right: {
+ chain: [
+ "cohort"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 27
+ }
+ start: 22
+ }
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[SELECT_FROM_t_WHERE_x_IN_cohort_ORDER_BY_y-3218ee99]
+ '''
+ {
+ end: 44
+ order_by: [
+ {
+ end: 44
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 44
+ from_asterisk: False
+ start: 43
+ }
+ order: "ASC"
+ start: 43
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ where: {
+ end: 33
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ op: "in"
+ right: {
+ chain: [
+ "cohort"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 27
+ }
+ start: 22
+ }
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[SELECT_a_IN_COHORT_b_FROM_t-5b6fc95a]
+ '''
+ {
+ end: 28
+ select: [
+ {
+ end: 18
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ op: "in"
+ right: {
+ chain: [
+ "COHORT"
+ ]
+ end: 18
+ from_asterisk: False
+ start: 12
+ }
+ start: 7
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 21
+ from_asterisk: False
+ start: 20
+ }
+ ]
+ select_from: {
+ end: 28
+ start: 27
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[SELECT_a_IN_cohort_LIMIT_1-0e687697]
+ '''
+ {
+ end: 26
+ limit: {
+ end: 26
+ start: 25
+ value: 1
+ }
+ select: [
+ {
+ end: 18
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ op: "in"
+ right: {
+ chain: [
+ "cohort"
+ ]
+ end: 18
+ from_asterisk: False
+ start: 12
+ }
+ start: 7
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[a_IN_COHORT-abf737ad]
+ '''
+ {
+ end: 11
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "in"
+ right: {
+ chain: [
+ "COHORT"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[a_IN_COHORT_1-0ff098f0]
+ '''
+ {
+ end: 13
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "in cohort"
+ right: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[a_IN_COHORT_t_id-24a43677]
+ '''
+ {
+ end: 16
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "in cohort"
+ right: {
+ chain: [
+ "t",
+ "id"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 12
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[a_IN_cohort-66d866ad]
+ '''
+ {
+ end: 11
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "in"
+ right: {
+ chain: [
+ "cohort"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[a_IN_cohort_1-d41053ab]
+ '''
+ {
+ end: 15
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "in cohort"
+ right: {
+ end: 15
+ start: 12
+ value: 1
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[a_NOT_IN_COHORT-73603d0e]
+ '''
+ {
+ end: 15
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "not in"
+ right: {
+ chain: [
+ "COHORT"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 9
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_in_cohort_falls_back_to_identifier_when_rhs_missing[a_NOT_IN_COHORT_1-2119868a]
+ '''
+ {
+ end: 17
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "not in cohort"
+ right: {
+ end: 17
+ start: 16
+ value: 1
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_interpolate_as_lambda_value[SELECT_1_ORDER_BY_x_INTERPOLATE_a_AS_5-845448af]
+ '''
+ {
+ end: 40
+ interpolate: [
+ {
+ end: 39
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ start: 33
+ value: {
+ end: 39
+ start: 38
+ value: 5
+ }
+ }
+ ]
+ order_by: [
+ {
+ end: 19
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ order: "ASC"
+ start: 18
+ }
+ ]
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_interpolate_as_lambda_value[SELECT_1_ORDER_BY_x_INTERPOLATE_a_AS_LAMBDA_y_y_1-5beacd77]
+ '''
+ {
+ end: 52
+ interpolate: [
+ {
+ end: 51
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ start: 33
+ value: {
+ args: [
+ "y"
+ ]
+ end: 51
+ expr: {
+ end: 51
+ left: {
+ chain: [
+ "y"
+ ]
+ end: 49
+ from_asterisk: False
+ start: 48
+ }
+ op: "+"
+ right: {
+ end: 51
+ start: 50
+ value: 1
+ }
+ start: 48
+ }
+ start: 38
+ }
+ }
+ ]
+ order_by: [
+ {
+ end: 19
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ order: "ASC"
+ start: 18
+ }
+ ]
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_interpolate_as_lambda_value[SELECT_1_ORDER_BY_x_INTERPOLATE_a_AS_y_y_1-e73f33c6]
+ '''
+ {
+ end: 47
+ interpolate: [
+ {
+ end: 46
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ start: 33
+ value: {
+ args: [
+ "y"
+ ]
+ end: 46
+ expr: {
+ end: 46
+ left: {
+ chain: [
+ "y"
+ ]
+ end: 44
+ from_asterisk: False
+ start: 43
+ }
+ op: "+"
+ right: {
+ end: 46
+ start: 45
+ value: 1
+ }
+ start: 43
+ }
+ start: 38
+ }
+ }
+ ]
+ order_by: [
+ {
+ end: 19
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ order: "ASC"
+ start: 18
+ }
+ ]
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_interpolate_as_lambda_value[SELECT_a_AS_my_alias_FROM_t-76974c76]
+ '''
+ {
+ end: 29
+ select: [
+ {
+ alias: "my alias"
+ end: 22
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ from_asterisk: False
+ hidden: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 29
+ start: 28
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_interpolate_as_lambda_value[SELECT_a_AS_my_alias_FROM_t-b0a69ab5]
+ '''
+ {
+ end: 27
+ select: [
+ {
+ alias: "my_alias"
+ end: 20
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ from_asterisk: False
+ hidden: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 27
+ start: 26
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_interval_combined_string_validates_count_and_unit[INTERVAL_1_DAY-f4d4dc94]
+ '''
+ {
+ args: [
+ {
+ end: 10
+ start: 9
+ value: 1
+ }
+ ]
+ distinct: False
+ end: 14
+ name: "toIntervalDay"
+ start: 0
+ }
+ '''
+# ---
+# name: test_interval_combined_string_validates_count_and_unit[INTERVAL_1_day-166b5a40]
+ '''
+ {
+ args: [
+ {
+ value: 1
+ }
+ ]
+ distinct: False
+ end: 16
+ name: "toIntervalDay"
+ start: 0
+ }
+ '''
+# ---
+# name: test_interval_combined_string_validates_count_and_unit[INTERVAL_1_day-c5454c55]
+ '''
+ {
+ args: [
+ {
+ end: 10
+ start: 9
+ value: 1
+ }
+ ]
+ distinct: False
+ end: 14
+ name: "toIntervalDay"
+ start: 0
+ }
+ '''
+# ---
+# name: test_interval_combined_string_validates_count_and_unit[INTERVAL_5_days-4d8a7675]
+ '''
+ {
+ args: [
+ {
+ value: 5
+ }
+ ]
+ distinct: False
+ end: 17
+ name: "toIntervalDay"
+ start: 0
+ }
+ '''
+# ---
+# name: test_is_only_consumes_known_tails[this_is_a_NONO_string-f306631b]
+ '''
+ {
+ declarations: [
+ {
+ end: 4
+ expr: {
+ chain: [
+ "this"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 0
+ }
+ start: 0
+ },
+ {
+ end: 7
+ expr: {
+ chain: [
+ "is"
+ ]
+ end: 7
+ from_asterisk: False
+ start: 5
+ }
+ start: 5
+ },
+ {
+ end: 9
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ start: 8
+ },
+ {
+ declarations: [
+ {
+ end: 17
+ expr: {
+ args: []
+ distinct: False
+ end: 17
+ name: "NONO"
+ start: 11
+ }
+ start: 11
+ }
+ ]
+ end: 18
+ start: 10
+ },
+ {
+ end: 25
+ expr: {
+ chain: [
+ "string"
+ ]
+ end: 25
+ from_asterisk: False
+ start: 19
+ }
+ start: 19
+ }
+ ]
+ end: 25
+ start: 0
+ }
+ '''
+# ---
+# name: test_is_only_consumes_known_tails[this_is_a_event_string-a7a9952e]
+ '''
+ {
+ declarations: [
+ {
+ end: 4
+ expr: {
+ chain: [
+ "this"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 0
+ }
+ start: 0
+ },
+ {
+ end: 7
+ expr: {
+ chain: [
+ "is"
+ ]
+ end: 7
+ from_asterisk: False
+ start: 5
+ }
+ start: 5
+ },
+ {
+ end: 9
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ start: 8
+ },
+ {
+ declarations: [
+ {
+ end: 16
+ expr: {
+ chain: [
+ "event"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 11
+ }
+ start: 11
+ }
+ ]
+ end: 17
+ start: 10
+ },
+ {
+ end: 24
+ expr: {
+ chain: [
+ "string"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 18
+ }
+ start: 18
+ }
+ ]
+ end: 24
+ start: 0
+ }
+ '''
+# ---
+# name: test_is_only_consumes_known_tails[this_is_a_string-517592df]
+ '''
+ {
+ declarations: [
+ {
+ end: 4
+ expr: {
+ chain: [
+ "this"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 0
+ }
+ start: 0
+ },
+ {
+ end: 7
+ expr: {
+ chain: [
+ "is"
+ ]
+ end: 7
+ from_asterisk: False
+ start: 5
+ }
+ start: 5
+ },
+ {
+ end: 9
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ start: 8
+ },
+ {
+ end: 16
+ expr: {
+ chain: [
+ "string"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 10
+ }
+ start: 10
+ }
+ ]
+ end: 16
+ start: 0
+ }
+ '''
+# ---
+# name: test_is_only_consumes_known_tails[x_is_distinct_from_y-2a0c9ca7]
+ '''
+ {
+ declarations: [
+ {
+ end: 20
+ expr: {
+ end: 20
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ negated: False
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 20
+ start: 0
+ }
+ '''
+# ---
+# name: test_is_only_consumes_known_tails[x_is_not_distinct_from_y-f0f823d6]
+ '''
+ {
+ declarations: [
+ {
+ end: 24
+ expr: {
+ end: 24
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ negated: True
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 24
+ start: 0
+ }
+ '''
+# ---
+# name: test_is_only_consumes_known_tails[x_is_not_null-cfb22d88]
+ '''
+ {
+ declarations: [
+ {
+ end: 13
+ expr: {
+ end: 13
+ is_null_comparison_style: True
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "!="
+ right: {
+
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 13
+ start: 0
+ }
+ '''
+# ---
+# name: test_is_only_consumes_known_tails[x_is_null-61bbe851]
+ '''
+ {
+ declarations: [
+ {
+ end: 9
+ expr: {
+ end: 9
+ is_null_comparison_style: True
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "=="
+ right: {
+
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 9
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_CROSS_JOIN_b-37625177]
+ '''
+ {
+ end: 28
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ end: 28
+ join_type: "CROSS JOIN"
+ start: 27
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_JOIN_b_JOIN_c_JOIN_d_ON_1_ON_2_ON_3-1ba06fe8]
+ '''
+ {
+ end: 51
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 51
+ expr: {
+ end: 51
+ start: 50
+ value: 3
+ }
+ start: 47
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 46
+ expr: {
+ end: 46
+ start: 45
+ value: 2
+ }
+ start: 42
+ }
+ end: 29
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 41
+ expr: {
+ end: 41
+ start: 40
+ value: 1
+ }
+ start: 37
+ }
+ end: 36
+ join_type: "JOIN"
+ start: 35
+ table: {
+ chain: [
+ "d"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ }
+ start: 28
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_JOIN_b_JOIN_c_ON_1-e23ca331]
+ '''
+ {
+ end: 36
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 16
+ next_join: {
+ end: 23
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 36
+ expr: {
+ end: 36
+ start: 35
+ value: 1
+ }
+ start: 32
+ }
+ end: 31
+ join_type: "JOIN"
+ start: 30
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ }
+ start: 22
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ }
+ start: 15
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_JOIN_b_JOIN_c_ON_1_ON_2-784741e7]
+ '''
+ {
+ end: 41
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 41
+ expr: {
+ end: 41
+ start: 40
+ value: 2
+ }
+ start: 37
+ }
+ end: 23
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 35
+ expr: {
+ end: 35
+ start: 34
+ value: 1
+ }
+ start: 31
+ }
+ end: 30
+ join_type: "JOIN"
+ start: 29
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ }
+ start: 22
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_JOIN_b_JOIN_c_ON_1_ON_2-90a5f601]
+ '''
+ {
+ end: 39
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 39
+ expr: {
+ end: 39
+ start: 38
+ value: 2
+ }
+ start: 35
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 34
+ expr: {
+ end: 34
+ start: 33
+ value: 1
+ }
+ start: 30
+ }
+ end: 29
+ join_type: "JOIN"
+ start: 28
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_JOIN_b_ON_1-090ac096]
+ '''
+ {
+ end: 27
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 27
+ expr: {
+ end: 27
+ start: 26
+ value: 1
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_JOIN_b_USING_sample-e8b8b967]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 37
+ expr: {
+ chain: [
+ "sample"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 30
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_JOIN_b_USING_x-8c9198cf]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 32
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_a_LEFT_JOIN_b_ON_1-08904ccf]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 32
+ expr: {
+ end: 32
+ start: 31
+ value: 1
+ }
+ start: 28
+ }
+ end: 27
+ join_type: "LEFT JOIN"
+ start: 26
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_t_USING_SAMPLE_0_5-e0dd68ce]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_constraint_rejected_on_lead_table_and_cross_join[SELECT_FROM_t_USING_SAMPLE_0_5_OFFSET_0_1-6d70757e]
+ '''
+ {
+ end: 43
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_expr_parens_does_not_take_outer_alias[SELECT_1_FROM_SELECT_1-9891e436]
+ '''
+ {
+ end: 24
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 24
+ start: 14
+ table: {
+ end: 23
+ select: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ start: 15
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_expr_parens_does_not_take_outer_alias[SELECT_1_FROM_SELECT_1_AS_x-bdd119a2]
+ '''
+ {
+ end: 29
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ alias: "x"
+ end: 29
+ start: 14
+ table: {
+ end: 23
+ select: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ start: 15
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_expr_parens_does_not_take_outer_alias[SELECT_1_FROM_t-d49fc80b]
+ '''
+ {
+ end: 15
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_expr_parens_does_not_take_outer_alias[SELECT_1_FROM_t_AS_x-a031b8f1]
+ '''
+ {
+ end: 20
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ alias: "x"
+ end: 20
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_on_with_comma_separated_exprs_rejected[SELECT_FROM_a_CROSS_JOIN_b-37625177]
+ '''
+ {
+ end: 28
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ end: 28
+ join_type: "CROSS JOIN"
+ start: 27
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_on_with_comma_separated_exprs_rejected[SELECT_FROM_a_JOIN_b_ON_x-600ead42]
+ '''
+ {
+ end: 27
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 27
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_on_with_comma_separated_exprs_rejected[SELECT_FROM_a_JOIN_b_ON_x_y-654f4c9a]
+ '''
+ {
+ end: 31
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 31
+ expr: {
+ end: 31
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ op: "=="
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 26
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_on_with_comma_separated_exprs_rejected[SELECT_FROM_a_JOIN_b_USING_x_y-09611221]
+ '''
+ {
+ end: 35
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 35
+ expr: {
+ exprs: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ },
+ {
+ chain: [
+ "y"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ ]
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_on_with_comma_separated_exprs_rejected[SELECT_FROM_a_b-c9da183a]
+ '''
+ {
+ end: 18
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ end: 18
+ join_type: "CROSS JOIN"
+ start: 17
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 18
+ from_asterisk: False
+ start: 17
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_ALL_INNER_JOIN_b_ON_1-fa383843]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 37
+ expr: {
+ end: 37
+ start: 36
+ value: 1
+ }
+ start: 33
+ }
+ end: 32
+ join_type: "ALL INNER JOIN"
+ start: 31
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_ASOF_JOIN_b_ON_1-775e3db0]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 32
+ expr: {
+ end: 32
+ start: 31
+ value: 1
+ }
+ start: 28
+ }
+ end: 27
+ join_type: "ASOF INNER JOIN"
+ start: 26
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_ASOF_LEFT_JOIN_b_ON_1-59ea9043]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 37
+ expr: {
+ end: 37
+ start: 36
+ value: 1
+ }
+ start: 33
+ }
+ end: 32
+ join_type: "LEFT ASOF JOIN"
+ start: 31
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_FULL_JOIN_b_ON_1-19821129]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 32
+ expr: {
+ end: 32
+ start: 31
+ value: 1
+ }
+ start: 28
+ }
+ end: 27
+ join_type: "FULL JOIN"
+ start: 26
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_FULL_OUTER_JOIN_b_ON_1-451d0912]
+ '''
+ {
+ end: 38
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 38
+ expr: {
+ end: 38
+ start: 37
+ value: 1
+ }
+ start: 34
+ }
+ end: 33
+ join_type: "FULL OUTER JOIN"
+ start: 32
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_INNER_ALL_JOIN_b_ON_1-8707a208]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 37
+ expr: {
+ end: 37
+ start: 36
+ value: 1
+ }
+ start: 33
+ }
+ end: 32
+ join_type: "ALL INNER JOIN"
+ start: 31
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_INNER_JOIN_b_ON_1-222a2184]
+ '''
+ {
+ end: 33
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 33
+ expr: {
+ end: 33
+ start: 32
+ value: 1
+ }
+ start: 29
+ }
+ end: 28
+ join_type: "INNER JOIN"
+ start: 27
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_JOIN_b_ON_1-2c4497a2]
+ '''
+ {
+ end: 27
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 27
+ expr: {
+ end: 27
+ start: 26
+ value: 1
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_LEFT_JOIN_b_ON_1-1893fb8b]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 32
+ expr: {
+ end: 32
+ start: 31
+ value: 1
+ }
+ start: 28
+ }
+ end: 27
+ join_type: "LEFT JOIN"
+ start: 26
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_LEFT_OUTER_JOIN_b_ON_1-768dda68]
+ '''
+ {
+ end: 38
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 38
+ expr: {
+ end: 38
+ start: 37
+ value: 1
+ }
+ start: 34
+ }
+ end: 33
+ join_type: "LEFT OUTER JOIN"
+ start: 32
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_grammar_alts_validation[SELECT_1_FROM_a_RIGHT_JOIN_b_ON_1-7a717706]
+ '''
+ {
+ end: 33
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 33
+ expr: {
+ end: 33
+ start: 32
+ value: 1
+ }
+ start: 29
+ }
+ end: 28
+ join_type: "RIGHT JOIN"
+ start: 27
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_modifier_arity_validation[SELECT_1_FROM_a_ASOF_ANTI_JOIN_b_ON_1-3944ad41]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 37
+ expr: {
+ end: 37
+ start: 36
+ value: 1
+ }
+ start: 33
+ }
+ end: 32
+ join_type: "ASOF ANTI JOIN"
+ start: 31
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_modifier_arity_validation[SELECT_1_FROM_a_ASOF_JOIN_b_ON_1-775e3db0]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 32
+ expr: {
+ end: 32
+ start: 31
+ value: 1
+ }
+ start: 28
+ }
+ end: 27
+ join_type: "ASOF INNER JOIN"
+ start: 26
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_modifier_arity_validation[SELECT_1_FROM_a_ASOF_LEFT_JOIN_b_ON_1-59ea9043]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 37
+ expr: {
+ end: 37
+ start: 36
+ value: 1
+ }
+ start: 33
+ }
+ end: 32
+ join_type: "LEFT ASOF JOIN"
+ start: 31
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_modifier_arity_validation[SELECT_1_FROM_a_ASOF_SEMI_JOIN_b_ON_1-0ea8f326]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 37
+ expr: {
+ end: 37
+ start: 36
+ value: 1
+ }
+ start: 33
+ }
+ end: 32
+ join_type: "ASOF SEMI JOIN"
+ start: 31
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_join_op_modifier_arity_validation[SELECT_1_FROM_a_SEMI_LEFT_JOIN_b_ON_1-78802495]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 37
+ expr: {
+ end: 37
+ start: 36
+ value: 1
+ }
+ start: 33
+ }
+ end: 32
+ join_type: "LEFT SEMI JOIN"
+ start: 31
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_1_2-0f315ae1]
+ '''
+ {
+ declarations: [
+ {
+ end: 14
+ expr: {
+ end: 14
+ left: {
+ end: 10
+ start: 9
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 14
+ start: 13
+ value: 2
+ }
+ start: 9
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 14
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_1_2_3-9bce406a]
+ '''
+ {
+ declarations: [
+ {
+ end: 12
+ expr: {
+ end: 11
+ start: 10
+ value: 1
+ }
+ name: "x"
+ start: 0
+ },
+ {
+ end: 23
+ left: {
+ args: [
+ {
+ end: 17
+ start: 16
+ value: 2
+ }
+ ]
+ end: 18
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 14
+ from_asterisk: False
+ start: 13
+ }
+ start: 13
+ }
+ right: {
+ end: 23
+ start: 22
+ value: 3
+ }
+ start: 13
+ }
+ ]
+ end: 23
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_1_2_3-9bce4e4e]
+ '''
+ {
+ declarations: [
+ {
+ end: 10
+ expr: {
+ end: 10
+ start: 9
+ value: 1
+ }
+ name: "x"
+ start: 0
+ },
+ {
+ end: 12
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 12
+ from_asterisk: False
+ start: 11
+ }
+ start: 11
+ },
+ {
+ end: 19
+ left: {
+ end: 14
+ start: 13
+ value: 2
+ }
+ right: {
+ end: 19
+ start: 18
+ value: 3
+ }
+ start: 13
+ }
+ ]
+ end: 19
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_y-ebed5a04]
+ '''
+ {
+ declarations: [
+ {
+ end: 10
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 10
+ from_asterisk: False
+ start: 9
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 10
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_y_z-95a8a20b]
+ '''
+ {
+ declarations: [
+ {
+ end: 14
+ expr: {
+ end: 14
+ left: {
+ chain: [
+ "y"
+ ]
+ end: 10
+ from_asterisk: False
+ start: 9
+ }
+ op: "*"
+ right: {
+ chain: [
+ "z"
+ ]
+ end: 14
+ from_asterisk: False
+ start: 13
+ }
+ start: 9
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 14
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_y_z_1-1b60c9ef]
+ '''
+ {
+ declarations: [
+ {
+ end: 19
+ expr: {
+ end: 19
+ left: {
+ chain: [
+ "y"
+ ]
+ end: 10
+ from_asterisk: False
+ start: 9
+ }
+ op: "*"
+ right: {
+ name: "z"
+ value: {
+ end: 19
+ start: 18
+ value: 1
+ }
+ }
+ start: 9
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 20
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_y_z_1-8b4290bc]
+ '''
+ {
+ declarations: [
+ {
+ end: 19
+ expr: {
+ end: 19
+ left: {
+ chain: [
+ "y"
+ ]
+ end: 10
+ from_asterisk: False
+ start: 9
+ }
+ op: "*"
+ right: {
+ name: "z"
+ value: {
+ end: 19
+ start: 18
+ value: 1
+ }
+ }
+ start: 9
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 19
+ start: 0
+ }
+ '''
+# ---
+# name: test_let_decl_shortens_rhs_when_trailing_colon_equals[let_x_y_z_3-f945d94b]
+ '''
+ {
+ declarations: [
+ {
+ end: 10
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 10
+ from_asterisk: False
+ start: 9
+ }
+ name: "x"
+ start: 0
+ },
+ {
+ end: 21
+ left: {
+ args: [
+ {
+ chain: [
+ "z"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ ]
+ end: 16
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 12
+ from_asterisk: False
+ start: 11
+ }
+ start: 11
+ }
+ right: {
+ end: 21
+ start: 20
+ value: 3
+ }
+ start: 11
+ }
+ ]
+ end: 21
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_offset_with_ties_must_precede_offset[SELECT_a_FROM_t_LIMIT_1_2_WITH_TIES-f7bf5a57]
+ '''
+ {
+ end: 36
+ limit: {
+ end: 23
+ start: 22
+ value: 1
+ }
+ limit_with_ties: True
+ offset: {
+ end: 26
+ start: 25
+ value: 2
+ }
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_offset_with_ties_must_precede_offset[SELECT_a_FROM_t_LIMIT_1_WITH_TIES-d856934c]
+ '''
+ {
+ end: 33
+ limit: {
+ end: 23
+ start: 22
+ value: 1
+ }
+ limit_with_ties: True
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_offset_with_ties_must_precede_offset[SELECT_a_FROM_t_LIMIT_1_WITH_TIES_OFFSET_2-0cdd37f3]
+ '''
+ {
+ end: 33
+ limit: {
+ end: 23
+ start: 22
+ value: 1
+ }
+ limit_with_ties: True
+ offset: {
+ end: 42
+ start: 41
+ value: 2
+ }
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_percent_marker_with_compound_body[SELECT_1_LIMIT_1_1_2_WITH_TIES-2bebe3f9]
+ '''
+ {
+ end: 32
+ limit: {
+ end: 22
+ left: {
+ end: 16
+ start: 15
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 22
+ left: {
+ end: 18
+ start: 17
+ value: 1
+ }
+ op: "%"
+ right: {
+ end: 22
+ start: 21
+ value: 2
+ }
+ start: 17
+ }
+ start: 15
+ }
+ limit_with_ties: True
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_percent_marker_with_compound_body[SELECT_1_LIMIT_1_1_OFFSET_3-5f7fcf8b]
+ '''
+ {
+ end: 20
+ limit: {
+ end: 18
+ left: {
+ end: 16
+ start: 15
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 18
+ start: 17
+ value: 1
+ }
+ start: 15
+ }
+ limit_percent: True
+ offset: {
+ end: 29
+ start: 28
+ value: 3
+ }
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_percent_marker_with_compound_body[SELECT_1_LIMIT_1_1_WITH_TIES-2ecff040]
+ '''
+ {
+ end: 30
+ limit: {
+ end: 18
+ left: {
+ end: 16
+ start: 15
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 18
+ start: 17
+ value: 1
+ }
+ start: 15
+ }
+ limit_percent: True
+ limit_with_ties: True
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_percent_marker_with_compound_body[SELECT_1_LIMIT_5_2_3-c597c916]
+ '''
+ {
+ end: 24
+ limit: {
+ end: 24
+ left: {
+ end: 20
+ left: {
+ end: 16
+ start: 15
+ value: 5
+ }
+ op: "%"
+ right: {
+ end: 20
+ start: 19
+ value: 2
+ }
+ start: 15
+ }
+ op: "+"
+ right: {
+ end: 24
+ start: 23
+ value: 3
+ }
+ start: 15
+ }
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_percent_marker_with_compound_body[SELECT_1_LIMIT_a_b_WITH_TIES-0ed4d10b]
+ '''
+ {
+ end: 30
+ limit: {
+ end: 18
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ op: "%"
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 18
+ from_asterisk: False
+ start: 17
+ }
+ start: 15
+ }
+ limit_percent: True
+ limit_with_ties: True
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_limit_percent_marker_with_compound_body[SELECT_a_b_LIMIT_c_AND_d_WITH_TIES-fe6066f2]
+ '''
+ {
+ end: 37
+ limit: {
+ end: 25
+ exprs: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ },
+ {
+ chain: [
+ "d"
+ ]
+ end: 25
+ from_asterisk: False
+ start: 24
+ }
+ ]
+ start: 18
+ }
+ limit_percent: True
+ limit_with_ties: True
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 10
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_INNER_JOIN_b_INNER_JOIN_c_ON_1_ON_1-8897c55f]
+ '''
+ {
+ end: 51
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 51
+ expr: {
+ end: 51
+ start: 50
+ value: 1
+ }
+ start: 47
+ }
+ end: 28
+ join_type: "INNER JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 46
+ expr: {
+ end: 46
+ start: 45
+ value: 1
+ }
+ start: 42
+ }
+ end: 41
+ join_type: "INNER JOIN"
+ start: 40
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 41
+ from_asterisk: False
+ start: 40
+ }
+ }
+ start: 27
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_JOIN_b_JOIN_c_JOIN_d_ON_1_ON_2_ON_3-1ba06fe8]
+ '''
+ {
+ end: 51
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 51
+ expr: {
+ end: 51
+ start: 50
+ value: 3
+ }
+ start: 47
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 46
+ expr: {
+ end: 46
+ start: 45
+ value: 2
+ }
+ start: 42
+ }
+ end: 29
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 41
+ expr: {
+ end: 41
+ start: 40
+ value: 1
+ }
+ start: 37
+ }
+ end: 36
+ join_type: "JOIN"
+ start: 35
+ table: {
+ chain: [
+ "d"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ }
+ start: 28
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_JOIN_b_JOIN_c_ON_1_ON_2-90a5f601]
+ '''
+ {
+ end: 39
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 39
+ expr: {
+ end: 39
+ start: 38
+ value: 2
+ }
+ start: 35
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 34
+ expr: {
+ end: 34
+ start: 33
+ value: 1
+ }
+ start: 30
+ }
+ end: 29
+ join_type: "JOIN"
+ start: 28
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_JOIN_b_JOIN_c_ON_a_x_b_x_ON_b_y_c_y-1fc9cde7]
+ '''
+ {
+ end: 51
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 51
+ expr: {
+ end: 51
+ left: {
+ chain: [
+ "b",
+ "y"
+ ]
+ end: 47
+ from_asterisk: False
+ start: 44
+ }
+ op: "=="
+ right: {
+ chain: [
+ "c",
+ "y"
+ ]
+ end: 51
+ from_asterisk: False
+ start: 48
+ }
+ start: 44
+ }
+ start: 41
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 40
+ expr: {
+ end: 40
+ left: {
+ chain: [
+ "a",
+ "x"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 33
+ }
+ op: "=="
+ right: {
+ chain: [
+ "b",
+ "x"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 37
+ }
+ start: 33
+ }
+ start: 30
+ }
+ end: 29
+ join_type: "JOIN"
+ start: 28
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_JOIN_b_JOIN_c_USING_x_USING_y-f74292d3]
+ '''
+ {
+ end: 49
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 49
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 48
+ from_asterisk: False
+ start: 47
+ }
+ start: 40
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 39
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 38
+ from_asterisk: False
+ start: 37
+ }
+ start: 30
+ }
+ end: 29
+ join_type: "JOIN"
+ start: 28
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_JOIN_b_ON_1-090ac096]
+ '''
+ {
+ end: 27
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 27
+ expr: {
+ end: 27
+ start: 26
+ value: 1
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_JOIN_b_ON_1_JOIN_c_ON_1-852526ab]
+ '''
+ {
+ end: 39
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 27
+ expr: {
+ end: 27
+ start: 26
+ value: 1
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 39
+ expr: {
+ end: 39
+ start: 38
+ value: 1
+ }
+ start: 35
+ }
+ end: 34
+ join_type: "JOIN"
+ start: 33
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_multi_join_with_stacked_on_using_clauses[SELECT_FROM_a_JOIN_b_USING_x-8c9198cf]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 32
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_named_argument_admits_identifier_shaped_keywords[f_false_1-01d3dfe5]
+ '''
+ {
+ args: [
+ {
+ name: "false"
+ value: {
+ end: 12
+ start: 11
+ value: 1
+ }
+ }
+ ]
+ distinct: False
+ end: 13
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_named_argument_admits_identifier_shaped_keywords[f_return_1-2b177743]
+ '''
+ {
+ args: [
+ {
+ name: "return"
+ value: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ }
+ ]
+ distinct: False
+ end: 14
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_named_argument_admits_identifier_shaped_keywords[f_select_1-237dee7e]
+ '''
+ {
+ args: [
+ {
+ name: "select"
+ value: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ }
+ ]
+ distinct: False
+ end: 14
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_named_argument_admits_identifier_shaped_keywords[f_true_1-9b9225aa]
+ '''
+ {
+ args: [
+ {
+ name: "true"
+ value: {
+ end: 11
+ start: 10
+ value: 1
+ }
+ }
+ ]
+ distinct: False
+ end: 12
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_named_argument_admits_identifier_shaped_keywords[f_x_1-76d68c5d]
+ '''
+ {
+ args: [
+ {
+ name: "x"
+ value: {
+ end: 8
+ start: 7
+ value: 1
+ }
+ }
+ ]
+ distinct: False
+ end: 9
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_named_argument_admits_identifier_shaped_keywords[f_x_1-f170cfdf]
+ '''
+ {
+ args: [
+ {
+ name: "x"
+ value: {
+ end: 10
+ start: 9
+ value: 1
+ }
+ }
+ ]
+ distinct: False
+ end: 11
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[NOT_BETWEEN_1_AND_2-28f8fa9b]
+ '''
+ {
+ end: 19
+ expr: {
+ chain: [
+ "NOT"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 0
+ }
+ high: {
+ end: 19
+ start: 18
+ value: 2
+ }
+ low: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ negated: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[NOT_ILIKE_a-d42c9095]
+ '''
+ {
+ end: 13
+ left: {
+ chain: [
+ "NOT"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 0
+ }
+ op: "ilike"
+ right: {
+ end: 13
+ start: 10
+ value: "a"
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[NOT_IN_1-3e4102c7]
+ '''
+ {
+ end: 10
+ expr: {
+ args: [
+ {
+ end: 9
+ start: 8
+ value: 1
+ }
+ ]
+ distinct: False
+ end: 10
+ name: "IN"
+ start: 4
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[NOT_IS_NOT_NULL-78bb4843]
+ '''
+ {
+ end: 15
+ is_null_comparison_style: True
+ left: {
+ chain: [
+ "NOT"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 0
+ }
+ op: "!="
+ right: {
+
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[NOT_IS_NULL-d120f788]
+ '''
+ {
+ end: 11
+ is_null_comparison_style: True
+ left: {
+ chain: [
+ "NOT"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 0
+ }
+ op: "=="
+ right: {
+
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[NOT_LIKE_a-b816a3e9]
+ '''
+ {
+ end: 12
+ left: {
+ chain: [
+ "NOT"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 0
+ }
+ op: "like"
+ right: {
+ end: 12
+ start: 9
+ value: "a"
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[NOT_x-be3cfda7]
+ '''
+ {
+ end: 5
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[not_in_1_2-808a9d9a]
+ '''
+ {
+ end: 12
+ expr: {
+ args: [
+ {
+ end: 9
+ start: 8
+ value: 1
+ },
+ {
+ end: 11
+ start: 10
+ value: 2
+ }
+ ]
+ distinct: False
+ end: 12
+ name: "in"
+ start: 4
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_not_with_keyword_infix_treats_not_as_field[not_like-bf61dc8b]
+ '''
+ {
+ end: 8
+ expr: {
+ chain: [
+ "like"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[fn_f_x_y-6557254c]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: []
+ end: 13
+ start: 11
+ }
+ end: 13
+ name: "f"
+ params: [
+ "x",
+ "y"
+ ]
+ start: 0
+ }
+ ]
+ end: 13
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[for_let_k_v_in_xs-ff6adbac]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: []
+ end: 23
+ start: 21
+ }
+ end: 23
+ expr: {
+ chain: [
+ "xs"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 17
+ }
+ keyVar: "k"
+ start: 0
+ valueVar: "v"
+ }
+ ]
+ end: 23
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[lambda_x_x-745d738b]
+ '''
+ {
+ args: [
+ "x"
+ ]
+ end: 11
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 10
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[let_select_1-f9981ab6]
+ '''
+ {
+ declarations: [
+ {
+ end: 15
+ expr: {
+ end: 15
+ start: 14
+ value: 1
+ }
+ name: "select"
+ start: 0
+ }
+ ]
+ end: 15
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[let_true_1-ffec968f]
+ '''
+ {
+ declarations: [
+ {
+ end: 13
+ expr: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ name: "true"
+ start: 0
+ }
+ ]
+ end: 13
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[try_catch_e-b114740f]
+ '''
+ {
+ declarations: [
+ {
+ catches: [
+ [
+ "e",
+ None,
+ {
+ declarations: []
+ end: 19
+ start: 17
+ }
+ ]
+ ]
+ end: 19
+ start: 0
+ try_stmt: {
+ declarations: []
+ end: 6
+ start: 4
+ }
+ }
+ ]
+ end: 19
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[try_catch_e_T-b7bb3be5]
+ '''
+ {
+ declarations: [
+ {
+ catches: [
+ [
+ "e",
+ "T",
+ {
+ declarations: []
+ end: 22
+ start: 20
+ }
+ ]
+ ]
+ end: 22
+ start: 0
+ try_stmt: {
+ declarations: []
+ end: 6
+ start: 4
+ }
+ }
+ ]
+ end: 22
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[x_x-42a183ac]
+ '''
+ {
+ args: [
+ "x"
+ ]
+ end: 6
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_null_inf_nan_rejected_in_hog_identifier_slots[x_y_x_y-510bd16e]
+ '''
+ {
+ args: [
+ "x",
+ "y"
+ ]
+ end: 15
+ expr: {
+ end: 15
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 10
+ }
+ op: "+"
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ start: 10
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_parse_order_expr_silently_drops_trailing_tokens[a_ASC_extra-7a36de73]
+ '''
+ {
+ end: 5
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ order: "ASC"
+ start: 0
+ }
+ '''
+# ---
+# name: test_parse_order_expr_silently_drops_trailing_tokens[a_DESC_NULLS_FIRST_extra_trailing_junk-19778eda]
+ '''
+ {
+ end: 18
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ order: "DESC"
+ start: 0
+ }
+ '''
+# ---
+# name: test_parse_order_expr_silently_drops_trailing_tokens[a_WITH_FILL_FROM_1_TO_10_INTERPOLATE_b-aa9b4e5f]
+ '''
+ {
+ end: 24
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ order: "ASC"
+ start: 0
+ with_fill: {
+ end: 24
+ from_value: {
+ end: 18
+ start: 17
+ value: 1
+ }
+ start: 2
+ to_value: {
+ end: 24
+ start: 22
+ value: 10
+ }
+ }
+ }
+ '''
+# ---
+# name: test_parse_order_expr_silently_drops_trailing_tokens[a_WITH_FILL_INTERPOLATE_b-836c447f]
+ '''
+ {
+ end: 11
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ order: "ASC"
+ start: 0
+ with_fill: {
+ end: 11
+ start: 2
+ }
+ }
+ '''
+# ---
+# name: test_pivot_binds_to_last_joined_table[select_1_from_a_b_pivot_x_for_y_in_z-9f17d474]
+ '''
+ {
+ end: 41
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ end: 41
+ join_type: "CROSS JOIN"
+ start: 17
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "y"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ values: [
+ {
+ chain: [
+ "z"
+ ]
+ end: 39
+ from_asterisk: False
+ start: 38
+ }
+ ]
+ }
+ ]
+ end: 41
+ start: 17
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 18
+ from_asterisk: False
+ start: 17
+ }
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_binds_to_last_joined_table[select_1_from_a_join_b_on_x_pivot_s_for_t_in_u-e028a672]
+ '''
+ {
+ end: 50
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 50
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "s"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "t"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 41
+ }
+ values: [
+ {
+ chain: [
+ "u"
+ ]
+ end: 48
+ from_asterisk: False
+ start: 47
+ }
+ ]
+ }
+ ]
+ end: 50
+ start: 14
+ table: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 27
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_binds_to_last_joined_table[select_1_from_a_join_b_pivot_x_for_y_in_z-051f23f6]
+ '''
+ {
+ end: 47
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 47
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "y"
+ ]
+ end: 39
+ from_asterisk: False
+ start: 38
+ }
+ values: [
+ {
+ chain: [
+ "z"
+ ]
+ end: 45
+ from_asterisk: False
+ start: 44
+ }
+ ]
+ }
+ ]
+ end: 47
+ start: 14
+ table: {
+ end: 16
+ next_join: {
+ end: 23
+ join_type: "JOIN"
+ start: 22
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ }
+ start: 15
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_binds_to_last_joined_table[select_1_from_a_join_b_pivot_x_for_y_in_z-1644fdca]
+ '''
+ {
+ end: 45
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ end: 45
+ join_type: "JOIN"
+ start: 21
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "y"
+ ]
+ end: 37
+ from_asterisk: False
+ start: 36
+ }
+ values: [
+ {
+ chain: [
+ "z"
+ ]
+ end: 43
+ from_asterisk: False
+ start: 42
+ }
+ ]
+ }
+ ]
+ end: 45
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b-fe466c4c]
+ '''
+ {
+ end: 37
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 37
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ ]
+ }
+ ]
+ end: 37
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_AND_c_IN_d-5f5b44b7]
+ '''
+ {
+ end: 50
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 50
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 42
+ exprs: [
+ {
+ end: 36
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ op: "in"
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ start: 28
+ },
+ {
+ chain: [
+ "c"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 41
+ }
+ ]
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 48
+ from_asterisk: False
+ start: 47
+ }
+ ]
+ }
+ ]
+ end: 50
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_IN_d-2d53f730]
+ '''
+ {
+ end: 44
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 44
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 36
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ op: "in"
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 41
+ }
+ ]
+ }
+ ]
+ end: 44
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_LIKE_c_IN_d-9cfbb7ae]
+ '''
+ {
+ end: 51
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 51
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 43
+ left: {
+ end: 36
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ op: "in"
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ start: 28
+ }
+ op: "like"
+ right: {
+ chain: [
+ "c"
+ ]
+ end: 43
+ from_asterisk: False
+ start: 42
+ }
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 49
+ from_asterisk: False
+ start: 48
+ }
+ ]
+ }
+ ]
+ end: 51
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_NOT_IN_d-0d7489c3]
+ '''
+ {
+ end: 48
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 48
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ ]
+ },
+ {
+ column: {
+ chain: [
+ "NOT"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 37
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 46
+ from_asterisk: False
+ start: 45
+ }
+ ]
+ }
+ ]
+ end: 48
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_c_IN_d-735a963e]
+ '''
+ {
+ end: 48
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 48
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 40
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ op: "in"
+ right: {
+ end: 40
+ left: {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ op: "+"
+ right: {
+ chain: [
+ "c"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 39
+ }
+ start: 33
+ }
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 46
+ from_asterisk: False
+ start: 45
+ }
+ ]
+ }
+ ]
+ end: 48
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_c_IN_d-8266a7d7]
+ '''
+ {
+ end: 46
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 46
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ ]
+ },
+ {
+ column: {
+ chain: [
+ "c"
+ ]
+ end: 38
+ from_asterisk: False
+ start: 37
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 44
+ from_asterisk: False
+ start: 43
+ }
+ ]
+ }
+ ]
+ end: 46
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_c_IN_d-adc8f373]
+ '''
+ {
+ end: 48
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 48
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 40
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ op: "in"
+ right: {
+ args: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 39
+ from_asterisk: False
+ start: 38
+ }
+ ]
+ end: 40
+ expr: {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ start: 33
+ }
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 46
+ from_asterisk: False
+ start: 45
+ }
+ ]
+ }
+ ]
+ end: 48
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_c_IN_d-de1aef9e]
+ '''
+ {
+ end: 48
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 48
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 40
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ op: "in"
+ right: {
+ end: 40
+ left: {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ op: "*"
+ right: {
+ chain: [
+ "c"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 39
+ }
+ start: 33
+ }
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 46
+ from_asterisk: False
+ start: 45
+ }
+ ]
+ }
+ ]
+ end: 48
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_column_lhs_extends_past_in_via_infix_operators[SELECT_FROM_t_PIVOT_1_FOR_a_IN_b_c_IN_d_e_IN_f-9e9453e9]
+ '''
+ {
+ end: 55
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 55
+ start: 14
+ table: {
+ aggregates: [
+ {
+ end: 23
+ start: 22
+ value: 1
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "a"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ }
+ values: [
+ {
+ chain: [
+ "b"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ ]
+ },
+ {
+ column: {
+ chain: [
+ "c"
+ ]
+ end: 38
+ from_asterisk: False
+ start: 37
+ }
+ values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 44
+ from_asterisk: False
+ start: 43
+ }
+ ]
+ },
+ {
+ column: {
+ chain: [
+ "e"
+ ]
+ end: 47
+ from_asterisk: False
+ start: 46
+ }
+ values: [
+ {
+ chain: [
+ "f"
+ ]
+ end: 53
+ from_asterisk: False
+ start: 52
+ }
+ ]
+ }
+ ]
+ end: 55
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_group_by_with_empty_list_rejected[SELECT_FROM_t_PIVOT_sum_a_FOR_b_IN_1-92abf443]
+ '''
+ {
+ end: 42
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 42
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ ]
+ distinct: False
+ end: 28
+ name: "sum"
+ start: 22
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ values: [
+ {
+ end: 40
+ start: 39
+ value: 1
+ }
+ ]
+ }
+ ]
+ end: 42
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_group_by_with_empty_list_rejected[SELECT_FROM_t_PIVOT_sum_a_FOR_b_IN_1_GROUP_BY_a-44a5efbd]
+ '''
+ {
+ end: 53
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 53
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ ]
+ distinct: False
+ end: 28
+ name: "sum"
+ start: 22
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ values: [
+ {
+ end: 40
+ start: 39
+ value: 1
+ }
+ ]
+ }
+ ]
+ end: 53
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 52
+ from_asterisk: False
+ start: 51
+ }
+ ]
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_group_by_with_empty_list_rejected[SELECT_FROM_t_PIVOT_sum_a_FOR_b_IN_1_GROUP_BY_a-6b2df146]
+ '''
+ {
+ end: 54
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 54
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ ]
+ distinct: False
+ end: 28
+ name: "sum"
+ start: 22
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ values: [
+ {
+ end: 40
+ start: 39
+ value: 1
+ }
+ ]
+ }
+ ]
+ end: 54
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 52
+ from_asterisk: False
+ start: 51
+ }
+ ]
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_group_by_with_empty_list_rejected[SELECT_FROM_t_PIVOT_sum_a_FOR_b_IN_1_GROUP_BY_a_c-7c40cf6d]
+ '''
+ {
+ end: 56
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 56
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ ]
+ distinct: False
+ end: 28
+ name: "sum"
+ start: 22
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ values: [
+ {
+ end: 40
+ start: 39
+ value: 1
+ }
+ ]
+ }
+ ]
+ end: 56
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 52
+ from_asterisk: False
+ start: 51
+ },
+ {
+ chain: [
+ "c"
+ ]
+ end: 55
+ from_asterisk: False
+ start: 54
+ }
+ ]
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_in_list_must_be_non_empty[SELECT_1_FROM_t_PIVOT_sum_x_FOR_y_IN_1_2-60b4ee23]
+ '''
+ {
+ end: 46
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 46
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ ]
+ distinct: False
+ end: 29
+ name: "sum"
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "y"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ values: [
+ {
+ end: 41
+ start: 40
+ value: 1
+ },
+ {
+ end: 44
+ start: 43
+ value: 2
+ }
+ ]
+ }
+ ]
+ end: 46
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_in_separator_extends_via_postfix_call[SELECT_1_FROM_t_PIVOT_s_FOR_a_IN_1_b_IN_2-3fe2971b]
+ '''
+ {
+ end: 47
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 47
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "s"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "a"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ values: [
+ {
+ end: 36
+ start: 35
+ value: 1
+ }
+ ]
+ },
+ {
+ column: {
+ chain: [
+ "b"
+ ]
+ end: 39
+ from_asterisk: False
+ start: 38
+ }
+ values: [
+ {
+ end: 45
+ start: 44
+ value: 2
+ }
+ ]
+ }
+ ]
+ end: 47
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_in_separator_extends_via_postfix_call[SELECT_1_FROM_t_PIVOT_sum_x_FOR_y_IN_1_2-60b4ee23]
+ '''
+ {
+ end: 46
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 46
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ ]
+ distinct: False
+ end: 29
+ name: "sum"
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "y"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ values: [
+ {
+ end: 41
+ start: 40
+ value: 1
+ },
+ {
+ end: 44
+ start: 43
+ value: 2
+ }
+ ]
+ }
+ ]
+ end: 46
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_in_separator_extends_via_postfix_call[SELECT_1_FROM_t_PIVOT_sum_x_FOR_y_IN_1_2_IN_3-7f8c6fd3]
+ '''
+ {
+ end: 54
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 54
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ ]
+ distinct: False
+ end: 29
+ name: "sum"
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 46
+ left: {
+ chain: [
+ "y"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ op: "in"
+ right: {
+ args: [
+ {
+ end: 45
+ start: 44
+ value: 2
+ }
+ ]
+ end: 46
+ expr: {
+ end: 41
+ start: 40
+ value: 1
+ }
+ start: 39
+ }
+ start: 34
+ }
+ values: [
+ {
+ end: 52
+ start: 51
+ value: 3
+ }
+ ]
+ }
+ ]
+ end: 54
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_in_separator_extends_via_postfix_call[SELECT_1_FROM_t_PIVOT_sum_x_FOR_y_z_IN_a_b_c_d-7fbea046]
+ '''
+ {
+ end: 61
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 61
+ start: 14
+ table: {
+ aggregates: [
+ {
+ args: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 27
+ }
+ ]
+ distinct: False
+ end: 29
+ name: "sum"
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ exprs: [
+ {
+ chain: [
+ "y"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ },
+ {
+ chain: [
+ "z"
+ ]
+ end: 39
+ from_asterisk: False
+ start: 38
+ }
+ ]
+ }
+ values: [
+ {
+ end: 51
+ exprs: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 47
+ from_asterisk: False
+ start: 46
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 50
+ from_asterisk: False
+ start: 49
+ }
+ ]
+ start: 45
+ },
+ {
+ end: 59
+ exprs: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 55
+ from_asterisk: False
+ start: 54
+ },
+ {
+ chain: [
+ "d"
+ ]
+ end: 58
+ from_asterisk: False
+ start: 57
+ }
+ ]
+ start: 53
+ }
+ ]
+ }
+ ]
+ end: 61
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_operand_containing_in[select_1_from_a_pivot_m_for_n_in_p_in_r-0cd889f0]
+ '''
+ {
+ end: 43
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 43
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "m"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ end: 35
+ left: {
+ chain: [
+ "n"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ op: "in"
+ right: {
+ chain: [
+ "p"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "r"
+ ]
+ end: 41
+ from_asterisk: False
+ start: 40
+ }
+ ]
+ }
+ ]
+ end: 43
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_operand_containing_in[select_1_from_a_pivot_m_for_n_in_r-c7281452]
+ '''
+ {
+ end: 38
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 38
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "m"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ chain: [
+ "n"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "r"
+ ]
+ end: 36
+ from_asterisk: False
+ start: 35
+ }
+ ]
+ }
+ ]
+ end: 38
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_operand_containing_in[select_1_from_a_unpivot_m_for_n_in_p_in_r-abba6578]
+ '''
+ {
+ end: 45
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 45
+ start: 14
+ table: {
+ columns: [
+ {
+ name_columns: {
+ end: 37
+ left: {
+ chain: [
+ "n"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ op: "in"
+ right: {
+ chain: [
+ "p"
+ ]
+ end: 37
+ from_asterisk: False
+ start: 36
+ }
+ start: 31
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "r"
+ ]
+ end: 43
+ from_asterisk: False
+ start: 42
+ }
+ ]
+ value_columns: {
+ chain: [
+ "m"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ }
+ ]
+ end: 45
+ include_nulls: False
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_operand_containing_in[select_1_from_a_unpivot_m_in_n_for_p_in_r-a7452485]
+ '''
+ {
+ end: 45
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 45
+ start: 14
+ table: {
+ columns: [
+ {
+ name_columns: {
+ chain: [
+ "p"
+ ]
+ end: 37
+ from_asterisk: False
+ start: 36
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "r"
+ ]
+ end: 43
+ from_asterisk: False
+ start: 42
+ }
+ ]
+ value_columns: {
+ end: 31
+ left: {
+ chain: [
+ "m"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ op: "in"
+ right: {
+ chain: [
+ "n"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 25
+ }
+ }
+ ]
+ end: 45
+ include_nulls: False
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_tuple_or_single_operand_with_postfix[select_1_from_a_pivot_m_for_n_in_p-2d2412dc]
+ '''
+ {
+ end: 42
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 42
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "m"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ args: []
+ end: 34
+ expr: {
+ chain: [
+ "n"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 29
+ }
+ values: [
+ {
+ chain: [
+ "p"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 39
+ }
+ ]
+ }
+ ]
+ end: 42
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_tuple_or_single_operand_with_postfix[select_1_from_a_unpivot_m_for_n_in_p-4464d6f9]
+ '''
+ {
+ end: 44
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 44
+ start: 14
+ table: {
+ columns: [
+ {
+ name_columns: {
+ args: []
+ end: 36
+ expr: {
+ chain: [
+ "n"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ start: 31
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "p"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 41
+ }
+ ]
+ value_columns: {
+ chain: [
+ "m"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ }
+ ]
+ end: 44
+ include_nulls: False
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_tuple_or_single_operand_with_postfix[select_1_from_a_unpivot_m_for_n_in_p-ed0a0a80]
+ '''
+ {
+ end: 42
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 42
+ start: 14
+ table: {
+ columns: [
+ {
+ name_columns: {
+ exprs: [
+ {
+ chain: [
+ "n"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ ]
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "p"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 39
+ }
+ ]
+ value_columns: {
+ chain: [
+ "m"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ }
+ ]
+ end: 42
+ include_nulls: False
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_tuple_or_single_parenthesised_operand[select_1_from_a_pivot_s_for_c_in_1-d1a6453e]
+ '''
+ {
+ end: 40
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 40
+ start: 14
+ table: {
+ aggregates: [
+ {
+ chain: [
+ "s"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ columns: [
+ {
+ column: {
+ exprs: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ ]
+ }
+ values: [
+ {
+ end: 38
+ start: 37
+ value: 1
+ }
+ ]
+ }
+ ]
+ end: 40
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_pivot_tuple_or_single_parenthesised_operand[select_1_from_a_unpivot_x_for_c_in_d-f259cf62]
+ '''
+ {
+ end: 44
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 44
+ start: 14
+ table: {
+ columns: [
+ {
+ name_columns: {
+ exprs: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ ]
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 41
+ }
+ ]
+ value_columns: {
+ exprs: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ ]
+ }
+ }
+ ]
+ end: 44
+ include_nulls: False
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_as_alias_inside_call_args[f_x_as_a_y_as_b-851531bc]
+ '''
+ {
+ args: [
+ {
+ alias: "a"
+ end: 10
+ expr: {
+ end: 5
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 3
+ }
+ start: 2
+ }
+ from_asterisk: False
+ hidden: False
+ start: 2
+ },
+ {
+ alias: "b"
+ end: 20
+ expr: {
+ end: 15
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 14
+ from_asterisk: False
+ start: 13
+ }
+ start: 12
+ }
+ from_asterisk: False
+ hidden: False
+ start: 12
+ }
+ ]
+ distinct: False
+ end: 21
+ name: "f"
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_as_alias_inside_call_args[has_x_as_a-f3b2e01e]
+ '''
+ {
+ args: [
+ {
+ alias: "a"
+ end: 12
+ expr: {
+ end: 7
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 4
+ }
+ from_asterisk: False
+ hidden: False
+ start: 4
+ }
+ ]
+ distinct: False
+ end: 13
+ name: "has"
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_as_alias_inside_call_args[has_x_as_a_y-ae91273b]
+ '''
+ {
+ args: [
+ {
+ alias: "a"
+ end: 12
+ expr: {
+ end: 7
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 4
+ }
+ from_asterisk: False
+ hidden: False
+ start: 4
+ },
+ {
+ chain: [
+ "y"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ ]
+ distinct: False
+ end: 16
+ name: "has"
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_as_alias_inside_call_args[if_has_x_as_x_y_x-a694ffea]
+ '''
+ {
+ args: [
+ {
+ args: [
+ {
+ alias: "_x"
+ end: 16
+ expr: {
+ end: 10
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ start: 7
+ }
+ from_asterisk: False
+ hidden: False
+ start: 7
+ },
+ {
+ end: 21
+ expr: {
+ chain: [
+ "y"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ }
+ start: 18
+ }
+ ]
+ distinct: False
+ end: 22
+ name: "has"
+ start: 3
+ },
+ {
+ chain: [
+ "_x"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 24
+ },
+ {
+ end: 30
+ exprs: []
+ start: 28
+ }
+ ]
+ distinct: False
+ end: 31
+ name: "if"
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_statement_then_postfix_call_or_property[1-26a9fdff]
+ '''
+ {
+ declarations: [
+ {
+ declarations: [
+ {
+ end: 7
+ expr: {
+ args: []
+ end: 7
+ expr: {
+ end: 5
+ expr: {
+ end: 4
+ start: 3
+ value: 1
+ }
+ start: 2
+ }
+ start: 2
+ }
+ start: 2
+ }
+ ]
+ end: 9
+ start: 0
+ }
+ ]
+ end: 9
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_statement_then_postfix_call_or_property[1-eb21f035]
+ '''
+ {
+ declarations: [
+ {
+ end: 5
+ expr: {
+ args: []
+ end: 5
+ expr: {
+ end: 3
+ expr: {
+ end: 2
+ start: 1
+ value: 1
+ }
+ start: 0
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 5
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_statement_then_postfix_call_or_property[1_x-b7ad756f]
+ '''
+ {
+ declarations: [
+ {
+ end: 5
+ expr: {
+ array: {
+ end: 3
+ expr: {
+ end: 2
+ start: 1
+ value: 1
+ }
+ start: 0
+ }
+ end: 5
+ nullish: False
+ property: {
+ value: "x"
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 5
+ start: 0
+ }
+ '''
+# ---
+# name: test_placeholder_statement_then_postfix_call_or_property[a-8c11fbbf]
+ '''
+ {
+ declarations: [
+ {
+ end: 5
+ expr: {
+ args: []
+ end: 5
+ expr: {
+ end: 3
+ expr: {
+ chain: [
+ "a"
+ ]
+ end: 2
+ from_asterisk: False
+ start: 1
+ }
+ start: 0
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 5
+ start: 0
+ }
+ '''
+# ---
+# name: test_quoted_identifier_backslash_escapes[1201cd03]
+ '''
+ {
+ chain: [
+ "\""
+ ]
+ end: 4
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_quoted_identifier_backslash_escapes[60ac401f]
+ '''
+ {
+ chain: [
+ "\\"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_quoted_identifier_backslash_escapes[a-7b3ce68b]
+ '''
+ {
+ chain: [
+ "a"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_quoted_identifier_backslash_escapes[a_b-97174e0c]
+ '''
+ {
+ chain: [
+ "a\"b"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_raw_type_param_text_rejects_null_inf_nan_keywords[cast_x_as_Array_Int-b2f1741f]
+ '''
+ {
+ end: 21
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "array(int)"
+ }
+ '''
+# ---
+# name: test_raw_type_param_text_rejects_null_inf_nan_keywords[cast_x_as_Decimal_10_2-f3f09ba9]
+ '''
+ {
+ end: 25
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "decimal(10, 2)"
+ }
+ '''
+# ---
+# name: test_raw_type_param_text_rejects_null_inf_nan_keywords[cast_x_as_FixedString_16-fad8a777]
+ '''
+ {
+ end: 26
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "fixedstring(16)"
+ }
+ '''
+# ---
+# name: test_raw_type_param_text_rejects_null_inf_nan_keywords[cast_x_as_Map_String_Int-fcaa3e58]
+ '''
+ {
+ end: 27
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "map(string, int)"
+ }
+ '''
+# ---
+# name: test_raw_type_param_text_rejects_null_inf_nan_keywords[cast_x_as_Nested_a_Int_b_String-fe7b24f8]
+ '''
+ {
+ end: 34
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "nested(a int, b string)"
+ }
+ '''
+# ---
+# name: test_raw_type_param_text_rejects_null_inf_nan_keywords[cast_x_as_Tuple_Int_String-7eae9c39]
+ '''
+ {
+ end: 29
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 5
+ }
+ start: 0
+ type_name: "tuple(int, string)"
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return-334bc128]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 17
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ start: 9
+ }
+ ]
+ end: 19
+ start: 7
+ }
+ end: 19
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 19
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return_X_Y-bd17e5f3]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 22
+ expr: {
+ name: "X"
+ value: {
+ chain: [
+ "Y"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 9
+ }
+ ]
+ end: 24
+ start: 7
+ }
+ end: 24
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 24
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return_a_b_c-f9ead1cd]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 15
+ start: 9
+ },
+ {
+ end: 24
+ left: {
+ chain: [
+ "a",
+ "b"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 16
+ }
+ right: {
+ chain: [
+ "c"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ start: 16
+ }
+ ]
+ end: 26
+ start: 7
+ }
+ end: 26
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 26
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return_columns_a-1fd49d55]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 29
+ expr: {
+ end: 29
+ expr: {
+ all_columns: False
+ regex: "a"
+ }
+ start: 16
+ }
+ start: 9
+ }
+ ]
+ end: 31
+ start: 7
+ }
+ end: 31
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 31
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return_columns_a_columns_b-08d0d995]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 23
+ expr: {
+ chain: [
+ "columns"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 16
+ }
+ start: 9
+ },
+ {
+ end: 44
+ left: {
+ end: 27
+ start: 24
+ value: "a"
+ }
+ right: {
+ all_columns: False
+ end: 44
+ regex: "b"
+ start: 32
+ }
+ start: 23
+ }
+ ]
+ end: 46
+ start: 7
+ }
+ end: 46
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 46
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return_columns_a_columns_b-93a42a1a]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 17
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ start: 9
+ },
+ {
+ end: 46
+ left: {
+ all_columns: False
+ end: 30
+ regex: "a"
+ start: 18
+ }
+ right: {
+ all_columns: False
+ end: 46
+ regex: "b"
+ start: 34
+ }
+ start: 18
+ }
+ ]
+ end: 48
+ start: 7
+ }
+ end: 48
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 48
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return_x_y-30e824f7]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 17
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ start: 9
+ },
+ {
+ end: 23
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 18
+ from_asterisk: False
+ start: 17
+ }
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 23
+ from_asterisk: False
+ start: 22
+ }
+ start: 17
+ }
+ ]
+ end: 25
+ start: 7
+ }
+ end: 25
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 25
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortened_when_assignment_follows[fn_f_return_x_y-fe2746c8]
+ '''
+ {
+ declarations: [
+ {
+ body: {
+ declarations: [
+ {
+ end: 17
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ start: 9
+ },
+ {
+ end: 24
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ }
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ start: 18
+ }
+ ]
+ end: 26
+ start: 7
+ }
+ end: 26
+ name: "f"
+ params: []
+ start: 0
+ }
+ ]
+ end: 26
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return-63143b6f]
+ '''
+ {
+ declarations: [
+ {
+ end: 6
+ start: 0
+ }
+ ]
+ end: 6
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_1_2-e412f6a7]
+ '''
+ {
+ declarations: [
+ {
+ end: 12
+ expr: {
+ end: 12
+ left: {
+ end: 8
+ start: 7
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 12
+ start: 11
+ value: 2
+ }
+ start: 7
+ }
+ start: 0
+ }
+ ]
+ end: 12
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_a_1-57ea5c7b]
+ '''
+ {
+ declarations: [
+ {
+ end: 13
+ expr: {
+ name: "a"
+ value: {
+ end: 13
+ start: 12
+ value: 1
+ }
+ }
+ start: 0
+ }
+ ]
+ end: 13
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_a_b_1-a74d108b]
+ '''
+ {
+ declarations: [
+ {
+ end: 6
+ start: 0
+ },
+ {
+ end: 15
+ left: {
+ chain: [
+ "a",
+ "b"
+ ]
+ end: 10
+ from_asterisk: False
+ start: 7
+ }
+ right: {
+ end: 15
+ start: 14
+ value: 1
+ }
+ start: 7
+ }
+ ]
+ end: 15
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_columns_a_1-ae27f3ae]
+ '''
+ {
+ declarations: [
+ {
+ end: 8
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ start: 0
+ },
+ {
+ end: 26
+ left: {
+ all_columns: False
+ end: 21
+ regex: "a"
+ start: 9
+ }
+ right: {
+ end: 26
+ start: 25
+ value: 1
+ }
+ start: 9
+ }
+ ]
+ end: 26
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_columns_a_1-d5322ce8]
+ '''
+ {
+ declarations: [
+ {
+ end: 14
+ expr: {
+ chain: [
+ "columns"
+ ]
+ end: 14
+ from_asterisk: False
+ start: 7
+ }
+ start: 0
+ },
+ {
+ end: 24
+ left: {
+ end: 18
+ start: 15
+ value: "a"
+ }
+ right: {
+ end: 24
+ start: 23
+ value: 1
+ }
+ start: 14
+ }
+ ]
+ end: 24
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_return_e-5cd47b32]
+ '''
+ {
+ declarations: [
+ {
+ end: 13
+ expr: {
+ chain: [
+ "return"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 7
+ }
+ start: 0
+ },
+ {
+ end: 30
+ left: {
+ args: [
+ {
+ end: 21
+ start: 18
+ value: "e"
+ }
+ ]
+ end: 23
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ start: 14
+ }
+ right: {
+ end: 30
+ items: []
+ start: 27
+ }
+ start: 14
+ }
+ ]
+ end: 30
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_return_e_e-5fad3d57]
+ '''
+ {
+ declarations: [
+ {
+ end: 13
+ expr: {
+ chain: [
+ "return"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 7
+ }
+ start: 0
+ },
+ {
+ end: 34
+ left: {
+ args: [
+ {
+ end: 21
+ start: 18
+ value: "e"
+ }
+ ]
+ end: 23
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ start: 14
+ }
+ right: {
+ end: 32
+ start: 29
+ value: "e"
+ }
+ start: 14
+ }
+ ]
+ end: 34
+ start: 0
+ }
+ '''
+# ---
+# name: test_return_expr_prefix_shortening_admits_keyword_head[return_x-03c38773]
+ '''
+ {
+ declarations: [
+ {
+ end: 8
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ start: 0
+ }
+ ]
+ end: 8
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_leading_dot_float_value[SELECT_1_FROM_t_SAMPLE_04-f4662500]
+ '''
+ {
+ end: 26
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 26
+ sample: {
+ end: 26
+ sample_value: {
+ end: 26
+ left: {
+ end: 26
+ start: 23
+ value: 0.04
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_leading_dot_float_value[SELECT_1_FROM_t_SAMPLE_1_04-ca63d0e6]
+ '''
+ {
+ end: 30
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 30
+ sample: {
+ end: 30
+ sample_value: {
+ end: 30
+ left: {
+ end: 24
+ start: 23
+ value: 1
+ }
+ right: {
+ end: 30
+ start: 27
+ value: 0.04
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_leading_dot_float_value[SELECT_1_FROM_t_SAMPLE_5-4a7ed32a]
+ '''
+ {
+ end: 25
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 25
+ sample: {
+ end: 25
+ sample_value: {
+ end: 25
+ left: {
+ end: 25
+ start: 23
+ value: 0.5
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_leading_dot_float_value[SELECT_1_FROM_t_SAMPLE_5_2-2ab956c8]
+ '''
+ {
+ end: 29
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 29
+ sample: {
+ end: 29
+ sample_value: {
+ end: 29
+ left: {
+ end: 25
+ start: 23
+ value: 0.5
+ }
+ right: {
+ end: 29
+ start: 28
+ value: 2
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_only_accepts_number_literals[SELECT_FROM_t_SAMPLE_0_5-aacda7ba]
+ '''
+ {
+ end: 26
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 26
+ sample: {
+ end: 26
+ sample_value: {
+ end: 26
+ left: {
+ end: 26
+ start: 23
+ value: 0.5
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_only_accepts_number_literals[SELECT_FROM_t_SAMPLE_1-a6cf0536]
+ '''
+ {
+ end: 24
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 24
+ sample: {
+ end: 24
+ sample_value: {
+ end: 24
+ left: {
+ end: 24
+ start: 23
+ value: 1
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_only_accepts_number_literals[SELECT_FROM_t_SAMPLE_1_2-ec47e6c8]
+ '''
+ {
+ end: 26
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 26
+ sample: {
+ end: 26
+ sample_value: {
+ end: 26
+ left: {
+ end: 24
+ start: 23
+ value: 1
+ }
+ right: {
+ end: 26
+ start: 25
+ value: 2
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_only_accepts_number_literals[SELECT_FROM_t_SAMPLE_1_OFFSET_2-7fea90c3]
+ '''
+ {
+ end: 33
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 33
+ sample: {
+ end: 33
+ offset_value: {
+ end: 33
+ left: {
+ end: 33
+ start: 32
+ value: 2
+ }
+ start: 32
+ }
+ sample_value: {
+ end: 24
+ left: {
+ end: 24
+ start: 23
+ value: 1
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_sample_clause_only_accepts_number_literals[SELECT_FROM_t_SAMPLE_p-97eb2593]
+ '''
+ {
+ end: 26
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 26
+ sample: {
+ end: 26
+ sample_value: {
+ end: 26
+ expr: {
+ chain: [
+ "p"
+ ]
+ end: 25
+ from_asterisk: False
+ start: 24
+ }
+ start: 23
+ }
+ start: 16
+ }
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_set_level_offset_compound_body[select_1_offset_a_b-4f5723bc]
+ '''
+ {
+ end: 9
+ offset: {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 19
+ from_asterisk: False
+ start: 18
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ }
+ ]
+ distinct: False
+ end: 24
+ name: "ifNull"
+ start: 18
+ }
+ select: [
+ {
+ end: 9
+ start: 8
+ value: 1
+ }
+ ]
+ start: 1
+ }
+ '''
+# ---
+# name: test_set_level_offset_compound_body[select_1_offset_a_ignore_nulls-5e3b6dec]
+ '''
+ {
+ end: 30
+ offset: {
+ chain: [
+ "a"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ }
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_set_level_offset_compound_body[select_1_offset_a_or_b-976e55ce]
+ '''
+ {
+ end: 22
+ offset: {
+ end: 22
+ exprs: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 17
+ from_asterisk: False
+ start: 16
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ ]
+ start: 16
+ }
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_expression_pratt_recovers_at_statement_level[2-10daa299]
+ '''
+ {
+ declarations: [
+ {
+ end: 1
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ start: 0
+ },
+ {
+ end: 3
+ expr: {
+ end: 3
+ start: 2
+ value: 2
+ }
+ start: 2
+ }
+ ]
+ end: 3
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_expression_pratt_recovers_at_statement_level[2-760365c8]
+ '''
+ {
+ declarations: [
+ {
+ end: 5
+ expr: {
+ end: 5
+ left: {
+ chain: [
+ "*"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "=="
+ right: {
+ end: 5
+ start: 4
+ value: 2
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 5
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_expression_pratt_recovers_at_statement_level[let_x_1_x_2-c2354d8b]
+ '''
+ {
+ declarations: [
+ {
+ end: 10
+ expr: {
+ end: 10
+ start: 9
+ value: 1
+ }
+ name: "x"
+ start: 0
+ },
+ {
+ end: 13
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ start: 12
+ },
+ {
+ end: 19
+ expr: {
+ end: 18
+ left: {
+ chain: [
+ "*"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ op: "=="
+ right: {
+ end: 18
+ start: 17
+ value: 2
+ }
+ start: 14
+ }
+ start: 14
+ }
+ ]
+ end: 19
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_expression_pratt_recovers_at_statement_level[x_2-0f4135a6]
+ '''
+ {
+ declarations: [
+ {
+ end: 1
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ start: 0
+ },
+ {
+ end: 7
+ expr: {
+ end: 7
+ left: {
+ chain: [
+ "*"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 2
+ }
+ op: "=="
+ right: {
+ end: 7
+ start: 6
+ value: 2
+ }
+ start: 2
+ }
+ start: 2
+ }
+ ]
+ end: 7
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_expression_pratt_recovers_at_statement_level[x_2-458f1b10]
+ '''
+ {
+ declarations: [
+ {
+ end: 5
+ expr: {
+ end: 5
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "=="
+ right: {
+ end: 5
+ start: 4
+ value: 2
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 5
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_expression_pratt_recovers_at_statement_level[x_2-9a354abc]
+ '''
+ {
+ declarations: [
+ {
+ end: 1
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ start: 0
+ },
+ {
+ end: 6
+ expr: {
+ end: 6
+ left: {
+ chain: [
+ "*"
+ ]
+ end: 3
+ from_asterisk: False
+ start: 2
+ }
+ op: "=="
+ right: {
+ end: 6
+ start: 5
+ value: 2
+ }
+ start: 2
+ }
+ start: 2
+ }
+ ]
+ end: 6
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_expression_pratt_recovers_at_statement_level[x_y-d5aea7e4]
+ '''
+ {
+ declarations: [
+ {
+ end: 5
+ expr: {
+ end: 5
+ left: {
+ chain: [
+ "x"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ op: "*"
+ right: {
+ chain: [
+ "y"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ start: 0
+ }
+ start: 0
+ }
+ ]
+ end: 5
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[a-740edf0a]
+ '''
+ {
+ declarations: [
+ {
+ end: 7
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ right: {
+ end: 7
+ items: []
+ start: 5
+ }
+ start: 0
+ },
+ {
+ end: 12
+ expr: {
+ args: []
+ end: 12
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 9
+ from_asterisk: False
+ start: 8
+ }
+ start: 8
+ }
+ start: 8
+ }
+ ]
+ end: 12
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[let_x-2b57f58d]
+ '''
+ {
+ declarations: [
+ {
+ declarations: [
+ {
+ end: 13
+ expr: {
+ end: 13
+ items: []
+ start: 11
+ }
+ name: "x"
+ start: 2
+ },
+ {
+ end: 18
+ expr: {
+ args: []
+ end: 18
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ start: 14
+ }
+ start: 14
+ }
+ ]
+ end: 20
+ start: 0
+ }
+ ]
+ end: 20
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[let_x-e03e4142]
+ '''
+ {
+ declarations: [
+ {
+ end: 11
+ expr: {
+ end: 11
+ items: []
+ start: 9
+ }
+ name: "x"
+ start: 0
+ },
+ {
+ end: 16
+ expr: {
+ args: []
+ end: 16
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ start: 12
+ }
+ start: 12
+ }
+ ]
+ end: 16
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[let_x_1-241ba30e]
+ '''
+ {
+ declarations: [
+ {
+ end: 17
+ expr: {
+ end: 17
+ left: {
+ end: 11
+ items: []
+ start: 9
+ }
+ op: "*"
+ right: {
+ end: 16
+ start: 15
+ value: 1
+ }
+ start: 9
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 17
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[let_x_1-6cd09a55]
+ '''
+ {
+ declarations: [
+ {
+ end: 10
+ expr: {
+ end: 10
+ start: 9
+ value: 1
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 10
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[let_x_1_2-0f315ae1]
+ '''
+ {
+ declarations: [
+ {
+ end: 14
+ expr: {
+ end: 14
+ left: {
+ end: 10
+ start: 9
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 14
+ start: 13
+ value: 2
+ }
+ start: 9
+ }
+ name: "x"
+ start: 0
+ }
+ ]
+ end: 14
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[let_x_f-15a498a5]
+ '''
+ {
+ declarations: [
+ {
+ end: 12
+ expr: {
+ args: []
+ distinct: False
+ end: 12
+ name: "f"
+ start: 9
+ }
+ name: "x"
+ start: 0
+ },
+ {
+ end: 17
+ expr: {
+ args: []
+ end: 17
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 14
+ from_asterisk: False
+ start: 13
+ }
+ start: 13
+ }
+ start: 13
+ }
+ ]
+ end: 17
+ start: 0
+ }
+ '''
+# ---
+# name: test_stmt_rhs_pratt_recovers_on_infix_rhs_failure[return-6b60c975]
+ '''
+ {
+ declarations: [
+ {
+ end: 9
+ expr: {
+ end: 9
+ items: []
+ start: 7
+ }
+ start: 0
+ },
+ {
+ end: 14
+ expr: {
+ args: []
+ end: 14
+ expr: {
+ chain: [
+ "*"
+ ]
+ end: 11
+ from_asterisk: False
+ start: 10
+ }
+ start: 10
+ }
+ start: 10
+ }
+ ]
+ end: 14
+ start: 0
+ }
+ '''
+# ---
+# name: test_string_escape_nul_bel_vtab[a-a9526e9c]
+ '''
+ {
+ end: 4
+ start: 0
+ value: "\u0007"
+ }
+ '''
+# ---
+# name: test_string_escape_nul_bel_vtab[a_0b-3405a434]
+ '''
+ {
+ chain: [
+ "ab"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_string_escape_nul_bel_vtab[a_0b-4b77a777]
+ '''
+ {
+ end: 6
+ start: 0
+ value: "ab"
+ }
+ '''
+# ---
+# name: test_string_escape_nul_bel_vtab[a_0b-de5bd9bf]
+ '''
+ {
+ chain: [
+ "ab"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_string_escape_nul_bel_vtab[v-61a2fc6b]
+ '''
+ {
+ end: 4
+ start: 0
+ value: "\u000b"
+ }
+ '''
+# ---
+# name: test_string_literal_unknown_backslash_escapes_rejected[921c9ffb]
+ '''
+ {
+ end: 4
+ start: 0
+ value: "'"
+ }
+ '''
+# ---
+# name: test_string_literal_unknown_backslash_escapes_rejected[b-aece1396]
+ '''
+ {
+ end: 4
+ start: 0
+ value: "\b"
+ }
+ '''
+# ---
+# name: test_string_literal_unknown_backslash_escapes_rejected[c120dc3b]
+ '''
+ {
+ end: 4
+ start: 0
+ value: "\\"
+ }
+ '''
+# ---
+# name: test_string_literal_unknown_backslash_escapes_rejected[n-20b0345d]
+ '''
+ {
+ end: 4
+ start: 0
+ value: "\n"
+ }
+ '''
+# ---
+# name: test_string_literal_unknown_backslash_escapes_rejected[t-48c97adb]
+ '''
+ {
+ end: 4
+ start: 0
+ value: "\t"
+ }
+ '''
+# ---
+# name: test_string_literal_unknown_backslash_escapes_rejected[xAB-5bbf43be]
+ '''
+ {
+ end: 6
+ start: 0
+ value: "\\xAB"
+ }
+ '''
+# ---
+# name: test_string_literal_unknown_backslash_escapes_rejected[xFF-69d00e14]
+ '''
+ {
+ end: 6
+ start: 0
+ value: "\\xFF"
+ }
+ '''
+# ---
+# name: test_subquery_arg_call_then_second_call[a_select_1_2-4d6e4e34]
+ '''
+ {
+ args: [
+ {
+ end: 13
+ start: 12
+ value: 2
+ }
+ ]
+ end: 14
+ expr: {
+ args: [
+ {
+ end: 10
+ select: [
+ {
+ end: 10
+ start: 9
+ value: 1
+ }
+ ]
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 11
+ name: "a"
+ start: 0
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_subquery_arg_call_then_second_call[f_select_1-9d3dbd4b]
+ '''
+ {
+ args: []
+ end: 13
+ expr: {
+ args: [
+ {
+ end: 10
+ select: [
+ {
+ end: 10
+ start: 9
+ value: 1
+ }
+ ]
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 11
+ name: "f"
+ start: 0
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_subquery_arg_call_then_second_call[f_select_1_x_y-4fc133a5]
+ '''
+ {
+ args: [
+ {
+ chain: [
+ "y"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ ]
+ end: 17
+ expr: {
+ args: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 13
+ from_asterisk: False
+ start: 12
+ }
+ ]
+ end: 14
+ expr: {
+ args: [
+ {
+ end: 10
+ select: [
+ {
+ end: 10
+ start: 9
+ value: 1
+ }
+ ]
+ start: 2
+ }
+ ]
+ distinct: False
+ end: 11
+ name: "f"
+ start: 0
+ }
+ start: 0
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_trailing_comma_after_joined_table_chain[SELECT_FROM_a_JOIN_b_ON_1-43ece755]
+ '''
+ {
+ end: 28
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 28
+ expr: {
+ end: 27
+ start: 26
+ value: 1
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_trailing_comma_after_joined_table_chain[SELECT_FROM_a_JOIN_b_ON_1_JOIN_c_ON_1-d103b5c3]
+ '''
+ {
+ end: 40
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 27
+ expr: {
+ end: 27
+ start: 26
+ value: 1
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ next_join: {
+ constraint: {
+ constraint_type: "ON"
+ end: 40
+ expr: {
+ end: 39
+ start: 38
+ value: 1
+ }
+ start: 35
+ }
+ end: 34
+ join_type: "JOIN"
+ start: 33
+ table: {
+ chain: [
+ "c"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ }
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_trailing_comma_after_joined_table_chain[SELECT_FROM_a_JOIN_b_USING_x-59315cf2]
+ '''
+ {
+ end: 33
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 33
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_trailing_limit_offset_compound_body[select_x_limit_a_by_c_limit_1_1-d3b25079]
+ '''
+ {
+ end: 33
+ limit: {
+ end: 33
+ left: {
+ end: 29
+ start: 28
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 33
+ start: 32
+ value: 1
+ }
+ start: 28
+ }
+ limit_by: {
+ end: 21
+ exprs: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 21
+ from_asterisk: False
+ start: 20
+ }
+ ]
+ n: {
+ chain: [
+ "a"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ start: 9
+ }
+ select: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_trailing_limit_offset_compound_body[select_x_limit_a_by_c_limit_d_e-3f73f4f3]
+ '''
+ {
+ end: 34
+ limit: {
+ args: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 29
+ from_asterisk: False
+ start: 28
+ },
+ {
+ chain: [
+ "e"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ ]
+ distinct: False
+ end: 34
+ name: "ifNull"
+ start: 28
+ }
+ limit_by: {
+ end: 21
+ exprs: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 21
+ from_asterisk: False
+ start: 20
+ }
+ ]
+ n: {
+ chain: [
+ "a"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ start: 9
+ }
+ select: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_trailing_limit_offset_compound_body[select_x_limit_a_by_c_offset_d_e-87f1d08f]
+ '''
+ {
+ end: 35
+ limit_by: {
+ end: 21
+ exprs: [
+ {
+ chain: [
+ "c"
+ ]
+ end: 21
+ from_asterisk: False
+ start: 20
+ }
+ ]
+ n: {
+ chain: [
+ "a"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ start: 9
+ }
+ offset: {
+ args: [
+ {
+ chain: [
+ "d"
+ ]
+ end: 30
+ from_asterisk: False
+ start: 29
+ },
+ {
+ chain: [
+ "e"
+ ]
+ end: 35
+ from_asterisk: False
+ start: 34
+ }
+ ]
+ distinct: False
+ end: 35
+ name: "ifNull"
+ start: 29
+ }
+ select: [
+ {
+ chain: [
+ "x"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_trim_substring_must_be_string_literal[TRIM_BOTH_x_FROM_y-52f4a49f]
+ '''
+ {
+ args: [
+ {
+ chain: [
+ "y"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 19
+ },
+ {
+ end: 13
+ start: 10
+ value: "x"
+ }
+ ]
+ distinct: False
+ end: 21
+ name: "trim"
+ start: 0
+ }
+ '''
+# ---
+# name: test_trim_substring_must_be_string_literal[TRIM_LEADING_f_x_FROM_y-094745fa]
+ '''
+ {
+ args: [
+ {
+ chain: [
+ "y"
+ ]
+ end: 24
+ from_asterisk: False
+ start: 23
+ },
+ {
+ end: 16
+ start: 15
+ value: "x"
+ }
+ ]
+ distinct: False
+ end: 25
+ name: "trimLeft"
+ start: 0
+ }
+ '''
+# ---
+# name: test_true_false_admitted_as_identifier_in_chain_and_table_positions[SELECT_FROM_x_false-7e634c78]
+ '''
+ {
+ end: 21
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 21
+ start: 14
+ table: {
+ chain: [
+ "x",
+ "false"
+ ]
+ end: 21
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_true_false_admitted_as_identifier_in_chain_and_table_positions[SELECT_FROM_x_true-c9cf3d5a]
+ '''
+ {
+ end: 20
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 20
+ start: 14
+ table: {
+ chain: [
+ "x",
+ "true"
+ ]
+ end: 20
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_true_false_admitted_as_identifier_in_chain_and_table_positions[WITH_x_true_false_AS_SELECT_1_2_SELECT_FROM_x-788aa70c]
+ '''
+ {
+ ctes: {
+ x: {
+ columns: [
+ "true",
+ "false"
+ ]
+ cte_type: "subquery"
+ end: 36
+ expr: {
+ end: 35
+ select: [
+ {
+ end: 32
+ start: 31
+ value: 1
+ },
+ {
+ end: 35
+ start: 34
+ value: 2
+ }
+ ]
+ start: 24
+ }
+ name: "x"
+ recursive: False
+ start: 5
+ }
+ }
+ end: 52
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 45
+ from_asterisk: False
+ start: 44
+ }
+ ]
+ select_from: {
+ end: 52
+ start: 51
+ table: {
+ chain: [
+ "x"
+ ]
+ end: 52
+ from_asterisk: False
+ start: 51
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_true_false_admitted_as_identifier_in_chain_and_table_positions[x_false-4e48341e]
+ '''
+ {
+ chain: [
+ "x",
+ "false"
+ ]
+ end: 7
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_true_false_admitted_as_identifier_in_chain_and_table_positions[x_true-dcaf0107]
+ '''
+ {
+ chain: [
+ "x",
+ "true"
+ ]
+ end: 6
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_true_false_admitted_as_identifier_in_chain_and_table_positions[x_true_false-f261c710]
+ '''
+ {
+ chain: [
+ "x",
+ "true",
+ "false"
+ ]
+ end: 12
+ from_asterisk: False
+ start: 0
+ }
+ '''
+# ---
+# name: test_tuple_access_rejects_leading_zero_index[a_0-0b222b93]
+ '''
+ {
+ end: 3
+ index: 0
+ nullish: False
+ start: 0
+ tuple: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ }
+ '''
+# ---
+# name: test_tuple_access_rejects_leading_zero_index[a_0-753c38dd]
+ '''
+ {
+ end: 4
+ index: 0
+ nullish: True
+ start: 0
+ tuple: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ }
+ '''
+# ---
+# name: test_tuple_access_rejects_leading_zero_index[a_0_5-164d1c7c]
+ '''
+ {
+ end: 5
+ index: 5
+ nullish: False
+ start: 0
+ tuple: {
+ end: 3
+ index: 0
+ nullish: False
+ start: 0
+ tuple: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ }
+ }
+ '''
+# ---
+# name: test_tuple_access_rejects_leading_zero_index[a_1-855efeb9]
+ '''
+ {
+ end: 3
+ index: 1
+ nullish: False
+ start: 0
+ tuple: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ }
+ '''
+# ---
+# name: test_tuple_access_rejects_leading_zero_index[a_1-9e58db9f]
+ '''
+ {
+ end: 4
+ index: 1
+ nullish: True
+ start: 0
+ tuple: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ }
+ '''
+# ---
+# name: test_tuple_access_rejects_leading_zero_index[a_1_5-b4ed1db9]
+ '''
+ {
+ end: 5
+ index: 5
+ nullish: False
+ start: 0
+ tuple: {
+ end: 3
+ index: 1
+ nullish: False
+ start: 0
+ tuple: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ }
+ }
+ '''
+# ---
+# name: test_tuple_access_rejects_leading_zero_index[a_999-97c86800]
+ '''
+ {
+ end: 5
+ index: 999
+ nullish: False
+ start: 0
+ tuple: {
+ chain: [
+ "a"
+ ]
+ end: 1
+ from_asterisk: False
+ start: 0
+ }
+ }
+ '''
+# ---
+# name: test_unary_plus_only_on_numeric_literal[1-acb72b94]
+ '''
+ {
+ end: 2
+ start: 0
+ value: 1
+ }
+ '''
+# ---
+# name: test_unary_plus_only_on_numeric_literal[1_5-13f87fad]
+ '''
+ {
+ end: 4
+ start: 0
+ value: 1.5
+ }
+ '''
+# ---
+# name: test_unary_plus_only_on_numeric_literal[inf-67723325]
+ '''
+ {
+ end: 4
+ start: 0
+ value: inf
+ }
+ '''
+# ---
+# name: test_unpivot_emits_include_nulls_false_by_default[SELECT_FROM_t_UNPIVOT_INCLUDE_NULLS_val_FOR_month_IN_a_b-8706c5ea]
+ '''
+ {
+ end: 63
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 63
+ start: 14
+ table: {
+ columns: [
+ {
+ name_columns: {
+ chain: [
+ "month"
+ ]
+ end: 52
+ from_asterisk: False
+ start: 47
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 58
+ from_asterisk: False
+ start: 57
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 61
+ from_asterisk: False
+ start: 60
+ }
+ ]
+ value_columns: {
+ chain: [
+ "val"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 39
+ }
+ }
+ ]
+ end: 63
+ include_nulls: True
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_unpivot_emits_include_nulls_false_by_default[SELECT_FROM_t_UNPIVOT_val_FOR_month_IN_a_b-073663d2]
+ '''
+ {
+ end: 49
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 49
+ start: 14
+ table: {
+ columns: [
+ {
+ name_columns: {
+ chain: [
+ "month"
+ ]
+ end: 38
+ from_asterisk: False
+ start: 33
+ }
+ unpivot_values: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 44
+ from_asterisk: False
+ start: 43
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 47
+ from_asterisk: False
+ start: 46
+ }
+ ]
+ value_columns: {
+ chain: [
+ "val"
+ ]
+ end: 28
+ from_asterisk: False
+ start: 25
+ }
+ }
+ ]
+ end: 49
+ include_nulls: False
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_unterminated_block_comment_lexes_as_div_asterisk[1-cb1d4405]
+ '''
+ {
+ end: 4
+ left: {
+ end: 1
+ start: 0
+ value: 1
+ }
+ op: "/"
+ right: {
+ chain: [
+ "*"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 3
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_unterminated_block_comment_lexes_as_div_asterisk[1-f1b4d33f]
+ '''
+ {
+ end: 4
+ left: {
+ end: 1
+ start: 0
+ value: 1
+ }
+ op: "/"
+ right: {
+ chain: [
+ "*"
+ ]
+ end: 4
+ from_asterisk: False
+ start: 3
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_unterminated_block_comment_lexes_as_div_asterisk[1_ok_2-0dd57f7f]
+ '''
+ {
+ end: 14
+ left: {
+ end: 1
+ start: 0
+ value: 1
+ }
+ op: "+"
+ right: {
+ end: 14
+ start: 13
+ value: 2
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_using_empty_parens_rejected[SELECT_FROM_a_JOIN_b_USING_x-8c9198cf]
+ '''
+ {
+ end: 32
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ next_join: {
+ constraint: {
+ constraint_type: "USING"
+ end: 32
+ expr: {
+ chain: [
+ "x"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 23
+ }
+ end: 22
+ join_type: "JOIN"
+ start: 21
+ table: {
+ chain: [
+ "b"
+ ]
+ end: 22
+ from_asterisk: False
+ start: 21
+ }
+ }
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_frame_between_falls_back_to_field[select_1_from_a_window_w_as_range_between_1_preceding_and_2_-74bc5cc4]
+ '''
+ {
+ end: 71
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ window_exprs: {
+ w: {
+ end: 70
+ frame_end: {
+ end: 70
+ frame_type: "FOLLOWING"
+ frame_value: 2
+ start: 59
+ }
+ frame_method: "RANGE"
+ frame_start: {
+ end: 54
+ frame_type: "PRECEDING"
+ frame_value: 1
+ start: 43
+ }
+ start: 29
+ }
+ }
+ }
+ '''
+# ---
+# name: test_window_frame_between_falls_back_to_field[select_1_from_a_window_w_as_range_between_preceding-2f0c8cfc]
+ '''
+ {
+ end: 53
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "a"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ window_exprs: {
+ w: {
+ end: 52
+ frame_method: "RANGE"
+ frame_start: {
+ end: 52
+ frame_type: "PRECEDING"
+ frame_value: {
+ chain: [
+ "between"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 35
+ }
+ start: 35
+ }
+ start: 29
+ }
+ }
+ }
+ '''
+# ---
+# name: test_window_frame_bound_low_precedence_value[SELECT_count_OVER_ROWS_BETWEEN_1_PRECEDING_AND_1_FOLLOWING_F-12320ed6]
+ '''
+ {
+ end: 69
+ select: [
+ {
+ args: []
+ end: 62
+ exprs: []
+ name: "count"
+ over_expr: {
+ end: 61
+ frame_end: {
+ end: 61
+ frame_type: "FOLLOWING"
+ frame_value: 1
+ start: 50
+ }
+ frame_method: "ROWS"
+ frame_start: {
+ end: 45
+ frame_type: "PRECEDING"
+ frame_value: 1
+ start: 34
+ }
+ start: 21
+ }
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 69
+ start: 68
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 69
+ from_asterisk: False
+ start: 68
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_frame_bound_low_precedence_value[SELECT_count_OVER_ROWS_a_AND_b_FOLLOWING_FROM_t-dbfe897a]
+ '''
+ {
+ end: 51
+ select: [
+ {
+ args: []
+ end: 44
+ exprs: []
+ name: "count"
+ over_expr: {
+ end: 43
+ frame_method: "ROWS"
+ frame_start: {
+ end: 43
+ frame_type: "FOLLOWING"
+ frame_value: {
+ end: 33
+ exprs: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ },
+ {
+ chain: [
+ "b"
+ ]
+ end: 33
+ from_asterisk: False
+ start: 32
+ }
+ ]
+ start: 26
+ }
+ start: 26
+ }
+ start: 21
+ }
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 51
+ start: 50
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 51
+ from_asterisk: False
+ start: 50
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_frame_bound_low_precedence_value[SELECT_count_OVER_ROWS_a_b_PRECEDING_FROM_t-ce81074e]
+ '''
+ {
+ end: 49
+ select: [
+ {
+ args: []
+ end: 42
+ exprs: []
+ name: "count"
+ over_expr: {
+ end: 41
+ frame_method: "ROWS"
+ frame_start: {
+ end: 41
+ frame_type: "PRECEDING"
+ frame_value: {
+ end: 31
+ left: {
+ chain: [
+ "a"
+ ]
+ end: 27
+ from_asterisk: False
+ start: 26
+ }
+ op: "=="
+ right: {
+ chain: [
+ "b"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ start: 26
+ }
+ start: 26
+ }
+ start: 21
+ }
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 49
+ start: 48
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 49
+ from_asterisk: False
+ start: 48
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_frame_non_int_bound_keeps_constant[SELECT_count_OVER_ROWS_1_5_PRECEDING_FROM_t-8e4584d0]
+ '''
+ {
+ end: 47
+ select: [
+ {
+ args: []
+ end: 40
+ exprs: []
+ name: "count"
+ over_expr: {
+ end: 39
+ frame_method: "ROWS"
+ frame_start: {
+ end: 39
+ frame_type: "PRECEDING"
+ frame_value: {
+ end: 29
+ start: 26
+ value: 1.5
+ }
+ start: 26
+ }
+ start: 21
+ }
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 47
+ start: 46
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 47
+ from_asterisk: False
+ start: 46
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_frame_non_int_bound_keeps_constant[SELECT_count_OVER_ROWS_2_PRECEDING_FROM_t-cdde9844]
+ '''
+ {
+ end: 45
+ select: [
+ {
+ args: []
+ end: 38
+ exprs: []
+ name: "count"
+ over_expr: {
+ end: 37
+ frame_method: "ROWS"
+ frame_start: {
+ end: 37
+ frame_type: "PRECEDING"
+ frame_value: 2
+ start: 26
+ }
+ start: 21
+ }
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 45
+ start: 44
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 45
+ from_asterisk: False
+ start: 44
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_frame_non_int_bound_keeps_constant[SELECT_count_OVER_ROWS_5_PRECEDING_FROM_t-1aadfc60]
+ '''
+ {
+ end: 47
+ select: [
+ {
+ args: []
+ end: 40
+ exprs: []
+ name: "count"
+ over_expr: {
+ end: 39
+ frame_method: "ROWS"
+ frame_start: {
+ end: 39
+ frame_type: "PRECEDING"
+ frame_value: {
+ end: 29
+ start: 26
+ value: "5"
+ }
+ start: 26
+ }
+ start: 21
+ }
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 47
+ start: 46
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 47
+ from_asterisk: False
+ start: 46
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_function_args_no_distinct_no_inline_order_by[foo_DISTINCT_a-38d65e56]
+ '''
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 14
+ from_asterisk: False
+ start: 13
+ }
+ ]
+ distinct: True
+ end: 15
+ name: "foo"
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_function_args_no_distinct_no_inline_order_by[foo_a_ORDER_BY_b-911baf76]
+ '''
+ {
+ args: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ ]
+ distinct: False
+ end: 17
+ name: "foo"
+ order_by: [
+ {
+ end: 16
+ expr: {
+ chain: [
+ "b"
+ ]
+ end: 16
+ from_asterisk: False
+ start: 15
+ }
+ order: "ASC"
+ start: 15
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_window_function_args_no_distinct_no_inline_order_by[foo_a_OVER-bc1fdc75]
+ '''
+ {
+ args: []
+ end: 14
+ exprs: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 5
+ from_asterisk: False
+ start: 4
+ }
+ ]
+ name: "foo"
+ over_expr: {
+ end: 13
+ start: 13
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_cte_admits_primary_form_keywords_as_name[WITH_case_AS_SELECT_1_SELECT_FROM_case-d2f86048]
+ '''
+ {
+ ctes: {
+ case: {
+ cte_type: "subquery"
+ end: 23
+ expr: {
+ end: 22
+ select: [
+ {
+ end: 22
+ start: 21
+ value: 1
+ }
+ ]
+ start: 14
+ }
+ name: "case"
+ recursive: False
+ start: 5
+ }
+ }
+ end: 42
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ ]
+ select_from: {
+ end: 42
+ start: 38
+ table: {
+ chain: [
+ "case"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 38
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_cte_admits_primary_form_keywords_as_name[WITH_cast_AS_SELECT_1_SELECT_FROM_cast-8cb6da6f]
+ '''
+ {
+ ctes: {
+ cast: {
+ cte_type: "subquery"
+ end: 23
+ expr: {
+ end: 22
+ select: [
+ {
+ end: 22
+ start: 21
+ value: 1
+ }
+ ]
+ start: 14
+ }
+ name: "cast"
+ recursive: False
+ start: 5
+ }
+ }
+ end: 42
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 32
+ from_asterisk: False
+ start: 31
+ }
+ ]
+ select_from: {
+ end: 42
+ start: 38
+ table: {
+ chain: [
+ "cast"
+ ]
+ end: 42
+ from_asterisk: False
+ start: 38
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_cte_admits_primary_form_keywords_as_name[WITH_not_AS_SELECT_1_SELECT_FROM_not-40598ddf]
+ '''
+ {
+ ctes: {
+ not: {
+ cte_type: "subquery"
+ end: 22
+ expr: {
+ end: 21
+ select: [
+ {
+ end: 21
+ start: 20
+ value: 1
+ }
+ ]
+ start: 13
+ }
+ name: "not"
+ recursive: False
+ start: 5
+ }
+ }
+ end: 40
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 31
+ from_asterisk: False
+ start: 30
+ }
+ ]
+ select_from: {
+ end: 40
+ start: 37
+ table: {
+ chain: [
+ "not"
+ ]
+ end: 40
+ from_asterisk: False
+ start: 37
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_cte_admits_primary_form_keywords_as_name[WITH_select_AS_SELECT_1_SELECT_FROM_select-fb820262]
+ '''
+ {
+ ctes: {
+ select: {
+ cte_type: "subquery"
+ end: 25
+ expr: {
+ end: 24
+ select: [
+ {
+ end: 24
+ start: 23
+ value: 1
+ }
+ ]
+ start: 16
+ }
+ name: "select"
+ recursive: False
+ start: 5
+ }
+ }
+ end: 46
+ select: [
+ {
+ chain: [
+ "*"
+ ]
+ end: 34
+ from_asterisk: False
+ start: 33
+ }
+ ]
+ select_from: {
+ end: 46
+ start: 40
+ table: {
+ chain: [
+ "select"
+ ]
+ end: 46
+ from_asterisk: False
+ start: 40
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_rollup_cube_totals_chain_grammar[SELECT_a_FROM_t_GROUP_BY_a_WITH_CUBE-4b20fd8f]
+ '''
+ {
+ end: 36
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_rollup_cube_totals_chain_grammar[SELECT_a_FROM_t_GROUP_BY_a_WITH_CUBE_WITH_TOTALS-e50c0e47]
+ '''
+ {
+ end: 48
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_rollup_cube_totals_chain_grammar[SELECT_a_FROM_t_GROUP_BY_a_WITH_ROLLUP-bd8ad166]
+ '''
+ {
+ end: 38
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_rollup_cube_totals_chain_grammar[SELECT_a_FROM_t_GROUP_BY_a_WITH_ROLLUP_WITH_TOTALS-16a75d63]
+ '''
+ {
+ end: 50
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_with_rollup_cube_totals_chain_grammar[SELECT_a_FROM_t_GROUP_BY_a_WITH_TOTALS-9ba510c9]
+ '''
+ {
+ end: 38
+ group_by: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 26
+ from_asterisk: False
+ start: 25
+ }
+ ]
+ select: [
+ {
+ chain: [
+ "a"
+ ]
+ end: 8
+ from_asterisk: False
+ start: 7
+ }
+ ]
+ select_from: {
+ end: 15
+ start: 14
+ table: {
+ chain: [
+ "t"
+ ]
+ end: 15
+ from_asterisk: False
+ start: 14
+ }
+ }
+ start: 0
+ }
+ '''
+# ---
+# name: test_zero_arg_lambda_as_clause_body[select_1_limit-3b325c8e]
+ '''
+ {
+ end: 18
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ },
+ {
+ args: []
+ distinct: False
+ end: 18
+ name: "limit"
+ start: 10
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_zero_arg_lambda_as_clause_body[select_1_limit_2-4360c7e5]
+ '''
+ {
+ end: 23
+ limit: {
+ args: []
+ end: 23
+ expr: {
+ end: 23
+ start: 22
+ value: 2
+ }
+ start: 16
+ }
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_zero_arg_lambda_as_clause_body[select_1_offset_3-629259cb]
+ '''
+ {
+ end: 24
+ offset: {
+ args: []
+ end: 24
+ expr: {
+ end: 24
+ start: 23
+ value: 3
+ }
+ start: 17
+ }
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ }
+ '''
+# ---
+# name: test_zero_arg_lambda_as_clause_body[select_1_where_2-96d16f8b]
+ '''
+ {
+ end: 23
+ select: [
+ {
+ end: 8
+ start: 7
+ value: 1
+ }
+ ]
+ start: 0
+ where: {
+ args: []
+ end: 23
+ expr: {
+ end: 23
+ start: 22
+ value: 2
+ }
+ start: 16
+ }
+ }
+ '''
+# ---
diff --git a/posthog/hogql/test/_generated_grammar_strategies.py b/posthog/hogql/test/_generated_grammar_strategies.py
index 26f1bcdd6843..42ec8fa772f6 100644
--- a/posthog/hogql/test/_generated_grammar_strategies.py
+++ b/posthog/hogql/test/_generated_grammar_strategies.py
@@ -618,7 +618,8 @@ def selectStmt_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append("select")
if _include_optional(draw):
parts.append("distinct")
- parts.append("")
+ if _include_optional(draw):
+ parts.append(draw(topClause_strategy(_dec(depth))))
parts.append(draw(selectColumnExprListBeforeFrom_strategy(_dec(depth))))
if _include_optional(draw):
parts.append(draw(fromClause_strategy(_dec(depth))))
@@ -663,7 +664,8 @@ def selectStmt_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(limitAndOffsetClause_strategy(_dec(depth))))
if group_idx == 1:
parts.append(draw(offsetOnlyClause_strategy(_dec(depth))))
- parts.append("")
+ if _include_optional(draw):
+ parts.append(draw(settingsClause_strategy(_dec(depth))))
return " ".join(p for p in parts if p)
return gen()
@@ -683,6 +685,21 @@ def withClause_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
return gen()
+def topClause_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
+ @st.composite
+ def gen(draw: Any) -> str:
+ parts: list[str] = []
+ parts.append("top")
+ parts.append(draw(decimal_literal_token))
+ if _include_optional(draw):
+ parts.append("with")
+ parts.append("ties")
+ return " ".join(p for p in parts if p)
+
+ return gen()
+
+
@functools.cache
def fromClause_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
@st.composite
@@ -953,6 +970,18 @@ def offsetOnlyClause_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[
return gen()
+def settingsClause_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
+ @st.composite
+ def gen(draw: Any) -> str:
+ parts: list[str] = []
+ parts.append("settings")
+ parts.append(draw(settingExprList_strategy(_dec(depth))))
+ return " ".join(p for p in parts if p)
+
+ return gen()
+
+
@functools.cache
def valuesClause_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
@st.composite
@@ -1559,7 +1588,7 @@ def columnTypeExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[st
@st.composite
def gen(draw: Any) -> str:
parts: list[str] = []
- seed_idx = draw(st.integers(min_value=0, max_value=4))
+ seed_idx = draw(st.integers(min_value=0, max_value=5))
seed = ""
if seed_idx == 0:
parts = []
@@ -1576,6 +1605,18 @@ def columnTypeExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[st
parts.append(")")
seed = " ".join(p for p in parts if p)
if seed_idx == 1:
+ parts = []
+ parts.append(draw(identifier_strategy(_dec(depth))))
+ parts.append("(")
+ parts.append(draw(enumValue_strategy(_dec(depth))))
+ for _ in range(draw(st.integers(min_value=0, max_value=_MAX_REPEAT))):
+ parts.append(",")
+ parts.append(draw(enumValue_strategy(_dec(depth))))
+ if _include_optional(draw):
+ parts.append(",")
+ parts.append(")")
+ seed = " ".join(p for p in parts if p)
+ if seed_idx == 2:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
parts.append("(")
@@ -1587,7 +1628,7 @@ def columnTypeExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[st
parts.append(",")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 2:
+ if seed_idx == 3:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
parts.append("(")
@@ -1595,13 +1636,13 @@ def columnTypeExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[st
parts.append(draw(columnExprList_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 3:
+ if seed_idx == 4:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
for _ in range(draw(st.integers(min_value=1, max_value=_MAX_REPEAT))):
parts.append(draw(identifier_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 4:
+ if seed_idx == 5:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
@@ -1763,7 +1804,7 @@ def selectColumnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[
@st.composite
def gen(draw: Any) -> str:
parts: list[str] = []
- alt_idx = draw(st.integers(min_value=0, max_value=2))
+ alt_idx = draw(st.integers(min_value=0, max_value=3))
if alt_idx == 0:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
@@ -1772,9 +1813,14 @@ def selectColumnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[
return " ".join(p for p in parts if p)
if alt_idx == 1:
parts = []
- parts.append(draw(columnExpr_strategy(_dec(depth))))
+ parts.append("from")
+ parts.append(draw(implicitAlias_strategy(_dec(depth))))
return " ".join(p for p in parts if p)
if alt_idx == 2:
+ parts = []
+ parts.append(draw(columnExpr_strategy(_dec(depth))))
+ return " ".join(p for p in parts if p)
+ if alt_idx == 3:
parts = []
parts.append(draw(columnExpr_strategy(_dec(depth))))
parts.append(draw(implicitAlias_strategy(_dec(depth))))
@@ -1792,7 +1838,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
def gen(draw: Any) -> str:
parts: list[str] = []
if depth <= 0:
- seed_idx = draw(st.sampled_from([5, 10, 15, 30, 33]))
+ seed_idx = draw(st.sampled_from([3, 4, 7, 9, 14, 19, 34, 37]))
else:
seed_idx = draw(
st.sampled_from(
@@ -1832,6 +1878,10 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
32,
33,
34,
+ 35,
+ 36,
+ 37,
+ 38,
]
)
)
@@ -1870,12 +1920,39 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
seed = " ".join(p for p in parts if p)
if seed_idx == 3:
+ parts = []
+ parts.append("date")
+ parts.append(draw(string_literal_token))
+ seed = " ".join(p for p in parts if p)
+ if seed_idx == 4:
+ parts = []
+ parts.append("interval")
+ parts.append(draw(string_literal_token))
+ seed = " ".join(p for p in parts if p)
+ if seed_idx == 5:
parts = []
parts.append("interval")
parts.append(draw(columnExpr_strategy(_dec(depth))))
parts.append(draw(interval_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 4:
+ if seed_idx == 6:
+ parts = []
+ parts.append("substring")
+ parts.append("(")
+ parts.append(draw(columnExpr_strategy(_dec(depth))))
+ parts.append("from")
+ parts.append(draw(columnExpr_strategy(_dec(depth))))
+ if _include_optional(draw):
+ parts.append("for")
+ parts.append(draw(columnExpr_strategy(_dec(depth))))
+ parts.append(")")
+ seed = " ".join(p for p in parts if p)
+ if seed_idx == 7:
+ parts = []
+ parts.append("timestamp")
+ parts.append(draw(string_literal_token))
+ seed = " ".join(p for p in parts if p)
+ if seed_idx == 8:
parts = []
parts.append("trim")
parts.append("(")
@@ -1891,21 +1968,21 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(columnExpr_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 5:
+ if seed_idx == 9:
parts = []
parts.append("columns")
parts.append("(")
parts.append(draw(string_literal_token))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 6:
+ if seed_idx == 10:
parts = []
parts.append("columns")
parts.append("(")
parts.append(draw(columnExprList_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 7:
+ if seed_idx == 11:
parts = []
group_idx = draw(st.integers(min_value=0, max_value=1))
if group_idx == 0:
@@ -1934,7 +2011,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 8:
+ if seed_idx == 12:
parts = []
parts.append("columns")
parts.append("(")
@@ -1945,7 +2022,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 9:
+ if seed_idx == 13:
parts = []
group_idx = draw(st.integers(min_value=0, max_value=1))
if group_idx == 0:
@@ -1966,14 +2043,14 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 10:
+ if seed_idx == 14:
parts = []
parts.append("columns")
parts.append("(")
parts.append("*")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 11:
+ if seed_idx == 15:
parts = []
parts.append("columns")
parts.append("(")
@@ -1990,7 +2067,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 12:
+ if seed_idx == 16:
parts = []
parts.append("columns")
parts.append("(")
@@ -2003,7 +2080,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 13:
+ if seed_idx == 17:
parts = []
parts.append("columns")
parts.append("(")
@@ -2016,7 +2093,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 14:
+ if seed_idx == 18:
parts = []
parts.append("columns")
parts.append("(")
@@ -2025,7 +2102,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append("*")
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 15:
+ if seed_idx == 19:
parts = []
parts.append("*")
parts.append("columns")
@@ -2033,7 +2110,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(string_literal_token))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 16:
+ if seed_idx == 20:
parts = []
parts.append("*")
parts.append("columns")
@@ -2041,7 +2118,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(columnExprList_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 17:
+ if seed_idx == 21:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
parts.append("(")
@@ -2050,7 +2127,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(")")
parts.append(draw(withinGroupClause_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 18:
+ if seed_idx == 22:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
parts.append("(")
@@ -2075,7 +2152,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(windowExpr_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 19:
+ if seed_idx == 23:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
parts.append("(")
@@ -2098,7 +2175,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append("over")
parts.append(draw(identifier_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 20:
+ if seed_idx == 24:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
if _include_optional(draw):
@@ -2123,21 +2200,21 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(columnExpr_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 21:
+ if seed_idx == 25:
parts = []
parts.append(draw(literal_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 22:
+ if seed_idx == 26:
parts = []
parts.append("-")
parts.append(draw(columnExpr_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 23:
+ if seed_idx == 27:
parts = []
parts.append("not")
parts.append(draw(columnExpr_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 24:
+ if seed_idx == 28:
parts = []
if _include_optional(draw):
parts.append(draw(tableIdentifier_strategy(_dec(depth))))
@@ -2149,7 +2226,7 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(identifierList_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 25:
+ if seed_idx == 29:
parts = []
parts.append("lambda")
parts.append(draw(identifier_strategy(_dec(depth))))
@@ -2161,25 +2238,25 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(":")
parts.append(draw(columnExpr_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 26:
+ if seed_idx == 30:
parts = []
parts.append("(")
parts.append(draw(selectSetStmt_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 27:
+ if seed_idx == 31:
parts = []
parts.append("(")
parts.append(draw(columnExpr_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 28:
+ if seed_idx == 32:
parts = []
parts.append("(")
parts.append(draw(columnExprList_strategy(_dec(depth))))
parts.append(")")
seed = " ".join(p for p in parts if p)
- if seed_idx == 29:
+ if seed_idx == 33:
parts = []
if _include_optional(draw):
parts.append("array")
@@ -2188,28 +2265,28 @@ def columnExpr_strategy(depth: int = _DEFAULT_DEPTH) -> st.SearchStrategy[str]:
parts.append(draw(columnExprList_strategy(_dec(depth))))
parts.append("]")
seed = " ".join(p for p in parts if p)
- if seed_idx == 30:
+ if seed_idx == 34:
parts = []
parts.append("{")
parts.append("")
parts.append("}")
seed = " ".join(p for p in parts if p)
- if seed_idx == 31:
+ if seed_idx == 35:
parts = []
parts.append(draw(columnLambdaExpr_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 32:
+ if seed_idx == 36:
parts = []
parts.append(draw(identifier_strategy(_dec(depth))))
parts.append(":=")
parts.append(draw(columnExpr_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
- if seed_idx == 33:
+ if seed_idx == 37:
parts = []
parts.append("#")
parts.append(draw(decimal_literal_token))
seed = " ".join(p for p in parts if p)
- if seed_idx == 34:
+ if seed_idx == 38:
parts = []
parts.append(draw(columnIdentifier_strategy(_dec(depth))))
seed = " ".join(p for p in parts if p)
diff --git a/posthog/hogql/test/_test_parser.py b/posthog/hogql/test/_test_parser.py
index 900a50c0075f..66a00808be10 100644
--- a/posthog/hogql/test/_test_parser.py
+++ b/posthog/hogql/test/_test_parser.py
@@ -3,14 +3,19 @@
# every assertion. Each test runs against all 3 backends; a runtime AttributeError surfaces as
# a test failure anyway. Relax the narrowing checks here only so the rest of the codebase
# keeps its strictness.
-# mypy: disable-error-code="arg-type, union-attr, attr-defined, assignment"
+# mypy: disable-error-code="arg-type, union-attr, attr-defined, assignment, operator"
+import re
import math
-from typing import Optional, cast
+import hashlib
+from typing import Any, Optional, cast
-from posthog.test.base import BaseTest, MemoryLeakTestMixin, no_memory_leak_check
+import pytest
+from posthog.test.base import BaseTest, MemoryLeakTestMixin
+from unittest.mock import patch
from parameterized import parameterized
+from syrupy.extensions.amber import AmberSnapshotExtension
from posthog.hogql import ast
from posthog.hogql.ast import (
@@ -37,11 +42,50 @@ from posthog.hogql.ast import (
WhileStatement,
)
from posthog.hogql.constants import HogQLParserBackend
-from posthog.hogql.errors import ExposedHogQLError, SyntaxError
+from posthog.hogql.errors import BaseHogQLError, ExposedHogQLError, SyntaxError
from posthog.hogql.parser import parse_expr, parse_order_expr, parse_program, parse_select, parse_string_template
+from posthog.hogql.test.utils import pretty_dataclasses
from posthog.hogql.visitor import clear_locations
+class _SharedParserSnapshotExtension(AmberSnapshotExtension):
+ """One shared `.ambr` across all backend subclasses, keyed by test-method name only.
+
+ Every backend (cpp-json / python / rust-json / rust-py) must construct the identical
+ AST — including source positions — so there is exactly one expected snapshot per
+ assertion, recorded once and asserted by all four. Default syrupy would key by class
+ (`TestParserCppJson` vs `TestParserRustJson`) and write a `.ambr` per test file.
+ """
+
+ @classmethod
+ def _get_file_basename(cls, *, test_location: Any, index: Any) -> str:
+ return "parser_ast"
+
+ @classmethod
+ def get_snapshot_name(cls, *, test_location: Any, index: Any = 0) -> str:
+ if isinstance(index, str):
+ index_suffix = f"[{index}]"
+ elif index:
+ index_suffix = f".{index}"
+ else:
+ index_suffix = ""
+ return f"{test_location.methodname}{index_suffix}"
+
+
+def _snapshot_key(src: str) -> str:
+ """Stable, readable, ambr-safe snapshot key for a source string.
+
+ Keyed purely on `src`, so it is independent of call order: the leak mixin re-runs each
+ test 102x, and a source-derived (rather than auto-incrementing) key means every rerun
+ re-compares the one stable entry instead of accumulating 102 copies. The short hash keeps
+ distinct sources that sanitise to the same prefix from colliding.
+ """
+ collapsed = re.sub(r"\s+", " ", src.strip())
+ safe = re.sub(r"[^0-9A-Za-z]+", "_", collapsed).strip("_")[:60]
+ digest = hashlib.sha1(src.encode("utf-8")).hexdigest()[:8]
+ return f"{safe}-{digest}" if safe else digest
+
+
def parser_test_factory(backend: HogQLParserBackend):
base_classes = (BaseTest,) if backend == "python" else (MemoryLeakTestMixin, BaseTest)
@@ -53,6 +97,44 @@ def parser_test_factory(backend: HogQLParserBackend):
maxDiff = None
+ # syrupy snapshot, injected per test by the `unittest_snapshot` fixture below.
+ snapshot: Any
+ pytestmark = pytest.mark.usefixtures("unittest_snapshot")
+
+ def _assert_ast(
+ self, src: str, rule: str = "select", placeholders: Optional[dict[str, ast.Expr]] = None
+ ) -> None:
+ # Parse `src` on this backend and check it against the shared cross-backend snapshot.
+ # cpp-json / rust-json / rust-py assert the FULL positioned AST (one recorded `.ambr`
+ # entry per source — positions verified, cpp regressions caught, no live self-compare).
+ # python is the legacy backend and not a position-parity target, so it only verifies
+ # STRUCTURE against the live cpp parse (clear_locations) — no position-divergence noise.
+ parse_fn = {
+ "expr": parse_expr,
+ "select": parse_select,
+ "program": parse_program,
+ "order": parse_order_expr,
+ "template": parse_string_template,
+ }[rule]
+ kwargs: dict[str, Any] = {"backend": backend}
+ if placeholders is not None:
+ kwargs["placeholders"] = placeholders
+ # Parse on every rerun so the leak mixin still exercises the parser 102x and a real
+ # per-parse leak is caught. Only COMPARE on the first run: syrupy / pretty_dataclasses
+ # / the cpp oracle parse allocate per call, so comparing on every rerun would trip the
+ # leak check with test-machinery growth that isn't a parser leak.
+ parsed = parse_fn(src, **kwargs)
+ # python has no leak mixin (runs once), so the attr is absent → treat as run 0.
+ if getattr(self, "_memory_leak_run_index", 0) != 0:
+ return
+ if backend == "python":
+ oracle_kwargs = {**kwargs, "backend": "cpp-json"}
+ assert clear_locations(parsed) == clear_locations(parse_fn(src, **oracle_kwargs))
+ return
+ if not hasattr(self, "_shared_ast_snapshot"):
+ self._shared_ast_snapshot = self.snapshot.use_extension(_SharedParserSnapshotExtension)
+ assert pretty_dataclasses(parsed) == self._shared_ast_snapshot(name=_snapshot_key(src))
+
def _string_template(self, template: str, placeholders: Optional[dict[str, ast.Expr]] = None) -> ast.Expr:
return clear_locations(parse_string_template(template, placeholders=placeholders, backend=backend))
@@ -2731,20 +2813,36 @@ def parser_test_factory(backend: HogQLParserBackend):
)
def test_grammar_quirk_invalid_join_type_rejected_on_all_backends(self):
- # `LEFT OUTER SEMI JOIN` passes the rust grammar's per-keyword checks (no rule forbids the combination) but isn't in `VALID_JOIN_TYPES`. Every backend must reject via `JoinExpr.__post_init__`; the rust-py path covers this via `PyEmitter::set_field` re-firing `__post_init__` because `join_type` is written post-construction by `chain_join`.
+ # `LEFT OUTER SEMI JOIN` passes the rust grammar's per-keyword checks (no rule forbids the combination) but isn't in `VALID_JOIN_TYPES`, so `JoinExpr.__post_init__` raises `ValueError` on every backend. rust-py writes `join_type` post-construction (via `chain_join`), so `PyEmitter::set_field` re-fires `__post_init__` and restores the original exception — surfacing the same `ValueError` the json backends raise from `cls(**kwargs)`.
q = "SELECT 1 FROM a LEFT OUTER SEMI JOIN b ON a.x = b.x"
- with self.assertRaises((ValueError, ExposedHogQLError)) as cm:
+ with self.assertRaises(ValueError) as cm:
self._select(q)
self.assertIn("Invalid join type", str(cm.exception))
- def test_deeply_nested_expression_does_not_stack_overflow(self):
- # Deep paren input must surface a clean `SyntaxError`, not stack-OOM in the recursive-descent loop. Cap lives at `MAX_EXPR_RECURSION_DEPTH = 1000`, mirrors ClickHouse's `max_parser_depth`. cpp / python paths have their own stack characteristics so the assertion is rust-specific.
+ def test_dataclass_post_init_failure_surfaces_original_exception(self):
+ # A dataclass `__post_init__` raising mid-build must surface the ORIGINAL exception on every backend. The json backends raise it straight from `deserialize_ast`; rust-py constructs dataclasses during the parse, so `PyEmitter` restores the exception across its panic/`catch_unwind` boundary instead of wrapping it in an envelope (or leaking a `PanicException`).
+ def always_reject(_self: ast.JoinExpr) -> None:
+ raise ValueError("synthetic post_init failure for test")
+
+ with patch.object(ast.JoinExpr, "__post_init__", always_reject):
+ with self.assertRaises(ValueError) as caught:
+ parse_select("SELECT 1 FROM a JOIN b ON a.x = b.x", backend=backend)
+ self.assertIn("synthetic post_init failure", str(caught.exception))
+
+ def test_deeply_nested_input_does_not_stack_overflow(self):
+ # Deeply-nested input must surface a clean `SyntaxError`, not a host stack overflow (an uncatchable SIGSEGV) in the recursive-descent loop. One shared counter caps all three recursion dimensions — expression nesting, subquery / set nesting, and Hog statement / block nesting — at `MAX_RECURSION_DEPTH = 1000`, mirroring ClickHouse's `max_parser_depth`. cpp / python have their own stack characteristics so the assertion is rust-specific. Which guard fires (and so the exact message) depends on how the input routes through the descent, hence the loose substring check.
if backend not in ("rust-json", "rust-py"):
self.skipTest("rust-specific recursion cap")
- deep = "(" * 1500 + "1" + ")" * 1500
- with self.assertRaises(SyntaxError) as cm:
- self._expr(deep)
- self.assertIn("too deeply nested", str(cm.exception).lower())
+ parse_fns = {"expr": parse_expr, "select": parse_select, "program": parse_program}
+ cases = (
+ ("expr", "(" * 1500 + "1" + ")" * 1500),
+ ("select", "(" * 1500 + "select 1" + ")" * 1500),
+ ("program", "{" * 1500 + "}" * 1500),
+ )
+ for rule, src in cases:
+ with self.assertRaises(SyntaxError, msg=rule) as cm:
+ parse_fns[rule](src, backend=backend)
+ self.assertIn("too deeply nested", str(cm.exception).lower(), msg=rule)
def test_ctes_inject_into_paren_wrapped_inner_with(self):
# An outer WITH attached to a paren-wrapped inner that already has its own WITH must surface both CTEs, with the outer's appended after the inner's (matches cpp's `VISIT(SelectStmtWithParens)` ordering).
@@ -3232,6 +3330,25 @@ def parser_test_factory(backend: HogQLParserBackend):
# A self-closing element has no “children” attribute at all.
self.assertEqual(tag, ast.HogQLXTag(kind="em", attributes=[]))
+ def test_return_hogqlx_tag_value(self):
+ # `return <Tag/>` is a returnStmt whose value is a HogQLX tag, not the `<` less-than operator binding `return` as a Field. The rust parser's return-guard read the following `<` as less-than and rejected the tag while cpp and python accept it; bare `<Tag/>` and `let x := <Tag/>` already worked, so only the return-value position needed the fix (`execute_hog` wraps a bare expression as `return <expr>;`, which is how this surfaced).
+ prog = cast(ast.Program, self._program("return <Sparkline />"))
+ stmt = cast(ast.ReturnStatement, prog.declarations[0])
+ self.assertIsInstance(stmt, ast.ReturnStatement)
+ self.assertEqual(stmt.expr, ast.HogQLXTag(kind="Sparkline", attributes=[]))
+ nested = cast(ast.ReturnStatement, cast(ast.Program, self._program("return <a>x</a>")).declarations[0])
+ self.assertEqual(
+ nested.expr,
+ ast.HogQLXTag(
+ kind="a",
+ attributes=[ast.HogQLXAttribute(name="children", value=[ast.Constant(value="x")])],
+ ),
+ )
+ self.assertIsInstance(self._program("fn f() { return <em /> }"), ast.Program)
+ # The `<`-tag exception must not over-fire: `return < 5` is still a less-than expression statement, not a returnStmt.
+ lt = cast(ast.Program, self._program("return < 5"))
+ self.assertNotIsInstance(lt.declarations[0], ast.ReturnStatement)
+
# 3. <strong>{event} <em>asd</em></strong>
def test_visit_hogqlx_expr_text_and_tag_children(self) -> None:
node = self._select("select <strong>{event} <em>asd</em></strong> from events")
@@ -4615,14 +4732,12 @@ def parser_test_factory(backend: HogQLParserBackend):
),
)
- @no_memory_leak_check
def test_statement_keywords_rejected_as_expressions(self):
# Hog statement keywords (`fn`, `let`, `while`, …) aren't in the `keyword` rule, unlike `if` / `for` / `return`.
for kw in ("fn", "fun", "let", "while", "throw", "try", "catch", "finally"):
with self.assertRaises(ExposedHogQLError, msg=f"{backend}: {kw!r} should reject"):
parse_expr(kw, backend=backend)
- @no_memory_leak_check
def test_exponent_float_without_fractional_digits(self):
# FLOATING_LITERAL's fractional digits are optional: `1.e5` is one token, not `1` then ArrayAccess on `e5`.
cases = {
@@ -4637,7 +4752,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertIsInstance(node, ast.Constant, msg=f"{backend}: {src!r}")
self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_clause_keyword_after_comma_in_select_columns(self):
# `select a, where b` is one column + WHERE clause; `select a, where` (no body) is two columns.
# `where * columns('x')` could also be multiplication, but cpp prefers the clause.
@@ -4664,7 +4778,6 @@ def parser_test_factory(backend: HogQLParserBackend):
node = parse_select(src, backend=backend)
self.assertEqual(len(node.select), 2, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_limit_percent_marker_with_compound_body(self):
# `%` is overloaded (modulo + LIMIT PERCENT); compound LIMIT bodies must bind it as the PERCENT marker.
cases = (
@@ -4676,11 +4789,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 LIMIT 1+1 % OFFSET 3",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_assignment_lhs_is_any_expression(self):
# `exprStmt: expression (COLONEQUALS expression)?` — `:=` LHS has no place-expression restriction.
cases = (
@@ -4692,11 +4802,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"for (let m in 488614) 1 := 1",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_call_as_assignment_target(self):
# `f() := 1` is `Call(f) := 1`; a statement's leading expr folds its postfix `(…)` even with `:=` after.
cases = (
@@ -4707,11 +4814,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"(a) := (b) (c) := (d)", # the postfix-stop guard's real RHS scenario must still hold
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_assignment_statement_consumes_trailing_semicolon(self):
# `exprStmt: expression (COLONEQUALS expression)? SEMICOLON?` — `:=`-form consumes its trailing `;`.
# (`varDecl`'s `LET …` form has no `SEMICOLON?` and must not consume it.)
@@ -4721,11 +4825,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"if (c) a := b ;; else d",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_trailing_limit_offset_compound_body(self):
# `LIMIT`/`OFFSET` after `LIMIT BY` takes a full `columnExpr` body — lower-precedence tails must bind.
cases = (
@@ -4734,11 +4835,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select x limit a by c limit 1 + 1",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_zero_arg_lambda_as_clause_body(self):
# After `,`, a clause-keyword + `()->` is a lambda clause body; bare `()` makes the keyword a column.
cases = (
@@ -4748,11 +4846,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select 1, limit ()", # bare () — keyword is a column
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_set_level_offset_compound_body(self):
# `offsetOnlyClause: OFFSET columnExpr` at selectSetStmt level takes a full columnExpr (lower-precedence tails bind).
cases = (
@@ -4761,11 +4856,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"(select 1) offset a ?? b",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_pivot_tuple_or_single_parenthesised_operand(self):
# Per `columnExprTupleOrSingle`, a parenthesised PIVOT/UNPIVOT operand is always a `Tuple`, even for one element.
cases = (
@@ -4773,11 +4865,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select 1 from a pivot (s for (c) in (1))",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_pivot_binds_to_last_joined_table(self):
# `joinExpr PIVOT` binds to the immediately-preceding `joinExpr`; after a constraint or explicit parens it wraps the whole chain.
cases = (
@@ -4787,11 +4876,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select 1 from (a join b) pivot (x for y in (z))",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_columns_macro_asterisk_form_as_list_element(self):
# `COLUMNS(…)` tries `columnExprList` before `* EXCLUDE` / `id.* …`, so an asterisk-form + postfix call is `ColumnsList(ExprCall(asterisk-form))`.
cases = (
@@ -4805,11 +4891,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"columns('re')",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_columns_replace_item_name_is_the_as_keyword(self):
# `columnsReplace: columnExpr AS identifier` — the replacement name can itself be the keyword `as`.
cases = (
@@ -4820,11 +4903,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"(* replace(a as b))", # guard: ordinary name
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_clause_keyword_then_postfix_op_is_a_column(self):
# Clause body can't start with a postfix op, so `qualify?.q` / `prewhere::q` keep the keyword as a column.
for src in (
@@ -4839,7 +4919,6 @@ def parser_test_factory(backend: HogQLParserBackend):
node = parse_select("select q, having y", backend=backend)
self.assertEqual(len(node.select), 1, msg=f"{backend}: having y")
- @no_memory_leak_check
def test_from_after_comma_needs_a_table_reference(self):
# FROM's body is a `joinExpr`, not a `columnExpr` — `from` after a comma stays a Field unless a table-ref starter follows.
for src in ("select q, from", "select q, from + 1", "select q, from()"):
@@ -4851,7 +4930,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertEqual(len(node.select), 1, msg=f"{backend}: from t")
self.assertIsNotNone(node.select_from, msg=f"{backend}: from t")
- @no_memory_leak_check
def test_clause_keyword_asterisk_then_postfix_is_a_clause(self):
# `<clause-kw> * <postfix-op>` is the clause with `*` spread + postfix; `*` mult RHS can't begin with a postfix op.
for src in (
@@ -4866,7 +4944,6 @@ def parser_test_factory(backend: HogQLParserBackend):
node = parse_select("select q, where * r", backend=backend)
self.assertEqual(len(node.select), 2, msg=f"{backend}: where * r")
- @no_memory_leak_check
def test_pivot_tuple_or_single_operand_with_postfix(self):
# PIVOT operand is `Tuple` only when `)` is followed by `FOR`/`IN`; `(n)()` takes the columnExpr branch (paren-expr + postfix call).
cases = (
@@ -4875,11 +4952,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select 1 from a unpivot (m for (n) in (p))", # guard: bare paren stays a Tuple
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_window_frame_between_falls_back_to_field(self):
# After ROWS/RANGE, `between` is ambiguous: `frameBetween` alt OR `frameStart` whose columnExpr is the `between` Field.
cases = (
@@ -4887,11 +4961,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select 1 from a window w as (range between 1 preceding and 2 following)", # guard: real BETWEEN frame
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_pivot_operand_containing_in(self):
# PIVOT operand is full `columnExpr`, so `for n in p in (r)` → operand `n in p` + structural `IN (r)`.
cases = (
@@ -4901,11 +4972,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select 1 from a pivot (m for n in (r))", # guard: simple form
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_decoration_after_pivot(self):
# `tableExpr PIVOT (…)` is itself a `tableExpr` — it can chain into alias, FINAL/SAMPLE, further PIVOT, or JOIN.
cases = (
@@ -4919,11 +4987,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 FROM t PIVOT (a FOR b IN (c)) JOIN u ON x",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_clause_keyword_as_last_group_by_key(self):
# The last GROUP BY key can be a clause-keyword Field (e.g. `window`); the next clause then opens normally.
for kw in ("window", "having", "qualify"):
@@ -4935,7 +5000,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertEqual(len(node.group_by or []), 2, msg=f"{backend}: {kw}")
self.assertIsNotNone(node.having, msg=f"{backend}: {kw}")
- @no_memory_leak_check
def test_integer_literal_above_i64_max(self):
# Above-i64 ints are kept lossless via the `value_type: "number"` string envelope (orjson rejects >64-bit number tokens).
cases = {
@@ -4953,7 +5017,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
self.assertIsInstance(node.value, int, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_string_escape_nul_bel_vtab(self):
# cpp drops `\0` (NUL ignored), decodes `\a`→0x07, `\v`→0x0B; `\0` also affects quoted identifiers.
cases = (
@@ -4964,11 +5027,8 @@ def parser_test_factory(backend: HogQLParserBackend):
r'"a\0b"',
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_reserved_keyword_alias_rejected(self):
# `assertValidAlias` fires at all four alias sites (AS-infix, alias-before, implicit, table); quoted forms opt out.
for src in (
@@ -4988,7 +5048,6 @@ def parser_test_factory(backend: HogQLParserBackend):
):
parse_select(src, backend=backend)
- @no_memory_leak_check
def test_settings_and_top_clause_error_class(self):
# SETTINGS/TOP parse but the visitor rejects them — `NotImplementedError` is `InternalHogQLError` and is rewritten to `ExposedHogQLError` at the parser boundary.
for src in ("SELECT 1 SETTINGS x = 1", "SELECT TOP 5 x FROM t"):
@@ -4999,7 +5058,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertIs(type(backend_cm.exception), type(cpp_cm.exception), msg=f"{backend}: {src!r}")
self.assertNotIsInstance(backend_cm.exception, SyntaxError, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_window_frame_non_int_bound_keeps_constant(self):
# Unwrap a frame-bound Constant to a bare number only when integer; floats / strings keep the Constant.
cases = (
@@ -5008,25 +5066,19 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT count() OVER (ROWS 2 PRECEDING) FROM t", # guard: int still bare
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_boolean_keyword_as_call_name(self):
# `true`/`false` are identifiers in the grammar (Bool Constants only as a bare columnIdentifier); as a call name they're `Call(name=...)`.
# `null` differs — `NULL` is a real lexer keyword, so `null(1)` stays an `ExprCall` on Null Constant.
for src in ("true(1)", "false(1)", "null(1)"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# guard: bare true/false/null are still Constants
for src, val in (("true", True), ("false", False), ("null", None)):
- node = parse_expr(src, backend="rust-json")
+ node = parse_expr(src, backend=backend)
self.assertIsInstance(node, ast.Constant, msg=src)
self.assertEqual(node.value, val, msg=src)
- @no_memory_leak_check
def test_hex_integer_literal_baseline(self):
# Pins plain `0x…` parsing against hex-float-lexer regressions; `e`/`E` are hex digits here, not exponent markers.
cases = {
@@ -5058,7 +5110,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
self.assertIsInstance(node.value, int, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_hex_float_literal_c99(self):
# Hex-float `FLOATING_LITERAL` is strict C99 — `p`/`P` is the only exponent marker; `e`/`E` always lexes as a hex digit.
cases = {
@@ -5090,7 +5141,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertIsInstance(node.value, float, msg=f"{backend}: {src!r}")
self.assertEqual(node.value, expected, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_hex_e_is_hex_digit_not_exponent_marker(self):
# `0x1e+4` is `0x1e` (=30) + `4`, not a hex-float — only `p`/`P` marks the exponent (strict C99, matches ClickHouse).
for src, op, lhs, rhs in (
@@ -5106,7 +5156,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertEqual(node.left.value, lhs, msg=f"{backend}: {src!r}")
self.assertEqual(node.right.value, rhs, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_hex_float_in_expression_context(self):
# Pins that the lexer recognises a whole hex-float as one token usable inside arithmetic.
for src, op, lhs, rhs in (
@@ -5122,13 +5171,11 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertEqual(node.left.value, lhs, msg=f"{backend}: {src!r}")
self.assertEqual(node.right.value, rhs, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_hex_float_no_integer_part_rejected(self):
# `0x.8p3` lacks HEX_DIGIT+ before the dot — invalid per both FLOATING_LITERAL and HEXADECIMAL_LITERAL.
with self.assertRaises(ExposedHogQLError, msg=f"{backend}: '0x.8p3'"):
parse_expr("0x.8p3", backend=backend)
- @no_memory_leak_check
def test_cast_type_arg_with_parenthesized_expr(self):
# `CAST(x AS name(args))` — the `ColumnTypeExprParam` arglist admits arbitrary columnExprs including ones with their own `(…)`.
cases = (
@@ -5137,11 +5184,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"cast(x as a(if((c), d, e)))",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_subquery_arg_call_then_second_call(self):
# `f(select 1)()` — `(select 1)` is `ColumnExprCallSelect`, the trailing `()` is a separate `ColumnExprCall` postfix nesting on top.
cases = (
@@ -5150,11 +5194,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"f(select 1)(x)(y)",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_between_not_lambda_lower_bound(self):
# `BETWEEN <low>`'s AND-reservation must propagate through a `NOT`-wrapped lambda low bound so the lambda doesn't over-consume `…and c`.
cases = (
@@ -5162,11 +5203,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"a between not x -> y and z",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_chained_between_inner_end_position(self):
# Left-recursive `between`: `a between L1 and H1 between L2 and H2` parses as `BetweenExpr(BetweenExpr(a, L1, H1), L2, H2)`.
# The inner BetweenExpr's `.end` must stop at H1 (offset of `2` here), not extend through H2.
@@ -5181,7 +5219,6 @@ def parser_test_factory(backend: HogQLParserBackend):
self.assertEqual(inner.end, 24, msg=f"{backend}: inner.end={inner.end}, expected 24")
self.assertEqual(outer.end, 40, msg=f"{backend}: outer.end={outer.end}, expected 40")
- @no_memory_leak_check
def test_bare_asterisk_clause_body_after_comma(self):
# `select a, where *` opens the WHERE clause with a bare `*` body; later LIMIT / GROUP BY / etc. is a normal subsequent clause.
cases = (
@@ -5194,11 +5231,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"select a, qualify * limit 1",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_placeholder_statement_then_postfix_call_or_property(self):
# `{expr}` at statement start is a placeholder; trailing `(…)` or `.x` is a postfix on it (not a `block` statement).
cases = (
@@ -5208,11 +5242,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"{ {1}() }",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_placeholder_as_alias_inside_call_args(self):
# `f({placeholder} AS alias, …)` — the placeholder is a columnExpr admitting a trailing `AS alias`, just like any other expression.
# Caught by the retention query builder emitting `has({start_event_timestamps} as _start_event_timestamps, {min_timestamp})`.
@@ -5223,11 +5254,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"if(has({x} as _x, {y}), _x, [])",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_is_only_consumes_known_tails(self):
# `IS` is only `IS [NOT] NULL` / `IS [NOT] DISTINCT FROM y` per cpp's grammar; in Hog program mode anything else falls back to per-token ExprStatements (e.g. `this is a string` parses as four bare identifier statements).
# Caught by `test_metadata.py::test_string_template` parsing `"this is a {event} string"` as `HogLanguage.HOG`.
@@ -5241,11 +5269,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"x is not distinct from y",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_window_frame_bound_low_precedence_value(self):
# Window frame bound is a full `columnExpr` — admits comparison / AND / OR (BETWEEN still splits on its own AND).
cases = (
@@ -5254,14 +5279,10 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT count() OVER (ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t", # guard: real BETWEEN
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_join_op_modifier_arity_validation(self):
# Each `joinOp` alt allows at most one ALL/ANY/ASOF; ANTI/SEMI combine only with ASOF as `ASOF (ANTI|SEMI)`.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
"SELECT 1 FROM a ANTI ASOF JOIN b ON 1",
@@ -5282,11 +5303,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 FROM a ASOF LEFT JOIN b ON 1",
"SELECT 1 FROM a SEMI LEFT JOIN b ON 1",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_group_by_all_falls_back_to_columns_on_postfix(self):
# `ALL` is also in the `keyword` rule — any postfix after `ALL` makes it a `Field('ALL')` columnExpr, not the all-mode marker.
for src in (
@@ -5296,18 +5314,12 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT a FROM t GROUP BY ALL[1]",
"SELECT a FROM t GROUP BY ALL()",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
# Guard: bare `ALL` (clause terminator follows) still hits the all-mode marker.
- oracle = parse_select("SELECT a FROM t GROUP BY ALL", backend="cpp-json")
- got = parse_select("SELECT a FROM t GROUP BY ALL", backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+ self._assert_ast("SELECT a FROM t GROUP BY ALL", "select")
- @no_memory_leak_check
def test_with_rollup_cube_totals_chain_grammar(self):
# `groupByClause … (WITH (CUBE|ROLLUP))? (WITH TOTALS)?` — at most one CUBE/ROLLUP, then optional TOTALS, in order.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
"SELECT a FROM t GROUP BY a WITH ROLLUP WITH CUBE",
@@ -5326,29 +5338,21 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT a FROM t GROUP BY a WITH ROLLUP WITH TOTALS",
"SELECT a FROM t GROUP BY a WITH CUBE WITH TOTALS",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_pivot_in_list_must_be_non_empty(self):
# `pivotColumn`'s `IN ( columnExprList )` is non-empty.
- from posthog.hogql.errors import BaseHogQLError
with self.assertRaises((BaseHogQLError, SyntaxError)):
- parse_select("SELECT 1 FROM t PIVOT (sum(x) FOR y IN ())", backend="rust-json")
+ parse_select("SELECT 1 FROM t PIVOT (sum(x) FOR y IN ())", backend=backend)
with self.assertRaises((BaseHogQLError, SyntaxError)):
parse_select("SELECT 1 FROM t PIVOT (sum(x) FOR y IN ())", backend="cpp-json")
# Guard: populated list still parses.
src = "SELECT 1 FROM t PIVOT (sum(x) FOR y IN (1, 2))"
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_trim_substring_must_be_string_literal(self):
# `TRIM (LEADING|TRAILING|BOTH string FROM columnExpr)` — `string` is `STRING_LITERAL | templateString` only.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
"TRIM(BOTH x FROM y)",
@@ -5361,11 +5365,8 @@ def parser_test_factory(backend: HogQLParserBackend):
parse_expr(src, backend=backend)
# Guards: string literal + template string still parse.
for src in ("TRIM(BOTH 'x' FROM y)", "TRIM(LEADING f'x' FROM y)"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_cte_list_paren_after_non_paren_cte(self):
# `, (` after a CTE continues the list — paren-subquery or paren-expr as next CTE, not a SELECT-start under trailing-comma tolerance.
for src in (
@@ -5376,11 +5377,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"WITH 1 AS a, (x -> x + 1) AS f SELECT f(a)",
"WITH count() AS c, (x -> x + 1) AS f SELECT f(c)",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_group_by_cube_rollup_continues_list(self):
# `CUBE(...)` / `ROLLUP(...)` followed by `, <more>` is a regular function call; the specialised mode commits only when no list continuation follows.
for src in (
@@ -5389,19 +5387,14 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM t GROUP BY ROLLUP(a), b",
"SELECT * FROM t GROUP BY a, CUBE(b)",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
# Bare `GROUP BY CUBE(...)` (no trailing keys) still uses the mode.
for src in (
"SELECT * FROM t GROUP BY CUBE(a)",
"SELECT * FROM t GROUP BY ROLLUP(a)",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_trailing_comma_after_joined_table_chain(self):
# A stray trailing comma after a constrained JOIN chain (`FROM a JOIN b ON 1,`) falls off the joinExpr without requiring a next table atom.
for src in (
@@ -5409,34 +5402,24 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM a JOIN b USING (x),",
"SELECT * FROM a JOIN b ON 1 JOIN c ON 1,",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_unterminated_block_comment_lexes_as_div_asterisk(self):
# `/* … */` only matches with a closing `*/`; unterminated `/*` falls back to `/ *` tokens that the grammar then evaluates normally.
for src in ("1 /*", "1 /* "):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# Unterminated `/*` + ident lexes as `1 / * ident`; expression parse fails on the extraneous tokens.
- from posthog.hogql.errors import BaseHogQLError
for src in ("1 /* unclosed", "a /* unclosed"):
with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
parse_expr(src, backend=backend)
# Guard: closed `/* … */` is still trivia.
- oracle = parse_expr("1 /* ok */ + 2", backend="cpp-json")
- got = parse_expr("1 /* ok */ + 2", backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+ self._assert_ast("1 /* ok */ + 2", "expr")
- @no_memory_leak_check
def test_interpolate_no_trailing_comma(self):
# `INTERPOLATE (…)` body is `interpolateExpr (COMMA interpolateExpr)*` — no trailing comma.
- from posthog.hogql.errors import BaseHogQLError
with self.assertRaises((BaseHogQLError, SyntaxError), msg=backend):
parse_select(
@@ -5444,49 +5427,34 @@ def parser_test_factory(backend: HogQLParserBackend):
backend=backend,
)
- @no_memory_leak_check
def test_boolean_dot_chain_is_field_not_array_access(self):
# `true.x` is `Field(['true','x'])` — bools act as identifiers in `columnIdentifier` chain position, not Bool Constant + `.x` postfix.
cases = ("true.x", "false.x", "TRUE.x", "true.x.y", "false.foo.bar")
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# Guards: bare `true`/`false` stay Bool Constants; `true(1)` is an ident-path Call.
for src in ("true", "false", "true(1)"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_using_empty_parens_rejected(self):
# `joinConstraintClause` requires a non-empty `columnExprList` in both `USING (…)` and `USING …` forms.
- from posthog.hogql.errors import BaseHogQLError
with self.assertRaises((BaseHogQLError, SyntaxError)):
- parse_select("SELECT * FROM a JOIN b USING ()", backend="rust-json")
+ parse_select("SELECT * FROM a JOIN b USING ()", backend=backend)
with self.assertRaises((BaseHogQLError, SyntaxError)):
parse_select("SELECT * FROM a JOIN b USING ()", backend="cpp-json")
# Populated USING still parses.
src = "SELECT * FROM a JOIN b USING (x)"
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_group_by_cube_rollup_empty_is_function_call(self):
# Empty `CUBE()`/`ROLLUP()` are ordinary Calls in the GROUP BY position, not mode markers.
for src in ("SELECT 1 GROUP BY CUBE()", "SELECT 1 GROUP BY ROLLUP()"):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
# Populated CUBE / ROLLUP still uses the mode marker.
src = "SELECT 1 GROUP BY CUBE(a, b)"
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_quoted_identifier_backslash_escapes(self):
# `QUOTED_IDENTIFIER` admits `\"`, `\\`, and `""` escapes inside `"…"`.
cases = (
@@ -5496,14 +5464,10 @@ def parser_test_factory(backend: HogQLParserBackend):
'"a"',
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_reserved_keywords_rejected_as_identifiers(self):
# `identifier` excludes NULL_SQL/INF/NAN_SQL/EXCEPT/INTERSECT and Hog-statement keywords (FN/FUN/LET/WHILE/THROW/TRY/CATCH/FINALLY).
- from posthog.hogql.errors import BaseHogQLError
expr_invalid = (
# Postfix DOT
@@ -5568,17 +5532,15 @@ def parser_test_factory(backend: HogQLParserBackend):
else:
self.assertIsNotNone(parse_expr(src, backend=backend), msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_bare_asterisk_replace_only_inside_parens(self):
# `ColumnExprAsterisk` only admits trailing EXCLUDE; `REPLACE` after `*` is valid only inside `(*…)` or `COLUMNS(*…)`.
- from posthog.hogql.errors import BaseHogQLError
invalid_select = ("SELECT * REPLACE (b AS a) FROM t",)
for src in invalid_select:
with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
parse_select(src, backend=backend)
with self.assertRaises((BaseHogQLError, SyntaxError)):
- parse_expr("* REPLACE (a AS b)", backend="rust-json")
+ parse_expr("* REPLACE (a AS b)", backend=backend)
with self.assertRaises((BaseHogQLError, SyntaxError)):
parse_expr("* REPLACE (a AS b)", backend="cpp-json")
# Guard: paren-wrapped REPLACE and bare-`*` EXCLUDE still parse.
@@ -5587,14 +5549,10 @@ def parser_test_factory(backend: HogQLParserBackend):
"(* EXCLUDE (a) REPLACE (b AS c))",
"* EXCLUDE (a)",
):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_filter_clause_invalid_before_within_group(self):
# `ColumnExprFunctionWithinGroup` has no FILTER slot.
- from posthog.hogql.errors import BaseHogQLError
for src in (
"median(x) FILTER (WHERE z) WITHIN GROUP (ORDER BY y)",
@@ -5603,14 +5561,10 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
parse_expr(src, backend=backend)
# WITHIN GROUP alone still parses.
- oracle = parse_expr("median(x) WITHIN GROUP (ORDER BY y)", backend="cpp-json")
- got = parse_expr("median(x) WITHIN GROUP (ORDER BY y)", backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=backend)
+ self._assert_ast("median(x) WITHIN GROUP (ORDER BY y)", "expr")
- @no_memory_leak_check
def test_window_function_args_no_distinct_no_inline_order_by(self):
# `ColumnExprWinFunction` takes a plain `columnExprList` — no DISTINCT, no in-args ORDER BY.
- from posthog.hogql.errors import BaseHogQLError
for src in (
"foo(a ORDER BY b) OVER ()",
@@ -5621,31 +5575,22 @@ def parser_test_factory(backend: HogQLParserBackend):
parse_expr(src, backend=backend)
# Plain forms still parse.
for src in ("foo(a) OVER ()", "foo(DISTINCT a)", "foo(a ORDER BY b)"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_unary_plus_only_on_numeric_literal(self):
# `numberLiteral`'s `+` is a sign prefix on number/INF/NAN, not a general unary op.
- from posthog.hogql.errors import BaseHogQLError
invalid = ("+a", "+(a)", "+(+a)", "+f(x)")
for src in invalid:
with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
parse_expr(src, backend=backend)
- # Guards: numeric / INF / NAN parse (NaN can't be equality-compared; pin parse success + node type).
- for src in ("+1", "+1.5", "+inf", "+nan"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertIsNotNone(got, msg=f"{backend}: {src!r}")
- if src not in ("+nan",):
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ # Guards: numeric / INF parse and pin the AST. NaN can't be equality-compared, so just assert it parses.
+ for src in ("+1", "+1.5", "+inf"):
+ self._assert_ast(src, "expr")
+ self.assertIsNotNone(parse_expr("+nan", backend=backend))
- @no_memory_leak_check
def test_column_cte_requires_identifier_after_as(self):
# `withExpr: columnExpr AS identifier` — post-AS must be a real identifier, not a number / string / paren group.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
"WITH a AS 1 SELECT a",
@@ -5656,18 +5601,14 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
parse_select(src, backend=backend)
# Identifier names continue to work.
- oracle = parse_select("WITH a AS b SELECT b", backend="cpp-json")
- got = parse_select("WITH a AS b SELECT b", backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}")
+ self._assert_ast("WITH a AS b SELECT b", "select")
- @no_memory_leak_check
def test_limit_offset_with_ties_must_precede_offset(self):
# `limitAndOffsetClause` is either `LIMIT n PERCENT? (COMMA n)? (WITH TIES)?` (compact) or `LIMIT n PERCENT? (WITH TIES)? OFFSET n` (verbose);
# `LIMIT n OFFSET m WITH TIES` matches neither — WITH TIES must precede OFFSET in the verbose form.
- from posthog.hogql.errors import BaseHogQLError
with self.assertRaises((BaseHogQLError, SyntaxError)):
- parse_select("SELECT a FROM t LIMIT 1 OFFSET 2 WITH TIES", backend="rust-json")
+ parse_select("SELECT a FROM t LIMIT 1 OFFSET 2 WITH TIES", backend=backend)
with self.assertRaises((BaseHogQLError, SyntaxError)):
parse_select("SELECT a FROM t LIMIT 1 OFFSET 2 WITH TIES", backend="cpp-json")
# Both valid forms still parse.
@@ -5676,11 +5617,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT a FROM t LIMIT 1, 2 WITH TIES",
"SELECT a FROM t LIMIT 1 WITH TIES",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_pivot_in_separator_extends_via_postfix_call(self):
# `pivotColumn`'s LHS extends past any `IN (…) (` (postfix-call on LHS); only the LAST `IN (…)` not followed by `(` is structural.
cases = (
@@ -5690,11 +5628,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 FROM t PIVOT (sum(x) FOR (y, z) IN ((a, b), (c, d)))",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_return_expr_prefix_shortened_when_assignment_follows(self):
# `return <expr>? <stmt>` where stmt starts with `:=` — cpp backtracks the expr to the shortest prefix that leaves `:=` parseable as the next stmt.
cases = (
@@ -5709,11 +5644,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"fn f() { return *columns('a') }", # no `:=`; full SpreadExpr
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_interpolate_as_lambda_value(self):
# `interpolateExpr: columnExpr (AS columnExpr)?` — AS RHS is a full columnExpr, so a lambda body is valid.
cases = (
@@ -5721,23 +5653,17 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 ORDER BY x INTERPOLATE (a AS y -> y+1)",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
# Guards: AS with a non-lambda RHS still folds as a normal column alias.
for src in (
"SELECT a AS my_alias FROM t",
'SELECT a AS "my alias" FROM t',
"SELECT 1 ORDER BY x INTERPOLATE (a AS 5)",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_hogqlx_tag_in_from_paren_decorations(self):
# `(<Tag/>)` is `LPAREN joinExpr RPAREN`: alias / FINAL / SAMPLE bind to the tag inside the parens (tableExpr) but not outside (JoinExprParens isn't a tableExpr).
- from posthog.hogql.errors import BaseHogQLError
accept = (
"SELECT 1 FROM (<Tag /> AS y)",
@@ -5745,9 +5671,7 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 FROM (<Tag /> FINAL)",
)
for src in accept:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
reject = (
"SELECT 1 FROM (<Tag />) AS x",
@@ -5758,7 +5682,6 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
parse_select(src, backend=backend)
- @no_memory_leak_check
def test_hogqlx_tag_text_accepts_arbitrary_non_brace_non_lt(self):
# `HOGQLX_TEXT_TEXT: ~[<{]+` — any byte except `<` and `{` is valid tag-body text.
cases = (
@@ -5770,11 +5693,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"<outer><inner>foo!bar</inner>baz&qux</outer>",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_hogqlx_tag_identifier_allows_hyphens(self):
# `HOGQLX_TAG_OPEN`/`_CLOSE` modes admit `[a-zA-Z_][a-zA-Z0-9_-]*` for tag and attribute names — hyphens are part of the ident.
cases = (
@@ -5786,14 +5706,10 @@ def parser_test_factory(backend: HogQLParserBackend):
"<a-b>{1}</a-b>",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_join_expr_parens_does_not_take_outer_alias(self):
# `JoinExprParens` isn't a `tableExpr`, so alias / FINAL / SAMPLE can't bind to a `(joinExpr)` from outside.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
"SELECT 1 FROM (t) AS x",
@@ -5813,14 +5729,10 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 FROM (SELECT 1) AS x",
)
for src in valid:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_string_literal_unknown_backslash_escapes_rejected(self):
# `ESCAPE_CHAR_COMMON` is closed: `\b \f \r \n \t \0 \a \v \\ \xNN` plus `\'`; anything else is a lexer error.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
r"'\x'", # \x without two hex digits
@@ -5843,11 +5755,8 @@ def parser_test_factory(backend: HogQLParserBackend):
r"'\xFF'",
)
for src in valid:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_sample_clause_leading_dot_float_value(self):
# Leading-dot floats `.5` lex as `Dot` + `Number`, so SAMPLE's ratio gate must admit `Dot` when followed by a Number.
cases = (
@@ -5857,14 +5766,10 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 FROM t SAMPLE 1 / .04",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_sample_clause_only_accepts_number_literals(self):
# `ratioExpr: placeholder | numberLiteral (SLASH numberLiteral)?` — each side is a `numberLiteral` only, not a general columnExpr.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
"SELECT * FROM t SAMPLE a",
@@ -5884,11 +5789,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM t SAMPLE 1 OFFSET 2",
)
for src in valid:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_join_op_grammar_alts_validation(self):
# `joinOp` has three disjoint alts:
# JoinOpInner, JoinOpLeftRight, JoinOpFull. Each keyword appears
@@ -5896,7 +5798,6 @@ def parser_test_factory(backend: HogQLParserBackend):
# LEFT / RIGHT / FULL. Rust's source-order loop set booleans
# without de-duplicating or cross-validating, so it accepted
# `INNER LEFT`, `LEFT OUTER LEFT`, `FULL INNER`, etc.
- from posthog.hogql.errors import BaseHogQLError
invalid = (
"SELECT 1 FROM a INNER LEFT JOIN b ON 1",
@@ -5923,28 +5824,20 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 FROM a ASOF LEFT JOIN b ON 1",
)
for src in valid:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_capital_F_template_string_only_in_full_template_context(self):
# `f'…'` is reachable from `templateString` (a `columnExpr`); `F'…'` only from the `fullTemplateString` entry rule.
- from posthog.hogql.errors import BaseHogQLError
for src in ("F'hello'", "F''", "F'{1+2}'"):
with self.assertRaises((BaseHogQLError, SyntaxError), msg=f"{backend}: {src!r}"):
parse_expr(src, backend=backend)
# Guard: lowercase form remains a valid column expression.
for src in ("f'hello'", "f'{1+2}'"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_empty_paren_only_clauses_rejected(self):
# `columnAliases`, `interpolateClause`'s paren body, and `columnsReplaceList` each require ≥ 1 element when parens are present.
- from posthog.hogql.errors import BaseHogQLError
invalid_select = (
"SELECT * FROM t AS x ()",
@@ -5969,21 +5862,15 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT 1 ORDER BY x INTERPOLATE (a AS b)",
"SELECT 1 ORDER BY x INTERPOLATE",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
for src in (
"COLUMNS(* REPLACE (a AS b, c AS d))",
"COLUMNS(* REPLACE (a AS b))",
):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_bare_zero_x_prefix_lexes_as_zero_plus_ident(self):
# `HEXADECIMAL_LITERAL` requires ≥ 1 hex digit after `0x`; otherwise the lexer falls back to `0` then ident `x`.
- from posthog.hogql.errors import BaseHogQLError
cases = (
"SELECT 0x AS y",
@@ -5993,16 +5880,11 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises((BaseHogQLError, SyntaxError), msg=src):
parse_select(src, backend="cpp-json")
with self.assertRaises((BaseHogQLError, SyntaxError), msg=src):
- parse_select(src, backend="rust-json")
- with self.assertRaises((BaseHogQLError, SyntaxError), msg=src):
- parse_select(src, backend="python")
+ parse_select(src, backend=backend)
# Valid hex literals (≥ 1 hex digit) must keep working.
for src in ("SELECT 0x1", "SELECT 0xFF", "SELECT 0xaB"):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_cast_type_param_group_mode_classification(self):
# `IDENT(...)` type expr commits per-group: Param renders via raw text (case-preserved, spaceless), Complex / Nested lowercase + `, `-join.
# Any depth-0 expr-shaped sibling forces Param mode for the entire group.
@@ -6027,11 +5909,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"cast(x as Foo(case when (c) then d end))",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_hogqlx_comments_skipped_between_attributes(self):
# `HOGQLX_TAG_OPEN`/`_CLOSE` modes skip block + line comments and route unknown bytes to UNEXPECTED_CHARACTER.
cases = (
@@ -6042,17 +5921,14 @@ def parser_test_factory(backend: HogQLParserBackend):
"<a /*c*/ />",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# Guard: unknown bytes (`#`, `@`) inside a tag now reject via UNEXPECTED_CHARACTER.
for src in ("<a # comment\n />", "<a @x b={1}/>"):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_expr(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_expr(src, backend="rust-json")
+ parse_expr(src, backend=backend)
- @no_memory_leak_check
def test_float_subnormal_preserved_not_flattened_to_infinity(self):
# Subnormal floats keep their value (cpp's `strtod`+errno distinguishes underflow from overflow); below the smallest subnormal → 0.0; true overflow → ±Infinity.
cases_subnormal = (
@@ -6070,7 +5946,6 @@ def parser_test_factory(backend: HogQLParserBackend):
got = parse_expr(src, backend=backend)
self.assertEqual(got.value, expected, msg=f"{backend}: {src!r}")
- @no_memory_leak_check
def test_stmt_rhs_pratt_recovers_on_infix_rhs_failure(self):
# cpp splits `let x := {} * ()` into two stmts when the `*` infix RHS rejects — the stranded operator + operand become the next stmt.
cases = (
@@ -6081,20 +5956,15 @@ def parser_test_factory(backend: HogQLParserBackend):
"let x := f() * ()",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
# Guard: a valid full expression still parses greedily — recovery only fires when RHS rejects.
for src in (
"let x := {} * (1)",
"let x := 1 + 2",
"let x := 1",
):
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_unpivot_emits_include_nulls_false_by_default(self):
# `JoinExprUnpivot` always emits `include_nulls` — `false` by default, `true` when `INCLUDE NULLS` is present.
cases = (
@@ -6102,11 +5972,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM t UNPIVOT INCLUDE NULLS (val FOR month IN (a, b))",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_not_with_keyword_infix_treats_not_as_field(self):
# `NOT <kw-infix> <rhs>` is `Field([not]) <kw-infix> <rhs>` when the infix RHS is valid; otherwise `Not(Field(kw))`.
cases = (
@@ -6117,9 +5984,7 @@ def parser_test_factory(backend: HogQLParserBackend):
"NOT IS NOT NULL",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# Guards: unary-NOT shapes work when the rhs is a complete columnExpr (no kw-infix gap).
for src in (
"NOT x",
@@ -6127,11 +5992,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"not in (1,2)", # IN takes a paren-list, parses as Not(Call(in))
"NOT IN (1)",
):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_multi_join_with_stacked_on_using_clauses(self):
# Multi-JOIN with stacked constraints binds right-associatively: in `a JOIN b JOIN c ON1 ON2`, ON1 attaches to `c`, ON2 to `b`.
cases = (
@@ -6142,9 +6004,7 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM a JOIN b JOIN c JOIN d ON 1 ON 2 ON 3",
)
for src in cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
# Guards: the interleaved / single-constraint shapes still
# parse the same way.
for src in (
@@ -6152,11 +6012,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM a JOIN b ON 1",
"SELECT * FROM a JOIN b USING (x)",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_enum_cast_rejected_as_unsupported(self):
# `ColumnTypeExprEnum` (`ident(enumValue,…)` where `enumValue: STRING = number`) is explicitly unsupported by the visitor.
for src in (
@@ -6168,11 +6025,10 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src) as cpp_cm:
parse_expr(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src) as rust_cm:
- parse_expr(src, backend="rust-json")
+ parse_expr(src, backend=backend)
self.assertIn("ColumnTypeExprEnum", str(cpp_cm.exception), msg=src)
self.assertIn("ColumnTypeExprEnum", str(rust_cm.exception), msg=src)
- @no_memory_leak_check
def test_raw_type_param_text_rejects_null_inf_nan_keywords(self):
# cpp's `columnTypeExpr` Param alt routes identifier-shaped
# tokens through the `identifier` rule, which omits NULL /
@@ -6196,7 +6052,7 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_expr(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_expr(src, backend="rust-json")
+ parse_expr(src, backend=backend)
# Guards: legitimate parametric type casts still parse.
for src in (
"cast(x as Tuple(Int, String))",
@@ -6206,11 +6062,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"cast(x as FixedString(16))",
"cast(x as Decimal(10, 2))",
):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_stmt_expression_pratt_recovers_at_statement_level(self):
# `x *= 2` has no `*=` token: splits into two stmts (`x` and `* = 2` → Compare(Field('*'), '==', 2)).
cases = (
@@ -6219,16 +6072,11 @@ def parser_test_factory(backend: HogQLParserBackend):
"let x := 1; x *= 2;",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
# Guards: `* = 2` is a Compare; `* 2` is two ExprStatements; `x * y` is a single multiplication.
for src in ("* = 2", "* 2", "x * y", "x = 2"):
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_let_decl_shortens_rhs_when_trailing_colon_equals(self):
# `LET ident := <expr>` has no slot for a trailing `:=`; cpp shortens the expr to its leading primary so the trailing `:=` opens a new stmt.
cases = (
@@ -6237,9 +6085,7 @@ def parser_test_factory(backend: HogQLParserBackend):
"let x := (1) * (2) := 3",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
# Guards: ident-chain RHS keeps the full expression via the NamedArgument path.
for src in (
"let x := y",
@@ -6248,11 +6094,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"let x := y * z := 1",
"let x := y * z := 1;",
):
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_bare_assignment_lead_chains_through_second_colon_equals(self):
# `IDENT := <rhs> := <outer>` — the *second* `:=` is the stmt-level varAssignment; the leading `IDENT := <rhs>` becomes a NamedArgument lvalue.
cases = (
@@ -6263,9 +6106,7 @@ def parser_test_factory(backend: HogQLParserBackend):
"a := 'str' := 2",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
# Guards: existing single- and ident-chain forms.
for src in (
"a := 1",
@@ -6276,11 +6117,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"if (c) a := b",
"if (c) a := b ; else d",
):
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_pivot_column_lhs_extends_past_in_via_infix_operators(self):
# `pivotColumn`'s LHS extends through ANY infix operator after an `IN(…)`; the structural IN is the LAST one not followed by an extender.
same_ast = (
@@ -6305,14 +6143,10 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM t PIVOT(1 FOR a IN (b))",
)
for src in same_ast:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_parse_order_expr_silently_drops_trailing_tokens(self):
# `parse_order_expr_json` parses one OrderExpr and silently drops anything trailing (incl. INTERPOLATE, which is one level up).
- from posthog.hogql.parser import parse_order_expr
for src in (
"a ASC extra",
@@ -6320,11 +6154,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"a WITH FILL INTERPOLATE (b)",
"a WITH FILL FROM 1 TO 10 INTERPOLATE (b)",
):
- oracle = parse_order_expr(src, backend="cpp-json")
- got = parse_order_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "order")
- @no_memory_leak_check
def test_pivot_group_by_with_empty_list_rejected(self):
# `GROUP BY` (PIVOT-level included) requires a non-empty `columnExprList`.
for src in (
@@ -6334,7 +6165,7 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_select(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_select(src, backend="rust-json")
+ parse_select(src, backend=backend)
# Guard: the non-empty and trailing-comma forms still parse.
for src in (
"SELECT * FROM t PIVOT(sum(a) FOR b IN (1) GROUP BY a)",
@@ -6342,11 +6173,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM t PIVOT(sum(a) FOR b IN (1) GROUP BY a,)",
"SELECT * FROM t PIVOT(sum(a) FOR b IN (1))",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_return_expr_prefix_shortening_admits_keyword_head(self):
# A leading keyword (`return return *(...) := X`) is a valid shortening head: expr = Field(['return']), `* (...) := X` is the next stmt.
cases = (
@@ -6354,9 +6182,7 @@ def parser_test_factory(backend: HogQLParserBackend):
"return return * ( 'e' ) := ( 'e' )",
)
for src in cases:
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
# Guards: existing shortening shapes still work.
for src in (
"return * columns('a') := 1",
@@ -6367,11 +6193,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"return x",
"return 1 + 2",
):
- oracle = parse_program(src, backend="cpp-json")
- got = parse_program(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "program")
- @no_memory_leak_check
def test_hogqlx_drops_whitespace_only_children_containing_newline(self):
# `HogqlxTagElementNested` drops child text runs that are all-whitespace AND contain a newline (so pretty-printed HOGQLX has no spurious Constant children).
for src in (
@@ -6380,9 +6203,7 @@ def parser_test_factory(backend: HogQLParserBackend):
"<a>{x}\n</a>",
"<a>\n <b/>\n</a>",
):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# Guards: pure-space/tab (no newline) and mixed-content runs are kept.
for src in (
"<a> </a>",
@@ -6392,11 +6213,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"<a></a>",
"<a/>",
):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_interval_combined_string_validates_count_and_unit(self):
# `INTERVAL '<count> <unit>'` requires an ASCII-digit count and a literal-lowercase unit; each invalid input must surface the same error string in both parsers.
cases = (
@@ -6411,22 +6229,17 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src) as cpp_cm:
parse_expr(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src) as rust_cm:
- parse_expr(src, backend="rust-json")
+ parse_expr(src, backend=backend)
self.assertIn(expected_msg, str(cpp_cm.exception), msg=src)
self.assertIn(expected_msg, str(rust_cm.exception), msg=src)
# Guard: valid combined-string and expr+unit forms still parse.
for src in ("INTERVAL '1 day'", "INTERVAL '5 days'", "INTERVAL 1 day", "INTERVAL 1 DAY"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_in_cohort_falls_back_to_identifier_when_rhs_missing(self):
# `IN COHORT` only commits when a columnExpr follows; otherwise `cohort` is the IN rhs identifier (`a IN cohort` → Compare(a, "in", Field('cohort'))).
for src in ("a IN COHORT", "a NOT IN COHORT", "a IN cohort"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
for src in (
"SELECT a IN COHORT, b FROM t",
"SELECT * FROM t WHERE x IN cohort",
@@ -6434,16 +6247,11 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM t WHERE x IN cohort ORDER BY y",
"SELECT a IN cohort LIMIT 1",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
# Guard: when an expression-starter follows, COHORT remains the marker.
for src in ("a IN COHORT 1", "a IN COHORT t.id", "a NOT IN COHORT 1", "a IN cohort + 1"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_tuple_access_rejects_leading_zero_index(self):
# Postfix `.<index>` requires `DECIMAL_LITERAL`; leading-zero numbers lex as `OCTAL_PREFIX_LITERAL` and are rejected.
for src in (
@@ -6456,30 +6264,24 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_expr(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_expr(src, backend="rust-json")
+ parse_expr(src, backend=backend)
# Guards: single-zero, multi-digit, and float-style chains.
for src in ("a.0", "a.1", "a.999", "a.1.5", "a.0.5", "a?.0", "a?.1"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_with_cte_admits_primary_form_keywords_as_name(self):
# CTE names can be any keyword in `identifier` — including primary-form heads (CASE / CAST / SELECT / NOT).
for kw in ("select", "case", "cast", "not"):
src = f"WITH {kw} AS (SELECT 1) SELECT * FROM {kw}"
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
# Guard: NULL / INF / NAN / INTERSECT stay rejected — omitted from `keyword`.
for kw in ("null", "inf", "nan", "intersect"):
src = f"WITH {kw} AS (SELECT 1) SELECT * FROM {kw}"
with self.assertRaises(ExposedHogQLError, msg=src):
parse_select(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_select(src, backend="rust-json")
+ parse_select(src, backend=backend)
- @no_memory_leak_check
def test_join_on_with_comma_separated_exprs_rejected(self):
# ON takes a comma-separated `columnExprList` per the grammar; the visitor then rejects multi-expr ON as unsupported.
for src in (
@@ -6489,7 +6291,7 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_select(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_select(src, backend="rust-json")
+ parse_select(src, backend=backend)
# Guards: single-expr ON, USING, CROSS JOIN, and comma-cross-join.
for src in (
"SELECT * FROM a JOIN b ON x",
@@ -6498,11 +6300,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"SELECT * FROM a CROSS JOIN b",
"SELECT * FROM a, b",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_cast_type_compound_loop_stops_at_non_identifier_keyword(self):
# `columnTypeExpr`'s compound alt is `identifier identifier+`; NULL / INF / NAN aren't in `identifier`, so `cast(x as Int NULL)` rejects.
# `Array(Int NULL)` is intentionally omitted — that routes through ColumnTypeExprParam's raw-text fallback (separate problem).
@@ -6516,7 +6315,7 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_expr(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_expr(src, backend="rust-json")
+ parse_expr(src, backend=backend)
# Guards: valid compound and nested forms.
for src in (
"cast(x as Int)",
@@ -6526,11 +6325,8 @@ def parser_test_factory(backend: HogQLParserBackend):
"cast(x as Foo Bar Baz)",
"cast(x as Foo Not Bar)",
):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_call_arg_select_releases_when_followed_by_keyword_infix(self):
# `f((SELECT 1) IN [1,2])` — the first call arg is the full Compare; keyword-led infixes (IN/LIKE/IS/BETWEEN + NOT-variants) must release the SELECT-as-arg arm.
cases = (
@@ -6546,16 +6342,11 @@ def parser_test_factory(backend: HogQLParserBackend):
"f((SELECT 1) NOT BETWEEN 1 AND 2)",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# Guard: bare-SELECT call argument.
for src in ("f((SELECT 1))", "f(SELECT 1)"):
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
- @no_memory_leak_check
def test_named_argument_admits_identifier_shaped_keywords(self):
# `ColumnExprNamedArg: identifier COLONEQUALS columnExpr` — `true`/`false` are plain IDENTIFIERs in the lexer; soft keywords pass via `keyword`.
cases = (
@@ -6568,17 +6359,14 @@ def parser_test_factory(backend: HogQLParserBackend):
"f(x := 1)",
)
for src in cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
# Guard: NULL / INF / NAN aren't in `identifier`, so they stay rejected.
for src in ("f(null := 1)", "f(inf := 1)", "f(nan := 1)"):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_expr(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_expr(src, backend="rust-json")
+ parse_expr(src, backend=backend)
- @no_memory_leak_check
def test_null_inf_nan_rejected_in_hog_identifier_slots(self):
# `varDecl`, `funcStmt`, `catchBlock`, `forInStmt`, and lambda heads all route through `identifier`, which omits NULL / INF / NAN / Hog-stmt keywords.
program_cases = (
@@ -6607,7 +6395,7 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_program(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_program(src, backend="rust-json")
+ parse_program(src, backend=backend)
# Guards: identifier-shaped slots still parse.
valid_cases = (
("let true := 1", "program"),
@@ -6621,30 +6409,21 @@ def parser_test_factory(backend: HogQLParserBackend):
("lambda x: x", "expr"),
)
for src, kind in valid_cases:
- parse_fn = parse_program if kind == "program" else parse_expr
- oracle = parse_fn(src, backend="cpp-json")
- got = parse_fn(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, kind)
- @no_memory_leak_check
def test_true_false_admitted_as_identifier_in_chain_and_table_positions(self):
# `true`/`false` are plain IDENTIFIERs in the lexer; they lift to Bool Constants only in the bare-Field branch.
expr_cases = ("x.true", "x.false", "x.true.false")
for src in expr_cases:
- oracle = parse_expr(src, backend="cpp-json")
- got = parse_expr(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "expr")
select_cases = (
"SELECT * FROM x.true",
"SELECT * FROM x.false",
"WITH x(true, false) AS (SELECT 1, 2) SELECT * FROM x",
)
for src in select_cases:
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_join_constraint_rejected_on_lead_table_and_cross_join(self):
# `joinConstraintClause` attaches to `JoinExprOp` / `JoinExprPositional` only — not to the lead `JoinExprTable` or `JoinExprCrossOp`.
for src in (
@@ -6674,7 +6453,7 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_select(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_select(src, backend="rust-json")
+ parse_select(src, backend=backend)
# Guards: regular JOIN+constraint, stacked ON chains, bare CROSS JOIN.
for src in (
"SELECT * FROM a JOIN b ON 1",
@@ -6689,11 +6468,8 @@ def parser_test_factory(backend: HogQLParserBackend):
# `sample` as an ident inside USING(…) — the `(` follow-token defers to the constraint parser, not the USING-SAMPLE guard.
"SELECT * FROM a JOIN b USING (sample)",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
- @no_memory_leak_check
def test_columns_exclude_replace_reject_reserved_keywords(self):
# `columnsExcludeItem` and `columnsReplaceItem` use the strict `identifier` rule (excludes NULL/INF/NAN/EXCEPT/INTERSECT + Hog-stmt keywords).
for src in (
@@ -6708,15 +6484,1367 @@ def parser_test_factory(backend: HogQLParserBackend):
with self.assertRaises(ExposedHogQLError, msg=src):
parse_select(src, backend="cpp-json")
with self.assertRaises(ExposedHogQLError, msg=src):
- parse_select(src, backend="rust-json")
+ parse_select(src, backend=backend)
# Guards: identifier-shaped EXCLUDE / REPLACE with admissible alias.
for src in (
"SELECT * EXCLUDE (a) FROM t",
"SELECT * EXCLUDE (a.b) FROM t",
"SELECT COLUMNS(* REPLACE (a AS b)) FROM t",
):
- oracle = parse_select(src, backend="cpp-json")
- got = parse_select(src, backend=backend)
- self.assertEqual(clear_locations(got), clear_locations(oracle), msg=f"{backend}: {src!r}")
+ self._assert_ast(src, "select")
+
+ def test_invalid_interval_in_block_body_rejected(self):
+ # Once `interval` is followed by a primary value it commits to the INTERVAL
+ # form: a missing / bad unit is a hard error, never a fall-back to
+ # `interval`-as-Field. Inside a Hog `{ … }` block body the fall-back would
+ # strand the string as a second statement, so `x -> { interval 'ln' }` would
+ # parse as `interval; 'ln'` — accepting input the cpp oracle rejects.
+ with self.assertRaises(BaseHogQLError):
+ parse_expr("x -> { interval 'ln' }", backend=backend)
+
+ def test_date_timestamp_literal_in_block_body_rejected(self):
+ # `DATE STRING` / `TIMESTAMP STRING` (the date/timestamp literal forms) are
+ # rejected — cpp parses them but its visitor has no literal node for them.
+ # rust must commit to the literal form, not treat `date` / `timestamp` as an
+ # identifier and strand the string; otherwise inside a Hog `{ … }` block body
+ # `{ date 'x' }` parses as the two statements `date; 'x'` and accepts input
+ # the cpp oracle rejects.
+ for query in ("x -> { date 'ddg' }", "x -> { timestamp 'x' }"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+
+ def test_from_table_implicit_alias_rejected(self):
+ # `from <implicit-alias>` in table position is the grammar's
+ # ColumnExprInvalidFromImplicitAlias footgun — cpp rejects it. rust
+ # parsed `select a, from b, from c` as a comma-join whose second table
+ # is `from` aliased `c`, accepting input cpp rejects. `from AS c` (explicit
+ # alias) and a plain comma-join (`select a, from b, c`) stay valid.
+ with self.assertRaises(BaseHogQLError):
+ parse_select("select a, from b, from c", backend=backend)
+ parse_select("select a, from b, c", backend=backend)
+ parse_select("select a, from b as c", backend=backend)
+
+ def test_invalid_cast_type_param_rejected(self):
+ # A parametric type's params are `columnExpr`s. rust's raw-text Param
+ # path concatenated tokens verbatim without checking the item parsed as
+ # an expression, so `cast(1 as d(()))` (empty group), `d(a() b)`
+ # (juxtaposition), and friends were accepted where cpp rejects. Each
+ # param must now validate as a columnExpr.
+ invalid = [
+ "cast(1 as d(()))",
+ "cast(1 as d(a() b))",
+ "cast(1 as d((),1))",
+ "cast(1 as Tuple(()))",
+ ]
+ for query in invalid:
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ # Valid parametric-type params still parse on both backends.
+ for query in ("cast(1 as d())", "cast(1 as d(#1))", "cast(1 as d([1]))", "cast(1 as Array(Int))"):
+ parse_expr(query, backend="cpp-json")
+ parse_expr(query, backend=backend)
+
+ def test_brace_placeholder_only_positions_reject_dict(self):
+ # `tableExpr`, `ratioExpr` (SAMPLE) and the `selectStmtWithParens`
+ # placeholder arm all admit only a placeholder `{ columnExpr }`, never
+ # a Dict. rust shared one brace parser across these slots and the expr
+ # position, so it built a Dict for `{}` / `{k: v}` and accepted input
+ # cpp rejects. Each placeholder-only slot must reject the Dict while
+ # still accepting the `{x}` placeholder.
+ dict_in_placeholder_slot = [
+ "select 1 from {}",
+ "select 1 from {1: 2}",
+ "select 1 from t sample {}",
+ "select 1 from t sample {1: 2}",
+ "{}",
+ "{1: 2}",
+ "({})",
+ ]
+ valid_placeholder = [
+ "select 1 from {x}",
+ "select 1 from t sample {x}",
+ "{x}",
+ "({x})",
+ ]
+ for query in dict_in_placeholder_slot:
+ with self.assertRaises(BaseHogQLError):
+ parse_select(query, backend=backend)
+ for query in valid_placeholder:
+ parse_select(query, backend=backend)
+
+ def test_empty_columns_call_and_star_spread_rejected(self):
+ # Empty `columns()` matches no `ColumnExprColumns*` production. rust
+ # built an empty-list ColumnsExpr and accepted it; it must instead let
+ # bare `columns()` fall back to a function call (cpp's behaviour). The
+ # `* columns()` spread is then invalid as a single expression — a
+ # for-in iterable / if / while condition — where cpp rejects it too.
+ invalid_single_expr = [
+ "for (let y in * columns()) {}",
+ "while (* columns()) {}",
+ "if (* columns()) {}",
+ ]
+ for query in invalid_single_expr:
+ with self.assertRaises(BaseHogQLError):
+ parse_program(query, backend=backend)
+ # `* columns()` as two statements (`*` then a `columns()` call), bare
+ # `columns()` / regex / list, and a non-empty `* columns('re')` spread
+ # all still parse on both backends.
+ valid = [
+ "* columns()",
+ "columns()",
+ "columns('re')",
+ "columns(a, b)",
+ "for (let y in * columns('re')) {}",
+ ]
+ for query in valid:
+ parse_program(query, backend=backend)
+
+ def test_window_name_rejects_hog_statement_keywords(self):
+ # A window name is an `identifier`, which admits only the keywords in
+ # cpp's `keyword` rule; the Hog-statement keywords are excluded, so they
+ # are not valid window names. rust accepted any keyword there. Both
+ # window-name positions are the same `identifier` rule: the `OVER <name>`
+ # target and the `WINDOW <name> AS (...)` clause. Both must reject the
+ # excluded keywords while still accepting an ordinary keyword/identifier.
+ excluded = ("finally", "try", "catch", "while", "let", "fn", "fun", "throw")
+ valid = ("select", "from", "with", "where", "w")
+ for name in excluded:
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(f"f() over {name}", backend=backend)
+ with self.assertRaises(BaseHogQLError):
+ parse_select(f"select 1 from t window {name} as (order by x)", backend=backend)
+ for name in valid:
+ parse_expr(f"f() over {name}", backend=backend)
+ parse_select(f"select 1 from t window {name} as (order by x)", backend=backend)
+
+ def test_materialized_keyword_rejected_as_identifier(self):
+ # MATERIALIZED is a lexer keyword used only in `WITH x AS MATERIALIZED
+ # (...)`; the grammar's `keyword` rule omits it, so it is not a valid
+ # identifier. rust admitted it via `kw_valid_as_identifier` /
+ # `kw_acts_as_ident_in_primary`, accepting `x.materialized`,
+ # `select materialized`, `exclude(materialized)` etc. where cpp rejects.
+ for query in ("x.materialized", "materialized", "columns(* exclude(materialized))"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ for query in ("select 1 as materialized", "select x from t as materialized", "select materialized from t"):
+ with self.assertRaises(BaseHogQLError):
+ parse_select(query, backend=backend)
+ # The legitimate MATERIALIZED keyword usage (CTE materialization) still parses.
+ for query in (
+ "with x as materialized (select 1) select 1 from x",
+ "with x as not materialized (select 1) select 1 from x",
+ ):
+ parse_select(query, backend=backend)
+
+ def test_bare_star_replace_rejected_outside_wrapper(self):
+ # `* REPLACE(...)` is a columnExpr only inside the paren forms
+ # `(* REPLACE(...))` / `(* EXCLUDE(...) REPLACE(...))` or `COLUMNS(* REPLACE(...))`.
+ # rust accepted a bare `* replace(...)` whenever a `)` followed (e.g. as a
+ # function argument or tuple element), since its guard couldn't tell a wrapper
+ # paren from a borrowed function-call one. Both must reject the bare form.
+ for query in ("full(* replace(a as b))", "* replace(a as b)", "(a, * replace(b as c))"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ with self.assertRaises(BaseHogQLError):
+ parse_select("select * replace(a as b) from t", backend=backend)
+ # Wrapped REPLACE forms (including nested) and a bare `* EXCLUDE` still parse.
+ valid = [
+ "(* replace(a as b))",
+ "(* exclude(x) replace(a as b))",
+ "columns(* replace(a as b))",
+ "((* replace(a as b)))",
+ "* exclude(a)",
+ ]
+ for query in valid:
+ parse_expr(query, backend=backend)
+
+ def test_wrapped_columns_replace_span_excludes_outer_parens(self):
+ # Only the BARE `(* [exclude] replace(...))` form has its wrapping parens
+ # in the ColumnsExpr ctx. When the ColumnsExpr instead comes from a
+ # `columns(...)` call or sits inside an EXTRA wrapping paren, cpp treats
+ # those parens as a separate `ColumnExprParens` (stripped) — the
+ # ColumnsExpr span stays inner. rust used to over-extend the span to the
+ # outer parens for every REPLACE-bearing ColumnsExpr; assert full AST
+ # parity (positions included) on both the bare and wrapped shapes.
+ for query in (
+ "(* replace(a as b))",
+ "(* exclude(x) replace(a as b))",
+ "columns(* replace(a as b))",
+ "((* replace(a as b)))",
+ "(((* replace(a as b))))",
+ "(columns(* replace(a as b)))",
+ "((columns(* replace(a as b))))",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_between_hoist_inner_wrapper_spans(self):
+ # When 2+ wrappers stack outside a BETWEEN (`1 between 2 and 3 as l :: Int`),
+ # the hoist-apply loop built each position-less and only the OUTERMOST got
+ # the outer pratt `wrap_pos` — the inner wrappers (here the Alias) stayed
+ # position-less. cpp spans each at `[lhs_start, end-of-its-own-token]`.
+ # The split now records each hoist's end and the apply loop stamps it.
+ for query in (
+ "1 between 2 and 3 as l :: Int",
+ "1 between 2 and 3 as l :: Int :: Float",
+ "1 between 2 and 3 as l [ 1 ]",
+ "1 between 2 and 3 as l . 1",
+ "1 between 2 and 3 as l ( x )",
+ "1 between 2 and 3 as l is null",
+ "1 between 2 and 3 as l or w",
+ "1 between 2 and 3 as l ? x : y",
+ "1 between 2 and 3 as l + 5",
+ "1 between 2 and 3 as l is distinct from w",
+ "1 between 2 and 3 as l",
+ "1 between 2 and 3 :: Int",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_arrow_lambda_block_body_span_with_trailing_postfix(self):
+ # An arrow lambda with a Hog BLOCK body (`x -> { … }`) ends at `}`, so a
+ # trailing postfix (`. 1`, `[1]`, `:: Int`) cannot fold into the body and
+ # binds OUTSIDE the lambda. The Lambda was then an intermediate pratt-loop
+ # lhs that the outer wrap never reached, leaving it position-less; cpp
+ # spans the Lambda over `args -> { … }`. The builder now stamps the span.
+ # (An expression body absorbs the postfix, so it never hit this.)
+ for query in (
+ "x -> { throw 0 } . 1",
+ "x, y -> { throw 0 } . 2",
+ "(a, b) -> { let z := 1 return z } . 1",
+ "x -> { throw 0 } [ 1 ]",
+ "x -> { throw 0 } :: Int",
+ "x -> { throw 0 }",
+ "x -> 1",
+ "f(x -> { throw 0 })",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_statement_leading_brace_block_vs_call(self):
+ # A statement-leading `{...}` is a Block, except when a postfix that
+ # cannot itself begin a statement follows the matching `}`: a `.` or an
+ # EMPTY `()` make the whole thing one called / accessed expression
+ # (`{1}.x`, `{1}()`). A non-empty `(expr)` IS a valid next statement, so
+ # the brace stays a Block and the `(expr)` is parsed separately
+ # (`{1} (a)` -> Block + ExprStatement). rust merged `{block} (expr)` into
+ # a single call. Both accept here, so assert full AST parity (positions
+ # included, no clear_locations) rather than just accept/reject.
+ for query in (
+ "{1} (a)",
+ "{} ('b')",
+ "{x} ('b')",
+ "{1}(a, b)",
+ "{1} ('b') ('c')",
+ "{1}(a).b",
+ "{1}()",
+ "{}()",
+ "{1}.x",
+ "{1:2} ('b')",
+ "{1}[1]",
+ # `.x` property access forces the call parse, but a leading-dot
+ # number `.5` is a valid next statement, so the brace stays a Block.
+ "{} .x",
+ "{ } .5",
+ "{ } .5.5",
+ ):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+
+ def test_columns_qualifier_rejects_invalid_identifier_keywords(self):
+ # The qualifier before `.*` inside `COLUMNS(...)` is the grammar's
+ # `identifier` (`COLUMNS LPAREN identifier DOT ASTERISK ...`), so only
+ # keywords admitted by `kw_valid_as_identifier` qualify. rust admitted any
+ # keyword there, accepting `columns(try.*)` where cpp rejects. The chain
+ # links (`columns(a.try.*)`) are `identifier` too and need the same gate.
+ excluded = (
+ "try",
+ "catch",
+ "finally",
+ "null",
+ "inf",
+ "nan",
+ "intersect",
+ "except",
+ "fn",
+ "fun",
+ "let",
+ "while",
+ "throw",
+ "materialized",
+ )
+ for name in excluded:
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(f"columns({name}.*)", backend=backend)
+ for query in ("columns(a.try.*)", "columns(a.b.catch.*)"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ # `kw_valid_as_identifier` keywords (and `true`/`false`, plain
+ # idents, and multi-level chains) remain valid qualifiers.
+ for query in (
+ "columns(week.*)",
+ "columns(select.*)",
+ "columns(interval.*)",
+ "columns(true.*)",
+ "columns(false.*)",
+ "columns(x.*)",
+ "columns(a.b.*)",
+ "columns(a.b.c.*)",
+ ):
+ parse_expr(query, backend=backend)
+
+ def test_bare_qualified_star_replace_rejected(self):
+ # A bare (unwrapped) `ColumnExprAsterisk` (grammar line 289) admits an
+ # optional trailing EXCLUDE but never REPLACE — REPLACE is a columnExpr
+ # only inside `columns(...)` / `(*...)`. rust consumed a trailing REPLACE
+ # in the bare qualified-asterisk postfix path and silently dropped it,
+ # accepting `a.* exclude(z) replace(1 as b)` where cpp rejects.
+ for query in (
+ "a.* replace(1 as b)",
+ "a.* exclude(z) replace(1 as b)",
+ "a.b.* exclude(z) replace(1 as b)",
+ ):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ # Exclude-only bare forms and the wrapped REPLACE forms still parse.
+ for query in (
+ "a.* exclude(z)",
+ "a.b.* exclude(z)",
+ "a.*",
+ "columns(a.* replace(1 as b))",
+ "columns(a.* exclude(z) replace(1 as b))",
+ "(* exclude(z) replace(1 as b))",
+ ):
+ parse_expr(query, backend=backend)
+
+ def test_columns_qualified_asterisk_continuation_positions(self):
+ # When a qualified asterisk (`a.*`) is the LHS of a postfix call or infix
+ # op inside `COLUMNS(...)`, the continuation node's span must start at the
+ # qualifier's start, not at the token after the asterisk. rust stamped the
+ # call/arith node start at the `(` / operator instead of at `a`, so both
+ # accepted but `columns[0].start` diverged. Assert full AST parity
+ # (positions included) rather than just accept/reject.
+ for query in (
+ "columns(a.*(b))",
+ "columns(a.b.*(c))",
+ "columns(a.* + 1)",
+ 'columns("iei".*(a.b, c.d))',
+ "columns(a.* exclude(z) + 1)",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_within_keyword_rejected_as_identifier(self):
+ # WITHIN is a lexer keyword used only in the `within group (...)` clause;
+ # the grammar's `keyword` rule omits it, so it is not a valid identifier.
+ # rust admitted it via `kw_valid_as_identifier` / `kw_acts_as_ident_in_primary`,
+ # accepting `within`, `x.within`, `columns(within.*)` as Fields and, at
+ # statement level, `f() within ()` as `f(); within()`. All must reject.
+ for query in ("within", "within()", "within + 1", "x.within", "1 as within", "columns(within.*)"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ for query in ("select within from t", "select 1 as within from t", "select x from t as within"):
+ with self.assertRaises(BaseHogQLError):
+ parse_select(query, backend=backend)
+ for query in ("f() within ()", "within ()", "within"):
+ with self.assertRaises(BaseHogQLError):
+ parse_program(query, backend=backend)
+ # The legitimate `within group (...)` clause still parses.
+ parse_expr("f() within group (order by x)", backend=backend)
+ parse_select("select f() within group (order by x) from t", backend=backend)
+
+ def test_positional_and_tuple_index_decimal_literal_parity(self):
+ # `#N` (positional ref) and `a.N` / `a?.N` (tuple access) all take a
+ # grammar DECIMAL_LITERAL index. rust's lexer folds hex / octal / float
+ # into one Number kind, so it diverged two ways: `#N` OVER-ACCEPTED
+ # hex/octal/float (`#0x6`, `#017`, `#1e3` became PositionalRef(0) via
+ # `parse().unwrap_or(0)`), while `.N` / `?.N` OVER-REJECTED leading-zero
+ # decimals (`a.08`, `a.019`) that cpp accepts because 8 and 9 are not
+ # octal digits, so the lexer reads them as DECIMAL not OCTAL. All three
+ # now share one `is_decimal_literal()` gate.
+ rejected = (
+ "#0x6",
+ "#0X6",
+ "#00",
+ "#06",
+ "#017",
+ "#007",
+ "#1e3",
+ "a.0x6",
+ "a.00",
+ "a.06",
+ "a.017",
+ "a.1e3",
+ "a?.06",
+ "a?.00",
+ )
+ for query in rejected:
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ # Decimal indices parse on both, including leading-zero forms whose digits
+ # escape the octal range (`08`, `019`). Assert full AST parity (positions
+ # included) rather than just accept/reject.
+ accepted = (
+ "#0",
+ "#6",
+ "#08",
+ "#019",
+ "#10",
+ "a.0",
+ "a.8",
+ "a.08",
+ "a.019",
+ "a.10",
+ "a?.0",
+ "a?.08",
+ "a?.019",
+ )
+ for query in accepted:
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_nested_interval_reserves_unit_for_outer(self):
+ # `INTERVAL <value> <unit>`: cpp's ALL(*) reserves the trailing unit for
+ # the OUTER interval, so a nested INTERVAL in value position never takes
+ # the unit-consuming form — it is string-only (`interval '5 day'`) or a
+ # Field / call. rust used to let the inner interval eat the unit, which
+ # over-rejected `interval interval '5 day' month` / `interval interval -
+ # x second` (expr) and over-accepted `interval interval 'jihi' month`
+ # (program, split into `interval` + `interval 'jihi' month`). The
+ # parenthesised forms were already self-contained. Both accept here, so
+ # assert full AST parity (positions included).
+ for query in (
+ "interval interval second",
+ "interval interval - x second",
+ "interval interval '5 day' month",
+ "interval interval (1) second",
+ "interval (interval '5 day') month",
+ "interval (interval '5 day' month) second",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ # A nested bad-string interval rejects on both: the inner
+ # ColumnExprIntervalString can't split into `<count> <unit>`. This must
+ # also reject at program level (rust no longer splits it into two
+ # statements once the inner string interval errors fatally).
+ for query in ("interval interval 'jihi' month", "interval interval x second"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ with self.assertRaises(BaseHogQLError):
+ parse_program("interval interval 'jihi' month", backend=backend)
+
+ def test_select_from_keyword_table_vs_invalid_from_column(self):
+ # `FROM implicitAlias # ColumnExprInvalidFromImplicitAlias` is a
+ # SELECT-COLUMN footgun only: a bare `from <ident>` in TABLE position is
+ # valid (`from b, from c` is table `from` aliased `c`). rust used to (1)
+ # over-reject explicit-FROM from-as-table cases via a misdiagnosed
+ # join.rs check, and (2) over-accept the trailing-comma `select a, from
+ # b, from (c)` because it broke the column list at the FIRST from. cpp's
+ # `selectColumnExprListBeforeFrom` makes every `from X` before the LAST
+ # one a column; only the final `from` opens the clause. Accepting cases
+ # assert full AST parity (positions included).
+ accept = (
+ # from-as-table in the FROM / join clause (explicit FROM):
+ "select a from b, from c",
+ "select * from from x",
+ "select 1 from a, from b, from(c)",
+ "select 1 from a join from b on 1",
+ "select 1 from from c",
+ "select x from t1, from t2, from t3",
+ "select 1 from b as from",
+ # the LAST `from` opens the clause; an earlier `from(...)` is a call column:
+ "select a, from (b), from (c)",
+ # single from / cross-join / subquery / union unaffected:
+ "select a, from b",
+ "select a, from b, c",
+ "select a, from (b), c",
+ "select a from b, c",
+ "select a, from (select 1 from t), c",
+ "select a, from b union all select c from d",
+ )
+ for query in accept:
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+ # Two+ top-level `from`s: every `from` before the last is a SELECT
+ # column, and a bare `from <ident>` column is the rejected footgun.
+ reject = (
+ "select from x",
+ "select a, from b, from c",
+ "select a, from b, from (c)",
+ "select a, from b, x, from (c)",
+ "select a, from b, from c, from d",
+ )
+ for query in reject:
+ with self.assertRaises(BaseHogQLError):
+ parse_select(query, backend=backend)
+
+ def test_from_trailing_comma_only_after_join_constraint(self):
+ # A trailing comma in the FROM clause is valid ONLY as the ON / USING
+ # `columnExprList`'s optional `COMMA?` (`a JOIN b ON 1,`); cpp's
+ # JoinConstraint span includes it. After a cross / plain / positional
+ # join the trailing comma is rejected. rust used to discard any
+ # post-join trailing comma (over-accepting `a, b,` / `a join b,`) and
+ # ended the constraint span before the comma (a position mismatch on the
+ # constrained cases). Accepting cases assert full AST parity (positions).
+ accept = (
+ "select x from a join b on 1,",
+ "select x from a left join b on 1,",
+ "select x from a join b using c,",
+ "select x from a join b using (c),",
+ "select x from (a join b on 1,)",
+ "select x from a join b using a, b,",
+ # controls (no trailing comma):
+ "select x from a, b",
+ "select x from a join b on 1",
+ "select x from a join b",
+ "select x from a, b, c",
+ )
+ for query in accept:
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+ # Trailing comma after a cross / plain / positional join (no constraint
+ # to own it) rejects on both.
+ reject = (
+ "select x from a, b,",
+ "select x from a cross join b,",
+ "select x from a join b,",
+ "select x from a positional join b,",
+ "select x from a join b on 1, c,",
+ "select x from a, from b,",
+ )
+ for query in reject:
+ with self.assertRaises(BaseHogQLError):
+ parse_select(query, backend=backend)
+
+ def test_interval_without_unit_does_not_over_commit(self):
+ # cpp commits to the INTERVAL form only for a STRING_LITERAL (the
+ # ColumnExprIntervalString alt). `interval <number|ident|quoted-ident>`
+ # with NO trailing unit is NOT an interval: cpp backtracks to `interval`
+ # as a Field. So at expr level it rejects (trailing tokens) on both, but
+ # at PROGRAM level it splits into two statements (`interval` + value).
+ # rust used to commit fatally for number/ident/quoted-ident too, which
+ # over-rejected the program split.
+ for query in ("interval 1", "interval x", 'interval "a"'):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ # A STRING value still commits (a bad single-token string rejects at both
+ # expr and program level — no two-statement split).
+ with self.assertRaises(BaseHogQLError):
+ parse_program("interval 'a'", backend=backend)
+ # A trailing unit still makes it a real interval Call on both backends.
+ for query in ("interval 1 day", 'interval "a" day', "interval x day"):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_statement_boundary_splits_incomplete_special_infix_and_postfix(self):
+ # At a statement boundary, an INCOMPLETE special-infix (LIKE / BETWEEN /
+ # IN / IS) or postfix (`[`) is cpp's "end this statement, start the next"
+ # shape, not an error: `week like` -> two Field statements, `"_" between
+ # "_"` -> three, `[ ] [ ]` -> two empty-array statements. rust's Pratt
+ # loop used to apply the operator greedily and error. These all parse on
+ # both backends with identical ASTs (positions included).
+ for query in (
+ "week like",
+ '"_" between "_"',
+ "[ ] [ ]",
+ "[ ] [ ] [ ]",
+ "week and",
+ "a in",
+ "a is",
+ ):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ # At EXPRESSION level there is no next statement, so the same incomplete
+ # forms stay hard errors on both backends (recovery is statement-only).
+ for query in ("week like", "[ ] [ ]", "a between b", '"_" between "_"'):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ # COMPLETE forms are unaffected — still parse identically on both.
+ for query in ("a like b", "a between b and c", "a[b]", "a in (1, 2)", "a is null", "a not like b"):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_not_and_modulo_accept_hogqlx_tag_operand(self):
+ # `<` begins a HogQLX tag as well as the less-than operator. In bounded
+ # lookahead rust used to always read `<` as less-than, so `not <a/>`
+ # stranded the tag (NOT became a Field) and `1 % <a/>` abandoned the
+ # modulo. cpp reads the tag operand. Both parse identically here.
+ for query in (
+ "not <a/>",
+ "not <a></a>",
+ "[not <a/>]",
+ "1 and not <a/>",
+ "f(not <a/>)",
+ "1 % <a/>",
+ "[1 % <a/>]",
+ "(1 % <a/>)",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ # Genuine less-than / modulo (no tag following) are unchanged.
+ for query in ("not < 2", "1 % 2", "1 % x"):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_boolean_literal_numeric_tuple_access_keeps_constant(self):
+ # `true.1` / `false.0` are tuple access on the boolean Constant, not a
+ # Field chain — cpp keeps Constant(true) as the tuple base. rust used to
+ # route every `true.`/`false.` through ident-lead, making the base a
+ # Field. `true.x` (chain), `true(1)` (call) and `null.1` are unaffected.
+ for query in ("true.1", "false.0", "true.1.2", "true.x", "true(1)", "true", "null.1"):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_return_keyword_as_identifier_before_infix_postfix(self):
+ # `return` is also a keyword-rule identifier. When it is followed by a
+ # pure infix / postfix operator, that operator binds `return` as its
+ # LHS, so the line is one exprStmt (`return :: t`, `return.x`, `return
+ # -> y`, `return = 1`, `return / 2`), not a bare return that strands the
+ # operator. A value-starter keeps the return statement (`return 1`,
+ # `return + 1`); a keyword-infix keeps the bare-return split (`return
+ # like x` is `return` + `like x`).
+ for query in (
+ "return -> y",
+ "return :: date",
+ "return . x",
+ "return ?. x",
+ "return = 1",
+ "return / 2",
+ "return || x",
+ "return < 2",
+ "return != 1",
+ "return ?? x",
+ ):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ for query in ("return 1", "return + 1", "return [1]", "return", "return like x", "return * 2"):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ # `.` is special: a leading-dot float (`return .5` -> value 0.5,
+ # `return .5.5` -> tuple-access on 0.5) is a return VALUE, while a
+ # `.`-chain-link (`return .x`) makes `return` an identifier (tuple /
+ # field). Both must match cpp (regression guard for the #16 dispatch).
+ for query in ("return .5", "return .5.5", "return . 5", "return .x"):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+
+ def test_not_before_statement_keyword_falls_back_to_field(self):
+ # At a statement boundary, `not` followed by a statement keyword that is
+ # not a valid expression operand (`let`, `throw`) is `not` as a bare
+ # Field statement followed by the keyword's statement — not a NOT whose
+ # operand fails. rust used to commit NOT to the operator and reject.
+ for query in ("not let x", "not throw x"):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ # An incomplete `not let` (no value) or a keyword that is neither a
+ # valid operand nor a complete statement still rejects on both.
+ for query in ("not let", "not while x", "not fn x"):
+ with self.assertRaises(BaseHogQLError):
+ parse_program(query, backend=backend)
+
+ def test_block_then_empty_param_lambda_is_two_statements(self):
+ # `{…} ()` is a dict / placeholder called with empty args (one
+ # exprStmt), but `{…} () -> body` is a Block followed by an empty-param
+ # lambda statement (two statements). rust used to force the empty-call
+ # interpretation and then reject when the block body was not a dict.
+ for query in ("{ } () -> 1", "{ let q := 1; } () -> 1;", "{ if (1) {} } () -> 1"):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ # Unchanged: empty call (no arrow), non-empty params, dict, plain block.
+ for query in ("{ } ()", "{ 1 } ()", "{ } (a) -> 1", "{ } () + 1", "{1: 2}", "{ let x := 1; }"):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+
+ def test_hogqlx_tag_name_rejects_non_identifier_keywords(self):
+ # A HogQLX tag/attr name is a grammar `identifier`, so a keyword head is
+ # valid only when the grammar's `keyword` rule admits it. The Hog-statement
+ # keywords (fn/fun/let/while/throw/try/catch/finally), set-op keywords
+ # (intersect/except), literal keywords (null/inf/nan) and within/materialized
+ # are omitted from that rule, so cpp rejects `<fn/>`; rust used to accept
+ # them as tag/attr names (over-accept).
+ for kw in (
+ "fn",
+ "fun",
+ "let",
+ "while",
+ "throw",
+ "try",
+ "catch",
+ "finally",
+ "intersect",
+ "except",
+ "null",
+ "inf",
+ "nan",
+ "within",
+ "materialized",
+ ):
+ for query in (f"< {kw} />", f"< a {kw} />"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+ # Keywords that the grammar's `keyword` rule admits stay valid tag names.
+ for kw in ("and", "select", "from", "by", "group", "order", "day", "sample"):
+ self.assertEqual(
+ parse_expr(f"< {kw} />", backend="cpp-json"),
+ parse_expr(f"< {kw} />", backend=backend),
+ msg=kw,
+ )
+
+ def test_not_falls_back_to_field_when_operand_invalid(self):
+ # In EXPRESSION context cpp's single-expression parse reads a leading NOT
+ # as a Field when its operand can't parse, so a following infix binds to
+ # it: `not < a` -> `(Field not) < a`, `not + a` -> `(Field not) + a`,
+ # `not in a` -> `(Field not) in a`, `not as x` -> `Field(not) AS x`. A bare
+ # `not as` keeps `Not(Field('as'))` (the operand parses). rust used to
+ # commit NOT to the unary operator and reject. `not in (1,2)` stays the
+ # unary `Not(Call(in, …))`.
+ for query in (
+ "not < a",
+ "not + a",
+ "not in a",
+ "not as",
+ "not as x",
+ "not as date",
+ "not like 'a'",
+ "not in (1,2)",
+ "not x",
+ "a not in b",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ # At a STATEMENT boundary cpp takes the shortest leading statement, so
+ # `not <op-keyword> <rhs>` is `Not(Field(<kw>))` (statement 1) and `<rhs>`
+ # opens the next statement (two declarations), not the greedy single
+ # expression. rust used to glue it into one statement.
+ for query in (
+ "not in a",
+ "not like 'a'",
+ "not and a",
+ "not is null",
+ "not * a",
+ "not ignore nulls",
+ ):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+
+ def test_in_cohort_marker_only_before_a_complete_value(self):
+ # `IN COHORT? columnExpr`: cpp takes the COHORT marker only when a complete
+ # value follows it. When COHORT is followed by an operator it is the IN rhs
+ # Field (or part of the rhs expression): `a in cohort < b` ->
+ # `(a in cohort) < b`, `a in cohort like b` -> `(a in cohort) like b`,
+ # `a in cohort * b` -> `a in (cohort * b)`. rust used to greedily eat COHORT
+ # and choke on the empty / dangling value.
+ for query in (
+ "a in cohort < b",
+ "a in cohort + b",
+ "a in cohort * b",
+ "a in cohort like b",
+ "a in cohort is null",
+ "a not in cohort < b",
+ "a not in cohort * b",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ # COHORT stays a marker before a complete value (a bare `*`, a negative
+ # number, a tag, a parenthesised/array value, or a plain primary), and a
+ # value followed by an outer infix (`cohort 1 < b`) still works.
+ for query in (
+ "a in cohort 1",
+ "a in cohort x",
+ "a in cohort *",
+ "a in cohort -1",
+ "a in cohort <foo/>",
+ "a in cohort (1)",
+ "a in cohort [1]",
+ "a in cohort 1 < b",
+ "a not in cohort 1",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_select_distinct_reread_as_column_when_no_value_follows(self):
+ # `SELECT DISTINCT? columnExprList`: DISTINCT is the modifier only when a
+ # column follows. When the next token ends the column list (comma / EOF)
+ # or opens a clause, cpp re-reads DISTINCT as the sole column Field:
+ # `SELECT DISTINCT` -> `[Field(distinct)]`, `SELECT DISTINCT ORDER BY 1` ->
+ # `[Field(distinct)]` + ORDER BY. rust used to keep DISTINCT a modifier and
+ # then reject on the empty / clause-keyword column slot.
+ for query in (
+ "SELECT DISTINCT",
+ "SELECT DISTINCT, a",
+ "SELECT DISTINCT ORDER BY 1",
+ "SELECT DISTINCT GROUP BY 1",
+ "SELECT DISTINCT WHERE 1",
+ "SELECT DISTINCT HAVING 1",
+ "SELECT DISTINCT LIMIT 1",
+ "SELECT DISTINCT group by 1",
+ ):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+ # DISTINCT stays the modifier before a real column (incl. a bare keyword
+ # column like `group` with no `BY`).
+ for query in (
+ "SELECT DISTINCT a",
+ "SELECT DISTINCT a, b",
+ "SELECT DISTINCT *",
+ "SELECT DISTINCT day",
+ "SELECT DISTINCT group",
+ ):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+ # `SELECT DISTINCT FROM x` keeps DISTINCT a modifier and rejects on both
+ # via the FROM-implicit-alias footgun (DISTINCT is NOT re-read here).
+ with self.assertRaises(BaseHogQLError):
+ parse_select("SELECT DISTINCT FROM x", backend=backend)
+
+ def test_hogqlx_attribute_and_text_child_positions_match(self):
+ # cpp positions each HogQLXAttribute (name start -> value end, or name end
+ # for a bare attribute), the string value Constant over the string token,
+ # and each text-child Constant over its raw byte span. rust left these
+ # inner nodes position-less. The shared suite strips positions, so this
+ # asserts exact-position parity (the comparison keeps positions).
+ for query in (
+ "<a b='1' />",
+ "<a b='1' c='2' />",
+ "< a and />",
+ "<a>x</a>",
+ "<a>hello world</a>",
+ "<a b='1'>text</a>",
+ "<a b={1} />",
+ "<outer><inner k='v'>t</inner></outer>",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_lambda_keyword_is_a_plain_alias_after_as(self):
+ # The grammar's explicit `AS identifier` admits every keyword, so `AS
+ # lambda` is a plain alias `Alias(expr, 'lambda')` in expression context.
+ # rust blanket-refused `AS lambda` (it only ever heads a lambda value in
+ # `INTERPOLATE (expr AS columnExpr)`), so it rejected the alias. Refuse
+ # only when a lambda BODY (`lambda [params] :`) actually follows.
+ for query in (
+ "1 as lambda",
+ "x as lambda",
+ "(1) as lambda",
+ "1 + 1 as lambda",
+ "[1 as lambda]",
+ "f(1 as lambda)",
+ "1 as lambda()",
+ "1 as lambda + 2",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ for query in ("select 1 as lambda", "select 1 as lambda, 2", "select 1 as lambda from t"):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+ # A real lambda body after `AS` is not a valid alias and rejects on both
+ # in plain expression context (the alias absorbs `lambda`, the `:` trails).
+ for query in ("1 as lambda: 2", "1 as lambda x: x", "1 as lambda x"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(query, backend=backend)
+
+ def test_empty_fstring_constant_spans_whole_token(self):
+ # An empty f-string `f''` has no interior text, so cpp spans its Constant
+ # over the whole `f''` token, not the zero-width gap between the quotes.
+ # rust positioned it at the interior; the comparison keeps positions.
+ for query in ("f''", "f'a'", "f'ab'", "f' '", "[f'']", "f'' || f''"):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_template_unknown_escape_with_multibyte_char(self):
+ # An unknown f-string escape `\X` drops the backslash and the escaped char (cpp's `STRING_TEXT` lexer behaviour). When `X` is a multibyte codepoint (`\é`, `\😀`) the rust body splitter must step past the whole codepoint — a fixed 2-byte step landed mid-char and panicked the body slice, an uncatchable `PanicException` on the json path that also escaped `except Exception`. cpp accepts all of these, so matching it (value + positions) is a parity requirement.
+ self.assertEqual(self._expr(r"f'\é'"), ast.Constant(value=""))
+ self.assertEqual(self._expr(r"f'\😀z'"), ast.Constant(value="z"))
+ self.assertEqual(self._expr(r"f'\éxyz'"), ast.Constant(value="xyz"))
+ # Full position parity against cpp for the position-carrying backends; python spans f-strings over the whole token, so it only checks structure.
+ for src in (r"f'\é'", r"f'\éxyz'", r"f'\😀z'", r"f'ab\écd'", r"f'\é{1}\😀'"):
+ expected = parse_expr(src, backend="cpp-json")
+ actual = parse_expr(src, backend=backend)
+ if backend == "python":
+ self.assertEqual(clear_locations(actual), clear_locations(expected), msg=src)
+ else:
+ self.assertEqual(actual, expected, msg=src)
+
+ def test_interpolate_expr_carries_positions(self):
+ # The INTERPOLATE item node (InterpolateExpr) was built without a position
+ # wrap, so it came back position-less; cpp spans it from the expr start to
+ # the value end (or the expr end when there is no `AS value`).
+ for query in (
+ "select 1 order by a with fill interpolate (b)",
+ "select 1 order by a with fill interpolate (b as 5)",
+ "select 1 order by a with fill interpolate (b, c)",
+ "select 1 order by a with fill interpolate (b as c, d)",
+ ):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+
+ def test_between_span_includes_parenthesized_high_closing_paren(self):
+ # A simple BETWEEN spans through the high operand's last consumed token,
+ # so a parenthesized `high` (`1 between 2 and (3)`) must include the
+ # trailing `)`. rust used `high.end` (the inner expr, parens stripped),
+ # leaving the BetweenExpr end one byte short. The comparison keeps
+ # positions.
+ for query in (
+ "1 between (2) and (3)",
+ "1 between 2 and (3)",
+ "1 between (2) and 3",
+ "1 not between 2 and (3)",
+ "a between (b) and (c)",
+ "1 between (2+3) and (4)",
+ "1 between (2) and (3) + 4",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_leading_comma_from_implicit_alias_dangling_clause(self):
+ # Under a leading/trailing comma, cpp's greedy `selectColumnExprListBeforeFrom`
+ # consumes `from <implicitAlias>` (+ any following cross-join tables) as
+ # columns up to a trailing comma when a two-token clause introducer
+ # (`USING SAMPLE` / `ARRAY JOIN`) follows it — then its visitor rejects the
+ # `ColumnExprInvalidFromImplicitAlias` column. rust used to open the FROM
+ # clause at `from f` and consume `using`/`array` as a cross-join table.
+ # A depth-0 dangling-clause forward-scan now matches cpp: both reject.
+ for query in (
+ "select 1, from f, using sample 1",
+ "select 1, from f, array join x",
+ "select 1, from f, g, using sample 1",
+ "select 1, from f, g, array join x",
+ ):
+ with self.assertRaises(BaseHogQLError, msg=query):
+ parse_select(query, backend=backend)
+ # A bare keyword cross-join table (no SAMPLE/JOIN completing the clause),
+ # and the no-leading-comma form, keep `using`/`array` as real tables — both
+ # accept, so the suppression stays scoped to the dangling-comma case.
+ for query in (
+ "select 1, from f, using",
+ "select 1, from f, array",
+ "select 1, from f, using x",
+ "select 1, from f, array x",
+ "select 1 from f, using sample 1",
+ "select 1 from f, array join x",
+ "select 1, from f, g",
+ ):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+
+ def test_date_literal_tolerated_in_discarded_set_decorators(self):
+ # A `selectSetStmt`'s trailing `orderByClause?` is always grammar-parsed
+ # but never emitted by cpp's `VISIT(SelectSetStmt)`, and its trailing
+ # LIMIT / OFFSET are dropped when the body is a `{placeholder}` (which
+ # can't carry them). cpp never visits those discarded subtrees, so an
+ # unsupported `date`/`timestamp` literal anywhere inside (incl. nested
+ # selects / calls) is tolerated. rust used to commit to the date literal
+ # and fatally reject; the suppression now leaks into the whole discarded
+ # subtree, matching cpp.
+ for query in (
+ "( {x} order by date 'z' )",
+ "( {x} order by (select 1 order by date 'z') )",
+ "( {x} order by f(date 'z') )",
+ "( {x} order by date 'z' + 1 )",
+ "( (select 1) order by (select date 'z') )", # ORDER BY discarded even for a real subquery
+ "( {x} order by date 'z' limit 1 )",
+ "( {x} limit date 'z' )", # placeholder LIMIT dropped -> tolerated
+ "( {x} offset date 'z' )",
+ "( {x} limit date 'z' with ties )",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ program = "range := ( { ( 'nlhonme ' ) } order by 'e' , date 'fa' collate 'a' ) "
+ self.assertEqual(
+ parse_program(program, backend="cpp-json"),
+ parse_program(program, backend=backend),
+ )
+ # Still strict where cpp DOES visit: a real SelectQuery's kept order by /
+ # limit / offset, and a bare / placeholder-block date literal. All must
+ # reject on both backends (the placeholder LIMIT suppression must not
+ # leak to a real `(select …)` body). A set op (UNION / EXCEPT) wraps the
+ # result in a decorator-carrying SelectSetQuery, so its LIMIT is KEPT and
+ # visited even when the operands are placeholders — the suppression must
+ # not fire there either.
+ for query, fn in (
+ ("select 1 order by date 'x'", parse_select),
+ ("select 1 order by (select date 'z')", parse_select),
+ ("select 1 limit date 'x'", parse_select),
+ ("(select 1) limit date 'x'", parse_select),
+ ("(select 1) offset date 'x'", parse_select),
+ ("{1} except {2} limit date 'x'", parse_select),
+ ("({1}) union all ({2}) limit date 'x'", parse_select),
+ ("({1}) except {2} limit interval 'p'", parse_select),
+ ("date 'x'", parse_expr),
+ ("{ date 'x' }", parse_program),
+ ):
+ with self.assertRaises(BaseHogQLError, msg=query):
+ fn(query, backend=backend)
+
+ def test_interval_string_without_unit_tolerated_in_unvisited_clause(self):
+ # `INTERVAL <string>` with no `<count> <unit>` content is cpp's
+ # `ColumnExprIntervalString`, which `visitColumnExprIntervalString`
+ # rejects — so it's tolerated in the same clauses cpp grammar-parses but
+ # never visits (discarded ORDER BY, a placeholder body's LIMIT). rust
+ # used to fatally require a unit keyword.
+ for query in (
+ "{x} order by interval 'pk'",
+ "{x} order by interval 'pk' collate ''",
+ "{x} order by 1 with fill to interval 'g'",
+ "{x} limit interval 'p'",
+ ):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+ # Still strict elsewhere: a KEPT clause visits it, a bare / block form
+ # rejects, and a non-string interval value with no unit is a grammar
+ # error even when discarded (so the suppression is string-gated).
+ strict: list[tuple[str, object]] = [
+ ("select 1 order by interval 'pk'", parse_select),
+ ("select 1 limit interval 'pk'", parse_select),
+ ("interval 'pk'", parse_expr),
+ ("{ interval 'ln' }", parse_program),
+ ("{x} order by interval 1", parse_select),
+ ("{x} order by interval x", parse_select),
+ ]
+ for query, fn in strict:
+ with self.assertRaises(BaseHogQLError, msg=query):
+ fn(query, backend=backend)
+
+ def test_interval_value_pending_flag_does_not_leak(self):
+ # `parse_interval_expr` flags the value's leading primary as a nested
+ # interval (one-shot, consumed by `parse_primary`). When the value parse
+ # errors BEFORE reaching `parse_primary` (a bare `interval` as an
+ # arithmetic operand: `interval + …`), the flag must not leak past the
+ # enclosing `try_alt` rollback and corrupt the FOLLOWING interval — which
+ # caused `interval + interval '5 day' month` to wrong-reject and
+ # `interval - interval '5 day' month` to build a mangled AST.
+ for query in (
+ "interval + interval '5 day' month",
+ "interval - interval '5 day' month",
+ "interval * interval '2 hour' day",
+ "x + interval '5 day' month",
+ "1 + interval '5 day' month",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_stacked_table_alias_span_ends_at_first_alias(self):
+ # `TableExprAlias` is left-recursive (`x a b c`): cpp's nested ctxs end
+ # the JoinExpr span at the INNERMOST (first) alias, while each outer
+ # alias only overwrites `alias` / `column_aliases`. rust extended the
+ # span to the last alias. Covers the `t format JSON` FORMAT-as-alias
+ # chain and column-alias stacks. (Single / no alias are unchanged.)
+ for query in (
+ "select 1 from x t",
+ "select 1 from x a b",
+ "select 1 from x a b c",
+ "select 1 from x t format JSON",
+ "select 1 from x (c1, c2)",
+ "select 1 from x a (c1) b (c2)",
+ ):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+
+ def test_between_split_synthetic_node_positions(self):
+ # When the greedy BETWEEN-body parse is split at the rightmost AND, the
+ # rebuilt And/Or (and the wrappers it descends through) must carry cpp's
+ # ctx-derived span, not the children's inner (paren-stripped) span. cpp
+ # positions a boolean node from its FIRST operand's `(` and LAST operand's
+ # `)`, and a stay-in-place wrapper (Lambda / Not / arith.right / the
+ # if-call else-branch) ends where its now-shorter child ends. A no_pos
+ # NamedArgument operand still contributes its `value`'s end.
+ for query in (
+ "x between (1) and (2) or y", # synthetic Or start = `(` of `(2)`
+ "1 between 2 and (3) and 4", # synthetic And end = `)` of `(3)`
+ "x between (1) and lambda z: (2) and (3)", # Lambda body end shrinks
+ "a between not lambda x: (b) and (c) and d", # Not + Lambda descent
+ "x between 1 and (2) * (3) and 4", # arith.right end shrinks
+ "a between b ? c : (d) and (e) and f", # if-call else-branch end
+ "1 between 2 between 3 and (4) and 5", # nested BETWEEN low peel
+ "x between y between z and (w) and v",
+ "p between (q) and r := (s) and (t)", # no_pos NamedArgument last operand
+ "m between (n) and o := (p) and q := (r) and (s)",
+ "x between (1) and ((2) or (3)) and (4)",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_between_parenthesized_group_high(self):
+ # `a and (b and c)` flattens to `And([a,b,c])` (cpp does too for a standalone
+ # expr), but in a BETWEEN body cpp keeps `(b and c)` as one high operand: the
+ # rightmost AND at paren-depth 0 is the one BEFORE the parens, so
+ # `1 between a and (b and c)` is `low=a, high=And(b,c)`. rust used to descend
+ # into the flattened inner AND and mis-split to `low=And(a,b), high=c`. The
+ # split now skips ANDs inside parens (paren-depth-0 rule).
+ for query in (
+ "1 between a and (b and c)",
+ "1 between a and ((b) and (c))",
+ "1 between a and (b and c and d)",
+ "1 between x and y and (b and c)",
+ "1 between a and (b or c)",
+ "1 between (a and b) and c",
+ "1 between a and (b and c) or d",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+
+ def test_return_empty_parens_is_a_call(self):
+ # `return ()` — empty parens are not a valid return value, so cpp re-reads
+ # `return` as a Field and `()` as an empty call: `Call(return, [])`. rust
+ # used to commit to the return statement and reject the empty parens. A
+ # `return (expr)` (incl. empty `[]` / `{}` which ARE valid values) keeps
+ # the returnStmt.
+ for query in ("return ()", "return ( )", "return () + 1", "x := return ()", "return () ()"):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ for query in ("return (1)", "return (1, 2)", "return []", "return {}", "return"):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+
+ def test_bare_star_decorator_splits_at_statement_boundary(self):
+ # A bare `*` admits only a valid `EXCLUDE (<identifiers>)` (no REPLACE, no
+ # string/empty list). At a statement boundary an invalid decorator is cpp's
+ # `*` (or `* EXCLUDE(...)`) statement followed by `exclude(...)` / `replace(...)`
+ # as the NEXT statement's call: `* exclude ('j')` -> `*` ; `exclude('j')`,
+ # `* replace (1 as b)` -> `*` ; `replace(1 as b)`, `* exclude (a) replace (b as c)`
+ # -> `ColumnsExpr(exclude=[a])` ; `replace(b as c)`. rust used to reject.
+ for query in (
+ "* exclude ('j')",
+ "* exclude ()",
+ "x := * exclude ('j')",
+ "osl := * exclude ()",
+ "* replace (1 as b)",
+ "* exclude (a) replace (1 as b)",
+ "x := * replace (1 as b)",
+ ):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ # A valid `* EXCLUDE (<idents>)` stays one columns-expr; outside a statement
+ # boundary (a SELECT column) an invalid / REPLACE decorator rejects on both,
+ # and the paren-wrapped `(* REPLACE …)` form stays valid.
+ for query in (
+ "select * exclude (a) from t",
+ "select (* replace (1 as b)) from t",
+ ):
+ self.assertEqual(
+ parse_select(query, backend="cpp-json"),
+ parse_select(query, backend=backend),
+ msg=query,
+ )
+ for query in ("select * exclude ('j') from t", "select * replace (1 as b) from t"):
+ with self.assertRaises(BaseHogQLError):
+ parse_select(query, backend=backend)
+
+ def test_invalid_filter_clause_splits_at_statement_boundary(self):
+ # The aggregate FILTER clause requires `(WHERE <expr>)`. An invalid FILTER
+ # (`filter ()`, no WHERE) is, at a statement boundary, cpp's completed
+ # `<call>()` statement followed by a `filter(...)` call as the NEXT
+ # statement: `l() filter ()` -> `l()` ; `filter()` (also for parametric
+ # `quantile(0.5)(x) filter ()`). rust used to commit to the clause and
+ # reject. A valid `filter (where …)` stays one expression (the clause is
+ # consumed and dropped).
+ for query in (
+ "l() filter ()",
+ "count() filter ()",
+ "x := l() filter ()",
+ "l() filter filter ()",
+ "quantile(0.5)(x) filter ()",
+ ):
+ self.assertEqual(
+ parse_program(query, backend="cpp-json"),
+ parse_program(query, backend=backend),
+ msg=query,
+ )
+ for query in ("count() filter (where 1)", "sum(x) filter (where y > 1) over ()", "count() over ()"):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ # Outside a statement boundary (a SELECT column) the invalid FILTER rejects.
+ with self.assertRaises(BaseHogQLError):
+ parse_expr("count() filter ()", backend=backend)
+
+ def test_cast_type_enum_vs_param_fallback(self):
+ # A cast type `q(...)` is `ColumnTypeExprEnum` only when every entry is a
+ # `string '=' numberLiteral` (the visitor then rejects it as unsupported).
+ # If any value isn't a numberLiteral (`''`, an ident, `1 + 2`) or the
+ # separator is `==`, ANTLR falls back to `ColumnTypeExprParam` (a
+ # columnExpr param), which cpp accepts. rust used to commit to the enum
+ # path on a `string =` head and reject these.
+ for query in (
+ "cast(1 as q('a' = ''))",
+ "cast(1 as q('a' = 'b'))",
+ "cast(1 as q('a' = x))",
+ "cast(1 as q('a' = 1 + 2))",
+ "cast(1 as q('a' == 1))",
+ "cast(1 as q('a' = 1, 'b' = ''))",
+ "try_cast(1 as q('a' = ''))",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
+ # A real enumValue list (string '=' numberLiteral, incl. floats / inf /
+ # signed / trailing comma) stays ColumnTypeExprEnum and rejects on both.
+ for value in ("1", "-1", "1.5", "1.5e3", "2447.9157e+17", "inf", "nan", "0x1f", ".5"):
+ with self.assertRaises(BaseHogQLError):
+ parse_expr(f"cast(1 as q('a' = {value}))", backend=backend)
+ # A NESTED enum (an enum type sitting in another type's parens, e.g.
+ # `q(w('k' = 1))`) is a `ColumnTypeExprEnum` cpp also rejects. rust used
+ # to mask the nested enum's (fatal) rejection with the raw-text Param
+ # fallback and over-accept; the type-param parser now propagates fatal
+ # errors instead.
+ for value in ("1", "inf", "nan", "0x1f"):
+ for query in (f"cast(1 as q(w('k' = {value})))", f"cast(1 as q(w('a' = 1, 'b' = {value})))"):
+ with self.assertRaises(BaseHogQLError, msg=query):
+ parse_expr(query, backend=backend)
+ # A nested NON-enum (string / ident value) falls back to Param and is
+ # accepted on both — the fatal propagation must not over-reject these.
+ for query in (
+ "cast(1 as q(w('k' = '')))",
+ "cast(1 as q(w('k' = x)))",
+ # Non-enum parametric / nested / complex types are unaffected.
+ "cast(1 as Decimal(10, 2))",
+ "cast(1 as FixedString(5))",
+ "cast(1 as Array(Int))",
+ "cast(1 as Tuple(UInt8, String))",
+ "cast(1 as Array(Tuple(UInt8, String)))",
+ ):
+ self.assertEqual(
+ parse_expr(query, backend="cpp-json"),
+ parse_expr(query, backend=backend),
+ msg=query,
+ )
return TestParser
diff --git a/posthog/hogql/test/test_diagnostic_common.py b/posthog/hogql/test/test_diagnostic_common.py
new file mode 100644
index 000000000000..2372ada2f313
--- /dev/null
+++ b/posthog/hogql/test/test_diagnostic_common.py
@@ -0,0 +1,55 @@
+"""Regression tests for the shadow-mismatch fail-fast guard shared by
+the PBT parser tooling (``_diagnostic_common`` helpers and the
+``parser_bench`` timing harness).
+
+The guard under test: when an oracle/candidate backend raises
+``HogQLParserShadowMismatch`` it is not a single pure parser (it ran a
+primary plus a shadow comparison that disagreed), so the tool aborts
+the whole run rather than masking a real cpp-vs-rust divergence as a
+backend crash (diagnostic) or a skipped row (bench). Every other
+exception still buckets as a ``crash`` so one bad query can't abort the
+run.
+"""
+
+from unittest import TestCase, mock
+
+from parameterized import parameterized
+
+from posthog.hogql.parser import HogQLParserShadowMismatch
+from posthog.hogql.scripts import _diagnostic_common
+from posthog.hogql.scripts._diagnostic_common import _safe_parse, corpus_try_parse
+from posthog.hogql.scripts.parser_bench import bench
+
+_PARSE_HELPERS = [("_safe_parse", _safe_parse), ("corpus_try_parse", corpus_try_parse)]
+
+
+def _raise_shadow_mismatch(_query, *, backend):
+ raise HogQLParserShadowMismatch("select parser AST mismatch: cpp-json vs rust-json")
+
+
+def _raise_runtime_error(_query, *, backend):
+ raise RuntimeError("half-built backend exploded")
+
+
+class TestDiagnosticShadowGuard(TestCase):
+ @parameterized.expand(_PARSE_HELPERS)
+ def test_shadow_mismatch_aborts_the_grind(self, _name, parse_fn):
+ with mock.patch.dict(_diagnostic_common._PARSER_FOR_RULE, {"select": _raise_shadow_mismatch}):
+ with self.assertRaises(SystemExit) as ctx:
+ parse_fn("select 1", "select", "cpp-json")
+ message = str(ctx.exception)
+ self.assertIn("HogQLParserShadowMismatch", message)
+ self.assertIn("TEST=1", message)
+
+ @parameterized.expand(_PARSE_HELPERS)
+ def test_non_shadow_crash_is_bucketed_not_aborted(self, _name, parse_fn):
+ with mock.patch.dict(_diagnostic_common._PARSER_FOR_RULE, {"select": _raise_runtime_error}):
+ status, ast, detail = parse_fn("select 1", "select", "cpp-json")
+ self.assertEqual(status, "crash")
+ self.assertIsNone(ast)
+ self.assertIn("half-built backend exploded", detail)
+
+ def test_bench_aborts_on_shadow_mismatch(self):
+ with self.assertRaises(SystemExit) as ctx:
+ bench("smoke", _raise_shadow_mismatch, {"q1": "select 1"}, 1, 1, "cpp-json", "rust-json")
+ self.assertIn("HogQLParserShadowMismatch", str(ctx.exception))
diff --git a/posthog/hogql/test/test_parser_cpp_json.py b/posthog/hogql/test/test_parser_cpp_json.py
index 8e747b9473e4..59ac83e88849 100644
--- a/posthog/hogql/test/test_parser_cpp_json.py
+++ b/posthog/hogql/test/test_parser_cpp_json.py
@@ -1,3 +1,11 @@
+import gc
+import tracemalloc
+
+from posthog.test.base import BaseTest
+
+from posthog.hogql.errors import ExposedHogQLError
+from posthog.hogql.parser import parse_program
+
from ._test_parser import parser_test_factory
@@ -6,3 +14,32 @@ class TestParserCppJson(parser_test_factory("cpp-json")): # type: ignore
# this test only exists to make pycharm recognise this class as a test class
# the actual tests are in the parent class
pass
+
+
+class TestCppParserRejectNoLeak(BaseTest):
+ def test_reject_path_does_not_leak(self):
+ # The cpp parser's error path returns a JSON error envelope (deserialize_ast then raises) instead of raising a Python exception built in C, which used to leak the (often large) ANTLR "expecting {...}" message string on every rejected parse. Measured with tracemalloc rather than the page-granular ru_maxrss leak mixin, which missed this leak on Linux CI (it only tripped on macOS's 16 KiB pages). Threshold sits far below the ~1 KB/parse the leak produced and far above the <1 B/parse steady state.
+ def reject() -> None:
+ try:
+ parse_program("let null := 1", backend="cpp-json")
+ except ExposedHogQLError:
+ pass
+
+ for _ in range(200): # saturate one-time caches before measuring
+ reject()
+ gc.collect()
+ was_tracing = tracemalloc.is_tracing()
+ if not was_tracing:
+ tracemalloc.start(1)
+ before = tracemalloc.take_snapshot()
+ runs = 500
+ for _ in range(runs):
+ reject()
+ gc.collect()
+ after = tracemalloc.take_snapshot()
+ per_parse = sum(stat.size_diff for stat in after.compare_to(before, "filename")) / runs
+ if not was_tracing:
+ tracemalloc.stop()
+ self.assertLess(
+ per_parse, 100, f"cpp-json reject path leaked {per_parse:.0f} B/parse (regressed; was ~1000 B/parse)"
+ )
diff --git a/posthog/hogql/test/test_parser_grammar_pbt.py b/posthog/hogql/test/test_parser_grammar_pbt.py
index 70e0ad8d53bb..fb4d4f49de7f 100644
--- a/posthog/hogql/test/test_parser_grammar_pbt.py
+++ b/posthog/hogql/test/test_parser_grammar_pbt.py
@@ -48,6 +48,7 @@ from posthog.hogql import ast
from posthog.hogql.errors import BaseHogQLError
from posthog.hogql.parser import parse_expr, parse_select
from posthog.hogql.test._generated_grammar_strategies import expr_strategy, select_strategy
+from posthog.hogql.test._grammar_token_strategies import _RESERVED_KEYWORDS
from posthog.hogql.visitor import clear_locations
pytestmark = pytest.mark.skipif(
@@ -242,6 +243,261 @@ def _apply_jiggle(query: str) -> st.SearchStrategy[str]:
return _inner()
+# ---------------------------------------------------------------------------
+# Mutation layer
+# ---------------------------------------------------------------------------
+#
+# The grammar generator only emits *valid* surface (it walks valid
+# productions). To exercise the rejection path — "does the candidate
+# refuse what the oracle refuses?" — we perturb a valid query into a
+# near-miss invalid one. Each operator targets a distinct syntactic
+# failure mode. A mutation that happens to land on still-valid syntax
+# is harmless: it flows through the normal acceptance-parity check.
+#
+# Tokens are crude space-split units (the generator emits space-separated
+# tokens), which keeps the perturbations cheap and the invalid forms
+# realistic (a stray `)` mid-query, a doubled keyword, a truncated tail).
+
+# Reserved keywords / operators that are hostile when injected into an
+# arbitrary position — they break the surrounding production without
+# being silently absorbable as identifiers.
+_INJECTION_TOKENS = (
+ "select",
+ "from",
+ "where",
+ "group",
+ "by",
+ "join",
+ "union",
+ "(",
+ ")",
+ "[",
+ "]",
+ ",",
+ "*",
+ "+",
+ "::",
+ "->",
+ "between",
+ "and",
+)
+
+
+def _mutate_once(draw: Any, query: str) -> str:
+ """Apply a single perturbation. Returns the query unchanged when it's
+ too short to perturb meaningfully."""
+ tokens = [t for t in query.split(" ") if t != ""]
+ if len(tokens) < 2:
+ return query
+
+ op = draw(
+ st.sampled_from(
+ [
+ "delete", # drop a token — unbalances counts, strands operators
+ "duplicate", # repeat a token — e.g. `SELECT SELECT`
+ "swap", # reorder adjacent tokens
+ "inject", # splice in a hostile keyword/operator
+ "drop_paren", # remove one `(` or `)` to unbalance nesting
+ "truncate", # cut the tail — incomplete production
+ ]
+ )
+ )
+
+ if op == "delete":
+ i = draw(st.integers(min_value=0, max_value=len(tokens) - 1))
+ del tokens[i]
+ elif op == "duplicate":
+ i = draw(st.integers(min_value=0, max_value=len(tokens) - 1))
+ tokens.insert(i, tokens[i])
+ elif op == "swap":
+ i = draw(st.integers(min_value=0, max_value=len(tokens) - 2))
+ tokens[i], tokens[i + 1] = tokens[i + 1], tokens[i]
+ elif op == "inject":
+ i = draw(st.integers(min_value=0, max_value=len(tokens)))
+ tokens.insert(i, draw(st.sampled_from(_INJECTION_TOKENS)))
+ elif op == "drop_paren":
+ paren_positions = [i for i, t in enumerate(tokens) if t in ("(", ")", "[", "]")]
+ if not paren_positions:
+ return query
+ del tokens[draw(st.sampled_from(paren_positions))]
+ elif op == "truncate":
+ cut = draw(st.integers(min_value=1, max_value=len(tokens) - 1))
+ tokens = tokens[:cut]
+
+ return " ".join(tokens)
+
+
+def _apply_mutation(query: str) -> st.SearchStrategy[str]:
+ """Perturb a valid query into a near-miss invalid one (1-3 stacked
+ mutations). Used by the diagnostic's ``--mutate`` mode to flood the
+ rejection path: most outputs are invalid, so the two-sided contract
+ (oracle rejects -> candidate must reject) gets exercised heavily."""
+
+ @st.composite
+ def _inner(draw: Any) -> str:
+ result = query
+ for _ in range(draw(st.integers(min_value=1, max_value=3))):
+ result = draw(_mutate_once(result))
+ return result
+
+ return _inner()
+
+
+# ---------------------------------------------------------------------------
+# Grammar-aware mutation layer
+# ---------------------------------------------------------------------------
+#
+# Token mutation (above) mostly yields *lexically* broken junk that both
+# backends reject at the lexer / early-parse stage — cheap, but it rarely
+# reaches the interesting over-acceptance boundary. Grammar-aware mutation
+# corrupts at the *production* level using the grammar's own vocabulary
+# (the reserved-keyword set, bracket pairs, literal forms): empty a
+# bracketed argument list, turn a `{x}` placeholder into a `{}` / `{k: v}`
+# dict, swap or duplicate a keyword, retype a literal, mismatch a bracket.
+# The results are structurally plausible but illegal — exactly the shapes
+# where one parser is liable to be more lenient than the other (both
+# reject-parity bugs found this session, `from {}` and `* columns()`, are
+# of this kind, where blind token edits would have to get lucky).
+
+_BRACKET_OPENERS: dict[str, str] = {"(": ")", "{": "}", "[": "]"}
+_BRACKET_CLOSERS: frozenset[str] = frozenset((")", "}", "]"))
+_RESERVED_KEYWORD_TUPLE: tuple[str, ...] = tuple(sorted(_RESERVED_KEYWORDS))
+
+# Tokens that sit right at the lexer / parser edge: ambiguous operators and
+# malformed-literal shapes. Mirrors the hostile-token seeding in ClickHouse's
+# own parser fuzzer grammar template.
+_ADVERSARIAL_TOKENS: tuple[str, ...] = (
+ "<>",
+ "<=>",
+ "::",
+ "->",
+ "||",
+ "!",
+ ":",
+ "..",
+ "1e",
+ "1e-",
+ "0x",
+ "1.2.3",
+ ".5.5",
+ "''",
+ "`",
+ "@",
+ "#",
+)
+
+
+def _bracket_pairs(tokens: list[str]) -> list[tuple[int, int]]:
+ """`(open_index, close_index)` for each matching bracket pair. Brackets
+ never occur inside HogQL string / identifier literals (their alphabets
+ exclude them), so a flat scan needs no quote tracking. Inner pairs are
+ listed before the outer pairs that enclose them."""
+ stack: list[int] = []
+ pairs: list[tuple[int, int]] = []
+ for i, tok in enumerate(tokens):
+ if tok in _BRACKET_OPENERS:
+ stack.append(i)
+ elif tok in _BRACKET_CLOSERS and stack:
+ pairs.append((stack.pop(), i))
+ return pairs
+
+
+def _string_mask(tokens: list[str]) -> list[bool]:
+ """Per-token "inside a quoted string / identifier" flag, by quote parity
+ — so keyword / identifier edits skip literal contents (a string literal
+ can contain a space and split across several tokens)."""
+ mask: list[bool] = []
+ in_squote = in_dquote = False
+ for tok in tokens:
+ mask.append(in_squote or in_dquote)
+ if tok.count("'") % 2 == 1:
+ in_squote = not in_squote
+ if tok.count('"') % 2 == 1:
+ in_dquote = not in_dquote
+ return mask
+
+
+def _grammar_mutate_once(draw: Any, query: str) -> str:
+ """Apply one grammar-aware perturbation, returning the query unchanged
+ when no operator applies."""
+ tokens = [t for t in query.split(" ") if t != ""]
+ if len(tokens) < 2:
+ return query
+ mask = _string_mask(tokens)
+ pairs = _bracket_pairs(tokens)
+ nonempty_pairs = [(o, c) for (o, c) in pairs if c - o > 1]
+ brace_pairs = [(o, c) for (o, c) in pairs if tokens[o] == "{"]
+ kw_idx = [i for i, t in enumerate(tokens) if not mask[i] and t.lower() in _RESERVED_KEYWORDS]
+ ident_idx = [
+ i
+ for i, t in enumerate(tokens)
+ if not mask[i] and t.isascii() and t.isidentifier() and t.lower() not in _RESERVED_KEYWORDS
+ ]
+ lit_idx = [i for i, t in enumerate(tokens) if t.lstrip("-").isdigit() or (len(t) >= 2 and t[0] == "'" == t[-1])]
+
+ ops: list[str] = ["adversarial_inject"] # always applicable
+ if nonempty_pairs:
+ ops.append("empty_brackets")
+ if pairs:
+ ops.append("bracket_retype")
+ if brace_pairs:
+ ops.append("brace_dictify")
+ if kw_idx:
+ ops += ["keyword_swap", "keyword_duplicate"]
+ if ident_idx:
+ ops.append("ident_to_keyword")
+ if lit_idx:
+ ops.append("literal_corrupt")
+ op = draw(st.sampled_from(ops))
+
+ if op == "empty_brackets":
+ o, c = draw(st.sampled_from(nonempty_pairs))
+ return " ".join(tokens[: o + 1] + tokens[c:])
+ if op == "bracket_retype":
+ o, c = draw(st.sampled_from(pairs))
+ tokens[c] = draw(st.sampled_from([x for x in (")", "}", "]") if x != tokens[c]]))
+ return " ".join(tokens)
+ if op == "brace_dictify":
+ o, c = draw(st.sampled_from(brace_pairs))
+ inner = tokens[o + 1 : c] or ["1"]
+ tokens[o : c + 1] = ["{", *inner, ":", *inner, "}"]
+ return " ".join(tokens)
+ if op == "keyword_swap":
+ tokens[draw(st.sampled_from(kw_idx))] = draw(st.sampled_from(_RESERVED_KEYWORD_TUPLE))
+ return " ".join(tokens)
+ if op == "keyword_duplicate":
+ i = draw(st.sampled_from(kw_idx))
+ tokens.insert(i, tokens[i])
+ return " ".join(tokens)
+ if op == "ident_to_keyword":
+ tokens[draw(st.sampled_from(ident_idx))] = draw(st.sampled_from(_RESERVED_KEYWORD_TUPLE))
+ return " ".join(tokens)
+ if op == "literal_corrupt":
+ tokens[draw(st.sampled_from(lit_idx))] = draw(st.sampled_from(_ADVERSARIAL_TOKENS))
+ return " ".join(tokens)
+ # adversarial_inject
+ tokens.insert(draw(st.integers(min_value=0, max_value=len(tokens))), draw(st.sampled_from(_ADVERSARIAL_TOKENS)))
+ return " ".join(tokens)
+
+
+def _apply_grammar_mutation(query: str) -> st.SearchStrategy[str]:
+ """Perturb a valid query into a structurally-plausible invalid one with
+ 1-2 stacked grammar-aware mutations. Used by the diagnostic's
+ ``--grammar-mutate`` mode to probe over-acceptance with near-miss shapes
+ a parser is more likely to wrongly accept than lexical junk is."""
+
+ @st.composite
+ def _inner(draw: Any) -> str:
+ result = query
+ for _ in range(draw(st.integers(min_value=1, max_value=2))):
+ result = draw(_grammar_mutate_once(result))
+ return result
+
+ return _inner()
+
+
# ---------------------------------------------------------------------------
# Differential parsing harness
# ---------------------------------------------------------------------------
diff --git a/posthog/hogql/test/test_parser_python.py b/posthog/hogql/test/test_parser_python.py
index 6e453e65100a..b8d2eec14ccc 100644
--- a/posthog/hogql/test/test_parser_python.py
+++ b/posthog/hogql/test/test_parser_python.py
@@ -1,5 +1,41 @@
from ._test_parser import parser_test_factory
+# The legacy pure-Python parser does not match the C++ oracle on these
+# cpp-parity edge cases (source positions, a few accept/reject calls, and the
+# Dict.items list-vs-tuple representation that the direct-construction path
+# below also hits). They live on the shared base so cpp-json / rust-json /
+# rust-py verify agreement; Python is deferred per case rather than fixed,
+# since it is the legacy backend and parity here was driven through the C++
+# and Rust parsers.
+_DEFERRED: set[str] = {
+ "test_bare_star_decorator_splits_at_statement_boundary",
+ "test_between_parenthesized_group_high",
+ "test_between_span_includes_parenthesized_high_closing_paren",
+ "test_between_split_synthetic_node_positions",
+ "test_block_then_empty_param_lambda_is_two_statements",
+ "test_date_literal_tolerated_in_discarded_set_decorators",
+ "test_empty_fstring_constant_spans_whole_token",
+ "test_from_trailing_comma_only_after_join_constraint",
+ "test_in_cohort_marker_only_before_a_complete_value",
+ "test_interval_combined_string_validates_count_and_unit",
+ "test_interval_string_without_unit_tolerated_in_unvisited_clause",
+ "test_interval_without_unit_does_not_over_commit",
+ "test_invalid_interval_in_block_body_rejected",
+ "test_lambda_keyword_is_a_plain_alias_after_as",
+ "test_leading_comma_from_implicit_alias_dangling_clause",
+ "test_nested_interval_reserves_unit_for_outer",
+ "test_not_and_modulo_accept_hogqlx_tag_operand",
+ "test_return_empty_parens_is_a_call",
+ "test_select_distinct_reread_as_column_when_no_value_follows",
+ "test_select_from_keyword_table_vs_invalid_from_column",
+ "test_stacked_table_alias_span_ends_at_first_alias",
+ "test_statement_leading_brace_block_vs_call",
+ "test_wrapped_columns_replace_span_excludes_outer_parens",
+}
+
class TestParserPython(parser_test_factory("python")): # type: ignore
- pass
+ def setUp(self) -> None:
+ super().setUp()
+ if self._testMethodName in _DEFERRED:
+ self.skipTest("legacy python parser does not match the C++ oracle on this case")
diff --git a/posthog/hogql/test/test_parser_rust_json.py b/posthog/hogql/test/test_parser_rust_json.py
index 4f6aab4924c2..2da6943da3d9 100644
--- a/posthog/hogql/test/test_parser_rust_json.py
+++ b/posthog/hogql/test/test_parser_rust_json.py
@@ -2,30 +2,13 @@
The full parser-behaviour suite lives in `_test_parser.py` and runs
against every backend via `parser_test_factory`. This file only wires
-the `rust-json` backend into that suite and lists the cases the Rust
-parser does not yet match the C++ reference on.
+the `rust-json` backend into that suite.
"""
from ._test_parser import parser_test_factory
-# Cases the Rust parser does not yet match C++ on, tracked for follow-up:
-# - promoted_assignment_target_carries_position: the Rust parser does
-# not yet emit per-node source positions (`start` / `end`) at all —
-# every node comes back position-less. The shared suite tolerates
-# this via `clear_locations`, but this test inspects raw positions.
-# Closing it means threading byte offsets through the whole emit
-# layer — a feature in its own right, not a local fix.
-_DEFERRED_EXACT: set[str] = {
- "test_promoted_assignment_target_carries_position",
-}
-
class TestParserRustJson(parser_test_factory("rust-json")): # type: ignore
- def setUp(self) -> None:
- super().setUp()
- if self._testMethodName in _DEFERRED_EXACT:
- self.skipTest("not yet matched by rust-json")
-
def test_empty(self):
# this test only exists to make pycharm recognise this class as a test class
# the actual tests are in the parent class
diff --git a/posthog/hogql/test/test_parser_rust_py.py b/posthog/hogql/test/test_parser_rust_py.py
index 907ba773563d..cb8541c248a7 100644
--- a/posthog/hogql/test/test_parser_rust_py.py
+++ b/posthog/hogql/test/test_parser_rust_py.py
@@ -7,40 +7,27 @@ only difference is how the result lands in Python (PyO3 builds the
dataclass instances directly, skipping the JSON round-trip).
"""
-from unittest.mock import patch
-
-from posthog.hogql import ast
-from posthog.hogql.errors import BaseHogQLError
-from posthog.hogql.parser import parse_select
-
from ._test_parser import parser_test_factory
-# Same deferral as `rust-json`: PyEmitter's `with_pos` chain doesn't yet
-# propagate positions onto the promoted assignment target node. Underlying
-# parser logic is shared, so the gap is wired in `with_pos` rather than
-# in the per-backend AST shape.
-_DEFERRED_EXACT: set[str] = {
- "test_promoted_assignment_target_carries_position",
+# `ast.Dict.items` is typed `list[tuple[Expr, Expr]]`. The direct-PyO3 path
+# builds tuples (matching the annotation); the JSON oracle (cpp-json) builds
+# lists, since JSON has no tuple type. These two tests assert full AST parity
+# against the JSON oracle, so the list-vs-tuple shape diverges — a serialisation
+# representation difference, not a parser-behaviour one. Deferred for rust-py
+# rather than reshaping the JSON deserialiser (which the oracle shares).
+_DEFERRED: set[str] = {
+ "test_block_then_empty_param_lambda_is_two_statements",
+ "test_statement_leading_brace_block_vs_call",
}
class TestParserRustPy(parser_test_factory("rust-py")): # type: ignore
def setUp(self) -> None:
super().setUp()
- if self._testMethodName in _DEFERRED_EXACT:
- self.skipTest("not yet matched by rust-py")
+ if self._testMethodName in _DEFERRED:
+ self.skipTest("Dict.items list (JSON oracle) vs tuple (direct PyO3) representation difference")
def test_empty(self):
# this test only exists to make pycharm recognise this class as a test class
# the actual tests are in the parent class
pass
-
- def test_dataclass_post_init_failure_surfaces_as_hogql_error(self):
- # PyEmitter.build calls `class(**kwargs)`; a dataclass `__post_init__` that raises lands as a Rust panic. `run_py`'s `catch_unwind` converts it to a `BaseHogQLError`, which production handlers catch; without the wrap PyO3 would surface `PanicException` (a `BaseException`, not in the HogQL error family).
- def always_reject(_self: ast.JoinExpr) -> None:
- raise ValueError("synthetic post_init failure for test")
-
- with patch.object(ast.JoinExpr, "__post_init__", always_reject):
- with self.assertRaises(BaseHogQLError) as caught:
- parse_select("SELECT 1 FROM a JOIN b ON a.x = b.x", backend="rust-py")
- self.assertIn("synthetic post_init failure", str(caught.exception))
diff --git a/posthog/test/base.py b/posthog/test/base.py
index 893794ee4b2d..d5ec454dcf24 100644
--- a/posthog/test/base.py
+++ b/posthog/test/base.py
@@ -808,18 +808,28 @@ class MemoryLeakTestMixin:
MEMORY_LEAK_CHECK_RUNS_N: int
"""How many times to run every test method to check for memory leaks"""
+ # Re-run index for the current test, exposed so a test body can do work that must happen
+ # exactly once (e.g. a snapshot/oracle comparison whose own machinery allocates and would
+ # otherwise trip the leak check on every rerun) only when this is 0, while still exercising
+ # the code under test on every rerun. Outside the priming/measure loop it stays 0.
+ _memory_leak_run_index: int = 0
+
def _callTestMethod(self, method):
# Tests marked `@no_memory_leak_check` run once, no priming/measure loop.
if getattr(method, "_no_memory_leak_check", False):
+ self._memory_leak_run_index = 0
method()
return
test_case = cast(unittest.TestCase, self)
+ self._memory_leak_run_index = 0
mem_original_b = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
for _ in range(self.MEMORY_PRIMING_RUNS_N): # Priming runs
method()
+ self._memory_leak_run_index += 1
mem_primed_b = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
for _ in range(self.MEMORY_LEAK_CHECK_RUNS_N): # Memory leak check runs
method()
+ self._memory_leak_run_index += 1
mem_tested_b = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
avg_memory_priming_increase_b = (mem_primed_b - mem_original_b) / self.MEMORY_PRIMING_RUNS_N
avg_memory_test_increase_b = (mem_tested_b - mem_primed_b) / self.MEMORY_LEAK_CHECK_RUNS_N
diff --git a/pyproject.toml b/pyproject.toml
index a885c4aa8d80..48db53342aef 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -67,8 +67,8 @@ dependencies = [
"grimp~=3.14",
"grpcio~=1.71.0",
"gspread==6.2.1",
- "hogql-parser==1.3.66",
- "hogql-parser-rs==1.3.72", # built from rust/hogql/parser via the build-hogql-parser-rs workflow + published to PyPI; rebuild locally with `uv pip install -e rust/hogql/parser` when iterating
+ "hogql-parser==1.3.69",
+ "hogql-parser-rs==1.3.75", # built from rust/hogql/parser via the build-hogql-parser-rs workflow + published to PyPI; rebuild locally with `uv pip install -e rust/hogql/parser` when iterating
"humanize~=4.12.3",
"infi-clickhouse-orm",
"jsonref==1.1.0",
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index c3f6b7ffdfba..2e1358663dd3 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -4142,7 +4142,7 @@ dependencies = [
[[package]]
name = "hogql_parser_rs"
-version = "1.3.72"
+version = "1.3.75"
dependencies = [
"pyo3",
"serde_json",
diff --git a/rust/hogql/parser/Cargo.toml b/rust/hogql/parser/Cargo.toml
index c3c762d0f12d..01150a2274e2 100644
--- a/rust/hogql/parser/Cargo.toml
+++ b/rust/hogql/parser/Cargo.toml
@@ -1,9 +1,7 @@
[package]
name = "hogql_parser_rs"
-# Track the cpp parser in `common/hogql_parser/setup.py` — both ship as
-# wheels named after the same HogQL grammar revision, so versions move in
-# lockstep.
-version = "1.3.72"
+# Versioned independently from the cpp parser in `common/hogql_parser/setup.py`. Both started from the same HogQL grammar revision, but the Rust port is bumped on its own whenever the hand-rolled parser changes (cpp is currently 1.3.69, this is 1.3.75); each ships as its own PyPI wheel.
+version = "1.3.75"
edition = "2021"
publish = false
diff --git a/rust/hogql/parser/pyproject.toml b/rust/hogql/parser/pyproject.toml
index d24c62344a17..51897563084f 100644
--- a/rust/hogql/parser/pyproject.toml
+++ b/rust/hogql/parser/pyproject.toml
@@ -8,9 +8,8 @@ build-backend = "maturin"
[project]
name = "hogql_parser_rs"
-# Mirrors `rust/hogql/parser/Cargo.toml` and `common/hogql_parser/setup.py`.
-# All three move in lockstep on every HogQL grammar change.
-version = "1.3.72"
+# Mirrors `rust/hogql/parser/Cargo.toml` (always identical). Tracks but is NOT locked to `common/hogql_parser/setup.py`: the Rust port is versioned independently and bumped on its own whenever the hand-rolled parser changes (cpp is currently 1.3.69, this is 1.3.75).
+version = "1.3.75"
description = "Hand-rolled Rust HogQL parser with C++-parity AST output"
readme = "README.md"
requires-python = ">=3.12"
diff --git a/rust/hogql/parser/src/emit.rs b/rust/hogql/parser/src/emit.rs
index 2a8eb9943da0..69d39306797d 100644
--- a/rust/hogql/parser/src/emit.rs
+++ b/rust/hogql/parser/src/emit.rs
@@ -259,6 +259,7 @@ pub trait Emitter {
/// Mark a node as position-less so downstream `with_pos` calls leave it bare. Mirrors cpp visitors that emit a node without `addPositionInfo(json, ctx)` — Python AST shows dataclass defaults (None). Example: `NamedArgument`.
fn no_pos(&self, value: Self::Value) -> Self::Value;
/// Override existing `start` / `end` keys, unlike the idempotent `with_pos`. Used when the outer span needs to include tokens the inner expression's wrap didn't see.
+ #[allow(dead_code)] // Position primitive retained for both backends; current span-stamping paths go through `set_field` / `with_pos`.
fn replace_pos(&self, value: Self::Value, start: Self::Value, end: Self::Value) -> Self::Value;
// ===== Inspection =====
diff --git a/rust/hogql/parser/src/emit_py.rs b/rust/hogql/parser/src/emit_py.rs
index 7fee1a68e465..e58b8ef72748 100644
--- a/rust/hogql/parser/src/emit_py.rs
+++ b/rust/hogql/parser/src/emit_py.rs
@@ -309,14 +309,19 @@ impl<'py> PyEmitter<'py> {
/// Construct a node by invoking `class(**kwargs)`. Wraps the result in [`PyAst`] with `positions_locked = false`.
fn build(&self, class: &Bound<'py, PyAny>, kwargs: &Bound<'py, PyDict>) -> PyAst {
- let obj = class
- .call(PyTuple::empty_bound(self.py), Some(kwargs))
- .expect("ast class construction failed (validate kwargs / class shape)")
- .unbind();
- PyAst {
- obj,
- positions_locked: false,
- rust_sentinels: None,
+ match class.call(PyTuple::empty_bound(self.py), Some(kwargs)) {
+ Ok(obj) => PyAst {
+ obj: obj.unbind(),
+ positions_locked: false,
+ rust_sentinels: None,
+ },
+ // A dataclass constructor / `__post_init__` raised. Restore the original Python
+ // exception so `run_py` re-raises it verbatim (the json backends surface the same
+ // raw exception from `deserialize_ast`), then unwind out of the deep parse via panic.
+ Err(err) => {
+ err.restore(self.py);
+ panic!("ast construction raised; original exception restored for run_py");
+ }
}
}
@@ -1214,14 +1219,13 @@ impl<'py> Emitter for PyEmitter<'py> {
) {
if let Ok(post_init) = bound.getattr("__post_init__") {
if let Err(py_err) = post_init.call0() {
- // Panic with the inner Python message only (not the `PyErr` Debug repr); `run_py`'s `catch_unwind` converts the panic to a `ParseError::not_implemented` envelope.
- let msg = py_err
- .value_bound(self.py)
- .str()
- .ok()
- .and_then(|s| s.to_str().ok().map(str::to_string))
- .unwrap_or_else(|| "ast dataclass validation failed".to_string());
- panic!("{msg}");
+ // Restore the original exception so `run_py` re-raises it verbatim — rust-py then
+ // surfaces the same exception the json backends do (which run this `__post_init__`
+ // check inside `cls(**kwargs)`), instead of a wrapped `not_implemented` envelope.
+ py_err.restore(self.py);
+ panic!(
+ "dataclass __post_init__ raised; original exception restored for run_py"
+ );
}
}
}
diff --git a/rust/hogql/parser/src/error.rs b/rust/hogql/parser/src/error.rs
index 3e8544972359..a0073107f1b1 100644
--- a/rust/hogql/parser/src/error.rs
+++ b/rust/hogql/parser/src/error.rs
@@ -71,6 +71,15 @@ impl ParseError {
}
}
+ /// Mark an existing error fatal so `try_alt` won't roll it back. Used at a
+ /// dispatch site that has committed to a single production (e.g. `INTERVAL`
+ /// followed by a primary value), where any parse failure is a hard error
+ /// rather than a signal to try another alternative.
+ pub fn into_fatal(mut self) -> Self {
+ self.fatal = true;
+ self
+ }
+
/// Build the JSON error envelope shape. Used directly by the `parse_*_py`
/// path (which raises a Python exception from this) and serialised to a
/// string by [`Self::to_json_string`] for the `parse_*_json` path.
diff --git a/rust/hogql/parser/src/lib.rs b/rust/hogql/parser/src/lib.rs
index f41abe3c23eb..ccc3a4897cf4 100644
--- a/rust/hogql/parser/src/lib.rs
+++ b/rust/hogql/parser/src/lib.rs
@@ -15,6 +15,12 @@
// `#[pyfunction]`'s expansion does an `.into()` on the `PyResult<PyObject>` return value, which is an identity conversion when the function already returns the target type — clippy's `useless_conversion` doesn't see through the macro and would flag every `parse_*_py` entry point. The lint isn't actionable from our side without leaving pyo3's `#[pyfunction]` abstraction.
#![allow(clippy::useless_conversion)]
+// Style lints that conflict with the parser's deliberate shape: a few internal helpers return wide tuples (the table-alias chain, function-arg bundles) rather than one-off structs; some builder-style helpers are named `from_*` but take `&self`; and the heavily-prose doc comments use markdown lists clippy's `doc_lazy_continuation` flags. None are actionable without churning the parser, so allow them crate-wide.
+#![allow(
+ clippy::type_complexity,
+ clippy::wrong_self_convention,
+ clippy::doc_lazy_continuation
+)]
use pyo3::prelude::*;
use std::panic::AssertUnwindSafe;
@@ -30,7 +36,25 @@ fn run<F>(f: F) -> String
where
F: FnOnce() -> Result<serde_json::Value, error::ParseError>,
{
- match f() {
+ // Catch panics so a parser bug surfaces as a structured JSON error envelope (a `NotImplementedError` the Python side maps to the `ExposedHogQLError` family) instead of a `PanicException` — a `BaseException` that slips past callers' `except Exception` and the shadow-comparison harness's guard, crashing the primary parse. `run_py` wraps its deep parse the same way; the `*_json` entry points have no other unwind boundary, so they need it here.
+ let outcome = std::panic::catch_unwind(AssertUnwindSafe(f));
+ let result = match outcome {
+ Ok(r) => r,
+ Err(panic) => {
+ let msg = panic
+ .downcast_ref::<&'static str>()
+ .copied()
+ .map(str::to_string)
+ .or_else(|| panic.downcast_ref::<String>().cloned())
+ .unwrap_or_else(|| "parser panicked".to_string());
+ Err(error::ParseError::not_implemented(
+ format!("internal parser panic: {msg}"),
+ 0,
+ 0,
+ ))
+ }
+ };
+ match result {
Ok(value) => serde_json::to_string(&value).unwrap_or_else(|_| {
// serde_json::Value -> string never fails in practice, but emit a structured error rather than panic across the FFI.
error::ParseError::syntax("internal: failed to serialize AST", 0, 0).to_json_string()
@@ -47,11 +71,16 @@ where
F: FnOnce(emit_py::PyEmitter<'py>) -> Result<emit_py::PyAst, error::ParseError>,
{
let emitter = emit_py::PyEmitter::new(py)?;
- // Convert any panic from the emitter drive (e.g. `class(**kwargs)` tripping dataclass `__post_init__`) into a `NotImplementedError` envelope. PyO3 would surface it as `PanicException`, which production callers catching the `ExposedHogQLError` family won't intercept.
+ // Drive the emitter under `catch_unwind`: a dataclass constructor / `__post_init__` raising mid-build unwinds via panic (the `Emitter` trait is infallible, so there's no Result channel out of the deep parse).
let outcome = std::panic::catch_unwind(AssertUnwindSafe(|| f(emitter)));
let result = match outcome {
Ok(r) => r,
Err(panic) => {
+ // `PyEmitter::build` restores the original Python exception before unwinding, so re-raise it verbatim — rust-py then surfaces the same exception the json backends do (they hit it in `deserialize_ast`), rather than a wrapped envelope.
+ if let Some(err) = PyErr::take(py) {
+ return Err(err);
+ }
+ // Genuine (non-PyErr) panic: wrap as a `NotImplementedError` envelope so production callers catching the `ExposedHogQLError` family intercept it, instead of PyO3 surfacing a raw `PanicException`.
let msg = panic
.downcast_ref::<&'static str>()
.copied()
@@ -146,3 +175,29 @@ fn hogql_parser_rs(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(parse_full_template_string_py, m)?)?;
Ok(())
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn run_converts_panic_to_json_error_envelope() {
+ // A panic on a `*_json` path must surface as a structured error envelope, not unwind across the FFI as a `PanicException` (a `BaseException` that escapes callers' `except Exception` and the shadow harness). cargo captures the expected panic's stderr for a passing test, so no hook silencing is needed.
+ let out = run(|| panic!("synthetic json-path panic"));
+ assert!(out.contains("\"error\":true"), "got: {out}");
+ assert!(out.contains("NotImplementedError"), "got: {out}");
+ assert!(out.contains("synthetic json-path panic"), "got: {out}");
+ }
+
+ #[test]
+ fn run_passes_through_ok_and_error_results() {
+ // The catch_unwind wrapper must not disturb the normal Ok / Err paths.
+ let ok = run(|| Ok(serde_json::json!({"node": "Constant"})));
+ assert!(ok.contains("Constant"), "got: {ok}");
+ let err = run(|| Err(error::ParseError::syntax("nope", 1, 2)));
+ assert!(
+ err.contains("SyntaxError") && err.contains("nope"),
+ "got: {err}"
+ );
+ }
+}
diff --git a/rust/hogql/parser/src/parse.rs b/rust/hogql/parser/src/parse.rs
index 1d56a7fedb90..ce29dcffcd36 100644
--- a/rust/hogql/parser/src/parse.rs
+++ b/rust/hogql/parser/src/parse.rs
@@ -160,8 +160,8 @@ pub fn parse_full_template_string_with_emit<E: Emitter + Clone>(
// Parser core
// ============================================================================
-/// Recursion-depth cap for `parse_expr_bp`. Mirrors ClickHouse's `max_parser_depth` default (1000) so deeply-nested input (e.g. `((((…))))`) surfaces a clean `ParseError::syntax` instead of stack-OOMing the worker before any parse error can fire.
-pub(crate) const MAX_EXPR_RECURSION_DEPTH: u32 = 1000;
+/// Shared recursion-depth cap across the parser's three recursive-descent dimensions — expression nesting (`parse_expr_bp`), subquery / set nesting (`parse_select_set_stmt`), and Hog statement / block nesting (`parse_statement`). Mirrors ClickHouse's `max_parser_depth` default (1000) so deeply-nested input (`((((…))))`, `(select (select …))`, `{ { … } }`) surfaces a clean `ParseError` instead of stack-OOMing the worker before any parse error can fire. One shared counter (not one per dimension) bounds total live descent depth regardless of how the nesting is composed, and stays below the empirical host-stack overflow points (~2000 nested subqueries, ~8000 nested blocks).
+pub(crate) const MAX_RECURSION_DEPTH: u32 = 1000;
pub(crate) struct Parser<'a, E: Emitter = JsonEmitter> {
pub(crate) src: &'a str,
@@ -216,6 +216,20 @@ pub(crate) struct Parser<'a, E: Emitter = JsonEmitter> {
/// (SELECT 1 ARRAY JOIN 2)) OVER w` is accepted by cpp for
/// exactly this reason. Saved/restored around the FILTER parse.
pub(crate) suppress_array_join_checks: bool,
+ /// When set, the parser is inside a clause cpp grammar-parses but its
+ /// visitor never visits, so VISITOR-level rejections are downgraded to
+ /// "tolerate-and-throw-away": a `DATE`/`TIMESTAMP` string literal
+ /// (`visitColumnExprDate`) and a unit-less `INTERVAL <string>`
+ /// (`visitColumnExprIntervalString`) parse into a throwaway node instead
+ /// of fatally rejecting. Set around the always-discarded `selectSetStmt`
+ /// `orderByClause?`, a `{placeholder}` body's dropped LIMIT / OFFSET, and
+ /// the discarded select-level `sampleClause`. cpp visits none of those
+ /// subtrees, so the flag intentionally leaks into nested parses there
+ /// (`({x} order by date 'd')`, `{x} limit interval 'p'` accept). A KEPT
+ /// clause (a real SelectQuery's order by / limit, a table-level sample)
+ /// leaves the flag unset, so `select 1 order by date 'd'` still rejects on
+ /// both. Saved/restored at each set site.
+ pub(crate) suppress_unvisited_clause_checks: bool,
/// When set, the Pratt postfix loop stops before folding a
/// `(…)`-call onto its LHS if a `:=` follows the matching `)`.
/// Set by the Hog-program statement parser while parsing a
@@ -262,6 +276,15 @@ pub(crate) struct Parser<'a, E: Emitter = JsonEmitter> {
/// directly and re-seeks the lexer, so peek1's transient invalid
/// state is recoverable.
pub(crate) hogqlx_text_lookahead_depth: u32,
+ /// One-shot flag set just before `parse_interval_expr` parses its value
+ /// expression and consumed at the top of `parse_primary`. When the value's
+ /// leading primary is itself an `INTERVAL`, cpp's ALL(*) reserves the
+ /// trailing unit keyword for the OUTER interval, so the nested interval is
+ /// parsed string-only (`INTERVAL '5 day'`) or as a Field / call — never the
+ /// unit-consuming `INTERVAL columnExpr interval` form. The take-on-read
+ /// semantics auto-reset across parens / call-args, so a parenthesised nested
+ /// interval (`interval (interval '5 day' month) second`) keeps its own unit.
+ pub(crate) interval_value_pending: bool,
/// Sorted byte offsets of each line start in `src` (line 1 starts at 0,
/// line N starts at `line_starts[N-1]`). Built once at construction;
/// `pos(offset)` binary-searches for line / column. Used to emit cpp's
@@ -279,8 +302,8 @@ pub(crate) struct Parser<'a, E: Emitter = JsonEmitter> {
/// once at construction so the hot wrap_pos path stays O(log n) via the
/// line-starts binary search.
pub(crate) is_ascii_src: bool,
- /// Live `parse_expr_bp` recursion depth; bumped on entry, decremented on exit. Enforces `MAX_EXPR_RECURSION_DEPTH`.
- pub(crate) expr_recursion_depth: u32,
+ /// Live recursive-descent depth shared across expression / subquery / statement nesting; bumped on entry to each recursive entry point, decremented on exit. Enforces `MAX_RECURSION_DEPTH`.
+ pub(crate) recursion_depth: u32,
/// AST node builder. Routes every node/position construction through the `Emitter` trait so we can swap `JsonEmitter` (current default, kept for WASM) for `PyEmitter` (constructs Python ast.* objects directly, avoiding the `serde_json::Value` intermediate). See `crate::emit`.
pub(crate) emit: E,
}
@@ -309,15 +332,17 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
between_body_depth: 0,
suppress_setstmt_trailing_order_by: false,
suppress_array_join_checks: false,
+ suppress_unvisited_clause_checks: false,
stop_postfix_call_before_colon_equals: false,
stmt_rhs_recover_on_pratt_rhs_failure: false,
limit_body_depth: 0,
pivot_in_stop: None,
hogqlx_text_lookahead_depth: 0,
+ interval_value_pending: false,
line_starts,
char_offsets: std::cell::OnceCell::new(),
is_ascii_src,
- expr_recursion_depth: 0,
+ recursion_depth: 0,
emit,
})
}
@@ -500,15 +525,23 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
self.emit.with_pos(value, s, e)
}
- /// Like [`Self::wrap_pos_to`] but overrides any existing `start` /
- /// `end` on the node. Use when the inner expression's wrap missed
- /// tokens that the outer grammar rule includes — e.g. cpp's
- /// `ColumnExprColumnsReplace` ctx covers the outer parens but the
- /// inner ColumnsExpr was wrapped at the `*` position only.
- pub(crate) fn replace_pos_to(&self, value: E::Value, start: usize, end: usize) -> E::Value {
- let s = self.pos_obj(start);
- let e = self.pos_obj(end);
- self.emit.replace_pos(value, s, e)
+ /// Run `f` one level deeper in the shared recursion-depth counter, rejecting cleanly if it would exceed [`MAX_RECURSION_DEPTH`]. The counter is decremented on every exit path (the over-depth bail and any `?` inside `f`), so it tracks live descent depth. Wraps the recursive entry points whose mutual recursion is otherwise unbounded — `parse_select_set_stmt` (subquery / set nesting) and `parse_statement` (Hog block / statement nesting); `parse_expr_bp` does the equivalent inline.
+ pub(crate) fn with_recursion_guard<T>(
+ &mut self,
+ f: impl FnOnce(&mut Self) -> Result<T, ParseError>,
+ ) -> Result<T, ParseError> {
+ self.recursion_depth += 1;
+ if self.recursion_depth > MAX_RECURSION_DEPTH {
+ self.recursion_depth -= 1;
+ return Err(ParseError::syntax(
+ "input too deeply nested",
+ self.peek0.start,
+ self.peek0.end,
+ ));
+ }
+ let result = f(self);
+ self.recursion_depth -= 1;
+ result
}
/// Snapshot the parser cursor + per-call context so a failed
@@ -1006,6 +1039,10 @@ pub(crate) fn kw_valid_as_identifier(kw: Kw) -> bool {
| Kw::Try
| Kw::Catch
| Kw::Finally
+ // MATERIALIZED is a lexer keyword used only in `WITH x AS MATERIALIZED (…)`; the grammar's `keyword` rule omits it, so it is never a valid identifier.
+ | Kw::Materialized
+ // WITHIN is a lexer keyword used only in the `within group (...)` clause; the grammar's `keyword` rule omits it, so it is never a valid identifier.
+ | Kw::Within
)
}
@@ -1038,6 +1075,10 @@ pub(crate) fn kw_acts_as_ident_in_primary(kw: Kw) -> bool {
// expression position).
| Kw::Fn | Kw::Fun | Kw::Let | Kw::While
| Kw::Throw | Kw::Try | Kw::Catch | Kw::Finally
+ // MATERIALIZED — keyword only in `WITH … AS MATERIALIZED (…)`, never a `keyword`-rule identifier.
+ | Kw::Materialized
+ // WITHIN — keyword only in the `within group (...)` clause, never a `keyword`-rule identifier.
+ | Kw::Within
)
}
diff --git a/rust/hogql/parser/src/parse/expr.rs b/rust/hogql/parser/src/parse/expr.rs
index 89ce3b85c262..f2b3e4358127 100644
--- a/rust/hogql/parser/src/parse/expr.rs
+++ b/rust/hogql/parser/src/parse/expr.rs
@@ -32,9 +32,9 @@ type FunctionArgs<V> = (bool, Vec<V>, Option<Vec<V>>);
impl<'a, E: Emitter + Clone> Parser<'a, E> {
pub(crate) fn parse_expr_bp(&mut self, min_bp: u8) -> Result<E::Value, ParseError> {
- // Cap the central recursive entry so deeply-nested input (`((…))` with thousands of nests) surfaces as a syntax error rather than stack OOM. Bound rationale on `MAX_EXPR_RECURSION_DEPTH`.
- self.expr_recursion_depth += 1;
- let result = if self.expr_recursion_depth > crate::parse::MAX_EXPR_RECURSION_DEPTH {
+ // Cap the central recursive entry so deeply-nested input (`((…))` with thousands of nests) surfaces as a syntax error rather than stack OOM. Shares the counter with subquery / statement nesting; bound rationale on `MAX_RECURSION_DEPTH`.
+ self.recursion_depth += 1;
+ let result = if self.recursion_depth > crate::parse::MAX_RECURSION_DEPTH {
Err(ParseError::syntax(
"expression too deeply nested",
self.peek0.start,
@@ -46,7 +46,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
.map(|lhs| self.wrap_pos(lhs, lhs_start))
.and_then(|lhs| self.pratt_continue_with_lhs(lhs, min_bp, lhs_start))
};
- self.expr_recursion_depth -= 1;
+ self.recursion_depth -= 1;
result
}
@@ -94,7 +94,13 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
}
}
let next = self.peek_next();
- if !peek_can_start_clause_body(next) || is_pure_infix_op(next) {
+ // `<` is a pure-infix token (less-than), but it also starts
+ // a HogQLX tag: `1 % <a/>` is `1 modulo <tag>`. Don't treat
+ // the `%` as the PERCENT marker when a tag follows. Plain
+ // `1 % < 2` (peek-next `<` not a tag) still breaks.
+ if (!peek_can_start_clause_body(next) || is_pure_infix_op(next))
+ && !self.peek_next_starts_hogqlx_tag()
+ {
break;
}
}
@@ -126,7 +132,31 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
lhs = self.wrap_pos(build_infix(&self.emit, op, lhs, rhs), lhs_start);
continue;
}
- if let Some(handled) = self.try_special_infix(kind, &mut lhs, min_bp, lhs_start)? {
+ // Special-infix (LIKE / BETWEEN / IS [NOT] (NULL|DISTINCT FROM) /
+ // IN / …). At a statement boundary (recover flag set) an INCOMPLETE
+ // form is cpp's "end this statement, start the next" shape, not an
+ // error: `week like` is two Field statements, `"_" between "_"` is
+ // three. The body/RHS parse happens before `lhs.take()`, so a
+ // failure leaves `lhs` intact — roll back the lexer and break so the
+ // operator begins the next statement (mirrors cpp ALL(*) backtrack
+ // and the regular-infix recovery above). At expression level (flag
+ // off) the failure stays a hard error, matching cpp.
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ let cp = self.checkpoint();
+ match self.try_special_infix(kind, &mut lhs, min_bp, lhs_start) {
+ Ok(Some(true)) => {
+ lhs = self.wrap_pos(lhs, lhs_start);
+ continue;
+ }
+ Ok(_) => {}
+ Err(_) => {
+ self.restore(cp)?;
+ break;
+ }
+ }
+ } else if let Some(handled) =
+ self.try_special_infix(kind, &mut lhs, min_bp, lhs_start)?
+ {
if handled {
// `try_special_infix` mutates `lhs` in place with a fresh
// unpositioned JSON node (`CompareOperation`, `BetweenExpr`,
@@ -154,6 +184,26 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
{
break;
}
+ // Same statement-boundary recovery as special-infix: a failing
+ // postfix (`[ ] [ ]` — the second `[` can't index the first
+ // empty array) ends the statement so the postfix token begins
+ // the next one. `parse_postfix` moves `lhs` by value, so clone
+ // it to restore on failure. Expression level keeps the error.
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ let cp = self.checkpoint();
+ let lhs_backup = lhs.clone();
+ match self.parse_postfix(kind, lhs) {
+ Ok(v) => {
+ lhs = self.wrap_pos(v, lhs_start);
+ continue;
+ }
+ Err(_) => {
+ self.restore(cp)?;
+ lhs = lhs_backup;
+ break;
+ }
+ }
+ }
lhs = self.parse_postfix(kind, lhs)?;
lhs = self.wrap_pos(lhs, lhs_start);
continue;
@@ -303,16 +353,35 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
if self.peek_next() == TokenKind::Arrow {
return self.parse_single_arg_arrow_lambda();
}
+ // `not <tag>` — a `<` that begins a HogQLX tag is NOT the
+ // less-than operator, so NOT is the unary prefix and the tag is
+ // its operand (`not <a/>` → `Not(<a/>)`). Without this, the
+ // `Lt` arm in the pure-binary-operator set below would read NOT
+ // as a Field and `<` as less-than, stranding the tag. Plain
+ // `not < 2` (peek-next `<` not a tag) still falls through there.
+ if self.peek_next_starts_hogqlx_tag() {
+ // `<…` is the tag operand only when it forms a *complete* tag
+ // (`not <a/>` -> `Not(<a/>)`); an incomplete `< ident`
+ // (`not < a`) is the less-than operator with NOT as a Field.
+ // Try the tag and fall through to the Field path on failure.
+ let cp = self.checkpoint();
+ self.bump()?; // NOT
+ match self.parse_expr_bp(BP_NOT) {
+ Ok(rhs) => return Ok(self.emit.not_(rhs)),
+ Err(_) => self.restore(cp)?,
+ }
+ }
// Bare `NOT` followed by a token that can't start an
- // expression (alias / list-terminator / EOF) is the
- // identifier "not" — cpp's `keyword` rule admits NOT
- // as an identifier and falls back to a Field. Without
- // this check, parse_prefix would eagerly consume NOT
- // and then error on the unexpected following token.
+ // expression (list-terminator / EOF) is the identifier
+ // "not" — cpp's `keyword` rule admits NOT as an identifier
+ // and falls back to a Field. Without this check, parse_prefix
+ // would eagerly consume NOT and then error on the unexpected
+ // following token. (`not as` is NOT here: `AS` parses as a
+ // Field operand, so cpp keeps `Not(Field('AS'))` via the
+ // general fallback below.)
if matches!(
self.peek_next(),
- TokenKind::Keyword(Kw::As)
- | TokenKind::Comma
+ TokenKind::Comma
| TokenKind::RParen
| TokenKind::RBracket
| TokenKind::RBrace
@@ -361,6 +430,60 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
) {
return self.parse_ident_lead();
}
+ // At a STATEMENT boundary cpp takes the shortest leading
+ // statement, so a `not <op-keyword> <rhs>` is `Not(Field(<kw>))`
+ // (statement 1) with `<rhs>` opening the next statement, rather
+ // than the greedy single expression `Field(not) <op> <rhs>`.
+ // Skip all the expression-context NOT-flip probes below and go
+ // straight to the general fallback, which produces exactly that
+ // split (`not like 'a'` → `Not(Field(like))`; then `'a'`).
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ let cp = self.checkpoint();
+ self.bump()?; // NOT
+ return match self.parse_expr_bp(BP_NOT) {
+ Ok(rhs) => Ok(self.emit.not_(rhs)),
+ Err(_) => {
+ self.restore(cp)?;
+ self.parse_ident_lead()
+ }
+ };
+ }
+ // EXPRESSION context below: cpp's single-expression parse greedily
+ // reads NOT as a Field so a following infix / alias binds to it.
+ // `not as <alias>` → `Field(not) AS <alias>`; a bare `not as` (no
+ // alias after `AS`) stays `Not(Field('as'))`. Aliases are
+ // IDENTIFIER / QUOTED_IDENTIFIER / keywordForAlias (date/first/id/key).
+ if self.peek_next() == TokenKind::Keyword(Kw::As) {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ if matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Ident
+ | TokenKind::QuotedIdent
+ | TokenKind::Keyword(Kw::Date | Kw::First | Kw::Id | Kw::Key))
+ ) {
+ return self.parse_ident_lead();
+ }
+ }
+ // `not in a` → binary `in` (`Compare(Field(not), "in", a)`), but
+ // `not in (1,2)` keeps the unary `Not(Call(in, [1,2]))` via the
+ // LParen exclusion.
+ if self.peek_next() == TokenKind::Keyword(Kw::In) {
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ if let Ok(after) = probe.next_token() {
+ if !matches!(
+ after.kind,
+ TokenKind::Eof
+ | TokenKind::Comma
+ | TokenKind::RParen
+ | TokenKind::RBracket
+ | TokenKind::RBrace
+ | TokenKind::Semicolon
+ | TokenKind::LParen
+ ) {
+ return self.parse_ident_lead();
+ }
+ }
+ }
// `not <kw-infix> <rhs>`: cpp's ALL(*) prefers
// `Field([not]) <kw-infix> <rhs>` over `Not(Field([kw]))`
// when the infix has a valid trailing RHS. `not like 'a'`
@@ -473,9 +596,26 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
return self.parse_ident_lead();
}
}
- self.bump()?;
- let rhs = self.parse_expr_bp(BP_NOT)?;
- Ok(self.emit.not_(rhs))
+ // General NOT fallback (cpp ALL(*) parity): try NOT as the unary
+ // prefix; if its operand can't parse, cpp re-reads NOT as a bare
+ // Field and the following infix/postfix binds to it — `not < a` ->
+ // `(Field not) < a`, `not + a` -> `(Field not) + a`, `not in a` ->
+ // `(Field not) in a`. `not AS` keeps `Not(Field('AS'))` because the
+ // operand parses. The earlier probes already diverted the cases
+ // where the operand parses but cpp still prefers Field(not), so the
+ // fallback only fires on a genuine operand failure. At a statement
+ // boundary this is also the `not let x` shape (`not` Field stmt then
+ // the `let x` statement). rust rejects only when both the unary and
+ // the Field interpretation fail — exactly as cpp does.
+ let cp = self.checkpoint();
+ self.bump()?; // NOT
+ match self.parse_expr_bp(BP_NOT) {
+ Ok(rhs) => Ok(self.emit.not_(rhs)),
+ Err(_) => {
+ self.restore(cp)?;
+ self.parse_ident_lead()
+ }
+ }
}
_ => {
// `<Tag ...>` — HogQLX tag in column position (cpp's
@@ -492,8 +632,29 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
}
}
+ /// After `<cursor> .` (the cursor token followed by a `.`), is the token
+ /// past the `.` a Field-chain link (identifier-ish) rather than a
+ /// tuple-access index (number)? `true.x` is a Field chain; `true.1` is
+ /// tuple access on the boolean Constant. Used to keep `true`/`false` a
+ /// Constant base for numeric tuple access while still folding `.identifier`
+ /// into a Field chain.
+ pub(crate) fn dot_next_is_chain_link(&self) -> bool {
+ if self.peek_next() != TokenKind::Dot {
+ return false;
+ }
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_))
+ )
+ }
+
fn parse_primary(&mut self) -> Result<E::Value, ParseError> {
let tok = self.peek0;
+ // One-shot: true only for the leading primary of an enclosing INTERVAL's
+ // value (set in `parse_interval_expr`). Taken here so it never leaks past
+ // the first primary — parens / call-args reset it for free.
+ let interval_value = std::mem::take(&mut self.interval_value_pending);
match tok.kind {
TokenKind::Number => {
self.bump()?;
@@ -536,21 +697,21 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
parse_template_body(&self.emit, self.src, body_offset, body_end)
}
TokenKind::Keyword(Kw::True | Kw::False)
- if self.peek_next() == TokenKind::LParen || self.peek_next() == TokenKind::Dot =>
+ if self.peek_next() == TokenKind::LParen || self.dot_next_is_chain_link() =>
{
- // `true`/`false` are not lexer tokens in the grammar —
- // they are ordinary identifiers, and become Bool
- // Constants only as a bare `columnIdentifier`. cpp
- // treats them as identifiers in two columnExpr-leading
- // postfix positions:
- // `true(…)` → Call(name='true') (function call)
- // `true.x` → Field(['true', 'x']) (chain)
- // The Pratt loop would otherwise wrap a `Constant(true)`
- // in an `ArrayAccess` for the `.x`, diverging from cpp's
- // Field shape. Route both shapes through ident-lead so
- // the chain accumulates correctly. `null` differs —
- // `NULL` is a real keyword, so `null(…)` stays an
- // `ExprCall` on the Null constant.
+ // `true`/`false` are not lexer tokens in the grammar — they are
+ // ordinary identifiers, and become Bool Constants only as a bare
+ // `columnIdentifier`. cpp treats them as identifiers in two
+ // columnExpr-leading postfix positions:
+ // `true(…)` → Call(name='true') (function call)
+ // `true.x` → Field(['true', 'x']) (chain)
+ // Route those through ident-lead so the chain accumulates. But
+ // `true.<number>` is tuple access on the boolean Constant
+ // (`true.1` → TupleAccess(Constant(true), 1)) — cpp keeps the
+ // Constant base, so that case is NOT routed here: it falls
+ // through to the Constant arms and the Pratt `.` postfix builds
+ // the TupleAccess. `null` differs — NULL is a real keyword, so
+ // `null(…)` / `null.1` already keep the Null constant.
self.parse_ident_lead()
}
TokenKind::Keyword(Kw::True) => {
@@ -626,9 +787,79 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// back to identifier and parses as a function call (which also
// covers `interval(distinct …)`, `interval(a, b) within group …`,
// `interval(a, b) over …`, and the empty `interval()` no-args
- // form). Mirror with `try_alt`.
+ // form).
+ //
+ // cpp commits to the INTERVAL form only when a STRING_LITERAL
+ // follows (the `INTERVAL STRING_LITERAL` ColumnExprIntervalString
+ // alt): then a missing / bad unit is a hard error, never a fall-back
+ // to `interval`-as-Field. This matters at statement level —
+ // `{ interval 'ln' }` must reject, not split into `interval` (Field)
+ // + `'ln'` (Constant). So mark the string-committed parse fatal so no
+ // outer `try_alt` rolls it back. For a number / identifier / quoted-
+ // identifier value (`interval 1`, `interval x`, `interval "a"`) cpp
+ // does NOT commit: with no trailing unit it backtracks to `interval`-
+ // as-Field, so at program level `interval 1` is two statements
+ // (`interval` + `1`). Use try_alt there so `interval 1 day` still
+ // parses as an interval while a unit-less `interval 1` falls back to
+ // a Field. The `interval(...)` shape keeps the function-call fall-
+ // back; operator continuations like `interval + 1` reach try_alt too.
+ //
+ // A nested INTERVAL in the value position of an enclosing INTERVAL
+ // (`interval interval '5 day' month`) is special: cpp's ALL(*)
+ // reserves the trailing unit (`month`) for the OUTER interval, so
+ // the inner one never takes the unit-consuming form. Parse it
+ // string-only when a string follows (`interval '5 day'` →
+ // `toIntervalDay(5)`, with a bad string a hard error like cpp's
+ // `ColumnExprIntervalString`), else as a Field / call via the ident
+ // path (`interval - x` → `interval` Field minus `x`; `interval(1)`
+ // → call). The trailing unit then binds to the outer interval.
+ TokenKind::Keyword(Kw::Interval) if interval_value => {
+ if self.peek_next() == TokenKind::String {
+ self.parse_interval_string_only()
+ .map_err(ParseError::into_fatal)
+ } else {
+ self.parse_ident_lead()
+ }
+ }
TokenKind::Keyword(Kw::Interval) if can_start_interval_value(self.peek_next()) => {
- self.try_alt(&[&Self::parse_interval_expr, &Self::parse_ident_lead])
+ if self.peek_next() == TokenKind::String {
+ self.parse_interval_expr().map_err(ParseError::into_fatal)
+ } else {
+ self.try_alt(&[&Self::parse_interval_expr, &Self::parse_ident_lead])
+ }
+ }
+ // ColumnExprDate (`DATE STRING_LITERAL`) / ColumnExprTimestamp
+ // (`TIMESTAMP STRING_LITERAL`). cpp's grammar matches these but its
+ // visitor raises NotImplementedError — the AST builder has no date /
+ // timestamp literal node — so they reject. Without this arm rust
+ // treats `date` / `timestamp` as a plain identifier and strands the
+ // string: at expression level `expect_eof` rejects, but inside a Hog
+ // `{ … }` block body the string becomes a second statement, so
+ // `{ date 'x' }` parses as `date; 'x'` and accepts input cpp rejects.
+ // Reject fatally so no outer `try_alt` rolls it back to the
+ // identifier form. `date(…)` (function call) and bare `date` keep
+ // the identifier path — only `date <string>` is the literal form.
+ TokenKind::Keyword(Kw::Date | Kw::Timestamp)
+ if self.peek_next() == TokenKind::String =>
+ {
+ if self.suppress_unvisited_clause_checks {
+ // Inside a clause cpp grammar-parses but never visits (a
+ // selectStmtWithParens trailing ORDER BY): consume `DATE
+ // STRING` into a throwaway Constant so the discarded parse
+ // completes, matching cpp's accept. The node value is moot.
+ self.bump()?;
+ let str_tok = self.peek0;
+ self.bump()?;
+ return Ok(self
+ .emit
+ .constant(self.emit.string(&unquote_single_string(self.text(str_tok)))));
+ }
+ let tok = self.peek0;
+ Err(ParseError::not_implemented_fatal(
+ "Date and timestamp literals are not supported",
+ tok.start,
+ tok.end,
+ ))
}
// Grammar (line 289): LAMBDA identifier (COMMA identifier)* COMMA? COLON columnExpr
// vs the keyword rule's "LAMBDA as identifier in primary position."
@@ -1045,6 +1276,21 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
str_tok.end,
));
}
+ // Reaching here means the string has no internal space (the split
+ // failed) and — per the branch guard — no trailing unit keyword:
+ // cpp's `ColumnExprIntervalString`, which `visitColumnExprIntervalString`
+ // rejects (it isn't `<count> <unit>`). In a clause cpp grammar-parses
+ // but never visits (`suppress_unvisited_clause_checks`), tolerate it
+ // with a throwaway so the discarded parse completes — matching cpp's
+ // accept (`{x} order by interval 'p'`). The node value is moot.
+ if self.suppress_unvisited_clause_checks {
+ let s = unquote_single_string(self.text(str_tok));
+ self.bump()?;
+ return Ok(self.emit.call(
+ "toIntervalSecond",
+ vec![self.emit.constant(self.emit.string(&s))],
+ ));
+ }
// Fall through to the expr+unit form: parse the string as
// the value expression and let the trailing unit keyword
// close the INTERVAL.
@@ -1058,7 +1304,19 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// keyword terminates the interval value before they're seen
// — the outer call gets to those operators after parse_interval_expr
// returns.
- let expr = self.parse_expr_bp(0)?;
+ //
+ // Flag the value's leading primary so a nested INTERVAL there yields
+ // the unit to us rather than eating it (see `parse_primary`). One-shot:
+ // `parse_primary` takes it, so only that first primary is affected.
+ // Reset unconditionally after the parse before propagating: on success
+ // `parse_primary` already took it, but if `parse_expr_bp` errors BEFORE
+ // reaching `parse_primary` (e.g. `interval + <non-number>`), the flag
+ // would otherwise leak past the enclosing `try_alt` rollback (whose
+ // checkpoint doesn't track it) and corrupt a following INTERVAL.
+ self.interval_value_pending = true;
+ let value_result = self.parse_expr_bp(0);
+ self.interval_value_pending = false;
+ let expr = value_result?;
// The grammar's `interval` rule is the eight singular unit
// *keyword* tokens (`SECOND | MINUTE | HOUR | DAY | WEEK |
// MONTH | QUARTER | YEAR`, with `YYYY` lexed as `YEAR`). A
@@ -1094,6 +1352,61 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
Ok(self.emit.call(unit_name, vec![expr]))
}
+ /// Parse `INTERVAL '<count> <unit>'` as the string-only
+ /// `ColumnExprIntervalString` form WITHOUT consuming a following unit
+ /// keyword. Used when an INTERVAL sits in the value position of an
+ /// enclosing INTERVAL (`interval interval '5 day' month`): cpp reserves the
+ /// trailing unit for the outer interval, so the inner string must carry its
+ /// own count+unit. Mirrors the combined-string branch of
+ /// `parse_interval_expr`, except a string that is not `<count> <unit>` is a
+ /// hard error (cpp's `visitColumnExprIntervalString`) rather than a
+ /// fall-through to the expr+unit form, which would steal the outer's unit.
+ fn parse_interval_string_only(&mut self) -> Result<E::Value, ParseError> {
+ self.expect_kw(Kw::Interval, "INTERVAL")?;
+ let str_tok = self.peek0;
+ let raw = unquote_single_string(self.text(str_tok));
+ let Some((count_str, unit)) = raw.split_once(' ') else {
+ self.bump()?;
+ return Err(ParseError::not_implemented_fatal(
+ "Unsupported interval type: must be in the format '<count> <unit>'",
+ str_tok.start,
+ str_tok.end,
+ ));
+ };
+ let count_valid = !count_str.is_empty() && count_str.bytes().all(|b| b.is_ascii_digit());
+ if !count_valid {
+ self.bump()?;
+ return Err(ParseError::not_implemented_fatal(
+ format!("Unsupported interval count: {count_str}"),
+ str_tok.start,
+ str_tok.end,
+ ));
+ }
+ let count: i64 = match count_str.parse() {
+ Ok(n) => n,
+ Err(_) => {
+ self.bump()?;
+ return Err(ParseError::not_implemented_fatal(
+ "Unknown error: stoi: out of range",
+ str_tok.start,
+ str_tok.end,
+ ));
+ }
+ };
+ let Some(unit_name) = interval_call_name_case_sensitive(unit) else {
+ self.bump()?;
+ return Err(ParseError::not_implemented_fatal(
+ format!("Unsupported interval unit: {unit}"),
+ str_tok.start,
+ str_tok.end,
+ ));
+ };
+ self.bump()?;
+ Ok(self
+ .emit
+ .call(unit_name, vec![self.emit.constant(self.emit.int(count))]))
+ }
+
/// Is `peek_next` a recognised INTERVAL unit keyword? Used by
/// parse_interval_expr to decide between the combined-string form
/// (`INTERVAL '5 day'`) and the expr-plus-unit form (`INTERVAL '1'
@@ -1231,6 +1544,10 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
fn parse_columns_expr(&mut self) -> Result<E::Value, ParseError> {
self.expect_kw(Kw::Columns, "COLUMNS")?;
self.expect(TokenKind::LParen, "(")?;
+ // Empty `columns()` matches no `ColumnExprColumns*` production (regex needs a string, the list needs >=1 columnExpr, the all-form needs `*`), so reject it: a bare `columns()` then falls back to a function call and `* columns()` (spread) is rejected, both matching cpp.
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("empty COLUMNS() is not a columns expression"));
+ }
// Three shapes inside the parens:
// 1. `'regex'` → ColumnsRegex
// 2. `*` [EXCLUDE (...)] [REPLACE (...)]
@@ -1281,16 +1598,16 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
self.emit.columns_expr(None, None, true, exclude, None),
asterisk_pos,
);
- self.columns_list_from_first(inner)?
+ self.columns_list_from_first(inner, asterisk_pos)?
}
} else {
// Could be `ident . *` or an expression list.
// Peek for the qualified-asterisk pattern: IDENT DOT ASTERISK.
- if matches!(
- self.peek(),
- TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
- ) && self.peek_next() == TokenKind::Dot
- {
+ // The qualifier is the grammar's `identifier`, so only keywords admitted by `kw_valid_as_identifier` qualify — Hog-statement keywords (try/catch/finally) and the rest of the omitted set are not Field qualifiers, so cpp rejects `columns(try.*)`; without this gate rust took it as a qualified-asterisk ColumnsExpr.
+ let first_is_qualifier_ident =
+ matches!(self.peek(), TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(self.peek(), TokenKind::Keyword(kw) if kw_valid_as_identifier(kw));
+ if first_is_qualifier_ident && self.peek_next() == TokenKind::Dot {
// Try to consume `IDENT.*` (or longer dotted chain ending in `*`).
let saved_pos = self.peek0.start;
let mut chain: Vec<String> = Vec::new();
@@ -1313,10 +1630,10 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
saw_star = true;
break;
}
- if matches!(
- nxt.kind,
- TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
- ) {
+ // Chain links are `identifier` too — gate keyword links on `kw_valid_as_identifier` so `columns(a.try.*)` rejects like cpp.
+ if matches!(nxt.kind, TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(nxt.kind, TokenKind::Keyword(kw) if kw_valid_as_identifier(kw))
+ {
chain.push(identifier_text(&self.src[nxt.start..nxt.end], nxt.kind));
} else {
ok = false;
@@ -1343,7 +1660,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// QualifiedReplace: ColumnsExpr(all_columns=True, replace=...) // qualifier dropped
// QualifiedExcludeReplace: ColumnsExpr(all_columns=True, exclude=..., replace=...) // qualifier dropped
match (exclude, replace) {
- (None, None) => self.columns_list_from_first(qualified_field)?,
+ (None, None) => self.columns_list_from_first(qualified_field, saved_pos)?,
(Some(ex), None) => {
// cpp's `ColumnExprColumnsQualifiedExclude`
// ctx covers `IDENT.* EXCLUDE(...)`; the
@@ -1353,7 +1670,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
self.emit.columns_expr(None, None, true, Some(ex), None),
saved_pos,
);
- self.columns_list_from_first(inner)?
+ self.columns_list_from_first(inner, saved_pos)?
}
(ex, repl @ Some(_)) => {
// cpp's `ColumnExprColumnsQualifiedReplace` /
@@ -1389,14 +1706,18 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
/// larger `columnExpr` (a postfix `(…)` call etc.) and may be the
/// first of a comma list — continue it through the Pratt loop and
/// collect the rest as `ColumnExprColumnsList`.
- fn columns_list_from_first(&mut self, first: E::Value) -> Result<E::Value, ParseError> {
+ fn columns_list_from_first(
+ &mut self,
+ first: E::Value,
+ first_start: usize,
+ ) -> Result<E::Value, ParseError> {
if self.peek() == TokenKind::RParen {
return Ok(self
.emit
.columns_expr(None, Some(vec![first]), false, None, None));
}
- let cont_start = self.peek0.start;
- let first = self.pratt_continue_with_lhs(first, 0, cont_start)?;
+ // The continuation (postfix call, infix op) extends the asterisk LHS, so its span must start at the LHS's start (`first_start`), not `self.peek0.start` (the token after it) — cpp spans `columns(a.*(b))`'s call from `a`, not from the `(`.
+ let first = self.pratt_continue_with_lhs(first, 0, first_start)?;
let mut list = vec![first];
while self.eat(TokenKind::Comma)? {
if self.peek() == TokenKind::RParen {
@@ -1408,110 +1729,114 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
}
fn parse_columns_decorators(&mut self) -> Result<ColumnsDecorators<E::Value>, ParseError> {
- let exclude = if self.eat_kw(Kw::Exclude)? {
- self.expect(TokenKind::LParen, "(")?;
- let mut names = Vec::new();
- loop {
- // Each entry is a `nestedIdentifier`: identifier
- // (DOT identifier)*. The cpp `visitNestedIdentifier`
- // joins the parts with `.` into a single string.
- let mut parts: Vec<String> = Vec::new();
- let first = self.bump()?;
- parts.push(match first.kind {
- TokenKind::Ident | TokenKind::QuotedIdent => {
- identifier_text(self.text(first), first.kind)
- }
- TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
- identifier_text(self.text(first), first.kind)
- }
- _ => {
- return Err(self.err(format!(
- "expected identifier in EXCLUDE list, got {:?}",
- first.kind
- )))
- }
- });
- while self.peek() == TokenKind::Dot {
- self.bump()?;
- let part = self.bump()?;
- parts.push(match part.kind {
- TokenKind::Ident | TokenKind::QuotedIdent => {
- identifier_text(self.text(part), part.kind)
- }
- TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
- identifier_text(self.text(part), part.kind)
- }
- _ => {
- return Err(self.err(format!(
- "expected identifier after `.` in EXCLUDE list, got {:?}",
- part.kind
- )))
- }
- });
+ let exclude = self.parse_exclude_clause()?;
+ let replace = self.parse_replace_clause()?;
+ Ok((exclude, replace))
+ }
+
+ /// `EXCLUDE LPAREN identifierList RPAREN` — the optional exclude list shared by the `COLUMNS(...)` family and the bare `ColumnExprAsterisk` (grammar line 289). Returns `None` when no EXCLUDE keyword follows.
+ fn parse_exclude_clause(&mut self) -> Result<Option<Vec<String>>, ParseError> {
+ if !self.eat_kw(Kw::Exclude)? {
+ return Ok(None);
+ }
+ self.expect(TokenKind::LParen, "(")?;
+ let mut names = Vec::new();
+ loop {
+ // Each entry is a `nestedIdentifier`: identifier
+ // (DOT identifier)*. The cpp `visitNestedIdentifier`
+ // joins the parts with `.` into a single string.
+ let mut parts: Vec<String> = Vec::new();
+ let first = self.bump()?;
+ parts.push(match first.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(first), first.kind)
}
- names.push(parts.join("."));
- if !self.eat(TokenKind::Comma)? {
- break;
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(first), first.kind)
}
- if self.peek() == TokenKind::RParen {
- break;
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier in EXCLUDE list, got {:?}",
+ first.kind
+ )))
}
- }
- self.expect(TokenKind::RParen, ")")?;
- Some(names)
- } else {
- None
- };
-
- let replace = if self.eat_kw(Kw::Replace)? {
- self.expect(TokenKind::LParen, "(")?;
- let mut items = Vec::new();
- loop {
- // `columnsReplaceItem: columnExpr AS identifier`. The
- // separator `AS` is the item's second-to-last token
- // (the last token is the replacement `identifier`).
- // Gate the alias-infix on that offset (same mechanism
- // as CAST) so the inner `columnExpr` parse takes any
- // earlier aliases and stops before the separator.
- let item_as = self.find_replace_item_as_pos()?;
- let prev_stop = std::mem::replace(&mut self.cast_as_stop, item_as);
- let expr_result = self.parse_expr_bp(0);
- self.cast_as_stop = prev_stop;
- let expr = expr_result?;
- self.expect_kw(Kw::As, "AS")?;
- let t = self.bump()?;
- let name = match t.kind {
+ });
+ while self.peek() == TokenKind::Dot {
+ self.bump()?;
+ let part = self.bump()?;
+ parts.push(match part.kind {
TokenKind::Ident | TokenKind::QuotedIdent => {
- identifier_text(self.text(t), t.kind)
+ identifier_text(self.text(part), part.kind)
}
TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
- identifier_text(self.text(t), t.kind)
+ identifier_text(self.text(part), part.kind)
}
_ => {
return Err(self.err(format!(
- "expected identifier in REPLACE clause, got {:?}",
- t.kind
+ "expected identifier after `.` in EXCLUDE list, got {:?}",
+ part.kind
)))
}
- };
- items.push((name, expr));
- if !self.eat(TokenKind::Comma)? {
- break;
+ });
+ }
+ names.push(parts.join("."));
+ if !self.eat(TokenKind::Comma)? {
+ break;
+ }
+ if self.peek() == TokenKind::RParen {
+ break;
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(Some(names))
+ }
+
+ /// `REPLACE LPAREN columnsReplaceList RPAREN` — the optional replace list, valid only inside the `COLUMNS(...)` / `(*...)` wrapper forms (a bare `ColumnExprAsterisk` admits EXCLUDE but never REPLACE). Returns `None` when no REPLACE keyword follows.
+ fn parse_replace_clause(&mut self) -> Result<Option<Vec<(String, E::Value)>>, ParseError> {
+ if !self.eat_kw(Kw::Replace)? {
+ return Ok(None);
+ }
+ self.expect(TokenKind::LParen, "(")?;
+ let mut items = Vec::new();
+ loop {
+ // `columnsReplaceItem: columnExpr AS identifier`. The
+ // separator `AS` is the item's second-to-last token
+ // (the last token is the replacement `identifier`).
+ // Gate the alias-infix on that offset (same mechanism
+ // as CAST) so the inner `columnExpr` parse takes any
+ // earlier aliases and stops before the separator.
+ let item_as = self.find_replace_item_as_pos()?;
+ let prev_stop = std::mem::replace(&mut self.cast_as_stop, item_as);
+ let expr_result = self.parse_expr_bp(0);
+ self.cast_as_stop = prev_stop;
+ let expr = expr_result?;
+ self.expect_kw(Kw::As, "AS")?;
+ let t = self.bump()?;
+ let name = match t.kind {
+ TokenKind::Ident | TokenKind::QuotedIdent => identifier_text(self.text(t), t.kind),
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
+ identifier_text(self.text(t), t.kind)
}
- // `columnsReplaceList: columnsReplaceItem (COMMA
- // columnsReplaceItem)*` — no trailing comma; cpp rejects
- // `REPLACE (b AS c,)`.
- if self.peek() == TokenKind::RParen {
- return Err(self.err("trailing comma in REPLACE clause"));
+ _ => {
+ return Err(self.err(format!(
+ "expected identifier in REPLACE clause, got {:?}",
+ t.kind
+ )))
}
+ };
+ items.push((name, expr));
+ if !self.eat(TokenKind::Comma)? {
+ break;
}
- self.expect(TokenKind::RParen, ")")?;
- Some(items)
- } else {
- None
- };
-
- Ok((exclude, replace))
+ // `columnsReplaceList: columnsReplaceItem (COMMA
+ // columnsReplaceItem)*` — no trailing comma; cpp rejects
+ // `REPLACE (b AS c,)`.
+ if self.peek() == TokenKind::RParen {
+ return Err(self.err("trailing comma in REPLACE clause"));
+ }
+ }
+ self.expect(TokenKind::RParen, ")")?;
+ Ok(Some(items))
}
/// Bare `*` at primary position. Three forms, in grammar-declared
@@ -1532,30 +1857,59 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
if matches!(self.peek(), TokenKind::Keyword(Kw::Columns))
&& self.peek_next() == TokenKind::LParen
{
- let inner = self.parse_columns_expr()?;
- return Ok(self.emit.spread_expr(inner));
- }
- // `ColumnExprAsterisk` (grammar line 289) admits ONLY an
- // optional trailing EXCLUDE on a bare `*`. `REPLACE` after `*`
- // is valid only inside the paren-wrapped forms (lines 220-225)
- // — `(* REPLACE (…))`, `(* EXCLUDE (…) REPLACE (…))`, and the
- // `COLUMNS(* … REPLACE …)` family. We detect the paren-wrapped
- // case by looking at what follows the REPLACE-list's closing
- // `)`: if it's `)` we're inside a wrapping paren (cpp's
- // ColumnExprColumnsReplace alt); anything else means the bare-
- // `*` REPLACE attempted at top level, which cpp rejects.
+ // cpp's ANTLR tries the `* COLUMNS(…)` spread (regex / list) and, when neither matches (e.g. an empty `columns()`), backs off to bare `*` (`ColumnExprAsterisk`), leaving COLUMNS(…) to the enclosing context (a later statement, or an error at the closing `)`). Mirror that fall-back on a non-fatal spread failure.
+ let cp = self.checkpoint();
+ match self.parse_columns_expr() {
+ Ok(inner) => return Ok(self.emit.spread_expr(inner)),
+ Err(e) if e.fatal => return Err(e),
+ Err(_) => self.restore(cp)?,
+ }
+ }
+ // `ColumnExprAsterisk` (grammar line 289) admits ONLY an optional trailing
+ // EXCLUDE on a bare `*`. `REPLACE` after `*` is valid only inside the
+ // paren-wrapped forms — `(* REPLACE (…))`, `(* EXCLUDE (…) REPLACE (…))`
+ // (parse_paren_or_tuple) and `COLUMNS(* … REPLACE …)` (parse_columns_expr),
+ // each of which consumes the `*` itself. So a `* … REPLACE` that reaches here is
+ // a bare top-level attempt (a function argument, a tuple element, …) — which cpp
+ // rejects, since bare `* … REPLACE` is not a columnExpr.
let cp_before_decorators = self.checkpoint();
- let (exclude, replace) = self.parse_columns_decorators()?;
- if replace.is_some() && self.peek() != TokenKind::RParen {
- self.restore(cp_before_decorators)?;
- return Err(self.err(
- "REPLACE after a bare `*` is only valid inside `(* REPLACE …)` / `COLUMNS(* REPLACE …)`",
- ));
+ let exclude = match self.parse_exclude_clause() {
+ Ok(e) => e,
+ Err(e) if e.fatal => return Err(e),
+ Err(e) => {
+ // The EXCLUDE list needs >=1 identifier, so a string / empty list
+ // fails the columns-exclude. At a statement boundary cpp re-reads
+ // `*` as a bare Field statement and `exclude(<…>)` as the next
+ // statement (a call): `* exclude ('j')` -> `*` ; `exclude('j')`.
+ // Outside a statement boundary (a SELECT column, an arg, …) there
+ // is no split, so propagate the rejection — matching cpp.
+ self.restore(cp_before_decorators)?;
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ return Ok(self.emit.field(vec![self.emit.string("*")]));
+ }
+ return Err(e);
+ }
+ };
+ // A bare `*` / `* EXCLUDE(...)` admits no trailing REPLACE (that needs the
+ // paren-wrapped `(* REPLACE …)` / `COLUMNS(* … REPLACE …)`). At a statement
+ // boundary cpp keeps the `*` / `* EXCLUDE(...)` as this statement and
+ // re-reads `replace(...)` as the next statement's call (`* replace (1 as b)`
+ // -> `*` ; `replace(1 as b)`); elsewhere it's a hard reject.
+ let cp_before_replace = self.checkpoint();
+ if self.parse_replace_clause()?.is_some() {
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ self.restore(cp_before_replace)?;
+ } else {
+ self.restore(cp_before_decorators)?;
+ return Err(self.err(
+ "REPLACE after a bare `*` is only valid inside `(* REPLACE …)` / `COLUMNS(* REPLACE …)`",
+ ));
+ }
}
- if exclude.is_none() && replace.is_none() {
+ if exclude.is_none() {
Ok(self.emit.field(vec![self.emit.string("*")]))
} else {
- Ok(self.emit.columns_expr(None, None, true, exclude, replace))
+ Ok(self.emit.columns_expr(None, None, true, exclude, None))
}
}
@@ -1563,8 +1917,11 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
fn parse_positional(&mut self) -> Result<E::Value, ParseError> {
self.expect(TokenKind::Hash, "#")?;
let tok = self.bump()?;
- if tok.kind != TokenKind::Number {
- return Err(self.err(format!("expected integer after '#', got {:?}", tok.kind)));
+ // Grammar: `HASH DECIMAL_LITERAL # ColumnExprPositional` — only a base-10 integer. Rust's lexer folds hex / octal / float into one `Number` kind, so re-check the text: `#0x6` (hex), `#017` (octal), `#1e3` (float) all reject in cpp, where rust used to read them as PositionalRef(0) via `parse().unwrap_or(0)`.
+ let is_dec = tok.kind == TokenKind::Number && is_decimal_literal(self.text(tok));
+ if !is_dec {
+ let got = self.text(tok).to_string();
+ return Err(self.err(format!("expected decimal integer after '#', got {got:?}")));
}
let n: i64 = self.text(tok).parse().unwrap_or(0);
Ok(self.emit.positional_ref(n))
@@ -1603,12 +1960,25 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
}
}
+ /// Parse a placeholder-only `{ … }` slot (`tableExpr` / `ratioExpr` / `selectStmtWithParens`): only `{ columnExpr }` is valid, so reject the Dict that `{}` or `{k: v}` would otherwise produce.
+ pub(crate) fn parse_brace_placeholder_only(&mut self) -> Result<E::Value, ParseError> {
+ let node = self.parse_brace_dict_or_placeholder()?;
+ if self.emit.node_kind(&node).as_deref() != Some("Placeholder") {
+ return Err(self.err("expected a placeholder `{name}` here, not a dict"));
+ }
+ Ok(node)
+ }
+
fn parse_single_arg_arrow_lambda(&mut self) -> Result<E::Value, ParseError> {
+ let lambda_start = self.peek0.start;
let ident = self.bump()?;
let name = identifier_text(self.text(ident), ident.kind);
self.expect(TokenKind::Arrow, "->")?;
let body = self.parse_lambda_body()?;
- Ok(self.emit.lambda(vec![name], body))
+ // Stamp the span here (not just via the caller's `wrap_pos`): a block
+ // body followed by a postfix leaves the lambda as an intermediate
+ // pratt-loop lhs the outer wrap never reaches.
+ Ok(self.wrap_pos(self.emit.lambda(vec![name], body), lambda_start))
}
/// Lambda body — either a single expression (`(x) -> expr`) or a
@@ -1655,6 +2025,12 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
if !is_ident_kind(self.peek()) {
return Ok(None);
}
+ // The Lambda spans from its first parameter through the body's last
+ // token. Stamp it here rather than relying on the caller's `wrap_pos`:
+ // a block body that can't absorb a trailing postfix (`x -> { … } . 1`)
+ // leaves the lambda as an intermediate pratt-loop lhs that the outer
+ // wrap never reaches, so it would otherwise be position-less.
+ let lambda_start = self.peek0.start;
// Probe with a shadow lexer that doesn't disturb the parser state.
let mut probe = Lexer::with_pos(self.src, self.peek0.start);
let mut names: Vec<String> = Vec::new();
@@ -1673,7 +2049,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// Confirmed; commit the consumption.
self.set_lexer_pos(probe.pos())?;
let body = self.parse_lambda_body()?;
- return Ok(Some(self.emit.lambda(names, body)));
+ return Ok(Some(
+ self.wrap_pos(self.emit.lambda(names, body), lambda_start),
+ ));
}
TokenKind::Comma => {
// Peek past the comma to handle the trailing-comma
@@ -1684,7 +2062,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
TokenKind::Arrow => {
self.set_lexer_pos(probe.pos())?;
let body = self.parse_lambda_body()?;
- return Ok(Some(self.emit.lambda(names, body)));
+ return Ok(Some(
+ self.wrap_pos(self.emit.lambda(names, body), lambda_start),
+ ));
}
k if is_ident_kind(k) => {
names.push(identifier_text(
@@ -1896,6 +2276,24 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
if self.peek() == TokenKind::RParen {
return Err(self.err("empty parentheses are not a valid expression"));
}
+ // `(* [EXCLUDE(...)] REPLACE(...))` — ColumnExprColumns[Exclude]Replace. A bare
+ // `* … REPLACE(…)` is a columnExpr only inside this paren form (or
+ // `COLUMNS(* … REPLACE(…))`); the general asterisk path rejects REPLACE everywhere
+ // else (function arg, tuple element, …) as cpp does. Recognise it here, consuming
+ // the wrapping `)`, rather than via a peek-at-`)` heuristic that can't tell this
+ // wrapper paren from a borrowed function-call paren.
+ if self.peek() == TokenKind::Asterisk {
+ let cp = self.checkpoint();
+ self.bump()?;
+ if let Ok((exclude, replace)) = self.parse_columns_decorators() {
+ if replace.is_some() && self.peek() == TokenKind::RParen {
+ self.bump()?;
+ let node = self.emit.columns_expr(None, None, true, exclude, replace);
+ return Ok(self.wrap_pos_to(node, outer_start, self.last_consumed_end));
+ }
+ }
+ self.restore(cp)?;
+ }
// Three competing grammar arms when the inner is non-empty:
// ColumnExprSubquery: LPAREN selectSetStmt RPAREN
// ColumnExprParens: LPAREN columnExpr RPAREN
@@ -1920,16 +2318,13 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// Alt 2: parens / tuple
&Self::parse_paren_expr_or_tuple_arm,
])?;
- // Re-wrap ColumnsExpr-with-REPLACE shapes whose grammar rule
- // (`LPAREN ASTERISK [EXCLUDE(...)]? REPLACE(...) RPAREN`) makes the
- // outer parens part of the ctx span — the inner wrap missed them.
- // Exclude-only `(* EXCLUDE (...))` is a regular ColumnExprAsterisk
- // inside ColumnExprParens (pass-through), so REPLACE is the
- // distinguishing marker.
- if is_paren_form_columns_replace(&self.emit, &result) {
- let end = self.last_consumed_end;
- return Ok(self.replace_pos_to(result, outer_start, end));
- }
+ // The bare `LPAREN ASTERISK [EXCLUDE(...)]? REPLACE(...) RPAREN` form —
+ // the only ColumnsExpr-with-REPLACE shape whose ctx includes the outer
+ // parens — is already handled above (the `peek == Asterisk` branch wraps
+ // it at `outer_start`). Any ColumnsExpr reaching here came through a
+ // `columns(...)` call or an extra wrapping paren, where cpp treats the
+ // wrapping parens as a separate `ColumnExprParens` (stripped) — so leave
+ // the inner span untouched rather than over-extending to the parens.
Ok(result)
}
@@ -2463,8 +2858,24 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// `name(args) [FILTER (WHERE …)] OVER (windowExpr | name)` —
// window function form. Distinguishable from the plain-call
// case by the trailing `OVER` keyword.
- // Optional `FILTER (WHERE …)` between the args and OVER.
- let filter_expr_for_window = self.parse_optional_filter()?;
+ // Optional `FILTER (WHERE …)` between the args and OVER. An invalid
+ // FILTER (e.g. `filter ()`, no `(WHERE …)`) is, at a statement
+ // boundary, cpp's completed `name(args)` statement followed by a
+ // `filter(...)` call as the NEXT statement (`l() filter ()` -> `l()`
+ // ; `filter()`); outside a statement boundary there is no split.
+ let cp_before_filter = self.checkpoint();
+ let filter_expr_for_window = match self.parse_optional_filter() {
+ Ok(f) => f,
+ Err(e) if e.fatal => return Err(e),
+ Err(e) => {
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ self.restore(cp_before_filter)?;
+ None
+ } else {
+ return Err(e);
+ }
+ }
+ };
if matches!(self.peek(), TokenKind::Keyword(Kw::Over)) {
// `ColumnExprWinFunction` (grammar line 235) takes a
// plain `columnExprList` — NO DISTINCT, NO in-arg
@@ -2491,7 +2902,11 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
} else {
let tok = self.bump()?;
let id = match tok.kind {
- TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(tok), tok.kind)
+ }
+ // A window name is an `identifier`, which admits only `kw_valid_as_identifier` keywords — the Hog-statement keywords (try / catch / finally / …) are not valid window names.
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
identifier_text(self.text(tok), tok.kind)
}
_ => {
@@ -2637,7 +3052,8 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// qualifier in that branch (returning `ColumnsExpr(all_columns=True,
// exclude=[…])`, NOT a Field chain).
if ended_with_star && matches!(self.peek(), TokenKind::Keyword(Kw::Exclude)) {
- let (exclude, _) = self.parse_columns_decorators()?;
+ // Bare `ColumnExprAsterisk` admits only EXCLUDE — a trailing REPLACE has no bare production (REPLACE lives only inside `columns(...)` / `(*...)`), so consume exclude-only and leave any REPLACE for the enclosing context to reject, matching cpp's `a.* exclude(z) replace(...)` rejection.
+ let exclude = self.parse_exclude_clause()?;
return Ok(self.emit.columns_expr(None, None, true, exclude, None));
}
Ok(self.emit.field(chain))
@@ -2751,7 +3167,24 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
self.expect(TokenKind::LParen, "(")?;
let (distinct, args, order_by) = self.parse_function_args_inner()?;
self.expect(TokenKind::RParen, ")")?;
- let filter_expr = self.parse_optional_filter()?;
+ // `<call>() FILTER (...)` is the aggregate FILTER clause, which requires
+ // `(WHERE <expr>)`. An invalid FILTER (e.g. `filter ()`, no WHERE) is, at
+ // a statement boundary, cpp's completed `<call>()` statement followed by a
+ // `filter(...)` call as the NEXT statement (`l() filter ()` -> `l()` ;
+ // `filter()`). Outside a statement boundary there is no split, so reject.
+ let cp_before_filter = self.checkpoint();
+ let filter_expr = match self.parse_optional_filter() {
+ Ok(f) => f,
+ Err(e) if e.fatal => return Err(e),
+ Err(e) => {
+ if self.stmt_rhs_recover_on_pratt_rhs_failure {
+ self.restore(cp_before_filter)?;
+ None
+ } else {
+ return Err(e);
+ }
+ }
+ };
if matches!(self.peek(), TokenKind::Keyword(Kw::Over)) {
self.bump()?;
drop((distinct, order_by, filter_expr));
@@ -2763,7 +3196,11 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
} else {
let tok = self.bump()?;
let id = match tok.kind {
- TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(tok), tok.kind)
+ }
+ // A window name is an `identifier`, which admits only `kw_valid_as_identifier` keywords — the Hog-statement keywords (try / catch / finally / …) are not valid window names.
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
identifier_text(self.text(tok), tok.kind)
}
_ => {
@@ -2949,6 +3386,76 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
Ok(name)
}
+ /// True when the parenthesised type body starting at `peek0` is a complete
+ /// `ColumnTypeExprEnum` list: `enumValue (COMMA enumValue)* COMMA?` where
+ /// `enumValue: string EQ_SINGLE numberLiteral`. Mirrors ANTLR committing to
+ /// the Enum alt only when EVERY entry matches; any non-numberLiteral value
+ /// (`'a' = ''`, `'a' = x`, `'a' = 1 + 2`) or a `==` separator instead of `=`
+ /// makes it fall through to `ColumnTypeExprParam` (a `columnExprList`).
+ /// NOTE: the lexer's `EqDouble` is the *single* `=` (grammar EQ_SINGLE);
+ /// `EqSingle` is `==`. numberLiteral folds to `Number` (plus optional sign)
+ /// or the `inf` / `nan` keywords.
+ fn paren_body_is_enum_value_list(&self) -> bool {
+ let mut pos = self.peek0.start;
+ loop {
+ let mut probe = Lexer::with_pos(self.src, pos);
+ // enumValue: STRING `=` numberLiteral
+ if !matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::String)) {
+ return false;
+ }
+ if !matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::EqDouble)) {
+ return false;
+ }
+ // numberLiteral: optional sign, then a number / leading-dot float /
+ // inf / nan. The lexer assembles a `.`-float across tokens (`1.5` is
+ // `1` `.` `5`), so after the leading number token consume the
+ // `(Dot|Number)*` continuation run before reading the separator —
+ // that keeps `'k' = 1.5e3` an enumValue while `'k' = 1 + 2` (an
+ // operator after the number) and `'k' = x` / `'k' = ''` fall through.
+ let mut t = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ if matches!(t.kind, TokenKind::Plus | TokenKind::Dash) {
+ t = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ }
+ if !matches!(
+ t.kind,
+ TokenKind::Number
+ | TokenKind::Dot
+ | TokenKind::Keyword(Kw::Inf)
+ | TokenKind::Keyword(Kw::Nan)
+ ) {
+ return false;
+ }
+ let mut sep = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ while matches!(sep.kind, TokenKind::Dot | TokenKind::Number) {
+ sep = match probe.next_token() {
+ Ok(t) => t,
+ Err(_) => return false,
+ };
+ }
+ match sep.kind {
+ TokenKind::RParen => return true,
+ TokenKind::Comma => {
+ pos = sep.end;
+ // Trailing comma (`… ,)`) closes a valid enum list.
+ let mut after = Lexer::with_pos(self.src, pos);
+ if matches!(after.next_token().map(|t| t.kind), Ok(TokenKind::RParen)) {
+ return true;
+ }
+ }
+ _ => return false,
+ }
+ }
+ }
+
fn parse_type_atom(&mut self) -> Result<String, ParseError> {
// Decode a single type-name token, unquoting quoted-idents and
// lowercasing the rest. The grammar's `columnTypeExpr` resolves
@@ -2981,11 +3488,16 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// with "Unsupported rule: ColumnTypeExprEnum", so rust must
// also error rather than fall through to the Param raw-text
// path (which would happily emit `enum8('a'=1)`).
- // Detect the enumValue shape at the head of the paren body —
- // STRING `=` Number — and short-circuit with the same error.
- if matches!(self.peek(), TokenKind::String)
- && matches!(self.peek_next(), TokenKind::EqDouble | TokenKind::EqSingle)
- {
+ //
+ // But ANTLR commits to Enum only when the WHOLE body is a valid
+ // enumValue list — `string '=' numberLiteral`, comma-separated. If
+ // any entry's value is not a numberLiteral (`q('a' = '')`, `q('a' =
+ // x)`, `q('a' = 1 + 2)`) or the separator is `==` rather than `=`
+ // (`q('a' == 1)`), ANTLR falls through to `ColumnTypeExprParam` (the
+ // body is a `columnExprList`, e.g. the comparison `'a' = ''`), which
+ // cpp ACCEPTS. So gate the reject on the full enum-list shape and let
+ // the Param path below handle the rest.
+ if self.paren_body_is_enum_value_list() {
let start = self.peek0.start;
let end = self.peek0.end;
// Fatal so the outer `try_alt`'s parse_ident_lead
@@ -3628,6 +4140,12 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
let cp = self.checkpoint();
match self.parse_type_expr() {
Ok(name) if matches!(self.peek(), TokenKind::Comma | TokenKind::RParen) => Ok(name),
+ // A FATAL error means the nested type committed and failed a
+ // visitor-level check — e.g. `q(w('k'=1))`, where the inner
+ // `w('k'=1)` is a `ColumnTypeExprEnum` that cpp rejects. Propagate
+ // it rather than masking it with the raw-text Param fallback (which
+ // would over-accept). Mirrors `try_alt`'s fatal short-circuit.
+ Err(e) if e.fatal => Err(e),
_ => {
self.restore(cp)?;
self.consume_raw_type_param_text()
@@ -3719,6 +4237,21 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// original input text is used verbatim — case is preserved
// (`ABC` stays `ABC`) and QuotedIdents keep their quotes
// (`"a"` stays `"a"`).
+ //
+ // ANTLR runs `getText()` only after matching the item as a `columnExpr`,
+ // so the verbatim text is a *valid* expression. Validate that first:
+ // parse the item as a columnExpr and require it to land on the param
+ // terminator. Otherwise non-columnExpr junk — `()` (empty group),
+ // `a() b` (juxtaposition), `Int NULL` — is swallowed as raw text and
+ // accepted, where cpp rejects. Both callers (param-mode loop and the
+ // `parse_type_param_item` fall-back) route through here.
+ let validate_cp = self.checkpoint();
+ self.parse_expr_bp(0)?;
+ if !matches!(self.peek(), TokenKind::Comma | TokenKind::RParen) {
+ return Err(self.err("type parameter is not a valid expression"));
+ }
+ self.restore(validate_cp)?;
+
let mut out = String::new();
let mut depth: i32 = 0;
loop {
@@ -4008,14 +4541,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
let part = self.bump()?;
match part.kind {
TokenKind::Number => {
- // cpp's lexer matches `0123` as OCTAL_PREFIX_LITERAL,
- // not DECIMAL_LITERAL — so a leading-zero multi-digit
- // index is grammatically rejected at the tuple-access
- // alt. Rust's lexer collapses both forms into one
- // `Number` token and used to silently re-parse it as
- // decimal (`a.0123` → TupleAccess(a, 123)).
+ // Grammar: tuple access takes a DECIMAL_LITERAL index. Rust's lexer folds hex / octal / float into one `Number` kind, so re-check the text. cpp's lexer matches `0123` / `017` as OCTAL_LITERAL (leading zero, all-octal digits) and rejects them here, but `08` / `019` are DECIMAL (8 and 9 are not octal digits) and accept.
let text = self.text(part);
- if text.len() > 1 && text.starts_with('0') && !text.contains('.') {
+ if !is_decimal_literal(text) {
return Err(self
.err(format!("expected decimal integer after '.', got {text:?}")));
}
@@ -4065,10 +4593,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
let part = self.bump()?;
match part.kind {
TokenKind::Number => {
- // Same OCTAL_PREFIX_LITERAL vs DECIMAL_LITERAL
- // split as the regular `.<N>` branch above.
+ // Same DECIMAL_LITERAL check as the regular `.<N>` branch above.
let text = self.text(part);
- if text.len() > 1 && text.starts_with('0') && !text.contains('.') {
+ if !is_decimal_literal(text) {
return Err(self.err(format!(
"expected decimal integer after '?.', got {text:?}"
)));
@@ -4155,6 +4682,69 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
Ok(true)
}
+ /// Parse the RHS of `IN` / `NOT IN`, consuming an optional `COHORT` marker.
+ /// cpp only takes the grammar's `COHORT?` alternative when a `columnExpr`
+ /// actually follows. `try_consume_cohort_marker` rejects the obvious
+ /// terminators up front, but a value that *starts* to parse and then fails
+ /// (e.g. `a IN COHORT < b`, where `< b` is a comparison on the whole
+ /// `(a in COHORT)` and is not a cohort value) must also fall back to
+ /// `COHORT`-as-Field. Try the cohort value and, on failure, restore and
+ /// re-read `COHORT` as the IN rhs Field. Returns `(is_cohort, rhs)`.
+ fn parse_in_cohort_rhs(&mut self) -> Result<(bool, E::Value), ParseError> {
+ let cp = self.checkpoint();
+ if self.try_consume_cohort_marker()? {
+ if let Ok(rhs) = self.parse_expr_bp(BP_COMPARE + 1) {
+ // The marker holds only when the value is a *complete* columnExpr
+ // with nothing left dangling. If a fresh primary sits right after
+ // it, the "value" was really an infix operator that parsed as a
+ // bare Field / `*` (`cohort * b`, `cohort like b`, `cohort is
+ // null`): two primaries can't be adjacent, so `cohort` is part of
+ // the rhs expression instead. `cohort < b` / `cohort + b` already
+ // fail the value parse above (incomplete tag / unary `+`), so they
+ // restore here too. Then the non-marker parse below yields
+ // `a in (cohort * b)` or `(a in cohort) like b` per precedence.
+ if !matches!(
+ self.peek(),
+ TokenKind::Number
+ | TokenKind::String
+ | TokenKind::Ident
+ | TokenKind::QuotedIdent
+ | TokenKind::Keyword(Kw::Null | Kw::Inf | Kw::Nan | Kw::True | Kw::False)
+ ) {
+ return Ok((true, rhs));
+ }
+ }
+ self.restore(cp)?;
+ }
+ let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ Ok((false, rhs))
+ }
+
+ /// True when the `lambda` keyword sitting at `peek_next` (peek1) is the head
+ /// of a `lambdaExpr` body — `LAMBDA (identifier (COMMA identifier)* COMMA?)?
+ /// COLON …`. Probes past the keyword with a shadow lexer. Used by the
+ /// AS-alias infix to distinguish a lambda value (`… AS lambda y: y`, only
+ /// reachable in INTERPOLATE) from a plain `lambda` alias (`1 AS lambda`).
+ fn lambda_body_follows_after_peek_next(&self) -> bool {
+ let mut lex = Lexer::with_pos(self.src, self.peek1.end);
+ loop {
+ match lex.next_token().map(|t| t.kind) {
+ // bare `lambda :` or the `:` after the last param
+ Ok(TokenKind::Colon) => return true,
+ // a parameter identifier — must be followed by `,` (more params)
+ // or `:` (body); anything else means this isn't a lambda head.
+ Ok(TokenKind::Ident | TokenKind::QuotedIdent) => {
+ match lex.next_token().map(|t| t.kind) {
+ Ok(TokenKind::Colon) => return true,
+ Ok(TokenKind::Comma) => continue,
+ _ => return false,
+ }
+ }
+ _ => return false,
+ }
+ }
+ }
+
// ---- Multi-token / context-sensitive infix --------------------------
/// Returns `Some(true)` if it consumed and produced an infix.
@@ -4256,19 +4846,25 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// at line ~126 stamps positions onto the OUTERMOST wrapper, but the BetweenExpr
// is now buried inside (e.g. as `Call(if, [BetweenExpr, …])` for the ternary hoist)
// and would not otherwise receive a span. cpp emits position info on BetweenExpr
- // unconditionally — match that. Use `high.end` (not `last_consumed_end`) — see
- // the BETWEEN arm below for the rationale.
+ // unconditionally — match that. Simple BETWEEN spans through the high operand's
+ // last consumed token (incl. a parenthesized high's trailing `)`); only the
+ // WIDE/hoist case needs `high.end` (last_consumed_end overshoots there).
let high_end = self.emit.get_field(&high, "end");
let between_inner = self.emit.between(prev, low, high, true);
- let mut between = match high_end {
- Some(end) => {
- self.emit
- .with_pos(between_inner, self.pos_obj(lhs_start), end)
+ let mut between = if hoisted.is_empty() {
+ self.wrap_pos(between_inner, lhs_start)
+ } else {
+ match high_end {
+ Some(end) => {
+ self.emit
+ .with_pos(between_inner, self.pos_obj(lhs_start), end)
+ }
+ None => self.wrap_pos(between_inner, lhs_start),
}
- None => self.wrap_pos(between_inner, lhs_start),
};
- for hoist in hoisted {
+ for (hoist, hoist_end) in hoisted {
between = apply_between_hoist(&self.emit, between, hoist);
+ between = self.stamp_hoist_pos(between, lhs_start, hoist_end);
}
*lhs = between;
Ok(Some(true))
@@ -4279,8 +4875,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
}
self.bump()?;
self.bump()?;
- let cohort = self.try_consume_cohort_marker()?;
- let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let (cohort, rhs) = self.parse_in_cohort_rhs()?;
let op = if cohort { "not in cohort" } else { "not in" };
let prev = std::mem::replace(lhs, self.emit.null());
*lhs = self.emit.compare(prev, op, rhs);
@@ -4318,20 +4913,28 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
self.bump()?;
let (low, high, hoisted) = self.parse_between_body(min_bp)?;
let prev = std::mem::replace(lhs, self.emit.null());
- // The inner BetweenExpr's structural end is `high.end`, not `self.last_consumed_end`.
- // When `parse_between_body`'s WIDE arm absorbs a nested BETWEEN and the split hoists
- // it back out (`BetweenHoist::Between`), `last_consumed_end` is past the high we'll
- // actually use; mirror cpp's per-ctx span by reading the end off `high` directly.
+ // The simple BETWEEN spans through the high operand's *last consumed*
+ // token — including a trailing `)` that a parenthesized high
+ // (`… and (3)`) strips from `high.end`. Only the WIDE/hoist case
+ // (`parse_between_body` absorbed a nested BETWEEN that is now hoisted
+ // back out) needs `high.end`, because there `last_consumed_end` is
+ // past the high we actually keep.
let high_end = self.emit.get_field(&high, "end");
let between_inner = self.emit.between(prev, low, high, false);
- let mut between = match high_end {
- Some(end) => self
- .emit
- .with_pos(between_inner, self.pos_obj(lhs_start), end),
- None => self.wrap_pos(between_inner, lhs_start),
+ let mut between = if hoisted.is_empty() {
+ self.wrap_pos(between_inner, lhs_start)
+ } else {
+ match high_end {
+ Some(end) => {
+ self.emit
+ .with_pos(between_inner, self.pos_obj(lhs_start), end)
+ }
+ None => self.wrap_pos(between_inner, lhs_start),
+ }
};
- for hoist in hoisted {
+ for (hoist, hoist_end) in hoisted {
between = apply_between_hoist(&self.emit, between, hoist);
+ between = self.stamp_hoist_pos(between, lhs_start, hoist_end);
}
*lhs = between;
Ok(Some(true))
@@ -4348,8 +4951,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
return Ok(None);
}
self.bump()?;
- let cohort = self.try_consume_cohort_marker()?;
- let rhs = self.parse_expr_bp(BP_COMPARE + 1)?;
+ let (cohort, rhs) = self.parse_in_cohort_rhs()?;
let op = if cohort { "in cohort" } else { "in" };
let prev = std::mem::replace(lhs, self.emit.null());
*lhs = self.emit.compare(prev, op, rhs);
@@ -4434,14 +5036,18 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
if !next_is_alias_target {
return Ok(None);
}
- // `LAMBDA` after `AS` always starts a `lambdaExpr`
- // (`LAMBDA identifier (COMMA identifier)* COMMA?
- // COLON columnExpr`), not an alias name. cpp's ALL(*)
- // sees the lambda body's `:` and backtracks the alias
- // alt; Pratt can't, so refuse the alias here so the
- // outer `INTERPOLATE (expr AS columnExpr)` form picks
- // the AS up itself.
- if matches!(self.peek_next(), TokenKind::Keyword(Kw::Lambda)) {
+ // `AS lambda <params> :` is a `lambdaExpr` value, not an alias —
+ // only valid in `INTERPOLATE (expr AS columnExpr)`, where refusing
+ // the alias here lets the INTERPOLATE clause pick up the AS and
+ // parse the lambda. But a bare `AS lambda` with NO lambda body is
+ // a plain alias (`1 as lambda` -> `Alias(1, 'lambda')`, cpp
+ // accepts; `1 as lambda: 2` rejects on both since the lambda-expr
+ // form isn't allowed in plain expression context — the alias
+ // absorbs `lambda` and the trailing `: 2` then fails). So refuse
+ // only when a lambda body actually follows.
+ if matches!(self.peek_next(), TokenKind::Keyword(Kw::Lambda))
+ && self.lambda_body_follows_after_peek_next()
+ {
return Ok(None);
}
// `AS <ident> ->` is the arrow-form lambda. The single
@@ -4534,6 +5140,19 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
///
/// Both alts share the same post-parse split + literal-AND
/// fallback; the difference is just the starting BP.
+ /// Stamp a hoisted BETWEEN wrapper's span. Every wrapper starts at the
+ /// BETWEEN's leftmost operand (`start`); the `end` is the wrapper's own last
+ /// token, captured during the split. `apply_between_hoist` builds a
+ /// position-less node, so `with_pos` fills it; the OUTERMOST wrapper's span
+ /// matches the outer pratt `wrap_pos` (idempotent). Falls back to
+ /// `wrap_pos` when the end wasn't captured.
+ fn stamp_hoist_pos(&self, node: E::Value, start: usize, end: Option<E::Value>) -> E::Value {
+ match end {
+ Some(e) => self.emit.with_pos(node, self.pos_obj(start), e),
+ None => self.wrap_pos(node, start),
+ }
+ }
+
fn parse_between_body(
&mut self,
outer_min_bp: u8,
@@ -4599,7 +5218,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
outer_min_bp: u8,
) -> Result<BetweenSplit<E::Value>, ParseError> {
let (low, high, hoisted) = Self::parse_between_body_arm(self, start_bp)?;
- if hoisted.iter().any(|h| hoist_min_bp(h) <= outer_min_bp) {
+ if hoisted.iter().any(|(h, _)| hoist_min_bp(h) <= outer_min_bp) {
return Err(
self.err("WIDE body hoist conflicts with outer precedence; falling through")
);
@@ -4615,7 +5234,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
start_bp: u8,
) -> Result<BetweenSplit<E::Value>, ParseError> {
let chain = self.parse_expr_bp(start_bp)?;
- if let Some((low, high, hoisted)) = split_at_rightmost_and(&self.emit, &chain) {
+ if let Some((low, high, hoisted)) = split_at_rightmost_and(self, &chain) {
return Ok((low, high, hoisted));
}
// The body had no AND that the split could find — consume the
@@ -4640,6 +5259,23 @@ fn can_start_case_body(tok: TokenKind) -> bool {
peek_can_start_clause_body(tok) && !is_pure_infix_op(tok)
}
+/// Is `text` a HogQL `DECIMAL_LITERAL` (base-10 integer) as the lexer would
+/// classify it? Used after `#`, `.`, and `?.`, all of which the grammar
+/// restricts to DECIMAL_LITERAL. Rust's lexer folds every numeric literal
+/// into one `Number` kind, so we re-check the text and reject what cpp's
+/// lexer would tokenize as something else: hex (`0x6`), floats (`1e3`,
+/// `1.5`), and OCTAL_LITERAL — a leading-zero run of octal digits (`017`,
+/// `00`), which the lexer matches as OCTAL before DECIMAL. A leading-zero
+/// number containing an 8 or 9 (`08`, `019`) is NOT octal, so the lexer
+/// reads it as DECIMAL and it is allowed.
+fn is_decimal_literal(text: &str) -> bool {
+ !text.is_empty()
+ && text.bytes().all(|b| b.is_ascii_digit())
+ && !(text.len() >= 2
+ && text.starts_with('0')
+ && text.bytes().all(|b| b.is_ascii_digit() && b <= b'7'))
+}
+
/// Can `tok` plausibly begin an INTERVAL value? Either an expression
/// starter (Number, Ident, etc.) or a string literal (the combined
/// `INTERVAL '5 day'` form).
@@ -4652,7 +5288,7 @@ fn can_start_interval_value(tok: TokenKind) -> bool {
/// `interval := 5` should fall back to the named-argument identifier
/// path because `:=` can't open an INTERVAL value, and similar for
/// comparison / equality operators.
-fn is_pure_infix_op(tok: TokenKind) -> bool {
+pub(crate) fn is_pure_infix_op(tok: TokenKind) -> bool {
matches!(
tok,
TokenKind::ColonEquals
@@ -4938,10 +5574,18 @@ pub(crate) enum BetweenHoist<V> {
},
}
+/// A hoisted BETWEEN wrapper paired with the `end` position of the
+/// original node it was lifted from. The `end` lets the apply loop stamp
+/// `[lhs_start, end]` on each wrapper so the INNER ones (which the outer
+/// pratt `wrap_pos` never reaches once a further wrapper sits outside
+/// them) carry cpp's span — e.g. `1 between 2 and 3 as l :: Int` needs the
+/// Alias at `[0, end-of-`l`]` and the TypeCast at `[0, end-of-`Int`]`.
+type HoistWithEnd<V> = (BetweenHoist<V>, Option<V>);
+
/// Result of finding the BETWEEN separator AND inside a greedy body
/// parse. `hoisted` wrappers are applied around the BetweenExpr by
/// the caller of `parse_between_body`, innermost first.
-type BetweenSplit<V> = (V, V, Vec<BetweenHoist<V>>);
+type BetweenSplit<V> = (V, V, Vec<HoistWithEnd<V>>);
/// The lowest binding power at which this hoist's outer wrapper can
/// fire. Used by `parse_between_body_arm_wide` to detect when an
@@ -5019,30 +5663,170 @@ fn apply_between_hoist<E: Emitter>(
}
}
+/// The byte offset carried by a position value, if present. ASCII-only —
+/// for non-ASCII sources this is a CHARACTER index, so callers that need a
+/// byte offset must gate on `parser.is_ascii_src` first. The JSON backend
+/// stores positions as `{line, column, offset}`; the Python backend stores
+/// the offset directly as an int — read whichever shape applies.
+fn pos_offset<E: Emitter>(emit: &E, pos: Option<&E::Value>) -> Option<usize> {
+ let pos = pos?;
+ if let Some(o) = emit.as_i64(pos) {
+ return usize::try_from(o).ok();
+ }
+ let offset = emit.get_field(pos, "offset")?;
+ usize::try_from(emit.as_i64(&offset)?).ok()
+}
+
+/// Given a child's inner `[start, end)` byte span, return the
+/// paren-inclusive `(outer_start, outer_end)` by counting the balanced
+/// `(`…`)` pairs that DIRECTLY wrap the child. A leading `(` (skipping
+/// whitespace) only counts when matched by a trailing `)` (skipping
+/// whitespace) — `min(leading_run, trailing_run)` — so parens belonging
+/// to a larger enclosing construct (the synthetic node itself, or a
+/// sibling group) are never absorbed. Byte-scanning is UTF-8-safe here:
+/// `(`, `)` and ASCII whitespace are single-byte and can't collide with
+/// any continuation byte.
+fn paren_inclusive_span(src: &str, start: usize, end: usize) -> (usize, usize) {
+ let bytes = src.as_bytes();
+ let mut lparens: Vec<usize> = Vec::new();
+ let mut i = start;
+ while i > 0 {
+ i -= 1;
+ match bytes[i] {
+ b'(' => lparens.push(i),
+ b if b.is_ascii_whitespace() => {}
+ _ => break,
+ }
+ }
+ let mut rparen_ends: Vec<usize> = Vec::new();
+ let mut j = end;
+ while j < bytes.len() {
+ match bytes[j] {
+ b')' => {
+ rparen_ends.push(j + 1);
+ j += 1;
+ }
+ b if b.is_ascii_whitespace() => j += 1,
+ _ => break,
+ }
+ }
+ let owned = lparens.len().min(rparen_ends.len());
+ let new_start = if owned > 0 { lparens[owned - 1] } else { start };
+ let new_end = if owned > 0 {
+ rparen_ends[owned - 1]
+ } else {
+ end
+ };
+ (new_start, new_end)
+}
+
+/// `child`'s `start` position extended backward over the parens it owns,
+/// rebuilt via `parser.pos_obj`. None when `child` lacks scannable byte
+/// offsets (non-ASCII source or a `no_pos` child).
+fn paren_extended_start<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ child: &E::Value,
+) -> Option<E::Value> {
+ if !parser.is_ascii_src {
+ return None;
+ }
+ let cs = pos_offset(&parser.emit, parser.emit.get_field(child, "start").as_ref())?;
+ let ce = pos_offset(&parser.emit, parser.emit.get_field(child, "end").as_ref())?;
+ let (new_start, _) = paren_inclusive_span(parser.src, cs, ce);
+ Some(parser.pos_obj(new_start))
+}
+
+/// `child`'s `end` position extended forward over the parens it owns.
+fn paren_extended_end<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ child: &E::Value,
+) -> Option<E::Value> {
+ if !parser.is_ascii_src {
+ return None;
+ }
+ let cs = pos_offset(&parser.emit, parser.emit.get_field(child, "start").as_ref())?;
+ let ce = pos_offset(&parser.emit, parser.emit.get_field(child, "end").as_ref())?;
+ let (_, new_end) = paren_inclusive_span(parser.src, cs, ce);
+ Some(parser.pos_obj(new_end))
+}
+
+/// The source-end position of `child` for stamping a synthetic And/Or
+/// or re-stamping a wrapper. A positioned node yields its paren-inclusive
+/// end; a `no_pos` NamedArgument (null `end`, but `name := value` source)
+/// ends where its `value` ends, so descend into it. cpp derives these
+/// ends from the operand's ANTLR ctx stop token even when the visitor
+/// emitted the node without its own position. None when nothing
+/// positioned is reachable.
+fn child_source_end_value<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ child: &E::Value,
+) -> Option<E::Value> {
+ if pos_offset(&parser.emit, parser.emit.get_field(child, "end").as_ref()).is_some() {
+ return paren_extended_end(parser, child).or_else(|| parser.emit.get_field(child, "end"));
+ }
+ if parser.emit.node_kind(child).as_deref() == Some("NamedArgument") {
+ return child_source_end_value(parser, &parser.emit.get_field(child, "value")?);
+ }
+ None
+}
+
+/// Re-stamp `node`'s `end` to `child`'s paren-inclusive end. Called by
+/// the stay-in-place wrapper arms of `split_at_rightmost_and` (Lambda /
+/// Not / ArithmeticOperation.right / the if-call else-branch) after they
+/// replace their rightmost child with the SHORTER left side of the AND
+/// split: the wrapper now ends where that child ends, not where the
+/// original greedy body parse stretched it. A `no_pos` wrapper (null
+/// `end`, e.g. NamedArgument) is left bare.
+fn restamp_end_from_child<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ node: &mut E::Value,
+ child: &E::Value,
+) {
+ // A node with no `end` field, or an explicitly null `end` (e.g. a
+ // `no_pos` NamedArgument), is left bare.
+ match parser.emit.get_field(node, "end") {
+ None => return,
+ Some(e) if parser.emit.is_null(&e) => return,
+ Some(_) => {}
+ }
+ if let Some(e) = child_source_end_value(parser, child) {
+ parser.emit.set_field(node, "end", e);
+ }
+}
+
/// Stamp `start` / `end` on a synthetic And/Or built by
/// `split_at_rightmost_and` from a slice of pre-positioned children.
-/// `emit::and_` / `emit::or_` produce position-less JSON; an outer
+/// `emit.and_` / `emit.or_` produce position-less JSON; an outer
/// `wrap_pos` would catch the BETWEEN-level wrap but not the inner
/// synthetic And/Or that lives inside BetweenExpr's `low` or `high`,
/// because BetweenExpr's `low` / `high` are direct fields (not nested
/// expressions that the pratt loop wraps). Derive the span from the
-/// first child's `start` and the last child's `end` so the inner
-/// synthetic node carries a non-null span.
-fn stamp_span_from_children<E: Emitter>(
- emit: &E,
- node: E::Value,
+/// first child's `start` and the last child's `end`. cpp positions
+/// these nodes from the ANTLR ctx of the boundary operands, whose
+/// `ColumnExprParens` start/stop tokens are the OUTER parens — but rust
+/// strips parens to inner spans, so extend the boundary children over
+/// the parens they own (matching the pratt loop's `lhs_start` capture,
+/// which sees the leading `(` as the first token).
+fn stamp_span_from_children<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ mut node: E::Value,
children: &[E::Value],
) -> E::Value {
if children.is_empty() {
return node;
}
- let start = emit.get_field(&children[0], "start");
- let end = emit.get_field(&children[children.len() - 1], "end");
- if let (Some(s), Some(e)) = (start, end) {
- emit.replace_pos(node, s, e)
- } else {
- node
+ let first = &children[0];
+ let last = &children[children.len() - 1];
+ let start =
+ paren_extended_start(parser, first).or_else(|| parser.emit.get_field(first, "start"));
+ let end = child_source_end_value(parser, last).or_else(|| parser.emit.get_field(last, "end"));
+ if let Some(s) = start {
+ parser.emit.set_field(&mut node, "start", s);
+ }
+ if let Some(e) = end {
+ parser.emit.set_field(&mut node, "end", e);
}
+ node
}
/// Walk an already-parsed boolean tree to find the rightmost AND in
@@ -5056,16 +5840,253 @@ fn stamp_span_from_children<E: Emitter>(
/// - An `Or` node defers — walk children right-to-left so we find the
/// *latest* AND-bearing child. Reconstruct the Or above the split.
/// - Anything else has no AND in it; return None.
-fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<BetweenSplit<E::Value>> {
- let node_name = emit.node_kind(node);
+/// True when `node` is wholly wrapped in parentheses in the source. Parens are
+/// stripped at parse time and the node carries the INNER span, so we look
+/// OUTWARD: the nearest non-whitespace byte before `start` must be `(`, the
+/// nearest at/after `end` must be `)`, and that `(` must balance-match that
+/// exact `)` (so `(b) and (c)` — whose outer `(`/`)` belong to different pairs —
+/// is NOT treated as wholly parenthesized). The split must treat such a node as
+/// opaque: cpp picks the rightmost AND at paren-depth 0, so an AND inside
+/// `(...)` is never the BETWEEN separator (`1 between a and (b and c)` keeps
+/// `high = (b and c)`, not the inner AND). Skips string / quoted-identifier
+/// bodies and block comments so parens inside literals don't miscount.
+/// ASCII-gated (byte-scan); callers fall back to descend-anyway on non-ASCII.
+fn is_wholly_parenthesized<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ node: &E::Value,
+) -> bool {
+ let start = match pos_offset(&parser.emit, parser.emit.get_field(node, "start").as_ref()) {
+ Some(s) => s,
+ None => return false,
+ };
+ let end = match pos_offset(&parser.emit, parser.emit.get_field(node, "end").as_ref()) {
+ Some(e) => e,
+ None => return false,
+ };
+ let bytes = parser.src.as_bytes();
+ if start >= end || end > bytes.len() {
+ return false;
+ }
+ // Nearest non-whitespace byte before `start` must be an opening paren.
+ let mut lp = start;
+ loop {
+ if lp == 0 {
+ return false;
+ }
+ lp -= 1;
+ if !bytes[lp].is_ascii_whitespace() {
+ break;
+ }
+ }
+ if bytes[lp] != b'(' {
+ return false;
+ }
+ // Nearest non-whitespace byte at/after `end` must be a closing paren.
+ let mut rp = end;
+ while rp < bytes.len() && bytes[rp].is_ascii_whitespace() {
+ rp += 1;
+ }
+ if rp >= bytes.len() || bytes[rp] != b')' {
+ return false;
+ }
+ // The `(` at `lp` must balance-match the `)` at `rp` exactly.
+ let mut depth = 0i32;
+ let mut i = lp;
+ while i <= rp {
+ match bytes[i] {
+ q @ (b'\'' | b'"' | b'`') => {
+ i += 1;
+ while i <= rp {
+ let c = bytes[i];
+ if c == b'\\' {
+ i += 2; // backslash escape
+ continue;
+ }
+ if c == q {
+ if i < rp && bytes[i + 1] == q {
+ i += 2; // doubled-quote escape
+ continue;
+ }
+ break; // closing quote
+ }
+ i += 1;
+ }
+ }
+ b'/' if i < rp && bytes[i + 1] == b'*' => {
+ i += 2;
+ while i < rp && !(bytes[i] == b'*' && bytes[i + 1] == b'/') {
+ i += 1;
+ }
+ i += 1; // skip the `*`; the outer `i += 1` skips the `/`
+ }
+ b'(' => depth += 1,
+ b')' => {
+ depth -= 1;
+ if depth == 0 {
+ return i == rp;
+ }
+ }
+ _ => {}
+ }
+ i += 1;
+ }
+ false
+}
+
+/// `a and (b and c)` flattens to `And([a,b,c])` (cpp does the same for a
+/// standalone expr), but in a BETWEEN body cpp keeps `(b and c)` as one high
+/// operand because the rightmost AND at paren-depth 0 is the one BEFORE the
+/// parens. The flattened node erases the grouping from its structure, so
+/// recover it from spans: scan from the node's start tracking paren-depth and
+/// split at the rightmost operand still at the node's base depth — the trailing
+/// deeper-nested operands are the parenthesized group (the high). Returns
+/// `(low, high)` only when such a trailing group exists (caller's normal split
+/// handles the rest). The group node gets the INNER span (its wrapping parens
+/// belong to the enclosing grammar, not the And/Or). ASCII-gated.
+fn try_trailing_paren_group_split<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ node: &E::Value,
+ exprs: &[E::Value],
+ is_or: bool,
+) -> Option<(E::Value, E::Value)> {
+ if !parser.is_ascii_src || exprs.len() < 3 {
+ return None;
+ }
+ let node_start = pos_offset(&parser.emit, parser.emit.get_field(node, "start").as_ref())?;
+ let starts: Vec<usize> = exprs
+ .iter()
+ .map(|e| pos_offset(&parser.emit, parser.emit.get_field(e, "start").as_ref()))
+ .collect::<Option<Vec<_>>>()?;
+ let ends: Vec<usize> = exprs
+ .iter()
+ .map(|e| pos_offset(&parser.emit, parser.emit.get_field(e, "end").as_ref()))
+ .collect::<Option<Vec<_>>>()?;
+ let bytes = parser.src.as_bytes();
+ let last_start = *starts.last().unwrap();
+ if node_start > starts[0] || last_start >= bytes.len() {
+ return None;
+ }
+ // For each junction k (gap between operand k and k+1) the AND/OR keyword sits
+ // at the gap's MINIMUM paren-depth — after any `)` closes, before any `(`
+ // opens. A junction at the node's base depth is a real top-level separator;
+ // deeper ones are inside parens. Scan once, sampling the running depth across
+ // each gap. (String / quoted-ident bodies and block comments are skipped so
+ // their parens don't miscount.)
+ let mut jmin = vec![i32::MAX; exprs.len() - 1];
+ let mut depth = 0i32;
+ let mut k_op = 0usize;
+ let mut i = node_start;
+ while i <= last_start {
+ while k_op + 1 < starts.len() && i >= starts[k_op + 1] {
+ k_op += 1;
+ }
+ let in_gap = k_op + 1 < exprs.len() && i >= ends[k_op];
+ match bytes[i] {
+ q @ (b'\'' | b'"' | b'`') => {
+ i += 1;
+ while i <= last_start {
+ let c = bytes[i];
+ if c == b'\\' {
+ i += 2;
+ continue;
+ }
+ if c == q {
+ if i < last_start && bytes[i + 1] == q {
+ i += 2;
+ continue;
+ }
+ break;
+ }
+ i += 1;
+ }
+ }
+ b'/' if i < last_start && bytes[i + 1] == b'*' => {
+ i += 2;
+ while i < last_start && !(bytes[i] == b'*' && bytes[i + 1] == b'/') {
+ i += 1;
+ }
+ i += 1;
+ }
+ b'(' => {
+ if in_gap {
+ jmin[k_op] = jmin[k_op].min(depth);
+ }
+ depth += 1;
+ }
+ b')' => {
+ if in_gap {
+ jmin[k_op] = jmin[k_op].min(depth);
+ }
+ depth -= 1;
+ }
+ _ => {
+ if in_gap {
+ jmin[k_op] = jmin[k_op].min(depth);
+ }
+ }
+ }
+ i += 1;
+ }
+ let base = *jmin.iter().min().unwrap();
+ let mut split_idx = 0usize;
+ for (k, d) in jmin.iter().enumerate() {
+ if *d == base {
+ split_idx = k;
+ }
+ }
+ // A trailing parenthesized group needs 2+ operands after the split point;
+ // otherwise the normal "pop the last operand" split already matches.
+ if split_idx >= exprs.len() - 2 {
+ return None;
+ }
+ let build = |lo: usize, hi_excl: usize| -> E::Value {
+ let group: Vec<E::Value> = exprs[lo..hi_excl].to_vec();
+ if group.len() == 1 {
+ return group.into_iter().next().unwrap();
+ }
+ let n = if is_or {
+ parser.emit.or_(group.clone())
+ } else {
+ parser.emit.and_(group.clone())
+ };
+ // Span from the children (paren-extended per child), matching cpp's
+ // ctx — the group's OWN wrapping parens belong to the enclosing grammar.
+ stamp_span_from_children(parser, n, &group)
+ };
+ let low = build(0, split_idx + 1);
+ let high = build(split_idx + 1, exprs.len());
+ Some((low, high))
+}
+
+fn split_at_rightmost_and<'a, E: Emitter + Clone>(
+ parser: &Parser<'a, E>,
+ node: &E::Value,
+) -> Option<BetweenSplit<E::Value>> {
+ // A parenthesized sub-expression is opaque to the rightmost-AND search:
+ // its ANDs sit at paren-depth > 0 and can't be the BETWEEN separator.
+ if parser.is_ascii_src && is_wholly_parenthesized(parser, node) {
+ return None;
+ }
+ let node_name = parser.emit.node_kind(node);
let node_name = node_name.as_deref();
+ // `node`'s `end` is the end of the wrapper this frame hoists (Alias, cast,
+ // postfix, …). Captured once so each `hoisted.push` can record it for the
+ // apply loop to stamp the wrapper's `[lhs_start, end]` span — needed for
+ // INNER wrappers the outer pratt `wrap_pos` never reaches.
+ let node_end = parser.emit.get_field(node, "end");
if node_name == Some("And") {
- let exprs = emit
+ let exprs = parser
+ .emit
.get_field(node, "exprs")
- .and_then(|v| emit.as_list(&v))?;
+ .and_then(|v| parser.emit.as_list(&v))?;
if exprs.len() < 2 {
return None;
}
+ // A trailing parenthesized group (`a and (b and c)` -> And([a,b,c])) is
+ // the opaque high; split before it at the paren-depth-0 AND.
+ if let Some((low, high)) = try_trailing_paren_group_split(parser, node, &exprs, false) {
+ return Some((low, high, Vec::new()));
+ }
// Try descending the LAST element first — it may itself contain
// a deeper AND that's the rightmost in source order. e.g.
// `(a) * b AND c := d AND e` parses as
@@ -5075,7 +6096,7 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// outer high. Without this descent we'd just pop the last
// element (NamedArg) wholesale and lose that AND.
if let Some((deep_left, deep_right, hoisted)) =
- split_at_rightmost_and(emit, &exprs[exprs.len() - 1])
+ split_at_rightmost_and(parser, &exprs[exprs.len() - 1])
{
let mut new_exprs = exprs.clone();
let last_idx = new_exprs.len() - 1;
@@ -5083,8 +6104,8 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
let new_left = if new_exprs.len() == 1 {
new_exprs.into_iter().next().unwrap()
} else {
- let synthetic = emit.and_(new_exprs.clone());
- stamp_span_from_children(emit, synthetic, &new_exprs)
+ let synthetic = parser.emit.and_(new_exprs.clone());
+ stamp_span_from_children(parser, synthetic, &new_exprs)
};
return Some((new_left, deep_right, hoisted));
}
@@ -5094,17 +6115,19 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
let left = if exprs.len() == 1 {
exprs.pop().unwrap()
} else {
- let synthetic = emit.and_(exprs.clone());
- stamp_span_from_children(emit, synthetic, &exprs)
+ let synthetic = parser.emit.and_(exprs.clone());
+ stamp_span_from_children(parser, synthetic, &exprs)
};
return Some((left, right, Vec::new()));
}
if node_name == Some("Or") {
- let exprs = emit
+ let exprs = parser
+ .emit
.get_field(node, "exprs")
- .and_then(|v| emit.as_list(&v))?;
+ .and_then(|v| parser.emit.as_list(&v))?;
for i in (0..exprs.len()).rev() {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &exprs[i])
+ if let Some((left_in, right_in, mut hoisted)) =
+ split_at_rightmost_and(parser, &exprs[i])
{
if hoisted.is_empty() {
// AND was found directly inside the Or's child (no
@@ -5118,8 +6141,8 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
let left = if left_children.len() == 1 {
left_children.pop().unwrap()
} else {
- let synthetic = emit.or_(left_children.clone());
- stamp_span_from_children(emit, synthetic, &left_children)
+ let synthetic = parser.emit.or_(left_children.clone());
+ stamp_span_from_children(parser, synthetic, &left_children)
};
let mut right_children: Vec<E::Value> = Vec::with_capacity(exprs.len() - i);
right_children.push(right_in);
@@ -5127,8 +6150,8 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
let right = if right_children.len() == 1 {
right_children.pop().unwrap()
} else {
- let synthetic = emit.or_(right_children.clone());
- stamp_span_from_children(emit, synthetic, &right_children)
+ let synthetic = parser.emit.or_(right_children.clone());
+ stamp_span_from_children(parser, synthetic, &right_children)
};
return Some((left, right, hoisted));
}
@@ -5142,10 +6165,13 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
let left_siblings: Vec<E::Value> = exprs[..i].to_vec();
let right_siblings: Vec<E::Value> = exprs[i + 1..].to_vec();
if !left_siblings.is_empty() || !right_siblings.is_empty() {
- hoisted.push(BetweenHoist::Or {
- left_siblings,
- right_siblings,
- });
+ hoisted.push((
+ BetweenHoist::Or {
+ left_siblings,
+ right_siblings,
+ },
+ node_end,
+ ));
}
return Some((left_in, right_in, hoisted));
}
@@ -5166,10 +6192,11 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// BetweenExpr. Descend through the Alias and HOIST its name to
// the caller's outer-wrap list.
if node_name == Some("Lambda") {
- if let Some(inner) = emit.get_field(node, "expr") {
- if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(emit, &inner) {
+ if let Some(inner) = parser.emit.get_field(node, "expr") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(parser, &inner) {
let mut new_node = node.clone();
- emit.set_field(&mut new_node, "expr", left_in);
+ restamp_end_from_child(parser, &mut new_node, &left_in);
+ parser.emit.set_field(&mut new_node, "expr", left_in);
return Some((new_node, right_in, hoisted));
}
}
@@ -5181,10 +6208,11 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// `Not.expr` peels the AND off so the outer BETWEEN sees its own
// `low = Not(Lambda(x, b))`, `high = c` split.
if node_name == Some("Not") {
- if let Some(inner) = emit.get_field(node, "expr") {
- if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(emit, &inner) {
+ if let Some(inner) = parser.emit.get_field(node, "expr") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(parser, &inner) {
let mut new_node = node.clone();
- emit.set_field(&mut new_node, "expr", left_in);
+ restamp_end_from_child(parser, &mut new_node, &left_in);
+ parser.emit.set_field(&mut new_node, "expr", left_in);
return Some((new_node, right_in, hoisted));
}
}
@@ -5212,51 +6240,66 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// possible), cpp prefers the rightmost-in-source which lives in
// `.right`.
if node_name == Some("ArithmeticOperation") {
- if let Some(inner) = emit.get_field(node, "right") {
- if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(emit, &inner) {
+ if let Some(inner) = parser.emit.get_field(node, "right") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(parser, &inner) {
let mut new_node = node.clone();
- emit.set_field(&mut new_node, "right", left_in);
+ restamp_end_from_child(parser, &mut new_node, &left_in);
+ parser.emit.set_field(&mut new_node, "right", left_in);
return Some((new_node, right_in, hoisted));
}
}
- if let Some(inner) = emit.get_field(node, "left") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
- let op = emit
+ if let Some(inner) = parser.emit.get_field(node, "left") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
+ let op = parser
+ .emit
.get_field(node, "op")
- .and_then(|v| emit.as_str(&v).map(|s| s.into_owned()))
+ .and_then(|v| parser.emit.as_str(&v).map(|s| s.into_owned()))
.unwrap_or_default();
- let right = emit.get_field(node, "right").unwrap_or_else(|| emit.null());
- hoisted.push(BetweenHoist::ArithmeticOperation { op, right });
+ let right = parser
+ .emit
+ .get_field(node, "right")
+ .unwrap_or_else(|| parser.emit.null());
+ hoisted.push((BetweenHoist::ArithmeticOperation { op, right }, node_end));
return Some((left_in, right_in, hoisted));
}
}
}
if node_name == Some("NamedArgument") {
- if let Some(inner) = emit.get_field(node, "value") {
- if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(emit, &inner) {
+ if let Some(inner) = parser.emit.get_field(node, "value") {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(parser, &inner) {
let mut new_node = node.clone();
- emit.set_field(&mut new_node, "value", left_in);
+ parser.emit.set_field(&mut new_node, "value", left_in);
return Some((new_node, right_in, hoisted));
}
}
}
if node_name == Some("Call")
- && emit
+ && parser
+ .emit
.get_field(node, "name")
- .and_then(|v| emit.as_str(&v).map(|s| s.into_owned()))
+ .and_then(|v| parser.emit.as_str(&v).map(|s| s.into_owned()))
.as_deref()
== Some("if")
{
- if let Some(args) = emit.get_field(node, "args").and_then(|v| emit.as_list(&v)) {
+ if let Some(args) = parser
+ .emit
+ .get_field(node, "args")
+ .and_then(|v| parser.emit.as_list(&v))
+ {
if args.len() == 3 {
// Try the else-branch (args[2]) first: `cond ? then :
// else AND high` parses with else absorbing the AND;
// we peel and rewrap the if-call.
- if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(emit, &args[2]) {
+ if let Some((left_in, right_in, hoisted)) = split_at_rightmost_and(parser, &args[2])
+ {
let mut new_args = args.clone();
new_args[2] = left_in;
let mut new_node = node.clone();
- emit.set_field(&mut new_node, "args", emit.array_(new_args));
+ restamp_end_from_child(parser, &mut new_node, &new_args[2]);
+ // `args` is a plain list field on the Call node (not an Array AST node), so rebuild it via `list_value`.
+ parser
+ .emit
+ .set_field(&mut new_node, "args", parser.emit.list_value(new_args));
return Some((new_node, right_in, hoisted));
}
// Try the cond (args[0]): `(BETWEEN body AND high) ?
@@ -5268,29 +6311,33 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// itself dissolves: its then/else go to the hoist, its
// cond's split becomes BETWEEN's low/high.
if let Some((left_in, right_in, mut hoisted)) =
- split_at_rightmost_and(emit, &args[0])
+ split_at_rightmost_and(parser, &args[0])
{
- hoisted.push(BetweenHoist::Ternary {
- then_branch: args[1].clone(),
- else_branch: args[2].clone(),
- });
+ hoisted.push((
+ BetweenHoist::Ternary {
+ then_branch: args[1].clone(),
+ else_branch: args[2].clone(),
+ },
+ node_end,
+ ));
return Some((left_in, right_in, hoisted));
}
}
}
}
if node_name == Some("Alias") {
- if let Some(inner) = emit.get_field(node, "expr") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
+ if let Some(inner) = parser.emit.get_field(node, "expr") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
// Hoist *this* alias name. Caller wraps BetweenExpr
// with each hoisted item in order (innermost first),
// which matches cpp's `Alias(BetweenExpr(...),
// outer_name)` shape.
- let name = emit
+ let name = parser
+ .emit
.get_field(node, "alias")
- .and_then(|v| emit.as_str(&v).map(|s| s.into_owned()))
+ .and_then(|v| parser.emit.as_str(&v).map(|s| s.into_owned()))
.unwrap_or_default();
- hoisted.push(BetweenHoist::Alias(name));
+ hoisted.push((BetweenHoist::Alias(name), node_end));
return Some((left_in, right_in, hoisted));
}
}
@@ -5306,33 +6353,39 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// accumulated wrappers so it ends up OUTERMOST around the
// alias-wrapped BetweenExpr the caller will build.
if node_name == Some("IsDistinctFrom") {
- if let Some(inner) = emit.get_field(node, "left") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
- let right = emit.get_field(node, "right").unwrap_or_else(|| emit.null());
- let negated = emit
+ if let Some(inner) = parser.emit.get_field(node, "left") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
+ let right = parser
+ .emit
+ .get_field(node, "right")
+ .unwrap_or_else(|| parser.emit.null());
+ let negated = parser
+ .emit
.get_field(node, "negated")
- .and_then(|v| emit.as_bool(&v))
+ .and_then(|v| parser.emit.as_bool(&v))
.unwrap_or(false);
- hoisted.push(BetweenHoist::IsDistinctFrom { right, negated });
+ hoisted.push((BetweenHoist::IsDistinctFrom { right, negated }, node_end));
return Some((left_in, right_in, hoisted));
}
}
}
if node_name == Some("CompareOperation")
- && emit
+ && parser
+ .emit
.get_field(node, "is_null_comparison_style")
- .and_then(|v| emit.as_bool(&v))
+ .and_then(|v| parser.emit.as_bool(&v))
== Some(true)
{
- if let Some(inner) = emit.get_field(node, "left") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
+ if let Some(inner) = parser.emit.get_field(node, "left") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
// `op` is "==" for IS NULL, "!=" for IS NOT NULL.
- let negated = emit
+ let negated = parser
+ .emit
.get_field(node, "op")
- .and_then(|v| emit.as_str(&v).map(|s| s.into_owned()))
+ .and_then(|v| parser.emit.as_str(&v).map(|s| s.into_owned()))
.as_deref()
== Some("!=");
- hoisted.push(BetweenHoist::IsNull { negated });
+ hoisted.push((BetweenHoist::IsNull { negated }, node_end));
return Some((left_in, right_in, hoisted));
}
}
@@ -5342,16 +6395,18 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// Descend through `array`; on success, hoist the access OUTSIDE
// the alias so it wraps the BetweenExpr the caller builds.
if node_name == Some("ArrayAccess") {
- if let Some(inner) = emit.get_field(node, "array") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
- let property = emit
+ if let Some(inner) = parser.emit.get_field(node, "array") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
+ let property = parser
+ .emit
.get_field(node, "property")
- .unwrap_or_else(|| emit.null());
- let nullish = emit
+ .unwrap_or_else(|| parser.emit.null());
+ let nullish = parser
+ .emit
.get_field(node, "nullish")
- .and_then(|v| emit.as_bool(&v))
+ .and_then(|v| parser.emit.as_bool(&v))
.unwrap_or(false);
- hoisted.push(BetweenHoist::ArrayAccess { property, nullish });
+ hoisted.push((BetweenHoist::ArrayAccess { property, nullish }, node_end));
return Some((left_in, right_in, hoisted));
}
}
@@ -5364,13 +6419,14 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// on `Alias(And(1, (2)), 'a')`, burying the BETWEEN-separator
// AND inside the call's `.expr`.
if node_name == Some("ExprCall") {
- if let Some(inner) = emit.get_field(node, "expr") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
- let args = emit
+ if let Some(inner) = parser.emit.get_field(node, "expr") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
+ let args = parser
+ .emit
.get_field(node, "args")
- .and_then(|v| emit.as_list(&v))
+ .and_then(|v| parser.emit.as_list(&v))
.unwrap_or_default();
- hoisted.push(BetweenHoist::ExprCall { args });
+ hoisted.push((BetweenHoist::ExprCall { args }, node_end));
return Some((left_in, right_in, hoisted));
}
}
@@ -5378,13 +6434,14 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// `TypeCast(<expr>, type_name)` — postfix `:: <type>` at
// BP_POSTFIX=130. Same hoisting pattern as ExprCall.
if node_name == Some("TypeCast") {
- if let Some(inner) = emit.get_field(node, "expr") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
- let type_name = emit
+ if let Some(inner) = parser.emit.get_field(node, "expr") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
+ let type_name = parser
+ .emit
.get_field(node, "type_name")
- .and_then(|v| emit.as_str(&v).map(|s| s.into_owned()))
+ .and_then(|v| parser.emit.as_str(&v).map(|s| s.into_owned()))
.unwrap_or_default();
- hoisted.push(BetweenHoist::TypeCast { type_name });
+ hoisted.push((BetweenHoist::TypeCast { type_name }, node_end));
return Some((left_in, right_in, hoisted));
}
}
@@ -5394,17 +6451,19 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// ArrayAccess but on a different node type with a different
// field name (`tuple` vs `array`, `index` vs `property`).
if node_name == Some("TupleAccess") {
- if let Some(inner) = emit.get_field(node, "tuple") {
- if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(emit, &inner) {
- let index = emit
+ if let Some(inner) = parser.emit.get_field(node, "tuple") {
+ if let Some((left_in, right_in, mut hoisted)) = split_at_rightmost_and(parser, &inner) {
+ let index = parser
+ .emit
.get_field(node, "index")
- .and_then(|v| emit.as_i64(&v))
+ .and_then(|v| parser.emit.as_i64(&v))
.unwrap_or(0);
- let nullish = emit
+ let nullish = parser
+ .emit
.get_field(node, "nullish")
- .and_then(|v| emit.as_bool(&v))
+ .and_then(|v| parser.emit.as_bool(&v))
.unwrap_or(false);
- hoisted.push(BetweenHoist::TupleAccess { index, nullish });
+ hoisted.push((BetweenHoist::TupleAccess { index, nullish }, node_end));
return Some((left_in, right_in, hoisted));
}
}
@@ -5437,27 +6496,36 @@ fn split_at_rightmost_and<E: Emitter>(emit: &E, node: &E::Value) -> Option<Betwe
// (no AND), so the `low` peel above fails. Fall through to
// `expr`: split And(d,e), hoist (f, g, neg=true).
if node_name == Some("BetweenExpr") {
- if let (Some(inner_low), Some(inner_high)) =
- (emit.get_field(node, "low"), emit.get_field(node, "high"))
- {
- if let Some((new_low, new_high, hoisted)) = split_at_rightmost_and(emit, &inner_low) {
+ if let (Some(inner_low), Some(inner_high)) = (
+ parser.emit.get_field(node, "low"),
+ parser.emit.get_field(node, "high"),
+ ) {
+ if let Some((new_low, new_high, hoisted)) = split_at_rightmost_and(parser, &inner_low) {
let mut new_inner = node.clone();
- emit.set_field(&mut new_inner, "low", new_low);
- emit.set_field(&mut new_inner, "high", new_high);
+ restamp_end_from_child(parser, &mut new_inner, &new_high);
+ parser.emit.set_field(&mut new_inner, "low", new_low);
+ parser.emit.set_field(&mut new_inner, "high", new_high);
return Some((new_inner, inner_high, hoisted));
}
}
- if let Some(inner_expr) = emit.get_field(node, "expr") {
+ if let Some(inner_expr) = parser.emit.get_field(node, "expr") {
if let Some((left_in, right_in, mut hoisted)) =
- split_at_rightmost_and(emit, &inner_expr)
+ split_at_rightmost_and(parser, &inner_expr)
{
- let low = emit.get_field(node, "low").unwrap_or_else(|| emit.null());
- let high = emit.get_field(node, "high").unwrap_or_else(|| emit.null());
- let negated = emit
+ let low = parser
+ .emit
+ .get_field(node, "low")
+ .unwrap_or_else(|| parser.emit.null());
+ let high = parser
+ .emit
+ .get_field(node, "high")
+ .unwrap_or_else(|| parser.emit.null());
+ let negated = parser
+ .emit
.get_field(node, "negated")
- .and_then(|v| emit.as_bool(&v))
+ .and_then(|v| parser.emit.as_bool(&v))
.unwrap_or(false);
- hoisted.push(BetweenHoist::Between { low, high, negated });
+ hoisted.push((BetweenHoist::Between { low, high, negated }, node_end));
return Some((left_in, right_in, hoisted));
}
}
@@ -5480,27 +6548,3 @@ pub(crate) fn is_bare_field<E: Emitter>(emit: &E, v: &E::Value) -> bool {
};
chain.len() == 1
}
-
-/// Detect a ColumnsExpr produced by the bare-paren grammar alts
-/// `LPAREN ASTERISK [EXCLUDE(...)]? REPLACE(...) RPAREN`, whose ctx
-/// span includes the outer parens. Exclude-only `(* EXCLUDE(...))` is
-/// a regular `ColumnExprAsterisk` inside `ColumnExprParens` (paren
-/// pass-through), so we key off `replace` presence to identify the
-/// bare-paren form. The COLUMNS-prefixed `COLUMNS(* REPLACE(...))`
-/// variant takes a different parse path (it doesn't go through
-/// `parse_paren_or_tuple`), so this check is safe.
-fn is_paren_form_columns_replace<E: Emitter>(emit: &E, v: &E::Value) -> bool {
- if emit.node_kind(v).as_deref() != Some("ColumnsExpr") {
- return false;
- }
- if emit
- .get_field(v, "all_columns")
- .and_then(|v| emit.as_bool(&v))
- != Some(true)
- {
- return false;
- }
- emit.get_field(v, "replace")
- .map(|v| !emit.is_null(&v))
- .unwrap_or(false)
-}
diff --git a/rust/hogql/parser/src/parse/hogqlx.rs b/rust/hogql/parser/src/parse/hogqlx.rs
index 7e67020ccc8f..6b4d6ff19aac 100644
--- a/rust/hogql/parser/src/parse/hogqlx.rs
+++ b/rust/hogql/parser/src/parse/hogqlx.rs
@@ -24,10 +24,10 @@
//! Parser API is identical across the two backends so no rewrites are
//! needed here.
-use super::{identifier_text, unquote_single_string, Parser};
+use super::{identifier_text, kw_valid_as_identifier, unquote_single_string, Parser};
use crate::emit::Emitter;
use crate::error::ParseError;
-use crate::lex::TokenKind;
+use crate::lex::{Lexer, TokenKind};
impl<'a, E: Emitter + Clone> Parser<'a, E> {
/// True when peek/peek_next look like the start of a HogQLX tag —
@@ -44,6 +44,22 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
)
}
+ /// Like `peek_starts_hogqlx_tag`, but one token further ahead: is the
+ /// token at `peek_next` (peek1) a `<` that begins a tag? Used by prefix
+ /// operators (`not <tag>`) and operator disambiguation (`1 % <tag>`) where
+ /// the `<` sits one token past the cursor and a probe lexer must resolve
+ /// the token after it.
+ pub(crate) fn peek_next_starts_hogqlx_tag(&self) -> bool {
+ if self.peek_next() != TokenKind::Lt {
+ return false;
+ }
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_))
+ )
+ }
+
/// Parse a HogQLX tag element starting at `<`.
///
/// Handles both `<Tag attr* />` (self-closing) and
@@ -129,19 +145,28 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
/// - `name = { expr }` → HogQLXAttribute(name, expr)
/// - `name` → HogQLXAttribute(name, Constant(true))
fn parse_hogqlx_attribute(&mut self) -> Result<E::Value, ParseError> {
+ // cpp positions the HogQLXAttribute from the name start to the value end
+ // (or the name end for a bare attribute), and the string value Constant
+ // over the string token. The bare-attribute `Constant(true)` stays
+ // position-less (cpp leaves it null too).
+ let name_start = self.peek0.start;
let name = self.parse_hogqlx_identifier("attribute name")?;
+ let name_end = self.last_consumed_end;
// No `=` → bare attribute, value is Constant(true).
if self.peek() != TokenKind::EqDouble {
- return Ok(self
+ let attr = self
.emit
- .hogqlx_attribute(&name, self.emit.constant(self.emit.bool(true))));
+ .hogqlx_attribute(&name, self.emit.constant(self.emit.bool(true)));
+ return Ok(self.wrap_pos_to(attr, name_start, name_end));
}
self.bump()?; // `=`
let value = match self.peek() {
TokenKind::String => {
let t = self.bump()?;
- self.emit
- .constant(self.emit.string(&unquote_single_string(self.text(t))))
+ let c = self
+ .emit
+ .constant(self.emit.string(&unquote_single_string(self.text(t))));
+ self.wrap_pos_to(c, t.start, t.end)
}
TokenKind::LBrace => {
self.bump()?;
@@ -156,7 +181,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
)));
}
};
- Ok(self.emit.hogqlx_attribute(&name, value))
+ let value_end = self.last_consumed_end;
+ let attr = self.emit.hogqlx_attribute(&name, value);
+ Ok(self.wrap_pos_to(attr, name_start, value_end))
}
/// Read tag-body children until the closing `</`. Children are:
@@ -171,6 +198,10 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
fn parse_hogqlx_children(&mut self) -> Result<Vec<E::Value>, ParseError> {
let mut children: Vec<E::Value> = Vec::new();
loop {
+ // `consume_hogqlx_text` scans from `last_consumed_end`, so that is
+ // the text run's start; its byte length gives the end. cpp positions
+ // each kept text Constant over its raw byte span.
+ let text_start = self.last_consumed_end;
let text = self.consume_hogqlx_text()?;
// cpp's `VISIT(HogqlxTagElementNested)` drops child text
// runs that contain a newline AND are entirely whitespace —
@@ -181,7 +212,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
&& text.bytes().all(|b| b.is_ascii_whitespace())
&& text.bytes().any(|b| b == b'\n' || b == b'\r');
if !text.is_empty() && !drop_for_newline_ws {
- children.push(self.emit.constant(self.emit.string(&text)));
+ let text_end = text_start + text.len();
+ let c = self.emit.constant(self.emit.string(&text));
+ children.push(self.wrap_pos_to(c, text_start, text_end));
}
match self.peek() {
TokenKind::LtSlash => return Ok(children),
@@ -263,8 +296,17 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
/// by an ident-like token with no intervening whitespace.
fn parse_hogqlx_identifier(&mut self, what: &str) -> Result<String, ParseError> {
let head = self.bump()?;
+ // A tag/attr name is an `identifier` (grammar `hogqlxTagElement` /
+ // `hogqlxTagAttribute`), so a keyword head is only valid when it is a
+ // grammar-`keyword`-rule member. The Hog-statement keywords (fn/let/…),
+ // set-op keywords (intersect/except) and literal keywords (null/inf/nan)
+ // are omitted from that rule, so cpp rejects `<fn/>` / `<a let/>` with
+ // "no viable alternative"; gate them out here to match.
let mut name = match head.kind {
- TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(head), head.kind)
+ }
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
identifier_text(self.text(head), head.kind)
}
_ => {
diff --git a/rust/hogql/parser/src/parse/join.rs b/rust/hogql/parser/src/parse/join.rs
index 767e2e9e85b4..e43ae1030196 100644
--- a/rust/hogql/parser/src/parse/join.rs
+++ b/rust/hogql/parser/src/parse/join.rs
@@ -43,18 +43,16 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
{
break;
}
- // `,` cross join. cpp's ANTLR ALL(*) tolerates a trailing
- // comma after a constrained JOIN chain (`a JOIN b ON 1,`)
- // when nothing parseable follows — the comma is recovery-
- // discarded. Mirror that: if peek_next isn't a token that
- // can start a table atom, consume + discard the trailing
- // comma so the outer SELECT parser keeps walking.
+ // `,` cross join. A trailing comma (peek_next can't start a table
+ // atom) is NOT a join-chain construct — cpp rejects it after a
+ // cross / plain / positional join (`a, b,`, `a join b,`). The only
+ // tolerated trailing comma is an ON / USING `columnExprList`'s
+ // optional `COMMA?` (`a JOIN b ON 1,`), which is consumed inside
+ // `parse_join_constraint_opt` so its span matches cpp's. So just
+ // leave any trailing comma here for the SELECT parser, which
+ // rejects it.
if self.peek() == TokenKind::Comma {
if !self.peek_next_starts_table_atom() {
- if joined_any {
- // Trailing comma after at least one join — discard.
- self.bump()?;
- }
break;
}
self.bump()?;
@@ -237,8 +235,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// Wrap the PivotExpr/UnpivotExpr in an outer JoinExpr (the C++
// visitor's JoinExprPivot does the same).
// Grammar order: `TableExprAlias` (alias + columnAliases) binds
- // inside `tableExpr`, then `JoinExprTable` adds `FINAL?`.
- let (alias, column_aliases) = self.consume_table_alias_chain()?;
+ // inside `tableExpr`, then `JoinExprTable` adds `FINAL?
+ // sampleClause?`.
+ let (alias, column_aliases, _) = self.consume_table_alias_chain()?;
let table_final = self.eat_kw(Kw::Final)?;
// Table-level SAMPLE (`tableExpr FINAL? sampleClause?`) binds only to a tableExpr-pivot; a joinExpr-pivot's trailing SAMPLE is statement-level, left for `reject_select_level_sample`.
let sample = if operand_is_table_expr {
@@ -473,22 +472,27 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// to fall out and let the outer chain consume it as
// cross-join, silently emitting a divergent JoinExpr.
//
- // A *trailing* comma (`FROM a JOIN b ON 1,` with nothing
- // parseable after) is tolerated — cpp's ANTLR recovery
- // discards it. Leave the outer JOIN loop to handle that.
- if self.peek() == TokenKind::Comma
- && !matches!(
+ // A *trailing* comma (`FROM a JOIN b ON 1,` with nothing parseable
+ // after) is the `columnExprList`'s optional `COMMA?` — valid, and
+ // cpp's JoinConstraint span covers it. Consume it here so the span
+ // matches (and so the outer JOIN loop doesn't have to special-case
+ // it). A comma with a real expression after is the unsupported
+ // multi-expression list.
+ if self.peek() == TokenKind::Comma {
+ if matches!(
self.peek_next(),
TokenKind::Eof | TokenKind::Semicolon | TokenKind::RParen
- )
- {
- let start = self.peek0.start;
- let end = self.peek0.end;
- return Err(ParseError::not_implemented(
- "Unsupported: JOIN ... ON with multiple expressions",
- start,
- end,
- ));
+ ) {
+ self.bump()?;
+ } else {
+ let start = self.peek0.start;
+ let end = self.peek0.end;
+ return Err(ParseError::not_implemented(
+ "Unsupported: JOIN ... ON with multiple expressions",
+ start,
+ end,
+ ));
+ }
}
return Ok(Some(
self.wrap_pos(self.emit.join_constraint(expr, "ON"), cons_start),
@@ -515,6 +519,17 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
} else {
self.emit.tuple_(exprs)
};
+ // Trailing `COMMA?` of the columnExprList — the paren form leaves it
+ // after `)`; the no-paren list parse already absorbs it. Consume it
+ // so the JoinConstraint span matches cpp's (`USING (c),`).
+ if self.peek() == TokenKind::Comma
+ && matches!(
+ self.peek_next(),
+ TokenKind::Eof | TokenKind::Semicolon | TokenKind::RParen
+ )
+ {
+ self.bump()?;
+ }
return Ok(Some(
self.wrap_pos(self.emit.join_constraint(expr, "USING"), cons_start),
));
@@ -581,14 +596,15 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// first, FINAL and SAMPLE after. Parsing SAMPLE before the
// alias (as this did) silently dropped the sample on an
// aliased table — `t AS e SAMPLE 1` lost its `SampleExpr`.
- let (alias, column_aliases) = self.consume_table_alias_chain()?;
+ let (alias, column_aliases, first_alias_end) = self.consume_table_alias_chain()?;
let had_alias = alias.is_some() || column_aliases.is_some();
- // Snapshot end after alias / column_aliases — cpp's
- // `TableExprAlias` ctx covers `tableExpr alias columnAliases?` and
- // its JoinExpr wrap stops there. The subsequent FINAL / SAMPLE
- // sit in the parent `JoinExprTable` rule, which adds them as
- // fields on the existing JoinExpr WITHOUT widening its span.
- let after_alias_end = self.last_consumed_end;
+ // Snapshot end after the FIRST alias / column_aliases — cpp's
+ // `TableExprAlias` ctx covers `tableExpr alias columnAliases?` and its
+ // JoinExpr wrap stops at the innermost (first) alias. Stacked aliases
+ // (`x a b c`, or the `t format JSON` FORMAT-as-alias chain) overwrite
+ // the alias field but don't widen the span; the subsequent FINAL /
+ // SAMPLE in the parent `JoinExprTable` rule don't widen it either.
+ let after_alias_end = first_alias_end.unwrap_or(self.last_consumed_end);
// `JoinExprTable: tableExpr FINAL? sampleClause?` — FINAL and
// SAMPLE decorate the (possibly aliased) table.
let final_ = self.eat_kw(Kw::Final)?;
@@ -638,17 +654,32 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
/// `(None, None)` when the table carries no alias at all.
fn consume_table_alias_chain(
&mut self,
- ) -> Result<(Option<String>, Option<Vec<String>>), ParseError> {
+ ) -> Result<(Option<String>, Option<Vec<String>>, Option<usize>), ParseError> {
+ // NB: `from <implicitAlias>` as a *table* (`select a from b, from c` —
+ // table `from` aliased `c`) is valid; the grammar's
+ // `ColumnExprInvalidFromImplicitAlias` footgun is a SELECT-*column*
+ // form only, enforced in `parse_select_columns`. Do not reject a bare
+ // `from` table here.
let mut alias: Option<String> = None;
let mut column_aliases: Option<Vec<String>> = None;
+ // `TableExprAlias` is left-recursive (`x a b c`): cpp's nested ctxs make
+ // the JoinExpr span end at the INNERMOST alias (the first `tableExpr
+ // alias columnAliases?`), while each outer alias only overwrites the
+ // `alias` / `column_aliases` fields. Capture the end after the FIRST
+ // alias so the caller clamps the span there (`from x a b` ends at `a`,
+ // `from x a (c1) b (c2)` ends at `a (c1)`).
+ let mut first_alias_end: Option<usize> = None;
while let Some(a) = self.try_consume_table_alias()? {
alias = Some(a);
// `columnAliases` belongs to *this* alias's `TableExprAlias`;
// re-read each iteration so the last alias's value (present
// or absent) is the one that survives.
column_aliases = self.try_consume_column_aliases()?;
+ if first_alias_end.is_none() {
+ first_alias_end = Some(self.last_consumed_end);
+ }
}
- Ok((alias, column_aliases))
+ Ok((alias, column_aliases, first_alias_end))
}
/// Optional `columnAliases` — `LPAREN identifier (COMMA identifier)*
@@ -781,9 +812,9 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
&Self::parse_join_expr_parens_arm,
]);
}
- // `{name}` — placeholder table reference.
+ // `{name}` — placeholder table reference (a Dict `{}` / `{k: v}` is not a tableExpr).
if self.peek() == TokenKind::LBrace {
- return self.parse_brace_dict_or_placeholder();
+ return self.parse_brace_placeholder_only();
}
// Identifier-led: either a Field chain (plain table reference) or
// a tableFunction (`name(args)`). Grammar's `tableIdentifier` →
@@ -1090,7 +1121,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// wraps in RatioExpr.
let ratio_start = self.peek0.start;
if self.peek() == TokenKind::LBrace {
- return self.parse_brace_dict_or_placeholder();
+ return self.parse_brace_placeholder_only();
}
let left = self.consume_ratio_value()?;
let right = if self.eat(TokenKind::Slash)? {
diff --git a/rust/hogql/parser/src/parse/program.rs b/rust/hogql/parser/src/parse/program.rs
index cd0a02735c3b..689e190cfc43 100644
--- a/rust/hogql/parser/src/parse/program.rs
+++ b/rust/hogql/parser/src/parse/program.rs
@@ -26,6 +26,7 @@
//! - Block { declarations: [decl, ...] }
//! - Program { declarations: [decl, ...] }
+use super::expr::is_pure_infix_op;
use super::{identifier_text, kw_valid_as_identifier, Parser};
use crate::emit::Emitter;
use crate::error::ParseError;
@@ -122,9 +123,11 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// `let x := y` + `*(z) := 3`.
if self.peek() == TokenKind::ColonEquals {
self.restore(cp)?;
+ // `parse_prefix` returns the bare node; the Pratt wrapper normally stamps its span, so stamp it here too (cpp positions the shortened primary, e.g. `let x := 1 * 2 := 3` → Constant(1) spanning the `1`).
+ let prefix_start = self.peek0.start;
match self.parse_prefix() {
Ok(primary) => {
- expr_val = primary;
+ expr_val = self.wrap_pos(primary, prefix_start);
}
Err(_) => {
self.restore(cp)?;
@@ -140,13 +143,46 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
fn parse_statement(&mut self) -> Result<E::Value, ParseError> {
let stmt_start = self.peek0.start;
- let result = self.parse_statement_inner()?;
+ // Guard the statement / block recursion (every nested block, `if`/`for`/`while`/`try` body, and bare block routes back through here) so `{ { … } }` or `if (a) if (b) …` nested past the cap rejects cleanly instead of overflowing the host stack (uncatchable SIGSEGV). Shares the counter with expression + subquery nesting.
+ let result = self.with_recursion_guard(Self::parse_statement_inner)?;
Ok(self.wrap_pos(result, stmt_start))
}
fn parse_statement_inner(&mut self) -> Result<E::Value, ParseError> {
match self.peek() {
- TokenKind::Keyword(Kw::Return) => self.parse_return_stmt(),
+ // `return` is also a `keyword`-rule identifier. When it is followed
+ // by a pure infix / postfix operator (`return :: t`, `return.x`,
+ // `return -> y`, `return = 1`, `return / 2`, …) that operator binds
+ // `return` as its LHS, so cpp parses the whole line as one exprStmt
+ // (`return` is a Field / lambda param), not a bare return that
+ // strands the operator. A value-starter or keyword-infix after
+ // `return` keeps the returnStmt (`return 1`, `return + 1`) or the
+ // bare-return split (`return like x`). Gate on `is_pure_infix_op`
+ // and fall through to the exprStmt arm for the identifier case.
+ //
+ // Exception: a `.` that begins a leading-dot float (`return .5` →
+ // value 0.5, `return .5.5` → tuple-access on 0.5) is a return VALUE,
+ // not tuple-access on `return`. Only a `.`-chain-link (`return.x`)
+ // makes `return` an identifier, so keep `return .<number>` in the
+ // returnStmt path.
+ //
+ // Exception: `return ()` — empty parens are not a valid return value,
+ // so cpp re-reads `return` as a Field and `()` as an empty call:
+ // `Call(return, [])`. `return (expr)` keeps the returnStmt. Route the
+ // empty-call case to the exprStmt arm below.
+ //
+ // Exception: a `<` that begins a HogQLX tag (`return <Tag/>`,
+ // `return <a>x</a>`) is a return VALUE, not the less-than operator
+ // binding `return` as a Field. `peek_next_starts_hogqlx_tag` probes
+ // past the `<`; a real less-than (`return < 5`) stays an exprStmt.
+ TokenKind::Keyword(Kw::Return)
+ if (!is_pure_infix_op(self.peek_next())
+ || self.peek_next_starts_hogqlx_tag()
+ || (self.peek_next() == TokenKind::Dot && !self.dot_next_is_chain_link()))
+ && !self.return_followed_by_empty_call() =>
+ {
+ self.parse_return_stmt()
+ }
TokenKind::Keyword(Kw::Throw) => self.parse_throw_stmt(),
TokenKind::Keyword(Kw::Try) => self.parse_try_catch_stmt(),
// `ifStmt` / `forStmt` / `forInStmt` open with `IF` / `FOR`
@@ -182,14 +218,16 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// through to the Block arm, and `{1: 2}` (whose body isn't
// a valid `declaration*`) falls through to the exprStmt arm.
TokenKind::LBrace => {
- // cpp's ANTLR ALL(*) prefers the exprStmt alt when a
- // postfix `(` or `.` follows the matching `}` — `{1}()`
- // and `{1}.x` are `Placeholder(1)` extended by a
- // postfix call / property access, not a Block followed
- // by stray tokens. Other postfixes (`[…]`, `+`, …) keep
- // the Block interpretation, matching cpp. Probe the
- // matching `}` to decide.
- if self.brace_followed_by_postfix_call_or_dot() {
+ // cpp's ALL(*) prefers the exprStmt alt only for a postfix the
+ // Block parse can't strand onto a following statement: a `.`
+ // (`{1}.x`) or an EMPTY `()` (`{1}()`). A non-empty `(expr)` is
+ // itself a valid next statement, so cpp keeps the Block and
+ // parses it separately (`{1} (a)` → Block + exprStmt). Other
+ // postfixes (`[…]`, `+`, …) already keep the Block. The
+ // block-vs-Dict split for the rest is left to `try_alt`: the
+ // block arm fails on a non-`declaration*` body like `{1: 2}`,
+ // falling through to the exprStmt arm.
+ if self.brace_followed_by_dot_or_empty_call() {
self.parse_expr_or_assignment_stmt()
} else {
self.try_alt(&[
@@ -261,9 +299,12 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// exists; fall back to bare return so `a.b := c`
// opens the next stmt.
self.restore(cp)?;
+ // The shortened head is the single consumed token; stamp its span so the Field carries positions like cpp (e.g. `return return * ('e') := {}` → Field(['return']) spanning the second `return`).
+ let head_start = self.peek0.start;
if self.peek() == TokenKind::Asterisk {
self.bump()?;
- expr_val = self.emit.field(vec![self.emit.string("*")]);
+ let f = self.emit.field(vec![self.emit.string("*")]);
+ expr_val = self.wrap_pos(f, head_start);
} else if matches!(
self.peek(),
TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_)
@@ -273,7 +314,8 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
) {
let t = self.bump()?;
let name = identifier_text(self.text(t), t.kind);
- expr_val = self.emit.field(vec![self.emit.string(&name)]);
+ let f = self.emit.field(vec![self.emit.string(&name)]);
+ expr_val = self.wrap_pos(f, head_start);
}
}
Ok(expr) => {
@@ -635,13 +677,14 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
))
}
- /// `self.peek()` is `{` — scan to its matching `}` and report
- /// whether the next token is `(` or `.`. Used at statement start
- /// to choose between the Block alt (`{ decls }`) and the exprStmt
- /// alt (`{expr} <postfix>`) — cpp's ANTLR prefers exprStmt for the
- /// two postfixes that can extend a placeholder expression but
- /// keeps Block for everything else.
- fn brace_followed_by_postfix_call_or_dot(&self) -> bool {
+ /// `self.peek()` is `{` — scan to its matching `}` and report whether the
+ /// following postfix forces the exprStmt parse over the Block parse. Only a
+ /// postfix that can't itself begin a statement does, so the Block parse
+ /// would strand it: a `.x` property access (`{1}.x`) or an EMPTY `()`
+ /// (`{1}()`). Postfixes that CAN begin a statement return false so the
+ /// Block stands: a non-empty `(expr)` (`{1} (a)` → Block + exprStmt) and a
+ /// leading-dot number `.5` (`{ } .5` → Block + `.5`, not `{}.5`).
+ fn brace_followed_by_dot_or_empty_call(&self) -> bool {
let mut probe = Lexer::with_pos(self.src, self.peek0.end);
let mut depth: i32 = 1;
while depth > 0 {
@@ -656,10 +699,36 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
_ => {}
}
}
- matches!(
- probe.next_token().map(|t| t.kind),
- Ok(TokenKind::LParen | TokenKind::Dot)
- )
+ match probe.next_token().map(|t| t.kind) {
+ // `.x` (property access) can't begin a statement, so force the
+ // exprStmt parse; a leading-dot number (`.5`) IS a valid statement,
+ // so keep the Block (`{ } .5` → Block + `.5`, not `{}.5`).
+ Ok(TokenKind::Dot) => {
+ !matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::Number))
+ }
+ // `{…} ()` is the dict / placeholder called with empty args →
+ // exprStmt. But `{…} () -> …` is a Block followed by an empty-param
+ // lambda statement (`() -> body`), so an Arrow after the empty `()`
+ // means keep the Block (`{ } () -> 1` → Block + lambda), not force
+ // the call. A non-empty `(a) -> 1` already keeps the Block (the
+ // RParen check below fails), matching cpp.
+ Ok(TokenKind::LParen) => {
+ matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::RParen))
+ && !matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::Arrow))
+ }
+ _ => false,
+ }
+ }
+
+ /// True when `return` is immediately followed by an empty `()` (the call
+ /// `return()`), distinguishing it from `return (expr)` (a return value).
+ /// `peek_next` is the `(`; probe one token past it for the closing `)`.
+ fn return_followed_by_empty_call(&self) -> bool {
+ if self.peek_next() != TokenKind::LParen {
+ return false;
+ }
+ let mut probe = Lexer::with_pos(self.src, self.peek1.end);
+ matches!(probe.next_token().map(|t| t.kind), Ok(TokenKind::RParen))
}
pub(crate) fn parse_block(&mut self) -> Result<E::Value, ParseError> {
diff --git a/rust/hogql/parser/src/parse/select.rs b/rust/hogql/parser/src/parse/select.rs
index 56963298d37d..fbe6d22f5d7d 100644
--- a/rust/hogql/parser/src/parse/select.rs
+++ b/rust/hogql/parser/src/parse/select.rs
@@ -11,7 +11,7 @@
use super::expr::is_bare_field;
use super::{
check_alias_not_reserved, format_set_op, identifier_text, inject_ctes_into_select,
- kw_allowed_as_implicit_alias, merge_select_decorators, Parser, BP_MULT,
+ kw_allowed_as_implicit_alias, kw_valid_as_identifier, merge_select_decorators, Parser, BP_MULT,
};
use crate::emit::Emitter;
use crate::error::ParseError;
@@ -19,6 +19,11 @@ use crate::lex::{Kw, Lexer, TokenKind};
impl<'a, E: Emitter + Clone> Parser<'a, E> {
pub(crate) fn parse_select_set_stmt(&mut self) -> Result<E::Value, ParseError> {
+ // Guard the subquery / set recursion (`parse_select_set_stmt` ↔ `parse_select_stmt_with_parens` on each `(` / `WITH (`) so `(select (select …))` nested past the cap rejects cleanly instead of overflowing the host stack (uncatchable SIGSEGV). Shares the counter with expression + statement nesting.
+ self.with_recursion_guard(Self::parse_select_set_stmt_inner)
+ }
+
+ fn parse_select_set_stmt_inner(&mut self) -> Result<E::Value, ParseError> {
let stmt_start = self.peek0.start;
let first = self.parse_select_stmt_with_parens()?;
let mut subsequent: Vec<E::Value> = Vec::new();
@@ -44,7 +49,21 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
| TokenKind::Keyword(Kw::Limit)
| TokenKind::Keyword(Kw::Offset)
);
- let trailing = self.parse_trailing_set_decorators()?;
+ // A lone `{placeholder}` body can't carry set-level LIMIT / OFFSET (only
+ // SelectQuery / SelectSetQuery do), so cpp drops them and never visits
+ // the subtree — see the `body_takes_decorators` drop below, which only
+ // fires when `subsequent.is_empty()`. Tell the decorator parser so it
+ // tolerates an unsupported date literal in that discarded LIMIT /
+ // OFFSET, the same way the always-discarded ORDER BY does. A real
+ // `(select …)` body keeps them, AND a set op (UNION / EXCEPT / …) wraps
+ // the result in a decorator-carrying SelectSetQuery — so both stay
+ // strict; only the lone-placeholder case is suppressed.
+ let body_is_placeholder = subsequent.is_empty()
+ && !matches!(
+ self.emit.node_kind(&first).as_deref(),
+ Some("SelectQuery") | Some("SelectSetQuery")
+ );
+ let trailing = self.parse_trailing_set_decorators(body_is_placeholder)?;
if subsequent.is_empty() {
// cpp's `VISIT(SelectSetStmt)` only writes `limit_percent`
@@ -202,7 +221,10 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
Ok(Some(op))
}
- fn parse_trailing_set_decorators(&mut self) -> Result<Vec<(String, E::Value)>, ParseError> {
+ fn parse_trailing_set_decorators(
+ &mut self,
+ body_is_placeholder: bool,
+ ) -> Result<Vec<(String, E::Value)>, ParseError> {
let mut out: Vec<(String, E::Value)> = Vec::new();
// `selectSetStmt`'s `orderByClause?` slot at this level is
// parsed by ANTLR but cpp's `VISIT(SelectSetStmt)` never emits
@@ -224,7 +246,17 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
{
self.bump()?;
self.bump()?;
- self.parse_order_expr_list()?;
+ // cpp never visits this discarded orderByClause, so an
+ // unsupported `date`/`timestamp` literal anywhere in its
+ // (also unvisited) subtree is tolerated. Suppress the fatal
+ // date-literal check for the duration of this parse; it
+ // intentionally leaks into nested selects/calls here, since
+ // cpp visits none of that subtree either.
+ let prev_date = self.suppress_unvisited_clause_checks;
+ self.suppress_unvisited_clause_checks = true;
+ let order_by_result = self.parse_order_expr_list();
+ self.suppress_unvisited_clause_checks = prev_date;
+ order_by_result?;
// Optional trailing `INTERPOLATE [(...)]` is part of the
// orderByClause grammar; consume-and-drop alongside the
// order_by we're discarding here.
@@ -241,11 +273,35 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
}
}
}
- // Trailing LIMIT/OFFSET on the set. Mirrors
- // `limitAndOffsetClauseOptional` in the grammar:
- // `LIMIT columnExpr PERCENT? (COMMA columnExpr)? (WITH TIES)?`
- // `LIMIT columnExpr PERCENT? (WITH TIES)? OFFSET columnExpr`
- // `OFFSET columnExpr`
+ // Trailing LIMIT / OFFSET. For a `{placeholder}` body these are
+ // dropped (the body can't carry them) and cpp never visits them, so —
+ // exactly like the ORDER BY above — tolerate an unsupported date
+ // literal inside. Gate on `body_is_placeholder` so a real `(select …)`
+ // body, whose LIMIT / OFFSET ARE kept and visited, stays strict.
+ // Restore the flag on every exit (incl. errors an outer `try_alt` may
+ // roll back) before propagating.
+ let prev_date = self.suppress_unvisited_clause_checks;
+ if body_is_placeholder {
+ self.suppress_unvisited_clause_checks = true;
+ }
+ let limit_offset_result = self.parse_set_trailing_limit_offset(&mut out);
+ self.suppress_unvisited_clause_checks = prev_date;
+ limit_offset_result?;
+ Ok(out)
+ }
+
+ /// Parse the trailing `limitAndOffsetClauseOptional` of a `selectSetStmt`,
+ /// pushing any `limit` / `offset` / `limit_percent` / `limit_with_ties`
+ /// decorators onto `out`. Split out of `parse_trailing_set_decorators` so
+ /// the caller can scope the date-literal-check suppression around it.
+ /// Mirrors the grammar:
+ /// `LIMIT columnExpr PERCENT? (COMMA columnExpr)? (WITH TIES)?`
+ /// `LIMIT columnExpr PERCENT? (WITH TIES)? OFFSET columnExpr`
+ /// `OFFSET columnExpr`
+ fn parse_set_trailing_limit_offset(
+ &mut self,
+ out: &mut Vec<(String, E::Value)>,
+ ) -> Result<(), ParseError> {
if self.eat_kw(Kw::Limit)? {
// The initial parse stops at BP_MULT+1 so `limit_resolve_percent`
// sees `%` undigested and can decide PERCENT-marker vs modulo.
@@ -305,7 +361,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
let off = self.parse_expr_bp(0)?;
out.push(("offset".into(), off));
}
- Ok(out)
+ Ok(())
}
fn parse_select_stmt_with_parens(&mut self) -> Result<E::Value, ParseError> {
@@ -355,7 +411,7 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// the bare-placeholder select body carries that position.
if self.peek() == TokenKind::LBrace {
let placeholder_start = self.peek0.start;
- let placeholder = self.parse_brace_dict_or_placeholder()?;
+ let placeholder = self.parse_brace_placeholder_only()?;
return Ok(self.wrap_pos(placeholder, placeholder_start));
}
self.parse_select_stmt()
@@ -424,10 +480,28 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
));
}
self.bump()?;
+ let cp_after_select = self.checkpoint();
let distinct = self.eat_kw(Kw::Distinct)?;
if distinct {
- self.emit
- .set_field(&mut obj, "distinct", self.emit.bool(true));
+ // `SELECT DISTINCT` is the modifier only when a column follows it.
+ // When the next token ends the column list (comma / EOF / `)` / `;`)
+ // or opens a clause (`ORDER BY` / `WHERE` / `GROUP BY` / `LIMIT` /
+ // …), cpp's ALL(*) re-reads DISTINCT as the sole column Field instead
+ // (`SELECT DISTINCT` -> `[Field(distinct)]`, `SELECT DISTINCT ORDER BY
+ // 1` -> `[Field(distinct)]` + ORDER BY). FROM is the exception:
+ // `SELECT DISTINCT FROM x` keeps DISTINCT a modifier and rejects via
+ // the FROM-implicit-alias footgun, matching cpp.
+ let distinct_is_column = matches!(
+ self.peek(),
+ TokenKind::Comma | TokenKind::Eof | TokenKind::RParen | TokenKind::Semicolon
+ ) || (self.peek_is_clause_terminator()
+ && self.peek() != TokenKind::Keyword(Kw::From));
+ if distinct_is_column {
+ self.restore(cp_after_select)?;
+ } else {
+ self.emit
+ .set_field(&mut obj, "distinct", self.emit.bool(true));
+ }
}
// `topClause: TOP DECIMAL_LITERAL (WITH TIES)?` — accepted by
// the grammar, rejected by the cpp visitor as unsupported. A
@@ -678,7 +752,11 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
loop {
let name_tok = self.bump()?;
let name = match name_tok.kind {
- TokenKind::Ident | TokenKind::QuotedIdent | TokenKind::Keyword(_) => {
+ TokenKind::Ident | TokenKind::QuotedIdent => {
+ identifier_text(self.text(name_tok), name_tok.kind)
+ }
+ // A WINDOW-clause name is an `identifier`, so only `kw_valid_as_identifier` keywords qualify — the Hog-statement keywords (try / catch / finally / …) do not.
+ TokenKind::Keyword(kw) if kw_valid_as_identifier(kw) => {
identifier_text(self.text(name_tok), name_tok.kind)
}
_ => {
@@ -730,14 +808,18 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// `(AS columnExpr)?` separator.
// `interpolate(a AS 5)` keeps AS for the
// outer because `5` isn't an alias target.
+ let interp_start = self.peek0.start;
let expr = self.parse_expr_bp(0)?;
let value = if self.eat_kw(Kw::As)? {
Some(self.parse_expr_bp(0)?)
} else {
None
};
+ // cpp spans the InterpolateExpr from the expr start to the
+ // value end (or the expr end when there is no `AS value`).
+ let interp_end = self.last_consumed_end;
let interp = self.emit.interpolate_expr(expr, value);
- items.push(interp);
+ items.push(self.wrap_pos_to(interp, interp_start, interp_end));
if !self.eat(TokenKind::Comma)? {
break;
}
@@ -1133,7 +1215,8 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
let trial = (|p: &mut Self| -> Result<Option<E::Value>, ParseError> {
p.bump()?; // %
let rhs = p.parse_expr_bp(BP_MULT + 1)?;
- let combined = p.emit.arith(lhs.clone(), "%", rhs);
+ // Stamp the modulo node's span before folding any lower-precedence tail, mirroring the Pratt loop's wrap-the-lhs step. Without this the inner `a % b` stays position-less when an outer op (`% 2 + 3` → the `+` node) wraps it (cpp positions the modulo sub-node).
+ let combined = p.wrap_pos(p.emit.arith(lhs.clone(), "%", rhs), lhs_start);
// Extend the whole columnExpr (BP=0) — cpp parses the
// LIMIT body greedily, so a lower-precedence tail
// (`% 2 + 3`, `% 2 AND 3`) stays part of the modulo body.
@@ -1552,9 +1635,27 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
// `WINDOW <name> AS (` and arith-`*` carve-outs. The `:`
// guard keeps the alias-before form (`select a, where : 1`)
// out of this path.
+ // A `from` here normally opens the FROM clause and ends the column
+ // list. But cpp's `selectColumnExprListBeforeFrom` makes every
+ // `from X` BEFORE the last one a SELECT column (the
+ // `ColumnExprInvalidFromImplicitAlias` footgun for bare `from
+ // <ident>`, or a `from(...)` call); only the FINAL `from` opens the
+ // clause. So when a later `from` exists, don't break — fall through
+ // and parse this `from X` as a column (`from b` then rejects via
+ // `is_bare_from_field`; `from(b)` stays a valid call column).
+ // A `from <implicitAlias>` whose FROM region dangles a `, USING SAMPLE`
+ // / `, ARRAY JOIN` is, per cpp's greedy `selectColumnExprListBeforeFrom`,
+ // a `ColumnExprInvalidFromImplicitAlias` column (not the FROM clause) —
+ // so don't break; fall through to parse `from X` as a column, which
+ // rejects via `is_bare_from_field`. Mirrors the second-`from` carve-out.
if !cols.is_empty()
&& self.peek_next() != TokenKind::Colon
&& self.peek_is_clause_terminator()
+ && !(self.peek() == TokenKind::Keyword(Kw::From)
+ && self.from_clause_followed_by_another_from())
+ && !(self.peek() == TokenKind::Keyword(Kw::From)
+ && self.peek_next_is_implicit_alias()
+ && self.from_region_has_dangling_clause_comma())
{
break;
}
@@ -1614,6 +1715,105 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
Ok(cols)
}
+ /// Probe forward from the current `from` (`peek0 == Keyword(From)`) for a
+ /// SECOND depth-0 `from` within the same FROM-clause region. A valid single
+ /// `joinExpr` never has two depth-0 `from` keywords, so a second one means
+ /// the current `from` is a SELECT column (not the clause) per cpp's
+ /// `selectColumnExprListBeforeFrom`. Stops at the from-region's end (a
+ /// depth-0 clause keyword / set-op, a closing bracket below the start depth,
+ /// `;`, or EOF) so a `from` in a later clause or UNIONed select doesn't
+ /// count.
+ fn from_clause_followed_by_another_from(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.end);
+ let mut depth: i32 = 0;
+ loop {
+ let kind = match probe.next_token() {
+ Ok(t) => t.kind,
+ Err(_) => return false,
+ };
+ match kind {
+ TokenKind::Eof | TokenKind::Semicolon => return false,
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => depth += 1,
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ depth -= 1;
+ if depth < 0 {
+ return false;
+ }
+ }
+ TokenKind::Keyword(Kw::From) if depth == 0 => return true,
+ TokenKind::Keyword(kw) if depth == 0 && from_region_terminator(kw) => return false,
+ _ => {}
+ }
+ }
+ }
+
+ /// Probe forward from the current `from` (`peek0 == Keyword(From)`) for a
+ /// depth-0 `COMMA` immediately followed by a two-token clause introducer —
+ /// `USING SAMPLE` or `ARRAY JOIN`. Consulted only in the leading/trailing-
+ /// comma column context (the column-loop break is unreachable otherwise), so
+ /// a hit means cpp's greedy `selectColumnExprListBeforeFrom` consumes this
+ /// `from <implicitAlias>` (and any following cross-join tables) as columns up
+ /// to that trailing comma, leaving the introducer as a select-level clause —
+ /// then its visitor rejects the `ColumnExprInvalidFromImplicitAlias`. cpp:
+ /// `select 1, from f, using sample 1` and `… , array join x` reject, while
+ /// `select 1, from f, using` / `… , array` (a bare keyword cross-join table,
+ /// no SAMPLE/JOIN) and the no-leading-comma `select 1 from f, using sample 1`
+ /// stay valid — hence the two-token check and the comma-context gate. Stops
+ /// at the from-region's end (depth-0 terminator, closing bracket below the
+ /// start depth, `;`, or EOF).
+ fn from_region_has_dangling_clause_comma(&self) -> bool {
+ let mut probe = Lexer::with_pos(self.src, self.peek0.end);
+ let mut depth: i32 = 0;
+ let mut prev_was_comma = false;
+ loop {
+ let kind = match probe.next_token() {
+ Ok(t) => t.kind,
+ Err(_) => return false,
+ };
+ match kind {
+ TokenKind::Eof | TokenKind::Semicolon => return false,
+ TokenKind::LParen | TokenKind::LBracket | TokenKind::LBrace => {
+ depth += 1;
+ prev_was_comma = false;
+ }
+ TokenKind::RParen | TokenKind::RBracket | TokenKind::RBrace => {
+ depth -= 1;
+ if depth < 0 {
+ return false;
+ }
+ prev_was_comma = false;
+ }
+ TokenKind::Comma if depth == 0 => prev_was_comma = true,
+ TokenKind::Keyword(Kw::Using) if depth == 0 && prev_was_comma => {
+ return matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Sample))
+ );
+ }
+ TokenKind::Keyword(Kw::Array) if depth == 0 && prev_was_comma => {
+ return matches!(
+ probe.next_token().map(|t| t.kind),
+ Ok(TokenKind::Keyword(Kw::Join))
+ );
+ }
+ TokenKind::Keyword(kw) if depth == 0 && from_region_terminator(kw) => return false,
+ _ => {
+ if depth == 0 {
+ prev_was_comma = false;
+ }
+ }
+ }
+ }
+ }
+
+ /// True when the token after `peek0` can be an `implicitAlias`
+ /// (`IDENTIFIER | QUOTED_IDENTIFIER | keywordForImplicitAlias`) — i.e. a bare
+ /// `from <here>` could be the grammar's `FROM implicitAlias` column form.
+ fn peek_next_is_implicit_alias(&self) -> bool {
+ matches!(self.peek_next(), TokenKind::Ident | TokenKind::QuotedIdent)
+ || matches!(self.peek_next(), TokenKind::Keyword(kw) if kw_allowed_as_implicit_alias(kw))
+ }
+
fn try_consume_implicit_alias(&mut self) -> Result<Option<String>, ParseError> {
match self.peek() {
TokenKind::Ident => {
@@ -1637,10 +1837,36 @@ impl<'a, E: Emitter + Clone> Parser<'a, E> {
}
}
+/// Keywords whose appearance at depth 0 ends the FROM-clause region: the
+/// post-FROM clauses and the set-operation joiners. Used by
+/// `from_clause_followed_by_another_from` to bound its look-ahead so a `from`
+/// in a later clause or UNIONed select isn't mistaken for a second FROM.
+fn from_region_terminator(kw: Kw) -> bool {
+ matches!(
+ kw,
+ Kw::Where
+ | Kw::Prewhere
+ | Kw::Group
+ | Kw::Having
+ | Kw::Qualify
+ | Kw::Window
+ | Kw::Order
+ | Kw::Limit
+ | Kw::Offset
+ | Kw::Settings
+ | Kw::Union
+ | Kw::Intersect
+ | Kw::Except
+ | Kw::Array
+ )
+}
+
/// True when `expr` is a bare `from` Field — a `Field` whose chain is
-/// the single element `from` (any case). Used to flag the grammar's
-/// `ColumnExprInvalidFromImplicitAlias` footgun (`select from x`).
-fn is_bare_from_field<E: Emitter>(emit: &E, expr: &E::Value) -> bool {
+/// the single element `from` (any case). Flags the grammar's
+/// `ColumnExprInvalidFromImplicitAlias` footgun (`select from x`) in the SELECT
+/// column list. (A bare `from` in *table* position is valid — `from b, from c`
+/// is table `from` aliased `c` — so the FROM/join path does not use this.)
+pub(crate) fn is_bare_from_field<E: Emitter>(emit: &E, expr: &E::Value) -> bool {
if emit.node_kind(expr).as_deref() != Some("Field") {
return false;
}
diff --git a/rust/hogql/parser/src/parse/template.rs b/rust/hogql/parser/src/parse/template.rs
index 2214a20ae887..e7a2d58584fd 100644
--- a/rust/hogql/parser/src/parse/template.rs
+++ b/rust/hogql/parser/src/parse/template.rs
@@ -129,7 +129,9 @@ pub(super) fn parse_template_body<E: Emitter + Clone>(
// token at the `\`, then starts a fresh token on
// the next valid character. The body splitter
// models that by closing the current literal chunk
- // and dropping the two-byte `\X` sequence.
+ // and dropping the `\X` sequence (both the backslash
+ // and the escaped char — cpp drops `\q`, `\é`, and
+ // `\😀` alike, all contributing nothing).
if !literal.is_empty() {
chunks.push(wrap_literal_chunk(
emit,
@@ -139,7 +141,15 @@ pub(super) fn parse_template_body<E: Emitter + Clone>(
body_offset + i,
));
}
- i += 2;
+ // `X` may be a multibyte codepoint (`\é`, `\😀`), so step
+ // past the whole escaped char, not a fixed 2 bytes — a
+ // fixed step lands mid-char and panics the `&body[i..]`
+ // slice at the bottom of the loop.
+ let escaped_char = body[i + 1..]
+ .chars()
+ .next()
+ .expect("guarded by `i + 1 < bytes.len()`");
+ i += 1 + escaped_char.len_utf8();
literal_start = i;
continue;
}
@@ -242,14 +252,16 @@ pub(super) fn parse_template_body<E: Emitter + Clone>(
));
}
if chunks.is_empty() {
- // Empty body — cpp emits an empty-string Constant spanning the
- // body (between the quotes). Position it accordingly.
+ // Empty body — cpp spans the empty-string Constant over the WHOLE
+ // `f'…'` token (there is no interior text to span), not the zero-width
+ // gap between the quotes. The token runs from `body_offset - 2` (`f'`)
+ // through `body_end + 1` (past the closing `'`).
return Ok(wrap_literal_chunk(
emit,
full_src,
String::new(),
- body_offset,
- body_end,
+ body_offset - 2,
+ body_end + 1,
));
}
// A single-chunk template IS that chunk — whether a literal
diff --git a/uv.lock b/uv.lock
index b70b6d005ece..28864aef7a27 100644
--- a/uv.lock
+++ b/uv.lock
@@ -11,7 +11,7 @@ resolution-markers = [
]
[options]
-exclude-newer = "2026-05-15T16:35:27.522223Z"
+exclude-newer = "2026-05-19T19:35:56.17510417Z"
exclude-newer-span = "P7D"
[options.exclude-newer-package]
@@ -3015,28 +3015,28 @@ provides-extras = ["dev"]
[[package]]
name = "hogql-parser"
-version = "1.3.66"
+version = "1.3.69"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/ae/ba/f8a401c758392089fc0b8d6f7745a725c98231808f0a6d98be2560f03637/hogql_parser-1.3.66.tar.gz", hash = "sha256:863ed5028647f505403954a4df11cc193e268cb40af7e66bd1f93414d6260d64", size = 92042, upload-time = "2026-05-22T16:32:23.176Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/89/1e/b3cf018b08692b494dc13deb7ddaf780a97077929d24012f50a7148da1e8/hogql_parser-1.3.69.tar.gz", hash = "sha256:583fba9ba1125348e4b748b1d86e89ced83dc966de5f08d24041db421e8691a5", size = 92043, upload-time = "2026-05-26T19:35:25.135Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/0a/94/802702c60418f5b3181624018532c8310bebc1da42a3919d420a07f0dcd5/hogql_parser-1.3.66-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:a45c49d831d3dadbb0d9d4f0617289d16315632632ec292d4740ea406890a080", size = 654400, upload-time = "2026-05-22T16:32:05.386Z" },
- { url = "https://files.pythonhosted.org/packages/12/3f/2f50b3cfe0e97683eddbe6d960970e5989bc43bf45ded2f581551e3ced36/hogql_parser-1.3.66-cp312-cp312-macosx_15_0_x86_64.whl", hash = "sha256:76a6246dc0b9d4b75965a1e15ba926bddb83b7cae297f4c567df00432c53def8", size = 670521, upload-time = "2026-05-22T16:32:07.073Z" },
- { url = "https://files.pythonhosted.org/packages/1c/28/fccc5f92e95724b12c93a632c0f3d2bc37cd483c2389bac1e2fbab3c3e94/hogql_parser-1.3.66-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:7359e8892cd1044a1207b6a9914a56411e1b9eda0cd335656d0a6eed776ada87", size = 5065157, upload-time = "2026-05-22T16:32:08.881Z" },
- { url = "https://files.pythonhosted.org/packages/56/3a/c43c4972a2a8b9588d7a9afc3dcf882506d053f045ba1503151c4a14cd9e/hogql_parser-1.3.66-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:7b52a755466e697f3b6865ccc9bb9943852222afb303652d2176868c4b7036a5", size = 5171652, upload-time = "2026-05-22T16:32:11.846Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/24/43a1827990c3f0572359401db0aadad1621379f18ff90ca1247d2d2e45e2/hogql_parser-1.3.69-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:b51457f85b2c6fb2d5b7d4752f8c34d9456af9abb97cc1c8aadb001f990359df", size = 654302, upload-time = "2026-05-26T19:35:11.732Z" },
+ { url = "https://files.pythonhosted.org/packages/dd/90/13fc7d638648ce902aa43f9e925b4dc030d29e662efceec95194a272be50/hogql_parser-1.3.69-cp312-cp312-macosx_15_0_x86_64.whl", hash = "sha256:227bb3f15d8beea1d6a63b5bc8f3ac17b01067b3100e69ef1bd71ab0e67d0b22", size = 670292, upload-time = "2026-05-26T19:35:13.345Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/12/8a912011b7177cf2e9b105638c1b644dc0a6545c4843885f2818f9af39d6/hogql_parser-1.3.69-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:40469d197c98a544f58be4cc93402aef94158481fd39887fd6531086483cf059", size = 5067317, upload-time = "2026-05-26T19:35:14.925Z" },
+ { url = "https://files.pythonhosted.org/packages/2d/23/3238479d7acbb65cd7bb2bf395c0ab552c5e15e307f677d4f8808dc366a0/hogql_parser-1.3.69-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:fcf8b40f6b99f0257f4881340b40c87ab56bbfc8414fea3650668ef56982ce10", size = 5174993, upload-time = "2026-05-26T19:35:16.728Z" },
]
[[package]]
name = "hogql-parser-rs"
-version = "1.3.72"
+version = "1.3.75"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/6b/e7/921674b57dda8dcf18fa98e9f601fa11e3d61a426aa6c447362fe7d92219/hogql_parser_rs-1.3.72.tar.gz", hash = "sha256:587bf0609f431545700fc880d9219f37c25d0865d8a20633059866f925957103", size = 257587, upload-time = "2026-05-22T16:26:02.601Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/0a/b1/744526df944b4b2675edacc9b9c100f97e964d62dd62d1b7ea566ed73110/hogql_parser_rs-1.3.75.tar.gz", hash = "sha256:2607eedc28004e45e03910e6f76502b1fd1757bd69d2ca768ef5ebde98e7a78f", size = 279337, upload-time = "2026-05-26T18:32:39.741Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/ac/c9/0a7515d96c68817e8b7ea9fdea009188b0bb5ac387d7538c12cd87572ef7/hogql_parser_rs-1.3.72-cp312-abi3-macosx_10_12_x86_64.whl", hash = "sha256:f12bff693dd1bf6c45b9baf7e53864f9848b02315cf526a4a09bd26e3038873d", size = 701227, upload-time = "2026-05-22T16:25:50.209Z" },
- { url = "https://files.pythonhosted.org/packages/3f/a1/aa0d76e8e9ad3011ea58f04e9461e265a51cfb19540639bb5bf0f31b2c73/hogql_parser_rs-1.3.72-cp312-abi3-macosx_11_0_arm64.whl", hash = "sha256:c99da60fc6c8a8ea20062b3341d57a8e0f6396b11a07c31a329c33519f8ee2b2", size = 662794, upload-time = "2026-05-22T16:25:51.917Z" },
- { url = "https://files.pythonhosted.org/packages/63/4f/bc8b67e6b7311a1def454f0e406d3bb8d3dbca9316c1861d53e90fcabbc5/hogql_parser_rs-1.3.72-cp312-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:1cc08aa01a439eb2ebca52666a39ac97e3d54cd5f36c7f31b5725c0b45446c7f", size = 2406931, upload-time = "2026-05-22T16:25:54.012Z" },
- { url = "https://files.pythonhosted.org/packages/97/b5/188cdfe2a12afce6546ffd7ed9c85d7962ccf71bed0b3e08c4ddd8f73e9b/hogql_parser_rs-1.3.72-cp312-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:132cddee12c02f040aef141c468c090df16ebf21033feec578beacbc297a2fbb", size = 2658950, upload-time = "2026-05-22T16:25:55.682Z" },
- { url = "https://files.pythonhosted.org/packages/60/03/85c2baa011956582ba74cd1fc270627ddba884dd35f9d00e40028177bed0/hogql_parser_rs-1.3.72-cp312-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2eb182ec64760022403bc8d8d347b775d00bb91a776c663f816fb96f8379aad1", size = 2578784, upload-time = "2026-05-22T16:25:58.098Z" },
- { url = "https://files.pythonhosted.org/packages/c6/1f/0b2eb1717f9267580fdfee652b4a355e4c29ba108152f1e277be47fa2b67/hogql_parser_rs-1.3.72-cp312-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d1d8842c2bad8950a125c0112e755db3ac671a00f239a548d30146f918a67ce5", size = 2625749, upload-time = "2026-05-22T16:26:00.414Z" },
+ { url = "https://files.pythonhosted.org/packages/bf/47/9d941887c7c9f4bbd4757d35a23e9214207e0f2ffb8edefee59ce77df2a0/hogql_parser_rs-1.3.75-cp312-abi3-macosx_10_12_x86_64.whl", hash = "sha256:e6c3c6a1941ec5991853c7304861c40430004f9db0f07836b79bcc569a47d0f2", size = 727452, upload-time = "2026-05-26T18:32:29.964Z" },
+ { url = "https://files.pythonhosted.org/packages/a6/aa/d9e38b03b6a09dbdca6d87ea8ba8beb350f30382346c050fd9515037c374/hogql_parser_rs-1.3.75-cp312-abi3-macosx_11_0_arm64.whl", hash = "sha256:7bb55e490ce617ddaea009f2bedcbfa7c620c9912f5e017ba6949cd0c410bae4", size = 685286, upload-time = "2026-05-26T18:32:31.942Z" },
+ { url = "https://files.pythonhosted.org/packages/8e/72/738099fef905ebab38d9cec09665883f1fe85267e5e8cc81d755f53d880c/hogql_parser_rs-1.3.75-cp312-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:9bc361647c9b7524a5046f10671100937e3183f703efedcbbfc141c9e73139c1", size = 2472142, upload-time = "2026-05-26T18:32:33.411Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/cb/3e2a9f3e4a5e8e3d9041f868031bb72ed8ae0b69cfd16d424ffcda285680/hogql_parser_rs-1.3.75-cp312-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:360b29ae4bec41bdfd783f69c476f38c3eebaebd200effd6aa3965855c2040be", size = 2733287, upload-time = "2026-05-26T18:32:34.985Z" },
+ { url = "https://files.pythonhosted.org/packages/07/6a/3d9671f911d5fd59616f12a4df07d4c889a076bea89d379005ca9c5d57b1/hogql_parser_rs-1.3.75-cp312-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:d07a4a38f30745264fc8d6b11bc3a4205f33a3277c8c2fed8c6f352dffb05308", size = 2645445, upload-time = "2026-05-26T18:32:36.447Z" },
+ { url = "https://files.pythonhosted.org/packages/49/97/06407d8accdf8c8a8f73912b838a611ab88386430e657c9056e112473888/hogql_parser_rs-1.3.75-cp312-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6ef7eae9924db9d324d7752eaad4941bc96475fa3ac8831ffad323435d9bbe4f", size = 2697696, upload-time = "2026-05-26T18:32:38.085Z" },
]
[[package]]
@@ -5566,8 +5566,8 @@ requires-dist = [
{ name = "grimp", specifier = "~=3.14" },
{ name = "grpcio", specifier = "~=1.71.0" },
{ name = "gspread", specifier = "==6.2.1" },
- { name = "hogql-parser", specifier = "==1.3.66" },
- { name = "hogql-parser-rs", specifier = "==1.3.72" },
+ { name = "hogql-parser", specifier = "==1.3.69" },
+ { name = "hogql-parser-rs", specifier = "==1.3.75" },
{ name = "humanize", specifier = "~=4.12.3" },
{ name = "infi-clickhouse-orm", git = "https://github.com/PostHog/infi.clickhouse_orm?rev=4e3996becf66bf5c26580aff12a80425d9d56fe5" },
{ name = "jsonref", specifier = "==1.1.0" },