| OLD | NEW |
| 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 provides classes to represent the internal structure of the | 6 * This provides classes to represent the internal structure of the |
| 7 * arguments to `Intl.message`. It is used when parsing sources to extract | 7 * arguments to `Intl.message`. It is used when parsing sources to extract |
| 8 * messages or to generate code for message substitution. Normal programs | 8 * messages or to generate code for message substitution. Normal programs |
| 9 * using Intl would not import this library. | 9 * using Intl would not import this library. |
| 10 * | 10 * |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 void addPieces(List<Message> messages) { | 316 void addPieces(List<Message> messages) { |
| 317 for (var each in messages) { | 317 for (var each in messages) { |
| 318 messagePieces.add(Message.from(each, this)); | 318 messagePieces.add(Message.from(each, this)); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 /** The description provided in the Intl.message call. */ | 322 /** The description provided in the Intl.message call. */ |
| 323 String description; | 323 String description; |
| 324 | 324 |
| 325 /** The examples from the Intl.message call */ | 325 /** The examples from the Intl.message call */ |
| 326 String examples; | 326 Map<String, dynamic> examples; |
| 327 | 327 |
| 328 /** | 328 /** |
| 329 * The name, which may come from the function name, from the arguments | 329 * The name, which may come from the function name, from the arguments |
| 330 * to Intl.message, or we may just re-use the message. | 330 * to Intl.message, or we may just re-use the message. |
| 331 */ | 331 */ |
| 332 String _name; | 332 String _name; |
| 333 | 333 |
| 334 /** | 334 /** |
| 335 * A placeholder for any other identifier that the translation format | 335 * A placeholder for any other identifier that the translation format |
| 336 * may want to use. | 336 * may want to use. |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 out.write('('); | 669 out.write('('); |
| 670 out.write(mainArgument); | 670 out.write(mainArgument); |
| 671 var args = codeAttributeNames; | 671 var args = codeAttributeNames; |
| 672 out.write(", {"); | 672 out.write(", {"); |
| 673 args.fold(out, (buffer, arg) => buffer..write( | 673 args.fold(out, (buffer, arg) => buffer..write( |
| 674 "'$arg': '${this[arg].toCode()}', ")); | 674 "'$arg': '${this[arg].toCode()}', ")); |
| 675 out.write("})}"); | 675 out.write("})}"); |
| 676 return out.toString(); | 676 return out.toString(); |
| 677 } | 677 } |
| 678 } | 678 } |
| OLD | NEW |