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

Unified Diff: pkg/args/lib/src/parser.dart

Issue 19810004: pkg/args: expose immutable collections (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: trying again Created 7 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/args/lib/src/options.dart ('k') | pkg/args/lib/src/usage.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/args/lib/src/parser.dart
diff --git a/pkg/args/lib/src/parser.dart b/pkg/args/lib/src/parser.dart
index 37a8e41ea651779e72d40df4f06267056eebde18..550fe63e065294d07167b6f0d1d241bdb11ffc51 100644
--- a/pkg/args/lib/src/parser.dart
+++ b/pkg/args/lib/src/parser.dart
@@ -41,7 +41,7 @@ class Parser {
final rest = <String>[];
/** The accumulated parsed options. */
- final Map results = {};
+ final Map<String, dynamic> results = <String, dynamic>{};
Parser(this.commandName, this.grammar, this.args, this.parent, rest,
{this.allowTrailingOptions: false}) {
@@ -277,12 +277,12 @@ class Parser {
* Called during parsing to validate the arguments. Throws a
* [FormatException] if [condition] is `false`.
*/
- validate(bool condition, String message) {
+ void validate(bool condition, String message) {
if (!condition) throw new FormatException(message);
}
/** Validates and stores [value] as the value for [option]. */
- setOption(Map results, Option option, value) {
+ void setOption(Map results, Option option, value) {
// See if it's one of the allowed values.
if (option.allowed != null) {
validate(option.allowed.any((allow) => allow == value),
« no previous file with comments | « pkg/args/lib/src/options.dart ('k') | pkg/args/lib/src/usage.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698