| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:front_end/src/fasta/deprecated_problems.dart' | 5 import 'package:front_end/src/fasta/deprecated_problems.dart' |
| 6 show deprecated_internalProblem; | 6 show deprecated_internalProblem; |
| 7 import 'package:front_end/src/fasta/fasta_codes.dart' show FastaMessage; | 7 import 'package:front_end/src/fasta/messages.dart' show Message; |
| 8 import 'package:front_end/src/fasta/parser/identifier_context.dart'; | 8 import 'package:front_end/src/fasta/parser/identifier_context.dart'; |
| 9 import 'package:front_end/src/fasta/parser/parser.dart'; | 9 import 'package:front_end/src/fasta/parser/parser.dart'; |
| 10 import 'package:front_end/src/fasta/source/stack_listener.dart'; | 10 import 'package:front_end/src/fasta/source/stack_listener.dart'; |
| 11 import 'package:front_end/src/scanner/token.dart'; | 11 import 'package:front_end/src/scanner/token.dart'; |
| 12 | 12 |
| 13 /// "Mini AST" representation of a declaration which can accept annotations. | 13 /// "Mini AST" representation of a declaration which can accept annotations. |
| 14 class AnnotatedNode { | 14 class AnnotatedNode { |
| 15 final Comment documentationComment; | 15 final Comment documentationComment; |
| 16 | 16 |
| 17 final List<Annotation> metadata; | 17 final List<Annotation> metadata; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 /// code. This representation is just sufficient for summary code generation. | 150 /// code. This representation is just sufficient for summary code generation. |
| 151 class MiniAstBuilder extends StackListener { | 151 class MiniAstBuilder extends StackListener { |
| 152 bool inMetadata = false; | 152 bool inMetadata = false; |
| 153 | 153 |
| 154 final compilationUnit = new CompilationUnit(); | 154 final compilationUnit = new CompilationUnit(); |
| 155 | 155 |
| 156 @override | 156 @override |
| 157 Uri get uri => null; | 157 Uri get uri => null; |
| 158 | 158 |
| 159 @override | 159 @override |
| 160 void addCompileTimeErrorFromMessage(FastaMessage message) { | 160 void addCompileTimeError(Message message, int charOffset) { |
| 161 deprecated_internalProblem(message.message); | 161 deprecated_internalProblem(message.message, uri, charOffset); |
| 162 } | 162 } |
| 163 | 163 |
| 164 @override | 164 @override |
| 165 void beginMetadata(Token token) { | 165 void beginMetadata(Token token) { |
| 166 inMetadata = true; | 166 inMetadata = true; |
| 167 } | 167 } |
| 168 | 168 |
| 169 @override | 169 @override |
| 170 void beginMetadataStar(Token token) { | 170 void beginMetadataStar(Token token) { |
| 171 debugEvent("beginMetadataStar"); | 171 debugEvent("beginMetadataStar"); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 final String name; | 472 final String name; |
| 473 | 473 |
| 474 final List<TypeName> typeArguments; | 474 final List<TypeName> typeArguments; |
| 475 | 475 |
| 476 TypeName(this.name, this.typeArguments); | 476 TypeName(this.name, this.typeArguments); |
| 477 } | 477 } |
| 478 | 478 |
| 479 /// "Mini AST" representation of an expression which summary code generation | 479 /// "Mini AST" representation of an expression which summary code generation |
| 480 /// need not be concerned about. | 480 /// need not be concerned about. |
| 481 class UnknownExpression extends Expression {} | 481 class UnknownExpression extends Expression {} |
| OLD | NEW |