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/fasta_codes.dart'; | 5 import 'package:front_end/src/fasta/fasta_codes.dart'; |
6 import 'package:front_end/src/fasta/parser/identifier_context.dart' | 6 import 'package:front_end/src/fasta/parser/identifier_context.dart' |
7 show IdentifierContext; | 7 show IdentifierContext; |
8 import 'package:front_end/src/fasta/parser.dart' as fasta; | 8 import 'package:front_end/src/fasta/parser.dart' as fasta; |
| 9 import 'package:front_end/src/fasta/parser/token_stream_rewriter.dart'; |
9 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; | 10 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; |
10 import 'package:front_end/src/fasta/util/link.dart'; | 11 import 'package:front_end/src/fasta/util/link.dart'; |
11 import 'package:front_end/src/scanner/token.dart'; | 12 import 'package:front_end/src/scanner/token.dart'; |
12 import 'package:test/test.dart'; | 13 import 'package:test/test.dart'; |
13 | 14 |
14 /** | 15 /** |
15 * Proxy implementation of the fasta parser listener that | 16 * Proxy implementation of the fasta parser listener that |
16 * asserts begin/end pairs of events and forwards all events | 17 * asserts begin/end pairs of events and forwards all events |
17 * to the specified listener. | 18 * to the specified listener. |
18 * | 19 * |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 53 } |
53 | 54 |
54 void end(String event) { | 55 void end(String event) { |
55 expectIn(event); | 56 expectIn(event); |
56 _stack.removeLast(); | 57 _stack.removeLast(); |
57 } | 58 } |
58 | 59 |
59 ForwardingTestListener(this.listener); | 60 ForwardingTestListener(this.listener); |
60 | 61 |
61 @override | 62 @override |
| 63 Token get firstToken => listener.firstToken; |
| 64 |
| 65 @override |
| 66 set firstToken(Token token) { |
| 67 listener.firstToken = token; |
| 68 } |
| 69 |
| 70 @override |
| 71 TokenStreamRewriter get rewriter => listener.rewriter; |
| 72 |
| 73 @override |
| 74 Uri get uri => listener.uri; |
| 75 |
| 76 @override |
62 void beginArguments(Token token) { | 77 void beginArguments(Token token) { |
63 listener.beginArguments(token); | 78 listener.beginArguments(token); |
64 begin('Arguments'); | 79 begin('Arguments'); |
65 } | 80 } |
66 | 81 |
67 @override | 82 @override |
68 void beginAssert(Token assertKeyword, fasta.Assert kind) { | 83 void beginAssert(Token assertKeyword, fasta.Assert kind) { |
69 listener.beginAssert(assertKeyword, kind); | 84 listener.beginAssert(assertKeyword, kind); |
70 begin('Assert'); | 85 begin('Assert'); |
71 } | 86 } |
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 return listener.replaceTokenWithGenericCommentTypeAssign( | 1550 return listener.replaceTokenWithGenericCommentTypeAssign( |
1536 tokenToStartReplacing, tokenWithComment); | 1551 tokenToStartReplacing, tokenWithComment); |
1537 // TODO(danrubel): implement replaceTokenWithGenericCommentTypeAssign | 1552 // TODO(danrubel): implement replaceTokenWithGenericCommentTypeAssign |
1538 } | 1553 } |
1539 | 1554 |
1540 @override | 1555 @override |
1541 set suppressParseErrors(bool value) { | 1556 set suppressParseErrors(bool value) { |
1542 listener.suppressParseErrors = value; | 1557 listener.suppressParseErrors = value; |
1543 // TODO(danrubel): implement suppressParseErrors | 1558 // TODO(danrubel): implement suppressParseErrors |
1544 } | 1559 } |
1545 | |
1546 // TODO(danrubel): implement uri | |
1547 @override | |
1548 Uri get uri => listener.uri; | |
1549 } | 1560 } |
OLD | NEW |