| 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 fasta.analyzer.ast_builder; | 5 library fasta.analyzer.ast_builder; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; | 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; |
| 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; | 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; |
| 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; | 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 debugEvent("OptionalFormalParameters"); | 586 debugEvent("OptionalFormalParameters"); |
| 587 push(new _OptionalFormalParameters(popList(count), beginToken, endToken)); | 587 push(new _OptionalFormalParameters(popList(count), beginToken, endToken)); |
| 588 } | 588 } |
| 589 | 589 |
| 590 void handleValuedFormalParameter(Token equals, Token token) { | 590 void handleValuedFormalParameter(Token equals, Token token) { |
| 591 debugEvent("ValuedFormalParameter"); | 591 debugEvent("ValuedFormalParameter"); |
| 592 Expression value = pop(); | 592 Expression value = pop(); |
| 593 push(new _ParameterDefaultValue(equals, value)); | 593 push(new _ParameterDefaultValue(equals, value)); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void handleFunctionType(Token functionToken, Token semicolon) { |
| 597 debugEvent("FunctionType"); |
| 598 FormalParameterList parameters = pop(); |
| 599 TypeParameterList typeParameters = pop(); |
| 600 TypeAnnotation returnType = pop(); |
| 601 push(ast.genericFunctionType(returnType, toAnalyzerToken(functionToken), |
| 602 typeParameters, parameters)); |
| 603 } |
| 604 |
| 596 void handleFormalParameterWithoutValue(Token token) { | 605 void handleFormalParameterWithoutValue(Token token) { |
| 597 debugEvent("FormalParameterWithoutValue"); | 606 debugEvent("FormalParameterWithoutValue"); |
| 598 push(NullValue.ParameterDefaultValue); | 607 push(NullValue.ParameterDefaultValue); |
| 599 } | 608 } |
| 600 | 609 |
| 601 void endFormalParameter( | 610 void endFormalParameter( |
| 602 Token covariantKeyword, Token thisKeyword, FormalParameterType kind) { | 611 Token covariantKeyword, Token thisKeyword, FormalParameterType kind) { |
| 603 debugEvent("FormalParameter"); | 612 debugEvent("FormalParameter"); |
| 604 _ParameterDefaultValue defaultValue = pop(); | 613 _ParameterDefaultValue defaultValue = pop(); |
| 605 | 614 |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 } else if (identical('static', s)) { | 1492 } else if (identical('static', s)) { |
| 1484 staticKeyword = token; | 1493 staticKeyword = token; |
| 1485 } else if (identical('var', s)) { | 1494 } else if (identical('var', s)) { |
| 1486 finalConstOrVarKeyword = token; | 1495 finalConstOrVarKeyword = token; |
| 1487 } else { | 1496 } else { |
| 1488 internalError('Unhandled modifier: $s'); | 1497 internalError('Unhandled modifier: $s'); |
| 1489 } | 1498 } |
| 1490 } | 1499 } |
| 1491 } | 1500 } |
| 1492 } | 1501 } |
| OLD | NEW |