Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: pkg/intl/lib/extract_messages.dart

Issue 109853003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/test/generated/test_support.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** 5 /**
6 * This is for use in extracting messages from a Dart program 6 * This is for use in extracting messages from a Dart program
7 * using the Intl.message() mechanism and writing them to a file for 7 * using the Intl.message() mechanism and writing them to a file for
8 * translation. This provides only the stub of a mechanism, because it 8 * translation. This provides only the stub of a mechanism, because it
9 * doesn't define how the file should be written. It provides an 9 * doesn't define how the file should be written. It provides an
10 * [IntlMessage] class that holds the extracted data and [parseString] 10 * [IntlMessage] class that holds the extracted data and [parseString]
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 var instance = _expectedInstance(node.methodName.name); 140 var instance = _expectedInstance(node.methodName.name);
141 return instance.checkValidity(node, arguments, name, parameters); 141 return instance.checkValidity(node, arguments, name, parameters);
142 } 142 }
143 143
144 /** 144 /**
145 * Record the parameters of the function or method declaration we last 145 * Record the parameters of the function or method declaration we last
146 * encountered before seeing the Intl.message call. 146 * encountered before seeing the Intl.message call.
147 */ 147 */
148 void visitMethodDeclaration(MethodDeclaration node) { 148 void visitMethodDeclaration(MethodDeclaration node) {
149 parameters = node.parameters; 149 parameters = node.parameters;
150 if (parameters == null) parameters = new FormalParameterList(); 150 if (parameters == null) parameters = new FormalParameterList(null, [], null, null, null);
151 name = node.name.name; 151 name = node.name.name;
152 super.visitMethodDeclaration(node); 152 super.visitMethodDeclaration(node);
153 } 153 }
154 154
155 /** 155 /**
156 * Record the parameters of the function or method declaration we last 156 * Record the parameters of the function or method declaration we last
157 * encountered before seeing the Intl.message call. 157 * encountered before seeing the Intl.message call.
158 */ 158 */
159 void visitFunctionDeclaration(FunctionDeclaration node) { 159 void visitFunctionDeclaration(FunctionDeclaration node) {
160 parameters = node.functionExpression.parameters; 160 parameters = node.functionExpression.parameters;
161 if (parameters == null) parameters = new FormalParameterList(); 161 if (parameters == null) parameters = new FormalParameterList(null, [], null, null, null);
162 name = node.name.name; 162 name = node.name.name;
163 super.visitFunctionDeclaration(node); 163 super.visitFunctionDeclaration(node);
164 } 164 }
165 165
166 /** 166 /**
167 * Examine method invocations to see if they look like calls to Intl.message. 167 * Examine method invocations to see if they look like calls to Intl.message.
168 * If we've found one, stop recursing. This is important because we can have 168 * If we've found one, stop recursing. This is important because we can have
169 * Intl.message(...Intl.plural...) and we don't want to treat the inner 169 * Intl.message(...Intl.plural...) and we don't want to treat the inner
170 * plural as if it was an outermost message. 170 * plural as if it was an outermost message.
171 */ 171 */
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 */ 466 */
467 final String message; 467 final String message;
468 468
469 /** 469 /**
470 * Creates a new exception with an optional error [message]. 470 * Creates a new exception with an optional error [message].
471 */ 471 */
472 const IntlMessageExtractionException([this.message = ""]); 472 const IntlMessageExtractionException([this.message = ""]);
473 473
474 String toString() => "IntlMessageExtractionException: $message"; 474 String toString() => "IntlMessageExtractionException: $message";
475 } 475 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/test_support.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698