OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.parser.listener; | 5 library fasta.parser.listener; |
6 | 6 |
7 import '../fasta_codes.dart' show FastaMessage; | 7 import '../fasta_codes.dart' show FastaMessage; |
8 | 8 |
9 import '../scanner/token.dart' show BeginGroupToken, SymbolToken, Token; | 9 import '../scanner/token.dart' show BeginGroupToken, SymbolToken, Token; |
10 | 10 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 void beginInitializedIdentifier(Token token) {} | 408 void beginInitializedIdentifier(Token token) {} |
409 | 409 |
410 void endInitializedIdentifier(Token nameToken) { | 410 void endInitializedIdentifier(Token nameToken) { |
411 logEvent("InitializedIdentifier"); | 411 logEvent("InitializedIdentifier"); |
412 } | 412 } |
413 | 413 |
414 void beginFieldInitializer(Token token) {} | 414 void beginFieldInitializer(Token token) {} |
415 | 415 |
416 /// Handle the end of a field initializer. Substructures: | 416 /// Handle the end of a field initializer. Substructures: |
417 /// - Initializer expression | 417 /// - Initializer expression |
418 void endFieldInitializer(Token assignment) { | 418 void endFieldInitializer(Token assignment, Token token) { |
419 logEvent("FieldInitializer"); | 419 logEvent("FieldInitializer"); |
420 } | 420 } |
421 | 421 |
422 /// Handle the lack of a field initializer. | 422 /// Handle the lack of a field initializer. |
423 void handleNoFieldInitializer(Token token) { | 423 void handleNoFieldInitializer(Token token) { |
424 logEvent("NoFieldInitializer"); | 424 logEvent("NoFieldInitializer"); |
425 } | 425 } |
426 | 426 |
427 void beginVariableInitializer(Token token) {} | 427 void beginVariableInitializer(Token token) {} |
428 | 428 |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 | 1068 |
1069 final FastaMessage message; | 1069 final FastaMessage message; |
1070 | 1070 |
1071 ParserError(this.beginOffset, this.endOffset, this.message); | 1071 ParserError(this.beginOffset, this.endOffset, this.message); |
1072 | 1072 |
1073 ParserError.fromTokens(Token begin, Token end, FastaMessage message) | 1073 ParserError.fromTokens(Token begin, Token end, FastaMessage message) |
1074 : this(begin.charOffset, end.charOffset + end.charCount, message); | 1074 : this(begin.charOffset, end.charOffset + end.charCount, message); |
1075 | 1075 |
1076 String toString() => "@${beginOffset}: ${message.message}\n${message.tip}"; | 1076 String toString() => "@${beginOffset}: ${message.message}\n${message.tip}"; |
1077 } | 1077 } |
OLD | NEW |