Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: pkg/compiler/lib/src/resolution/send_structure.dart

Issue 1126173002: Refactor handling of compounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refactor Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.send_structure; 5 library dart2js.send_structure;
6 6
7 import 'access_semantics.dart'; 7 import 'access_semantics.dart';
8 import 'operators.dart'; 8 import 'operators.dart';
9 import 'semantic_visitor.dart'; 9 import 'semantic_visitor.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 case AccessKind.LOCAL_FUNCTION: 170 case AccessKind.LOCAL_FUNCTION:
171 return visitor.visitLocalFunctionInvoke( 171 return visitor.visitLocalFunctionInvoke(
172 node, 172 node,
173 semantics.element, 173 semantics.element,
174 node.argumentsNode, 174 node.argumentsNode,
175 // TODO(johnniwinther): Store the call selector instead of the 175 // TODO(johnniwinther): Store the call selector instead of the
176 // selector using the name of the function. 176 // selector using the name of the function.
177 callStructure, 177 callStructure,
178 arg); 178 arg);
179 case AccessKind.LOCAL_VARIABLE: 179 case AccessKind.LOCAL_VARIABLE:
180 case AccessKind.FINAL_LOCAL_VARIABLE:
180 return visitor.visitLocalVariableInvoke( 181 return visitor.visitLocalVariableInvoke(
181 node, 182 node,
182 semantics.element, 183 semantics.element,
183 node.argumentsNode, 184 node.argumentsNode,
184 // TODO(johnniwinther): Store the call selector instead of the 185 // TODO(johnniwinther): Store the call selector instead of the
185 // selector using the name of the variable. 186 // selector using the name of the variable.
186 callStructure, 187 callStructure,
187 arg); 188 arg);
188 case AccessKind.PARAMETER: 189 case AccessKind.PARAMETER:
190 case AccessKind.FINAL_PARAMETER:
189 return visitor.visitParameterInvoke( 191 return visitor.visitParameterInvoke(
190 node, 192 node,
191 semantics.element, 193 semantics.element,
192 node.argumentsNode, 194 node.argumentsNode,
193 // TODO(johnniwinther): Store the call selector instead of the 195 // TODO(johnniwinther): Store the call selector instead of the
194 // selector using the name of the parameter. 196 // selector using the name of the parameter.
195 callStructure, 197 callStructure,
196 arg); 198 arg);
197 case AccessKind.STATIC_FIELD: 199 case AccessKind.STATIC_FIELD:
200 case AccessKind.STATIC_FINAL_FIELD:
198 return visitor.visitStaticFieldInvoke( 201 return visitor.visitStaticFieldInvoke(
199 node, 202 node,
200 semantics.element, 203 semantics.element,
201 node.argumentsNode, 204 node.argumentsNode,
202 callStructure, 205 callStructure,
203 arg); 206 arg);
204 case AccessKind.STATIC_METHOD: 207 case AccessKind.STATIC_METHOD:
205 return visitor.visitStaticFunctionInvoke( 208 return visitor.visitStaticFunctionInvoke(
206 node, 209 node,
207 semantics.element, 210 semantics.element,
208 node.argumentsNode, 211 node.argumentsNode,
209 callStructure, 212 callStructure,
210 arg); 213 arg);
211 case AccessKind.STATIC_GETTER: 214 case AccessKind.STATIC_GETTER:
212 return visitor.visitStaticGetterInvoke( 215 return visitor.visitStaticGetterInvoke(
213 node, 216 node,
214 semantics.element, 217 semantics.element,
215 node.argumentsNode, 218 node.argumentsNode,
216 callStructure, 219 callStructure,
217 arg); 220 arg);
218 case AccessKind.STATIC_SETTER: 221 case AccessKind.STATIC_SETTER:
219 return visitor.errorStaticSetterInvoke( 222 return visitor.errorStaticSetterInvoke(
220 node, 223 node,
221 semantics.element, 224 semantics.element,
222 node.argumentsNode, 225 node.argumentsNode,
223 callStructure, 226 callStructure,
224 arg); 227 arg);
225 case AccessKind.TOPLEVEL_FIELD: 228 case AccessKind.TOPLEVEL_FIELD:
229 case AccessKind.TOPLEVEL_FINAL_FIELD:
226 return visitor.visitTopLevelFieldInvoke( 230 return visitor.visitTopLevelFieldInvoke(
227 node, 231 node,
228 semantics.element, 232 semantics.element,
229 node.argumentsNode, 233 node.argumentsNode,
230 callStructure, 234 callStructure,
231 arg); 235 arg);
232 case AccessKind.TOPLEVEL_METHOD: 236 case AccessKind.TOPLEVEL_METHOD:
233 return visitor.visitTopLevelFunctionInvoke( 237 return visitor.visitTopLevelFunctionInvoke(
234 node, 238 node,
235 semantics.element, 239 semantics.element,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 node.argumentsNode, 295 node.argumentsNode,
292 callStructure, 296 callStructure,
293 arg); 297 arg);
294 case AccessKind.THIS_PROPERTY: 298 case AccessKind.THIS_PROPERTY:
295 return visitor.visitThisPropertyInvoke( 299 return visitor.visitThisPropertyInvoke(
296 node, 300 node,
297 node.argumentsNode, 301 node.argumentsNode,
298 selector, 302 selector,
299 arg); 303 arg);
300 case AccessKind.SUPER_FIELD: 304 case AccessKind.SUPER_FIELD:
305 case AccessKind.SUPER_FINAL_FIELD:
301 return visitor.visitSuperFieldInvoke( 306 return visitor.visitSuperFieldInvoke(
302 node, 307 node,
303 semantics.element, 308 semantics.element,
304 node.argumentsNode, 309 node.argumentsNode,
305 callStructure, 310 callStructure,
306 arg); 311 arg);
307 case AccessKind.SUPER_METHOD: 312 case AccessKind.SUPER_METHOD:
308 return visitor.visitSuperMethodInvoke( 313 return visitor.visitSuperMethodInvoke(
309 node, 314 node,
310 semantics.element, 315 semantics.element,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 node, 428 node,
424 node.receiver, 429 node.receiver,
425 selector, 430 selector,
426 arg); 431 arg);
427 case AccessKind.LOCAL_FUNCTION: 432 case AccessKind.LOCAL_FUNCTION:
428 return visitor.visitLocalFunctionGet( 433 return visitor.visitLocalFunctionGet(
429 node, 434 node,
430 semantics.element, 435 semantics.element,
431 arg); 436 arg);
432 case AccessKind.LOCAL_VARIABLE: 437 case AccessKind.LOCAL_VARIABLE:
438 case AccessKind.FINAL_LOCAL_VARIABLE:
433 return visitor.visitLocalVariableGet( 439 return visitor.visitLocalVariableGet(
434 node, 440 node,
435 semantics.element, 441 semantics.element,
436 arg); 442 arg);
437 case AccessKind.PARAMETER: 443 case AccessKind.PARAMETER:
444 case AccessKind.FINAL_PARAMETER:
438 return visitor.visitParameterGet( 445 return visitor.visitParameterGet(
439 node, 446 node,
440 semantics.element, 447 semantics.element,
441 arg); 448 arg);
442 case AccessKind.STATIC_FIELD: 449 case AccessKind.STATIC_FIELD:
450 case AccessKind.STATIC_FINAL_FIELD:
443 return visitor.visitStaticFieldGet( 451 return visitor.visitStaticFieldGet(
444 node, 452 node,
445 semantics.element, 453 semantics.element,
446 arg); 454 arg);
447 case AccessKind.STATIC_METHOD: 455 case AccessKind.STATIC_METHOD:
448 return visitor.visitStaticFunctionGet( 456 return visitor.visitStaticFunctionGet(
449 node, 457 node,
450 semantics.element, 458 semantics.element,
451 arg); 459 arg);
452 case AccessKind.STATIC_GETTER: 460 case AccessKind.STATIC_GETTER:
453 return visitor.visitStaticGetterGet( 461 return visitor.visitStaticGetterGet(
454 node, 462 node,
455 semantics.element, 463 semantics.element,
456 arg); 464 arg);
457 case AccessKind.STATIC_SETTER: 465 case AccessKind.STATIC_SETTER:
458 return visitor.errorStaticSetterGet( 466 return visitor.errorStaticSetterGet(
459 node, 467 node,
460 semantics.element, 468 semantics.element,
461 arg); 469 arg);
462 case AccessKind.TOPLEVEL_FIELD: 470 case AccessKind.TOPLEVEL_FIELD:
471 case AccessKind.TOPLEVEL_FINAL_FIELD:
463 return visitor.visitTopLevelFieldGet( 472 return visitor.visitTopLevelFieldGet(
464 node, 473 node,
465 semantics.element, 474 semantics.element,
466 arg); 475 arg);
467 case AccessKind.TOPLEVEL_METHOD: 476 case AccessKind.TOPLEVEL_METHOD:
468 return visitor.visitTopLevelFunctionGet( 477 return visitor.visitTopLevelFunctionGet(
469 node, 478 node,
470 semantics.element, 479 semantics.element,
471 arg); 480 arg);
472 case AccessKind.TOPLEVEL_GETTER: 481 case AccessKind.TOPLEVEL_GETTER:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 break; 513 break;
505 case AccessKind.THIS: 514 case AccessKind.THIS:
506 // TODO(johnniwinther): Handle this when `this` is a [Send]. 515 // TODO(johnniwinther): Handle this when `this` is a [Send].
507 break; 516 break;
508 case AccessKind.THIS_PROPERTY: 517 case AccessKind.THIS_PROPERTY:
509 return visitor.visitThisPropertyGet( 518 return visitor.visitThisPropertyGet(
510 node, 519 node,
511 selector, 520 selector,
512 arg); 521 arg);
513 case AccessKind.SUPER_FIELD: 522 case AccessKind.SUPER_FIELD:
523 case AccessKind.SUPER_FINAL_FIELD:
514 return visitor.visitSuperFieldGet( 524 return visitor.visitSuperFieldGet(
515 node, 525 node,
516 semantics.element, 526 semantics.element,
517 arg); 527 arg);
518 case AccessKind.SUPER_METHOD: 528 case AccessKind.SUPER_METHOD:
519 return visitor.visitSuperMethodGet( 529 return visitor.visitSuperMethodGet(
520 node, 530 node,
521 semantics.element, 531 semantics.element,
522 arg); 532 arg);
523 case AccessKind.SUPER_GETTER: 533 case AccessKind.SUPER_GETTER:
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 node, 589 node,
580 semantics.element, 590 semantics.element,
581 node.arguments.single, 591 node.arguments.single,
582 arg); 592 arg);
583 case AccessKind.LOCAL_VARIABLE: 593 case AccessKind.LOCAL_VARIABLE:
584 return visitor.visitLocalVariableSet( 594 return visitor.visitLocalVariableSet(
585 node, 595 node,
586 semantics.element, 596 semantics.element,
587 node.arguments.single, 597 node.arguments.single,
588 arg); 598 arg);
599 case AccessKind.FINAL_LOCAL_VARIABLE:
600 return visitor.errorFinalLocalVariableSet(
601 node,
602 semantics.element,
603 node.arguments.single,
604 arg);
589 case AccessKind.PARAMETER: 605 case AccessKind.PARAMETER:
590 return visitor.visitParameterSet( 606 return visitor.visitParameterSet(
591 node, 607 node,
592 semantics.element, 608 semantics.element,
593 node.arguments.single, 609 node.arguments.single,
594 arg); 610 arg);
611 case AccessKind.FINAL_PARAMETER:
612 return visitor.errorFinalParameterSet(
613 node,
614 semantics.element,
615 node.arguments.single,
616 arg);
595 case AccessKind.STATIC_FIELD: 617 case AccessKind.STATIC_FIELD:
596 return visitor.visitStaticFieldSet( 618 return visitor.visitStaticFieldSet(
597 node, 619 node,
598 semantics.element, 620 semantics.element,
599 node.arguments.single, 621 node.arguments.single,
600 arg); 622 arg);
623 case AccessKind.STATIC_FINAL_FIELD:
624 return visitor.errorFinalStaticFieldSet(
625 node,
626 semantics.element,
627 node.arguments.single,
628 arg);
601 case AccessKind.STATIC_METHOD: 629 case AccessKind.STATIC_METHOD:
602 return visitor.errorStaticFunctionSet( 630 return visitor.errorStaticFunctionSet(
603 node, 631 node,
604 semantics.element, 632 semantics.element,
605 node.arguments.single, 633 node.arguments.single,
606 arg); 634 arg);
607 case AccessKind.STATIC_GETTER: 635 case AccessKind.STATIC_GETTER:
608 return visitor.errorStaticGetterSet( 636 return visitor.errorStaticGetterSet(
609 node, 637 node,
610 semantics.element, 638 semantics.element,
611 node.arguments.single, 639 node.arguments.single,
612 arg); 640 arg);
613 case AccessKind.STATIC_SETTER: 641 case AccessKind.STATIC_SETTER:
614 return visitor.visitStaticSetterSet( 642 return visitor.visitStaticSetterSet(
615 node, 643 node,
616 semantics.element, 644 semantics.element,
617 node.arguments.single, 645 node.arguments.single,
618 arg); 646 arg);
619 case AccessKind.TOPLEVEL_FIELD: 647 case AccessKind.TOPLEVEL_FIELD:
620 return visitor.visitTopLevelFieldSet( 648 return visitor.visitTopLevelFieldSet(
621 node, 649 node,
622 semantics.element, 650 semantics.element,
623 node.arguments.single, 651 node.arguments.single,
624 arg); 652 arg);
653 case AccessKind.TOPLEVEL_FINAL_FIELD:
654 return visitor.errorFinalTopLevelFieldSet(
655 node,
656 semantics.element,
657 node.arguments.single,
658 arg);
625 case AccessKind.TOPLEVEL_METHOD: 659 case AccessKind.TOPLEVEL_METHOD:
626 return visitor.errorTopLevelFunctionSet( 660 return visitor.errorTopLevelFunctionSet(
627 node, 661 node,
628 semantics.element, 662 semantics.element,
629 node.arguments.single, 663 node.arguments.single,
630 arg); 664 arg);
631 case AccessKind.TOPLEVEL_GETTER: 665 case AccessKind.TOPLEVEL_GETTER:
632 return visitor.errorTopLevelGetterSet( 666 return visitor.errorTopLevelGetterSet(
633 node, 667 node,
634 semantics.element, 668 semantics.element,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 node, 709 node,
676 selector, 710 selector,
677 node.arguments.single, 711 node.arguments.single,
678 arg); 712 arg);
679 case AccessKind.SUPER_FIELD: 713 case AccessKind.SUPER_FIELD:
680 return visitor.visitSuperFieldSet( 714 return visitor.visitSuperFieldSet(
681 node, 715 node,
682 semantics.element, 716 semantics.element,
683 node.arguments.single, 717 node.arguments.single,
684 arg); 718 arg);
719 case AccessKind.SUPER_FINAL_FIELD:
720 return visitor.errorFinalSuperFieldSet(
721 node,
722 semantics.element,
723 node.arguments.single,
724 arg);
685 case AccessKind.SUPER_METHOD: 725 case AccessKind.SUPER_METHOD:
686 return visitor.errorSuperMethodSet( 726 return visitor.errorSuperMethodSet(
687 node, 727 node,
688 semantics.element, 728 semantics.element,
689 node.arguments.single, 729 node.arguments.single,
690 arg); 730 arg);
691 case AccessKind.SUPER_GETTER: 731 case AccessKind.SUPER_GETTER:
692 return visitor.errorSuperGetterSet( 732 return visitor.errorSuperGetterSet(
693 node, 733 node,
694 semantics.element, 734 semantics.element,
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 case AccessKind.DYNAMIC_PROPERTY: 1243 case AccessKind.DYNAMIC_PROPERTY:
1204 return visitor.visitDynamicPropertyCompound( 1244 return visitor.visitDynamicPropertyCompound(
1205 node, 1245 node,
1206 node.receiver, 1246 node.receiver,
1207 operator, 1247 operator,
1208 node.arguments.single, 1248 node.arguments.single,
1209 getterSelector, 1249 getterSelector,
1210 setterSelector, 1250 setterSelector,
1211 arg); 1251 arg);
1212 case AccessKind.LOCAL_FUNCTION: 1252 case AccessKind.LOCAL_FUNCTION:
1213 return visitor.errorLocalFunctionCompound( 1253 return visitor.visitLocalFunctionCompound(
1214 node, 1254 node,
1215 semantics.element, 1255 semantics.element,
1216 operator, 1256 operator,
1217 node.arguments.single, 1257 node.arguments.single,
1218 arg); 1258 arg);
1219 case AccessKind.LOCAL_VARIABLE: 1259 case AccessKind.LOCAL_VARIABLE:
1220 return visitor.visitLocalVariableCompound( 1260 return visitor.visitLocalVariableCompound(
1221 node, 1261 node,
1222 semantics.element, 1262 semantics.element,
1223 operator, 1263 operator,
1224 node.arguments.single, 1264 node.arguments.single,
1225 arg); 1265 arg);
1266 case AccessKind.FINAL_LOCAL_VARIABLE:
1267 return visitor.visitFinalLocalVariableCompound(
1268 node,
1269 semantics.element,
1270 operator,
1271 node.arguments.single,
1272 arg);
1226 case AccessKind.PARAMETER: 1273 case AccessKind.PARAMETER:
1227 return visitor.visitParameterCompound( 1274 return visitor.visitParameterCompound(
1228 node, 1275 node,
1229 semantics.element, 1276 semantics.element,
1230 operator, 1277 operator,
1231 node.arguments.single, 1278 node.arguments.single,
1232 arg); 1279 arg);
1280 case AccessKind.FINAL_PARAMETER:
1281 return visitor.visitFinalParameterCompound(
1282 node,
1283 semantics.element,
1284 operator,
1285 node.arguments.single,
1286 arg);
1233 case AccessKind.STATIC_FIELD: 1287 case AccessKind.STATIC_FIELD:
1234 return visitor.visitStaticFieldCompound( 1288 return visitor.visitStaticFieldCompound(
1235 node, 1289 node,
1236 semantics.element, 1290 semantics.element,
1237 operator, 1291 operator,
1238 node.arguments.single, 1292 node.arguments.single,
1239 arg); 1293 arg);
1294 case AccessKind.STATIC_FINAL_FIELD:
1295 return visitor.visitStaticFinalFieldCompound(
1296 node,
1297 semantics.element,
1298 operator,
1299 node.arguments.single,
1300 arg);
1240 case AccessKind.STATIC_METHOD: 1301 case AccessKind.STATIC_METHOD:
1241 // TODO(johnniwinther): Handle this. 1302 return visitor.visitStaticMethodCompound(
1242 break; 1303 node,
1304 semantics.element,
1305 operator,
1306 node.arguments.single,
1307 arg);
1243 case AccessKind.STATIC_GETTER: 1308 case AccessKind.STATIC_GETTER:
1244 // This is not a valid case. 1309 // This is not a valid case.
1245 break; 1310 break;
1246 case AccessKind.STATIC_SETTER: 1311 case AccessKind.STATIC_SETTER:
1247 // This is not a valid case. 1312 // This is not a valid case.
1248 break; 1313 break;
1249 case AccessKind.TOPLEVEL_FIELD: 1314 case AccessKind.TOPLEVEL_FIELD:
1250 return visitor.visitTopLevelFieldCompound( 1315 return visitor.visitTopLevelFieldCompound(
1251 node, 1316 node,
1252 semantics.element, 1317 semantics.element,
1253 operator, 1318 operator,
1254 node.arguments.single, 1319 node.arguments.single,
1255 arg); 1320 arg);
1321 case AccessKind.TOPLEVEL_FINAL_FIELD:
1322 return visitor.visitTopLevelFinalFieldCompound(
1323 node,
1324 semantics.element,
1325 operator,
1326 node.arguments.single,
1327 arg);
1256 case AccessKind.TOPLEVEL_METHOD: 1328 case AccessKind.TOPLEVEL_METHOD:
1257 // TODO(johnniwinther): Handle this. 1329 return visitor.visitTopLevelMethodCompound(
1258 break; 1330 node,
1331 semantics.element,
1332 operator,
1333 node.arguments.single,
1334 arg);
1259 case AccessKind.TOPLEVEL_GETTER: 1335 case AccessKind.TOPLEVEL_GETTER:
1260 // This is not a valid case. 1336 // This is not a valid case.
1261 break; 1337 break;
1262 case AccessKind.TOPLEVEL_SETTER: 1338 case AccessKind.TOPLEVEL_SETTER:
1263 // This is not a valid case. 1339 // This is not a valid case.
1264 break; 1340 break;
1265 case AccessKind.CLASS_TYPE_LITERAL: 1341 case AccessKind.CLASS_TYPE_LITERAL:
1266 return visitor.errorClassTypeLiteralCompound( 1342 return visitor.visitClassTypeLiteralCompound(
1267 node, 1343 node,
1268 semantics.constant, 1344 semantics.constant,
1269 operator, 1345 operator,
1270 node.arguments.single, 1346 node.arguments.single,
1271 arg); 1347 arg);
1272 case AccessKind.TYPEDEF_TYPE_LITERAL: 1348 case AccessKind.TYPEDEF_TYPE_LITERAL:
1273 return visitor.errorTypedefTypeLiteralCompound( 1349 return visitor.visitTypedefTypeLiteralCompound(
1274 node, 1350 node,
1275 semantics.constant, 1351 semantics.constant,
1276 operator, 1352 operator,
1277 node.arguments.single, 1353 node.arguments.single,
1278 arg); 1354 arg);
1279 case AccessKind.DYNAMIC_TYPE_LITERAL: 1355 case AccessKind.DYNAMIC_TYPE_LITERAL:
1280 return visitor.errorDynamicTypeLiteralCompound( 1356 return visitor.visitDynamicTypeLiteralCompound(
1281 node, 1357 node,
1282 semantics.constant, 1358 semantics.constant,
1283 operator, 1359 operator,
1284 node.arguments.single, 1360 node.arguments.single,
1285 arg); 1361 arg);
1286 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL: 1362 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
1287 return visitor.errorTypeVariableTypeLiteralCompound( 1363 return visitor.visitTypeVariableTypeLiteralCompound(
1288 node, 1364 node,
1289 semantics.element, 1365 semantics.element,
1290 operator, 1366 operator,
1291 node.arguments.single, 1367 node.arguments.single,
1292 arg); 1368 arg);
1293 case AccessKind.EXPRESSION: 1369 case AccessKind.EXPRESSION:
1294 // This is not a valid case. 1370 // This is not a valid case.
1295 break; 1371 break;
1296 case AccessKind.THIS: 1372 case AccessKind.THIS:
1297 // This is not a valid case. 1373 // This is not a valid case.
1298 break; 1374 break;
1299 case AccessKind.THIS_PROPERTY: 1375 case AccessKind.THIS_PROPERTY:
1300 return visitor.visitThisPropertyCompound( 1376 return visitor.visitThisPropertyCompound(
1301 node, 1377 node,
1302 operator, 1378 operator,
1303 node.arguments.single, 1379 node.arguments.single,
1304 getterSelector, 1380 getterSelector,
1305 setterSelector, 1381 setterSelector,
1306 arg); 1382 arg);
1307 case AccessKind.SUPER_FIELD: 1383 case AccessKind.SUPER_FIELD:
1308 return visitor.visitSuperFieldCompound( 1384 return visitor.visitSuperFieldCompound(
1309 node, 1385 node,
1310 semantics.element, 1386 semantics.element,
1311 operator, 1387 operator,
1312 node.arguments.single, 1388 node.arguments.single,
1313 arg); 1389 arg);
1390 case AccessKind.SUPER_FINAL_FIELD:
1391 return visitor.visitSuperFinalFieldCompound(
1392 node,
1393 semantics.element,
1394 operator,
1395 node.arguments.single,
1396 arg);
1314 case AccessKind.SUPER_METHOD: 1397 case AccessKind.SUPER_METHOD:
1315 // TODO(johnniwinther): Handle this. 1398 return visitor.visitSuperMethodCompound(
1316 break; 1399 node,
1400 semantics.element,
1401 operator,
1402 node.arguments.single,
1403 arg);
1317 case AccessKind.SUPER_GETTER: 1404 case AccessKind.SUPER_GETTER:
1318 // This is not a valid case. 1405 // This is not a valid case.
1319 break; 1406 break;
1320 case AccessKind.SUPER_SETTER: 1407 case AccessKind.SUPER_SETTER:
1321 // This is not a valid case. 1408 // This is not a valid case.
1322 break; 1409 break;
1323 case AccessKind.CONSTANT: 1410 case AccessKind.CONSTANT:
1324 // TODO(johnniwinther): Should this be a valid case? 1411 // TODO(johnniwinther): Should this be a valid case?
1325 break; 1412 break;
1326 case AccessKind.UNRESOLVED_SUPER: 1413 case AccessKind.UNRESOLVED_SUPER:
1327 case AccessKind.UNRESOLVED: 1414 return visitor.visitUnresolvedSuperCompound(
1328 // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
1329 return visitor.errorUnresolvedCompound(
1330 node, 1415 node,
1331 semantics.element, 1416 semantics.element,
1332 operator, 1417 operator,
1418 node.arguments.single,
1419 arg);
1420 case AccessKind.UNRESOLVED:
1421 return visitor.visitUnresolvedCompound(
1422 node,
1423 semantics.element,
1424 operator,
1333 node.arguments.single, 1425 node.arguments.single,
1334 arg); 1426 arg);
1335 case AccessKind.COMPOUND: 1427 case AccessKind.COMPOUND:
1336 CompoundAccessSemantics compoundSemantics = semantics; 1428 CompoundAccessSemantics compoundSemantics = semantics;
1337 switch (compoundSemantics.compoundAccessKind) { 1429 switch (compoundSemantics.compoundAccessKind) {
1338 case CompoundAccessKind.STATIC_GETTER_SETTER: 1430 case CompoundAccessKind.STATIC_GETTER_SETTER:
1339 return visitor.visitStaticGetterSetterCompound( 1431 return visitor.visitStaticGetterSetterCompound(
1340 node, 1432 node,
1341 compoundSemantics.getter, 1433 compoundSemantics.getter,
1342 compoundSemantics.setter, 1434 compoundSemantics.setter,
1343 operator, 1435 operator,
1344 node.arguments.single, 1436 node.arguments.single,
1345 arg); 1437 arg);
1346 case CompoundAccessKind.STATIC_METHOD_SETTER: 1438 case CompoundAccessKind.STATIC_METHOD_SETTER:
1347 return visitor.visitStaticMethodSetterCompound( 1439 return visitor.visitStaticMethodSetterCompound(
1348 node, 1440 node,
1349 compoundSemantics.getter, 1441 compoundSemantics.getter,
1350 compoundSemantics.setter, 1442 compoundSemantics.setter,
1351 operator, 1443 operator,
1352 node.arguments.single, 1444 node.arguments.single,
1353 arg); 1445 arg);
1446 case CompoundAccessKind.UNRESOLVED_STATIC_GETTER:
1447 return visitor.visitUnresolvedStaticGetterCompound(
1448 node,
1449 compoundSemantics.getter,
1450 compoundSemantics.setter,
1451 operator,
1452 node.arguments.single,
1453 arg);
1454 case CompoundAccessKind.UNRESOLVED_STATIC_SETTER:
1455 return visitor.visitUnresolvedStaticSetterCompound(
1456 node,
1457 compoundSemantics.getter,
1458 compoundSemantics.setter,
1459 operator,
1460 node.arguments.single,
1461 arg);
1354 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER: 1462 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER:
1355 return visitor.visitTopLevelGetterSetterCompound( 1463 return visitor.visitTopLevelGetterSetterCompound(
1356 node, 1464 node,
1357 compoundSemantics.getter, 1465 compoundSemantics.getter,
1358 compoundSemantics.setter, 1466 compoundSemantics.setter,
1359 operator, 1467 operator,
1360 node.arguments.single, 1468 node.arguments.single,
1361 arg); 1469 arg);
1362 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER: 1470 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER:
1363 return visitor.visitTopLevelMethodSetterCompound( 1471 return visitor.visitTopLevelMethodSetterCompound(
1364 node, 1472 node,
1365 compoundSemantics.getter, 1473 compoundSemantics.getter,
1366 compoundSemantics.setter, 1474 compoundSemantics.setter,
1367 operator, 1475 operator,
1368 node.arguments.single, 1476 node.arguments.single,
1369 arg); 1477 arg);
1478 case CompoundAccessKind.UNRESOLVED_TOPLEVEL_GETTER:
1479 return visitor.visitUnresolvedTopLevelGetterCompound(
1480 node,
1481 compoundSemantics.getter,
1482 compoundSemantics.setter,
1483 operator,
1484 node.arguments.single,
1485 arg);
1486 case CompoundAccessKind.UNRESOLVED_TOPLEVEL_SETTER:
1487 return visitor.visitUnresolvedTopLevelSetterCompound(
1488 node,
1489 compoundSemantics.getter,
1490 compoundSemantics.setter,
1491 operator,
1492 node.arguments.single,
1493 arg);
1370 case CompoundAccessKind.SUPER_FIELD_FIELD: 1494 case CompoundAccessKind.SUPER_FIELD_FIELD:
1371 // TODO(johnniwinther): Handle this. 1495 // TODO(johnniwinther): Handle this.
1372 break; 1496 break;
1373 case CompoundAccessKind.SUPER_GETTER_SETTER: 1497 case CompoundAccessKind.SUPER_GETTER_SETTER:
1374 return visitor.visitSuperGetterSetterCompound( 1498 return visitor.visitSuperGetterSetterCompound(
1375 node, 1499 node,
1376 compoundSemantics.getter, 1500 compoundSemantics.getter,
1377 compoundSemantics.setter, 1501 compoundSemantics.setter,
1378 operator, 1502 operator,
1379 node.arguments.single, 1503 node.arguments.single,
(...skipping 16 matching lines...) Expand all
1396 arg); 1520 arg);
1397 case CompoundAccessKind.SUPER_FIELD_SETTER: 1521 case CompoundAccessKind.SUPER_FIELD_SETTER:
1398 return visitor.visitSuperFieldSetterCompound( 1522 return visitor.visitSuperFieldSetterCompound(
1399 node, 1523 node,
1400 compoundSemantics.getter, 1524 compoundSemantics.getter,
1401 compoundSemantics.setter, 1525 compoundSemantics.setter,
1402 operator, 1526 operator,
1403 node.arguments.single, 1527 node.arguments.single,
1404 arg); 1528 arg);
1405 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER: 1529 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
1406 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER: 1530 return visitor.visitUnresolvedSuperGetterCompound(
1407 // TODO(johnniwinther): Handle these separately.
1408 return visitor.errorUnresolvedCompound(
1409 node, 1531 node,
1410 semantics.element, 1532 compoundSemantics.getter,
1533 compoundSemantics.setter,
1411 operator, 1534 operator,
1412 node.arguments.single, 1535 node.arguments.single,
1413 arg); 1536 arg);
1414 break; 1537 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
1538 return visitor.visitUnresolvedSuperSetterCompound(
1539 node,
1540 compoundSemantics.getter,
1541 compoundSemantics.setter,
1542 operator,
1543 node.arguments.single,
1544 arg);
1415 } 1545 }
1416 break; 1546 break;
1417 } 1547 }
1418 throw new SpannableAssertionFailure(node, 1548 throw new SpannableAssertionFailure(node,
1419 "Invalid compound assigment: ${semantics}"); 1549 "Invalid compound assigment: ${semantics}");
1420 } 1550 }
1421 1551
1422 String toString() => 'compound($operator,$semantics)'; 1552 String toString() => 'compound($operator,$semantics)';
1423 } 1553 }
1424 1554
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 switch (semantics.kind) { 1650 switch (semantics.kind) {
1521 case AccessKind.DYNAMIC_PROPERTY: 1651 case AccessKind.DYNAMIC_PROPERTY:
1522 return visitor.visitDynamicPropertyPrefix( 1652 return visitor.visitDynamicPropertyPrefix(
1523 node, 1653 node,
1524 node.receiver, 1654 node.receiver,
1525 operator, 1655 operator,
1526 getterSelector, 1656 getterSelector,
1527 setterSelector, 1657 setterSelector,
1528 arg); 1658 arg);
1529 case AccessKind.LOCAL_FUNCTION: 1659 case AccessKind.LOCAL_FUNCTION:
1530 return visitor.errorLocalFunctionPrefix( 1660 return visitor.visitLocalFunctionPrefix(
1531 node, 1661 node,
1532 semantics.element, 1662 semantics.element,
1533 operator, 1663 operator,
1534 arg); 1664 arg);
1535 case AccessKind.LOCAL_VARIABLE: 1665 case AccessKind.LOCAL_VARIABLE:
1536 return visitor.visitLocalVariablePrefix( 1666 return visitor.visitLocalVariablePrefix(
1537 node, 1667 node,
1538 semantics.element, 1668 semantics.element,
1539 operator, 1669 operator,
1540 arg); 1670 arg);
1671 case AccessKind.FINAL_LOCAL_VARIABLE:
1672 return visitor.visitFinalLocalVariablePrefix(
1673 node,
1674 semantics.element,
1675 operator,
1676 arg);
1541 case AccessKind.PARAMETER: 1677 case AccessKind.PARAMETER:
1542 return visitor.visitParameterPrefix( 1678 return visitor.visitParameterPrefix(
1543 node, 1679 node,
1544 semantics.element, 1680 semantics.element,
1545 operator, 1681 operator,
1546 arg); 1682 arg);
1683 case AccessKind.FINAL_PARAMETER:
1684 return visitor.visitFinalParameterPrefix(
1685 node,
1686 semantics.element,
1687 operator,
1688 arg);
1547 case AccessKind.STATIC_FIELD: 1689 case AccessKind.STATIC_FIELD:
1548 return visitor.visitStaticFieldPrefix( 1690 return visitor.visitStaticFieldPrefix(
1549 node, 1691 node,
1550 semantics.element, 1692 semantics.element,
1551 operator, 1693 operator,
1552 arg); 1694 arg);
1695 case AccessKind.STATIC_FINAL_FIELD:
1696 return visitor.visitStaticFinalFieldPrefix(
1697 node,
1698 semantics.element,
1699 operator,
1700 arg);
1553 case AccessKind.STATIC_METHOD: 1701 case AccessKind.STATIC_METHOD:
1554 // TODO(johnniwinther): Handle this. 1702 return visitor.visitStaticMethodPrefix(
1555 break; 1703 node,
1704 semantics.element,
1705 operator,
1706 arg);
1556 case AccessKind.STATIC_GETTER: 1707 case AccessKind.STATIC_GETTER:
1557 // This is not a valid case. 1708 // This is not a valid case.
1558 break; 1709 break;
1559 case AccessKind.STATIC_SETTER: 1710 case AccessKind.STATIC_SETTER:
1560 // This is not a valid case. 1711 // This is not a valid case.
1561 break; 1712 break;
1562 case AccessKind.TOPLEVEL_FIELD: 1713 case AccessKind.TOPLEVEL_FIELD:
1563 return visitor.visitTopLevelFieldPrefix( 1714 return visitor.visitTopLevelFieldPrefix(
1564 node, 1715 node,
1565 semantics.element, 1716 semantics.element,
1566 operator, 1717 operator,
1567 arg); 1718 arg);
1719 case AccessKind.TOPLEVEL_FINAL_FIELD:
1720 return visitor.visitTopLevelFinalFieldPrefix(
1721 node,
1722 semantics.element,
1723 operator,
1724 arg);
1568 case AccessKind.TOPLEVEL_METHOD: 1725 case AccessKind.TOPLEVEL_METHOD:
1569 // TODO(johnniwinther): Handle this. 1726 return visitor.visitTopLevelMethodPrefix(
1570 break; 1727 node,
1728 semantics.element,
1729 operator,
1730 arg);
1571 case AccessKind.TOPLEVEL_GETTER: 1731 case AccessKind.TOPLEVEL_GETTER:
1572 // This is not a valid case. 1732 // This is not a valid case.
1573 break; 1733 break;
1574 case AccessKind.TOPLEVEL_SETTER: 1734 case AccessKind.TOPLEVEL_SETTER:
1575 // This is not a valid case. 1735 // This is not a valid case.
1576 break; 1736 break;
1577 case AccessKind.CLASS_TYPE_LITERAL: 1737 case AccessKind.CLASS_TYPE_LITERAL:
1578 return visitor.errorClassTypeLiteralPrefix( 1738 return visitor.visitClassTypeLiteralPrefix(
1579 node, 1739 node,
1580 semantics.constant, 1740 semantics.constant,
1581 operator, 1741 operator,
1582 arg); 1742 arg);
1583 case AccessKind.TYPEDEF_TYPE_LITERAL: 1743 case AccessKind.TYPEDEF_TYPE_LITERAL:
1584 return visitor.errorTypedefTypeLiteralPrefix( 1744 return visitor.visitTypedefTypeLiteralPrefix(
1585 node, 1745 node,
1586 semantics.constant, 1746 semantics.constant,
1587 operator, 1747 operator,
1588 arg); 1748 arg);
1589 case AccessKind.DYNAMIC_TYPE_LITERAL: 1749 case AccessKind.DYNAMIC_TYPE_LITERAL:
1590 return visitor.errorDynamicTypeLiteralPrefix( 1750 return visitor.visitDynamicTypeLiteralPrefix(
1591 node, 1751 node,
1592 semantics.constant, 1752 semantics.constant,
1593 operator, 1753 operator,
1594 arg); 1754 arg);
1595 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL: 1755 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
1596 return visitor.errorTypeVariableTypeLiteralPrefix( 1756 return visitor.visitTypeVariableTypeLiteralPrefix(
1597 node, 1757 node,
1598 semantics.element, 1758 semantics.element,
1599 operator, 1759 operator,
1600 arg); 1760 arg);
1601 case AccessKind.EXPRESSION: 1761 case AccessKind.EXPRESSION:
1602 // This is not a valid case. 1762 // This is not a valid case.
1603 break; 1763 break;
1604 case AccessKind.THIS: 1764 case AccessKind.THIS:
1605 // This is not a valid case. 1765 // This is not a valid case.
1606 break; 1766 break;
1607 case AccessKind.THIS_PROPERTY: 1767 case AccessKind.THIS_PROPERTY:
1608 return visitor.visitThisPropertyPrefix( 1768 return visitor.visitThisPropertyPrefix(
1609 node, 1769 node,
1610 operator, 1770 operator,
1611 getterSelector, 1771 getterSelector,
1612 setterSelector, 1772 setterSelector,
1613 arg); 1773 arg);
1614 case AccessKind.SUPER_FIELD: 1774 case AccessKind.SUPER_FIELD:
1615 return visitor.visitSuperFieldPrefix( 1775 return visitor.visitSuperFieldPrefix(
1616 node, 1776 node,
1617 semantics.element, 1777 semantics.element,
1618 operator, 1778 operator,
1619 arg); 1779 arg);
1780 case AccessKind.SUPER_FINAL_FIELD:
1781 return visitor.visitSuperFinalFieldPrefix(
1782 node,
1783 semantics.element,
1784 operator,
1785 arg);
1620 case AccessKind.SUPER_METHOD: 1786 case AccessKind.SUPER_METHOD:
1621 // TODO(johnniwinther): Handle this. 1787 return visitor.visitSuperMethodPrefix(
1622 break; 1788 node,
1789 semantics.element,
1790 operator,
1791 arg);
1623 case AccessKind.SUPER_GETTER: 1792 case AccessKind.SUPER_GETTER:
1624 // This is not a valid case. 1793 // This is not a valid case.
1625 break; 1794 break;
1626 case AccessKind.SUPER_SETTER: 1795 case AccessKind.SUPER_SETTER:
1627 // This is not a valid case. 1796 // This is not a valid case.
1628 break; 1797 break;
1629 case AccessKind.CONSTANT: 1798 case AccessKind.CONSTANT:
1630 // TODO(johnniwinther): Should this be a valid case? 1799 // TODO(johnniwinther): Should this be a valid case?
1631 break; 1800 break;
1632 case AccessKind.UNRESOLVED_SUPER: 1801 case AccessKind.UNRESOLVED_SUPER:
1633 case AccessKind.UNRESOLVED: 1802 return visitor.visitUnresolvedSuperPrefix(
1634 // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
1635 return visitor.errorUnresolvedPrefix(
1636 node, 1803 node,
1637 semantics.element, 1804 semantics.element,
1638 operator, 1805 operator,
1806 arg);
1807 case AccessKind.UNRESOLVED:
1808 return visitor.visitUnresolvedPrefix(
1809 node,
1810 semantics.element,
1811 operator,
1639 arg); 1812 arg);
1640 case AccessKind.COMPOUND: 1813 case AccessKind.COMPOUND:
1641 CompoundAccessSemantics compoundSemantics = semantics; 1814 CompoundAccessSemantics compoundSemantics = semantics;
1642 switch (compoundSemantics.compoundAccessKind) { 1815 switch (compoundSemantics.compoundAccessKind) {
1643 case CompoundAccessKind.STATIC_GETTER_SETTER: 1816 case CompoundAccessKind.STATIC_GETTER_SETTER:
1644 return visitor.visitStaticGetterSetterPrefix( 1817 return visitor.visitStaticGetterSetterPrefix(
1645 node, 1818 node,
1646 compoundSemantics.getter, 1819 compoundSemantics.getter,
1647 compoundSemantics.setter, 1820 compoundSemantics.setter,
1648 operator, 1821 operator,
1649 arg); 1822 arg);
1650 case CompoundAccessKind.STATIC_METHOD_SETTER: 1823 case CompoundAccessKind.STATIC_METHOD_SETTER:
1651 return visitor.visitStaticMethodSetterPrefix( 1824 return visitor.visitStaticMethodSetterPrefix(
1652 node, 1825 node,
1653 compoundSemantics.getter, 1826 compoundSemantics.getter,
1654 compoundSemantics.setter, 1827 compoundSemantics.setter,
1655 operator, 1828 operator,
1656 arg); 1829 arg);
1830 case CompoundAccessKind.UNRESOLVED_STATIC_GETTER:
1831 return visitor.visitUnresolvedStaticGetterPrefix(
1832 node,
1833 compoundSemantics.getter,
1834 compoundSemantics.setter,
1835 operator,
1836 arg);
1837 case CompoundAccessKind.UNRESOLVED_STATIC_SETTER:
1838 return visitor.visitUnresolvedStaticSetterPrefix(
1839 node,
1840 compoundSemantics.getter,
1841 compoundSemantics.setter,
1842 operator,
1843 arg);
1844 case CompoundAccessKind.STATIC_METHOD_SETTER:
1845 return visitor.visitStaticMethodSetterPrefix(
1846 node,
1847 compoundSemantics.getter,
1848 compoundSemantics.setter,
1849 operator,
1850 arg);
1657 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER: 1851 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER:
1658 return visitor.visitTopLevelGetterSetterPrefix( 1852 return visitor.visitTopLevelGetterSetterPrefix(
1659 node, 1853 node,
1660 compoundSemantics.getter, 1854 compoundSemantics.getter,
1661 compoundSemantics.setter, 1855 compoundSemantics.setter,
1662 operator, 1856 operator,
1663 arg); 1857 arg);
1664 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER: 1858 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER:
1665 return visitor.visitTopLevelMethodSetterPrefix( 1859 return visitor.visitTopLevelMethodSetterPrefix(
1666 node, 1860 node,
1667 compoundSemantics.getter, 1861 compoundSemantics.getter,
1668 compoundSemantics.setter, 1862 compoundSemantics.setter,
1669 operator, 1863 operator,
1670 arg); 1864 arg);
1865 case CompoundAccessKind.UNRESOLVED_TOPLEVEL_GETTER:
1866 return visitor.visitUnresolvedTopLevelGetterPrefix(
1867 node,
1868 compoundSemantics.getter,
1869 compoundSemantics.setter,
1870 operator,
1871 arg);
1872 case CompoundAccessKind.UNRESOLVED_TOPLEVEL_SETTER:
1873 return visitor.visitUnresolvedTopLevelSetterPrefix(
1874 node,
1875 compoundSemantics.getter,
1876 compoundSemantics.setter,
1877 operator,
1878 arg);
1671 case CompoundAccessKind.SUPER_FIELD_FIELD: 1879 case CompoundAccessKind.SUPER_FIELD_FIELD:
1672 return visitor.visitSuperFieldFieldPrefix( 1880 return visitor.visitSuperFieldFieldPrefix(
1673 node, 1881 node,
1674 compoundSemantics.getter, 1882 compoundSemantics.getter,
1675 compoundSemantics.setter, 1883 compoundSemantics.setter,
1676 operator, 1884 operator,
1677 arg); 1885 arg);
1678 case CompoundAccessKind.SUPER_GETTER_SETTER: 1886 case CompoundAccessKind.SUPER_GETTER_SETTER:
1679 return visitor.visitSuperGetterSetterPrefix( 1887 return visitor.visitSuperGetterSetterPrefix(
1680 node, 1888 node,
(...skipping 16 matching lines...) Expand all
1697 operator, 1905 operator,
1698 arg); 1906 arg);
1699 case CompoundAccessKind.SUPER_FIELD_SETTER: 1907 case CompoundAccessKind.SUPER_FIELD_SETTER:
1700 return visitor.visitSuperFieldSetterPrefix( 1908 return visitor.visitSuperFieldSetterPrefix(
1701 node, 1909 node,
1702 compoundSemantics.getter, 1910 compoundSemantics.getter,
1703 compoundSemantics.setter, 1911 compoundSemantics.setter,
1704 operator, 1912 operator,
1705 arg); 1913 arg);
1706 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER: 1914 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
1915 return visitor.visitUnresolvedSuperGetterPrefix(
1916 node,
1917 compoundSemantics.getter,
1918 compoundSemantics.setter,
1919 operator,
1920 arg);
1707 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER: 1921 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
1708 // TODO(johnniwinther): Handle these directly. 1922 return visitor.visitUnresolvedSuperSetterPrefix(
1709 return visitor.errorUnresolvedPrefix(
1710 node, 1923 node,
1711 semantics.element, 1924 compoundSemantics.getter,
1925 compoundSemantics.setter,
1712 operator, 1926 operator,
1713 arg); 1927 arg);
1714 } 1928 }
1715 } 1929 }
1716 throw new SpannableAssertionFailure(node, 1930 throw new SpannableAssertionFailure(node,
1717 "Invalid compound assigment: ${semantics}"); 1931 "Invalid compound assigment: ${semantics}");
1718 } 1932 }
1719 1933
1720 String toString() => 'prefix($operator,$semantics)'; 1934 String toString() => 'prefix($operator,$semantics)';
1721 } 1935 }
(...skipping 22 matching lines...) Expand all
1744 switch (semantics.kind) { 1958 switch (semantics.kind) {
1745 case AccessKind.DYNAMIC_PROPERTY: 1959 case AccessKind.DYNAMIC_PROPERTY:
1746 return visitor.visitDynamicPropertyPostfix( 1960 return visitor.visitDynamicPropertyPostfix(
1747 node, 1961 node,
1748 node.receiver, 1962 node.receiver,
1749 operator, 1963 operator,
1750 getterSelector, 1964 getterSelector,
1751 setterSelector, 1965 setterSelector,
1752 arg); 1966 arg);
1753 case AccessKind.LOCAL_FUNCTION: 1967 case AccessKind.LOCAL_FUNCTION:
1754 return visitor.errorLocalFunctionPostfix( 1968 return visitor.visitLocalFunctionPostfix(
1755 node, 1969 node,
1756 semantics.element, 1970 semantics.element,
1757 operator, 1971 operator,
1758 arg); 1972 arg);
1759 case AccessKind.LOCAL_VARIABLE: 1973 case AccessKind.LOCAL_VARIABLE:
1760 return visitor.visitLocalVariablePostfix( 1974 return visitor.visitLocalVariablePostfix(
1761 node, 1975 node,
1762 semantics.element, 1976 semantics.element,
1763 operator, 1977 operator,
1764 arg); 1978 arg);
1979 case AccessKind.FINAL_LOCAL_VARIABLE:
1980 return visitor.visitFinalLocalVariablePostfix(
1981 node,
1982 semantics.element,
1983 operator,
1984 arg);
1765 case AccessKind.PARAMETER: 1985 case AccessKind.PARAMETER:
1766 return visitor.visitParameterPostfix( 1986 return visitor.visitParameterPostfix(
1767 node, 1987 node,
1768 semantics.element, 1988 semantics.element,
1769 operator, 1989 operator,
1770 arg); 1990 arg);
1991 case AccessKind.FINAL_PARAMETER:
1992 return visitor.visitFinalParameterPostfix(
1993 node,
1994 semantics.element,
1995 operator,
1996 arg);
1771 case AccessKind.STATIC_FIELD: 1997 case AccessKind.STATIC_FIELD:
1772 return visitor.visitStaticFieldPostfix( 1998 return visitor.visitStaticFieldPostfix(
1773 node, 1999 node,
1774 semantics.element, 2000 semantics.element,
1775 operator, 2001 operator,
1776 arg); 2002 arg);
2003 case AccessKind.STATIC_FINAL_FIELD:
2004 return visitor.visitStaticFinalFieldPostfix(
2005 node,
2006 semantics.element,
2007 operator,
2008 arg);
1777 case AccessKind.STATIC_METHOD: 2009 case AccessKind.STATIC_METHOD:
1778 // TODO(johnniwinther): Handle this. 2010 return visitor.visitStaticMethodPostfix(
1779 break; 2011 node,
2012 semantics.element,
2013 operator,
2014 arg);
1780 case AccessKind.STATIC_GETTER: 2015 case AccessKind.STATIC_GETTER:
1781 // This is not a valid case. 2016 // This is not a valid case.
1782 break; 2017 break;
1783 case AccessKind.STATIC_SETTER: 2018 case AccessKind.STATIC_SETTER:
1784 // This is not a valid case. 2019 // This is not a valid case.
1785 break; 2020 break;
1786 case AccessKind.TOPLEVEL_FIELD: 2021 case AccessKind.TOPLEVEL_FIELD:
1787 return visitor.visitTopLevelFieldPostfix( 2022 return visitor.visitTopLevelFieldPostfix(
1788 node, 2023 node,
1789 semantics.element, 2024 semantics.element,
1790 operator, 2025 operator,
1791 arg); 2026 arg);
2027 case AccessKind.TOPLEVEL_FINAL_FIELD:
2028 return visitor.visitTopLevelFinalFieldPostfix(
2029 node,
2030 semantics.element,
2031 operator,
2032 arg);
1792 case AccessKind.TOPLEVEL_METHOD: 2033 case AccessKind.TOPLEVEL_METHOD:
1793 // TODO(johnniwinther): Handle this. 2034 return visitor.visitTopLevelMethodPostfix(
1794 break; 2035 node,
2036 semantics.element,
2037 operator,
2038 arg);
1795 case AccessKind.TOPLEVEL_GETTER: 2039 case AccessKind.TOPLEVEL_GETTER:
1796 // This is not a valid case. 2040 // This is not a valid case.
1797 break; 2041 break;
1798 case AccessKind.TOPLEVEL_SETTER: 2042 case AccessKind.TOPLEVEL_SETTER:
1799 // This is not a valid case. 2043 // This is not a valid case.
1800 break; 2044 break;
1801 case AccessKind.CLASS_TYPE_LITERAL: 2045 case AccessKind.CLASS_TYPE_LITERAL:
1802 return visitor.errorClassTypeLiteralPostfix( 2046 return visitor.visitClassTypeLiteralPostfix(
1803 node, 2047 node,
1804 semantics.constant, 2048 semantics.constant,
1805 operator, 2049 operator,
1806 arg); 2050 arg);
1807 case AccessKind.TYPEDEF_TYPE_LITERAL: 2051 case AccessKind.TYPEDEF_TYPE_LITERAL:
1808 return visitor.errorTypedefTypeLiteralPostfix( 2052 return visitor.visitTypedefTypeLiteralPostfix(
1809 node, 2053 node,
1810 semantics.constant, 2054 semantics.constant,
1811 operator, 2055 operator,
1812 arg); 2056 arg);
1813 case AccessKind.DYNAMIC_TYPE_LITERAL: 2057 case AccessKind.DYNAMIC_TYPE_LITERAL:
1814 return visitor.errorDynamicTypeLiteralPostfix( 2058 return visitor.visitDynamicTypeLiteralPostfix(
1815 node, 2059 node,
1816 semantics.constant, 2060 semantics.constant,
1817 operator, 2061 operator,
1818 arg); 2062 arg);
1819 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL: 2063 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
1820 return visitor.errorTypeVariableTypeLiteralPostfix( 2064 return visitor.visitTypeVariableTypeLiteralPostfix(
1821 node, 2065 node,
1822 semantics.element, 2066 semantics.element,
1823 operator, 2067 operator,
1824 arg); 2068 arg);
1825 case AccessKind.EXPRESSION: 2069 case AccessKind.EXPRESSION:
1826 // This is not a valid case. 2070 // This is not a valid case.
1827 break; 2071 break;
1828 case AccessKind.THIS: 2072 case AccessKind.THIS:
1829 // This is not a valid case. 2073 // This is not a valid case.
1830 break; 2074 break;
1831 case AccessKind.THIS_PROPERTY: 2075 case AccessKind.THIS_PROPERTY:
1832 return visitor.visitThisPropertyPostfix( 2076 return visitor.visitThisPropertyPostfix(
1833 node, 2077 node,
1834 operator, 2078 operator,
1835 getterSelector, 2079 getterSelector,
1836 setterSelector, 2080 setterSelector,
1837 arg); 2081 arg);
1838 case AccessKind.SUPER_FIELD: 2082 case AccessKind.SUPER_FIELD:
1839 return visitor.visitSuperFieldPostfix( 2083 return visitor.visitSuperFieldPostfix(
1840 node, 2084 node,
1841 semantics.element, 2085 semantics.element,
1842 operator, 2086 operator,
1843 arg); 2087 arg);
2088 case AccessKind.SUPER_FINAL_FIELD:
2089 return visitor.visitSuperFinalFieldPostfix(
2090 node,
2091 semantics.element,
2092 operator,
2093 arg);
1844 case AccessKind.SUPER_METHOD: 2094 case AccessKind.SUPER_METHOD:
1845 // TODO(johnniwinther): Handle this. 2095 return visitor.visitSuperMethodPostfix(
1846 break; 2096 node,
2097 semantics.element,
2098 operator,
2099 arg);
1847 case AccessKind.SUPER_GETTER: 2100 case AccessKind.SUPER_GETTER:
1848 // This is not a valid case. 2101 // This is not a valid case.
1849 break; 2102 break;
1850 case AccessKind.SUPER_SETTER: 2103 case AccessKind.SUPER_SETTER:
1851 // This is not a valid case. 2104 // This is not a valid case.
1852 break; 2105 break;
1853 case AccessKind.CONSTANT: 2106 case AccessKind.CONSTANT:
1854 // TODO(johnniwinther): Should this be a valid case? 2107 // TODO(johnniwinther): Should this be a valid case?
1855 break; 2108 break;
1856 case AccessKind.UNRESOLVED_SUPER: 2109 case AccessKind.UNRESOLVED_SUPER:
1857 case AccessKind.UNRESOLVED: 2110 return visitor.visitUnresolvedSuperPostfix(
1858 // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
1859 return visitor.errorUnresolvedPostfix(
1860 node, 2111 node,
1861 semantics.element, 2112 semantics.element,
1862 operator, 2113 operator,
2114 arg);
2115 case AccessKind.UNRESOLVED:
2116 return visitor.visitUnresolvedPostfix(
2117 node,
2118 semantics.element,
2119 operator,
1863 arg); 2120 arg);
1864 case AccessKind.COMPOUND: 2121 case AccessKind.COMPOUND:
1865 CompoundAccessSemantics compoundSemantics = semantics; 2122 CompoundAccessSemantics compoundSemantics = semantics;
1866 switch (compoundSemantics.compoundAccessKind) { 2123 switch (compoundSemantics.compoundAccessKind) {
1867 case CompoundAccessKind.STATIC_GETTER_SETTER: 2124 case CompoundAccessKind.STATIC_GETTER_SETTER:
1868 return visitor.visitStaticGetterSetterPostfix( 2125 return visitor.visitStaticGetterSetterPostfix(
1869 node, 2126 node,
1870 compoundSemantics.getter, 2127 compoundSemantics.getter,
1871 compoundSemantics.setter, 2128 compoundSemantics.setter,
1872 operator, 2129 operator,
1873 arg); 2130 arg);
2131 case CompoundAccessKind.UNRESOLVED_STATIC_GETTER:
2132 return visitor.visitUnresolvedStaticGetterPostfix(
2133 node,
2134 compoundSemantics.getter,
2135 compoundSemantics.setter,
2136 operator,
2137 arg);
2138 case CompoundAccessKind.UNRESOLVED_STATIC_SETTER:
2139 return visitor.visitUnresolvedStaticSetterPostfix(
2140 node,
2141 compoundSemantics.getter,
2142 compoundSemantics.setter,
2143 operator,
2144 arg);
1874 case CompoundAccessKind.STATIC_METHOD_SETTER: 2145 case CompoundAccessKind.STATIC_METHOD_SETTER:
1875 return visitor.visitStaticMethodSetterPostfix( 2146 return visitor.visitStaticMethodSetterPostfix(
1876 node, 2147 node,
1877 compoundSemantics.getter, 2148 compoundSemantics.getter,
1878 compoundSemantics.setter, 2149 compoundSemantics.setter,
1879 operator, 2150 operator,
1880 arg); 2151 arg);
1881 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER: 2152 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER:
1882 return visitor.visitTopLevelGetterSetterPostfix( 2153 return visitor.visitTopLevelGetterSetterPostfix(
1883 node, 2154 node,
1884 compoundSemantics.getter, 2155 compoundSemantics.getter,
1885 compoundSemantics.setter, 2156 compoundSemantics.setter,
1886 operator, 2157 operator,
1887 arg); 2158 arg);
1888 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER: 2159 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER:
1889 return visitor.visitTopLevelMethodSetterPostfix( 2160 return visitor.visitTopLevelMethodSetterPostfix(
1890 node, 2161 node,
1891 compoundSemantics.getter, 2162 compoundSemantics.getter,
1892 compoundSemantics.setter, 2163 compoundSemantics.setter,
1893 operator, 2164 operator,
1894 arg); 2165 arg);
2166 case CompoundAccessKind.UNRESOLVED_TOPLEVEL_GETTER:
2167 return visitor.visitUnresolvedTopLevelGetterPostfix(
2168 node,
2169 compoundSemantics.getter,
2170 compoundSemantics.setter,
2171 operator,
2172 arg);
2173 case CompoundAccessKind.UNRESOLVED_TOPLEVEL_SETTER:
2174 return visitor.visitUnresolvedTopLevelSetterPostfix(
2175 node,
2176 compoundSemantics.getter,
2177 compoundSemantics.setter,
2178 operator,
2179 arg);
1895 case CompoundAccessKind.SUPER_FIELD_FIELD: 2180 case CompoundAccessKind.SUPER_FIELD_FIELD:
1896 return visitor.visitSuperFieldFieldPostfix( 2181 return visitor.visitSuperFieldFieldPostfix(
1897 node, 2182 node,
1898 compoundSemantics.getter, 2183 compoundSemantics.getter,
1899 compoundSemantics.setter, 2184 compoundSemantics.setter,
1900 operator, 2185 operator,
1901 arg); 2186 arg);
1902 case CompoundAccessKind.SUPER_GETTER_SETTER: 2187 case CompoundAccessKind.SUPER_GETTER_SETTER:
1903 return visitor.visitSuperGetterSetterPostfix( 2188 return visitor.visitSuperGetterSetterPostfix(
1904 node, 2189 node,
(...skipping 16 matching lines...) Expand all
1921 operator, 2206 operator,
1922 arg); 2207 arg);
1923 case CompoundAccessKind.SUPER_FIELD_SETTER: 2208 case CompoundAccessKind.SUPER_FIELD_SETTER:
1924 return visitor.visitSuperFieldSetterPostfix( 2209 return visitor.visitSuperFieldSetterPostfix(
1925 node, 2210 node,
1926 compoundSemantics.getter, 2211 compoundSemantics.getter,
1927 compoundSemantics.setter, 2212 compoundSemantics.setter,
1928 operator, 2213 operator,
1929 arg); 2214 arg);
1930 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER: 2215 case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
2216 return visitor.visitUnresolvedSuperGetterPostfix(
2217 node,
2218 compoundSemantics.getter,
2219 compoundSemantics.setter,
2220 operator,
2221 arg);
1931 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER: 2222 case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
1932 // TODO(johnniwinther): Handle these directly. 2223 return visitor.visitUnresolvedSuperSetterPostfix(
1933 return visitor.errorUnresolvedPostfix(
1934 node, 2224 node,
1935 semantics.element, 2225 compoundSemantics.getter,
2226 compoundSemantics.setter,
1936 operator, 2227 operator,
1937 arg); 2228 arg);
1938 } 2229 }
1939 } 2230 }
1940 throw new SpannableAssertionFailure(node, 2231 throw new SpannableAssertionFailure(node,
1941 "Invalid compound assigment: ${semantics}"); 2232 "Invalid compound assigment: ${semantics}");
1942 } 2233 }
1943 2234
1944 String toString() => 'postfix($operator,$semantics)'; 2235 String toString() => 'postfix($operator,$semantics)';
1945 } 2236 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 final ConstructorElement constructor; 2505 final ConstructorElement constructor;
2215 final Selector selector; 2506 final Selector selector;
2216 2507
2217 ThisConstructorInvokeStructure(this.constructor, this.selector); 2508 ThisConstructorInvokeStructure(this.constructor, this.selector);
2218 2509
2219 R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) { 2510 R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) {
2220 return visitor.visitThisConstructorInvoke( 2511 return visitor.visitThisConstructorInvoke(
2221 node, constructor, node.argumentsNode, selector, arg); 2512 node, constructor, node.argumentsNode, selector, arg);
2222 } 2513 }
2223 } 2514 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698