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 parser_helper; | 5 library parser_helper; |
6 | 6 |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 | 8 |
9 import "package:compiler/src/elements/elements.dart"; | 9 import "package:compiler/src/elements/elements.dart"; |
10 import 'package:compiler/src/id_generator.dart'; | 10 import 'package:compiler/src/id_generator.dart'; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 infos.forEach(log); | 63 infos.forEach(log); |
64 } | 64 } |
65 | 65 |
66 void reportWarning( | 66 void reportWarning( |
67 DiagnosticMessage message, | 67 DiagnosticMessage message, |
68 [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) { | 68 [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) { |
69 log(message); | 69 log(message); |
70 infos.forEach(log); | 70 infos.forEach(log); |
71 } | 71 } |
72 | 72 |
73 void reportInfo(Spannable node, MessageKind errorCode, [Map arguments]) { | 73 void reportInfo(Spannable node, MessageKind errorCode, |
74 [Map arguments = const {}]) { | |
Johnni Winther
2016/06/30 11:09:33
Ditto
| |
74 log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false)); | 75 log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false)); |
75 } | 76 } |
76 | 77 |
77 void reportHint( | 78 void reportHint( |
78 DiagnosticMessage message, | 79 DiagnosticMessage message, |
79 [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) { | 80 [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) { |
80 log(message); | 81 log(message); |
81 infos.forEach(log); | 82 infos.forEach(log); |
82 } | 83 } |
83 | 84 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 reporter.withCurrentElement(unit, () => parser.parseUnit(tokens)); | 163 reporter.withCurrentElement(unit, () => parser.parseUnit(tokens)); |
163 return unit.localMembers; | 164 return unit.localMembers; |
164 } | 165 } |
165 | 166 |
166 NodeList fullParseUnit(String source, {DiagnosticReporter reporter}) { | 167 NodeList fullParseUnit(String source, {DiagnosticReporter reporter}) { |
167 return parseBodyCode( | 168 return parseBodyCode( |
168 source, | 169 source, |
169 (parser, tokens) => parser.parseUnit(tokens), | 170 (parser, tokens) => parser.parseUnit(tokens), |
170 reporter: reporter); | 171 reporter: reporter); |
171 } | 172 } |
OLD | NEW |