diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-28 17:51:02 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-28 17:51:02 +0100 |
commit | 6618d1edc3edaad9ebdc216e6d7423ac9ac6a265 (patch) | |
tree | 6134e50e3b501e810c6da140257d7ccdca90602a /crates/ra_syntax/tests/data/parser/ok | |
parent | 8138b1da4f1564913a1a22407c65e77aa5320d56 (diff) | |
parent | d436ab05810c208b41a1b61896d3d87691cd9e99 (diff) |
Merge #1213
1213: Make lexer produce only single character puncts r=matklad a=edwin0cheng
As discussed in Zulip, this PR change `lexer` to produce only single char punct.
* Remove producing `DOTDOTDOT, DOTDOTEQ, DOTDOT, COLONCOLON, EQEQ, FAT_ARROW, NEQ, THIN_ARROW` in lexer.
* Add required code in parser to make sure everythings works fine.
* Change some tests (Mainly because the `ast::token_tree` is different)
Note: i think the use of `COLON` in rust is too overloaded :)
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/ok')
-rw-r--r-- | crates/ra_syntax/tests/data/parser/ok/0035_weird_exprs.txt | 111 |
1 files changed, 74 insertions, 37 deletions
diff --git a/crates/ra_syntax/tests/data/parser/ok/0035_weird_exprs.txt b/crates/ra_syntax/tests/data/parser/ok/0035_weird_exprs.txt index 960d332e4..c89b591e9 100644 --- a/crates/ra_syntax/tests/data/parser/ok/0035_weird_exprs.txt +++ b/crates/ra_syntax/tests/data/parser/ok/0035_weird_exprs.txt | |||
@@ -1181,7 +1181,8 @@ SOURCE_FILE@[0; 3813) | |||
1181 | TOKEN_TREE@[1988; 2195) | 1181 | TOKEN_TREE@[1988; 2195) |
1182 | L_PAREN@[1988; 1989) "(" | 1182 | L_PAREN@[1988; 1989) "(" |
1183 | IDENT@[1989; 1995) "String" | 1183 | IDENT@[1989; 1995) "String" |
1184 | COLONCOLON@[1995; 1997) "::" | 1184 | COLON@[1995; 1996) ":" |
1185 | COLON@[1996; 1997) ":" | ||
1185 | IDENT@[1997; 2001) "from" | 1186 | IDENT@[1997; 2001) "from" |
1186 | TOKEN_TREE@[2001; 2055) | 1187 | TOKEN_TREE@[2001; 2055) |
1187 | L_PAREN@[2001; 2002) "(" | 1188 | L_PAREN@[2001; 2002) "(" |
@@ -1196,55 +1197,80 @@ SOURCE_FILE@[0; 3813) | |||
1196 | STRING@[2080; 2086) "\"{:?}\"" | 1197 | STRING@[2080; 2086) "\"{:?}\"" |
1197 | COMMA@[2086; 2087) "," | 1198 | COMMA@[2086; 2087) "," |
1198 | WHITESPACE@[2087; 2088) " " | 1199 | WHITESPACE@[2087; 2088) " " |
1199 | DOTDOT@[2088; 2090) ".." | 1200 | DOT@[2088; 2089) "." |
1201 | DOT@[2089; 2090) "." | ||
1200 | WHITESPACE@[2090; 2091) " " | 1202 | WHITESPACE@[2090; 2091) " " |
1201 | DOTDOT@[2091; 2093) ".." | 1203 | DOT@[2091; 2092) "." |
1204 | DOT@[2092; 2093) "." | ||
1202 | WHITESPACE@[2093; 2094) " " | 1205 | WHITESPACE@[2093; 2094) " " |
1203 | DOTDOT@[2094; 2096) ".." | 1206 | DOT@[2094; 2095) "." |
1207 | DOT@[2095; 2096) "." | ||
1204 | WHITESPACE@[2096; 2097) " " | 1208 | WHITESPACE@[2096; 2097) " " |
1205 | DOTDOT@[2097; 2099) ".." | 1209 | DOT@[2097; 2098) "." |
1210 | DOT@[2098; 2099) "." | ||
1206 | WHITESPACE@[2099; 2100) " " | 1211 | WHITESPACE@[2099; 2100) " " |
1207 | DOTDOT@[2100; 2102) ".." | 1212 | DOT@[2100; 2101) "." |
1213 | DOT@[2101; 2102) "." | ||
1208 | WHITESPACE@[2102; 2103) " " | 1214 | WHITESPACE@[2102; 2103) " " |
1209 | DOTDOT@[2103; 2105) ".." | 1215 | DOT@[2103; 2104) "." |
1216 | DOT@[2104; 2105) "." | ||
1210 | WHITESPACE@[2105; 2106) " " | 1217 | WHITESPACE@[2105; 2106) " " |
1211 | DOTDOT@[2106; 2108) ".." | 1218 | DOT@[2106; 2107) "." |
1219 | DOT@[2107; 2108) "." | ||
1212 | WHITESPACE@[2108; 2109) " " | 1220 | WHITESPACE@[2108; 2109) " " |
1213 | DOTDOT@[2109; 2111) ".." | 1221 | DOT@[2109; 2110) "." |
1222 | DOT@[2110; 2111) "." | ||
1214 | WHITESPACE@[2111; 2112) " " | 1223 | WHITESPACE@[2111; 2112) " " |
1215 | DOTDOT@[2112; 2114) ".." | 1224 | DOT@[2112; 2113) "." |
1225 | DOT@[2113; 2114) "." | ||
1216 | WHITESPACE@[2114; 2115) " " | 1226 | WHITESPACE@[2114; 2115) " " |
1217 | DOTDOT@[2115; 2117) ".." | 1227 | DOT@[2115; 2116) "." |
1228 | DOT@[2116; 2117) "." | ||
1218 | WHITESPACE@[2117; 2118) " " | 1229 | WHITESPACE@[2117; 2118) " " |
1219 | DOTDOT@[2118; 2120) ".." | 1230 | DOT@[2118; 2119) "." |
1231 | DOT@[2119; 2120) "." | ||
1220 | WHITESPACE@[2120; 2121) " " | 1232 | WHITESPACE@[2120; 2121) " " |
1221 | DOTDOT@[2121; 2123) ".." | 1233 | DOT@[2121; 2122) "." |
1234 | DOT@[2122; 2123) "." | ||
1222 | WHITESPACE@[2123; 2124) " " | 1235 | WHITESPACE@[2123; 2124) " " |
1223 | DOTDOT@[2124; 2126) ".." | 1236 | DOT@[2124; 2125) "." |
1237 | DOT@[2125; 2126) "." | ||
1224 | WHITESPACE@[2126; 2158) "\n ..." | 1238 | WHITESPACE@[2126; 2158) "\n ..." |
1225 | DOTDOT@[2158; 2160) ".." | 1239 | DOT@[2158; 2159) "." |
1240 | DOT@[2159; 2160) "." | ||
1226 | WHITESPACE@[2160; 2161) " " | 1241 | WHITESPACE@[2160; 2161) " " |
1227 | DOTDOT@[2161; 2163) ".." | 1242 | DOT@[2161; 2162) "." |
1243 | DOT@[2162; 2163) "." | ||
1228 | WHITESPACE@[2163; 2164) " " | 1244 | WHITESPACE@[2163; 2164) " " |
1229 | DOTDOT@[2164; 2166) ".." | 1245 | DOT@[2164; 2165) "." |
1246 | DOT@[2165; 2166) "." | ||
1230 | WHITESPACE@[2166; 2167) " " | 1247 | WHITESPACE@[2166; 2167) " " |
1231 | DOTDOT@[2167; 2169) ".." | 1248 | DOT@[2167; 2168) "." |
1249 | DOT@[2168; 2169) "." | ||
1232 | WHITESPACE@[2169; 2170) " " | 1250 | WHITESPACE@[2169; 2170) " " |
1233 | DOTDOT@[2170; 2172) ".." | 1251 | DOT@[2170; 2171) "." |
1252 | DOT@[2171; 2172) "." | ||
1234 | WHITESPACE@[2172; 2173) " " | 1253 | WHITESPACE@[2172; 2173) " " |
1235 | DOTDOT@[2173; 2175) ".." | 1254 | DOT@[2173; 2174) "." |
1255 | DOT@[2174; 2175) "." | ||
1236 | WHITESPACE@[2175; 2176) " " | 1256 | WHITESPACE@[2175; 2176) " " |
1237 | DOTDOT@[2176; 2178) ".." | 1257 | DOT@[2176; 2177) "." |
1258 | DOT@[2177; 2178) "." | ||
1238 | WHITESPACE@[2178; 2179) " " | 1259 | WHITESPACE@[2178; 2179) " " |
1239 | DOTDOT@[2179; 2181) ".." | 1260 | DOT@[2179; 2180) "." |
1261 | DOT@[2180; 2181) "." | ||
1240 | WHITESPACE@[2181; 2182) " " | 1262 | WHITESPACE@[2181; 2182) " " |
1241 | DOTDOT@[2182; 2184) ".." | 1263 | DOT@[2182; 2183) "." |
1264 | DOT@[2183; 2184) "." | ||
1242 | WHITESPACE@[2184; 2185) " " | 1265 | WHITESPACE@[2184; 2185) " " |
1243 | DOTDOT@[2185; 2187) ".." | 1266 | DOT@[2185; 2186) "." |
1267 | DOT@[2186; 2187) "." | ||
1244 | WHITESPACE@[2187; 2188) " " | 1268 | WHITESPACE@[2187; 2188) " " |
1245 | DOTDOT@[2188; 2190) ".." | 1269 | DOT@[2188; 2189) "." |
1270 | DOT@[2189; 2190) "." | ||
1246 | WHITESPACE@[2190; 2191) " " | 1271 | WHITESPACE@[2190; 2191) " " |
1247 | DOTDOT@[2191; 2193) ".." | 1272 | DOT@[2191; 2192) "." |
1273 | DOT@[2192; 2193) "." | ||
1248 | R_PAREN@[2193; 2194) ")" | 1274 | R_PAREN@[2193; 2194) ")" |
1249 | R_PAREN@[2194; 2195) ")" | 1275 | R_PAREN@[2194; 2195) ")" |
1250 | SEMI@[2195; 2196) ";" | 1276 | SEMI@[2195; 2196) ";" |
@@ -1321,7 +1347,8 @@ SOURCE_FILE@[0; 3813) | |||
1321 | IDENT@[2308; 2310) "u8" | 1347 | IDENT@[2308; 2310) "u8" |
1322 | R_PAREN@[2310; 2311) ")" | 1348 | R_PAREN@[2310; 2311) ")" |
1323 | WHITESPACE@[2311; 2312) " " | 1349 | WHITESPACE@[2311; 2312) " " |
1324 | FAT_ARROW@[2312; 2314) "=>" | 1350 | EQ@[2312; 2313) "=" |
1351 | R_ANGLE@[2313; 2314) ">" | ||
1325 | WHITESPACE@[2314; 2315) " " | 1352 | WHITESPACE@[2314; 2315) " " |
1326 | TOKEN_TREE@[2315; 2552) | 1353 | TOKEN_TREE@[2315; 2552) |
1327 | L_CURLY@[2315; 2316) "{" | 1354 | L_CURLY@[2315; 2316) "{" |
@@ -1359,7 +1386,8 @@ SOURCE_FILE@[0; 3813) | |||
1359 | IDENT@[2405; 2407) "u8" | 1386 | IDENT@[2405; 2407) "u8" |
1360 | R_PAREN@[2407; 2408) ")" | 1387 | R_PAREN@[2407; 2408) ")" |
1361 | WHITESPACE@[2408; 2409) " " | 1388 | WHITESPACE@[2408; 2409) " " |
1362 | THIN_ARROW@[2409; 2411) "->" | 1389 | MINUS@[2409; 2410) "-" |
1390 | R_ANGLE@[2410; 2411) ">" | ||
1363 | WHITESPACE@[2411; 2412) " " | 1391 | WHITESPACE@[2411; 2412) " " |
1364 | AMP@[2412; 2413) "&" | 1392 | AMP@[2412; 2413) "&" |
1365 | LIFETIME@[2413; 2416) "\'u8" | 1393 | LIFETIME@[2413; 2416) "\'u8" |
@@ -1403,7 +1431,8 @@ SOURCE_FILE@[0; 3813) | |||
1403 | EQ@[2615; 2616) "=" | 1431 | EQ@[2615; 2616) "=" |
1404 | WHITESPACE@[2616; 2617) " " | 1432 | WHITESPACE@[2616; 2617) " " |
1405 | IDENT@[2617; 2619) "u8" | 1433 | IDENT@[2617; 2619) "u8" |
1406 | COLONCOLON@[2619; 2621) "::" | 1434 | COLON@[2619; 2620) ":" |
1435 | COLON@[2620; 2621) ":" | ||
1407 | IDENT@[2621; 2623) "u8" | 1436 | IDENT@[2621; 2623) "u8" |
1408 | TOKEN_TREE@[2623; 2629) | 1437 | TOKEN_TREE@[2623; 2629) |
1409 | L_PAREN@[2623; 2624) "(" | 1438 | L_PAREN@[2623; 2624) "(" |
@@ -1413,7 +1442,8 @@ SOURCE_FILE@[0; 3813) | |||
1413 | SEMI@[2629; 2630) ";" | 1442 | SEMI@[2629; 2630) ";" |
1414 | WHITESPACE@[2630; 2643) "\n " | 1443 | WHITESPACE@[2630; 2643) "\n " |
1415 | CRATE_KW@[2643; 2648) "crate" | 1444 | CRATE_KW@[2643; 2648) "crate" |
1416 | COLONCOLON@[2648; 2650) "::" | 1445 | COLON@[2648; 2649) ":" |
1446 | COLON@[2649; 2650) ":" | ||
1417 | IDENT@[2650; 2652) "u8" | 1447 | IDENT@[2650; 2652) "u8" |
1418 | TOKEN_TREE@[2652; 2657) | 1448 | TOKEN_TREE@[2652; 2657) |
1419 | L_PAREN@[2652; 2653) "(" | 1449 | L_PAREN@[2652; 2653) "(" |
@@ -1453,7 +1483,8 @@ SOURCE_FILE@[0; 3813) | |||
1453 | TOKEN_TREE@[2722; 2829) | 1483 | TOKEN_TREE@[2722; 2829) |
1454 | L_PAREN@[2722; 2723) "(" | 1484 | L_PAREN@[2722; 2723) "(" |
1455 | IDENT@[2723; 2729) "String" | 1485 | IDENT@[2723; 2729) "String" |
1456 | COLONCOLON@[2729; 2731) "::" | 1486 | COLON@[2729; 2730) ":" |
1487 | COLON@[2730; 2731) ":" | ||
1457 | IDENT@[2731; 2735) "from" | 1488 | IDENT@[2731; 2735) "from" |
1458 | TOKEN_TREE@[2735; 2742) | 1489 | TOKEN_TREE@[2735; 2742) |
1459 | L_PAREN@[2735; 2736) "(" | 1490 | L_PAREN@[2735; 2736) "(" |
@@ -1462,12 +1493,15 @@ SOURCE_FILE@[0; 3813) | |||
1462 | COMMA@[2742; 2743) "," | 1493 | COMMA@[2742; 2743) "," |
1463 | WHITESPACE@[2743; 2759) "\n " | 1494 | WHITESPACE@[2743; 2759) "\n " |
1464 | IDENT@[2759; 2765) "String" | 1495 | IDENT@[2759; 2765) "String" |
1465 | COLONCOLON@[2765; 2767) "::" | 1496 | COLON@[2765; 2766) ":" |
1497 | COLON@[2766; 2767) ":" | ||
1466 | L_ANGLE@[2767; 2768) "<" | 1498 | L_ANGLE@[2767; 2768) "<" |
1467 | R_ANGLE@[2768; 2769) ">" | 1499 | R_ANGLE@[2768; 2769) ">" |
1468 | COLONCOLON@[2769; 2771) "::" | 1500 | COLON@[2769; 2770) ":" |
1501 | COLON@[2770; 2771) ":" | ||
1469 | IDENT@[2771; 2775) "from" | 1502 | IDENT@[2771; 2775) "from" |
1470 | COLONCOLON@[2775; 2777) "::" | 1503 | COLON@[2775; 2776) ":" |
1504 | COLON@[2776; 2777) ":" | ||
1471 | L_ANGLE@[2777; 2778) "<" | 1505 | L_ANGLE@[2777; 2778) "<" |
1472 | R_ANGLE@[2778; 2779) ">" | 1506 | R_ANGLE@[2778; 2779) ">" |
1473 | TOKEN_TREE@[2779; 2786) | 1507 | TOKEN_TREE@[2779; 2786) |
@@ -1476,7 +1510,8 @@ SOURCE_FILE@[0; 3813) | |||
1476 | R_PAREN@[2785; 2786) ")" | 1510 | R_PAREN@[2785; 2786) ")" |
1477 | DOT@[2786; 2787) "." | 1511 | DOT@[2786; 2787) "." |
1478 | IDENT@[2787; 2792) "chars" | 1512 | IDENT@[2787; 2792) "chars" |
1479 | COLONCOLON@[2792; 2794) "::" | 1513 | COLON@[2792; 2793) ":" |
1514 | COLON@[2793; 2794) ":" | ||
1480 | L_ANGLE@[2794; 2795) "<" | 1515 | L_ANGLE@[2794; 2795) "<" |
1481 | R_ANGLE@[2795; 2796) ">" | 1516 | R_ANGLE@[2795; 2796) ">" |
1482 | TOKEN_TREE@[2796; 2798) | 1517 | TOKEN_TREE@[2796; 2798) |
@@ -1484,7 +1519,8 @@ SOURCE_FILE@[0; 3813) | |||
1484 | R_PAREN@[2797; 2798) ")" | 1519 | R_PAREN@[2797; 2798) ")" |
1485 | DOT@[2798; 2799) "." | 1520 | DOT@[2798; 2799) "." |
1486 | IDENT@[2799; 2802) "rev" | 1521 | IDENT@[2799; 2802) "rev" |
1487 | COLONCOLON@[2802; 2804) "::" | 1522 | COLON@[2802; 2803) ":" |
1523 | COLON@[2803; 2804) ":" | ||
1488 | L_ANGLE@[2804; 2805) "<" | 1524 | L_ANGLE@[2804; 2805) "<" |
1489 | R_ANGLE@[2805; 2806) ">" | 1525 | R_ANGLE@[2805; 2806) ">" |
1490 | TOKEN_TREE@[2806; 2808) | 1526 | TOKEN_TREE@[2806; 2808) |
@@ -1492,7 +1528,8 @@ SOURCE_FILE@[0; 3813) | |||
1492 | R_PAREN@[2807; 2808) ")" | 1528 | R_PAREN@[2807; 2808) ")" |
1493 | DOT@[2808; 2809) "." | 1529 | DOT@[2808; 2809) "." |
1494 | IDENT@[2809; 2816) "collect" | 1530 | IDENT@[2809; 2816) "collect" |
1495 | COLONCOLON@[2816; 2818) "::" | 1531 | COLON@[2816; 2817) ":" |
1532 | COLON@[2817; 2818) ":" | ||
1496 | L_ANGLE@[2818; 2819) "<" | 1533 | L_ANGLE@[2818; 2819) "<" |
1497 | IDENT@[2819; 2825) "String" | 1534 | IDENT@[2819; 2825) "String" |
1498 | R_ANGLE@[2825; 2826) ">" | 1535 | R_ANGLE@[2825; 2826) ">" |