OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 serialization.summarize_const_expr; | 5 library serialization.summarize_const_expr; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
9 import 'package:analyzer/dart/element/type.dart' show DartType; | 9 import 'package:analyzer/dart/element/type.dart' show DartType; |
10 import 'package:analyzer/src/summary/format.dart'; | 10 import 'package:analyzer/src/summary/format.dart'; |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } else if (operator == TokenType.GT) { | 479 } else if (operator == TokenType.GT) { |
480 operations.add(UnlinkedExprOperation.greater); | 480 operations.add(UnlinkedExprOperation.greater); |
481 } else if (operator == TokenType.LT) { | 481 } else if (operator == TokenType.LT) { |
482 operations.add(UnlinkedExprOperation.less); | 482 operations.add(UnlinkedExprOperation.less); |
483 } else if (operator == TokenType.GT_EQ) { | 483 } else if (operator == TokenType.GT_EQ) { |
484 operations.add(UnlinkedExprOperation.greaterEqual); | 484 operations.add(UnlinkedExprOperation.greaterEqual); |
485 } else if (operator == TokenType.LT_EQ) { | 485 } else if (operator == TokenType.LT_EQ) { |
486 operations.add(UnlinkedExprOperation.lessEqual); | 486 operations.add(UnlinkedExprOperation.lessEqual); |
487 } else if (operator == TokenType.PERCENT) { | 487 } else if (operator == TokenType.PERCENT) { |
488 operations.add(UnlinkedExprOperation.modulo); | 488 operations.add(UnlinkedExprOperation.modulo); |
| 489 } else if (operator == TokenType.QUESTION_QUESTION) { |
| 490 operations.add(UnlinkedExprOperation.ifNull); |
489 } else { | 491 } else { |
490 throw new StateError('Unknown operator: $operator'); | 492 throw new StateError('Unknown operator: $operator'); |
491 } | 493 } |
492 } | 494 } |
493 | 495 |
494 void _serializeCascadeExpression(CascadeExpression expr) { | 496 void _serializeCascadeExpression(CascadeExpression expr) { |
495 _serialize(expr.target); | 497 _serialize(expr.target); |
496 for (Expression section in expr.cascadeSections) { | 498 for (Expression section in expr.cascadeSections) { |
497 operations.add(UnlinkedExprOperation.cascadeSectionBegin); | 499 operations.add(UnlinkedExprOperation.cascadeSectionBegin); |
498 _serialize(section); | 500 _serialize(section); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 if (typeArguments == null) { | 644 if (typeArguments == null) { |
643 ints.add(0); | 645 ints.add(0); |
644 } else { | 646 } else { |
645 ints.add(typeArguments.arguments.length); | 647 ints.add(typeArguments.arguments.length); |
646 for (TypeName typeName in typeArguments.arguments) { | 648 for (TypeName typeName in typeArguments.arguments) { |
647 references.add(serializeTypeName(typeName)); | 649 references.add(serializeTypeName(typeName)); |
648 } | 650 } |
649 } | 651 } |
650 } | 652 } |
651 } | 653 } |
OLD | NEW |