Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** General options used by the compiler. */ | 5 /** General options used by the compiler. */ |
| 6 FrogOptions options; | 6 FrogOptions options; |
| 7 | 7 |
| 8 /** Extracts options from command-line arguments. */ | 8 /** Extracts options from command-line arguments. */ |
| 9 void parseOptions(String homedir, List<String> args, FileSystem files) { | 9 void parseOptions(String homedir, List<String> args, FileSystem files) { |
| 10 assert(options == null); | 10 assert(options == null); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 bool forceDynamic = false; | 37 bool forceDynamic = false; |
| 38 bool dietParse = false; | 38 bool dietParse = false; |
| 39 bool compileOnly = false; | 39 bool compileOnly = false; |
| 40 | 40 |
| 41 // Message support | 41 // Message support |
| 42 bool throwOnErrors = false; | 42 bool throwOnErrors = false; |
| 43 bool throwOnWarnings = false; | 43 bool throwOnWarnings = false; |
| 44 bool throwOnFatal = false; | 44 bool throwOnFatal = false; |
| 45 bool showInfo = false; | 45 bool showInfo = false; |
| 46 bool showWarnings = true; | 46 bool showWarnings = true; |
| 47 bool useColors = true; | |
| 47 | 48 |
| 48 /** | 49 /** |
| 49 * Options to be used later for passing to the generated code. These are all | 50 * Options to be used later for passing to the generated code. These are all |
| 50 * the arguments after the first dart script, if any. | 51 * the arguments after the first dart script, if any. |
| 51 */ | 52 */ |
| 52 List<String> childArgs; | 53 List<String> childArgs; |
| 53 | 54 |
| 54 FrogOptions(String homedir, List<String> args, FileSystem files) { | 55 FrogOptions(String homedir, List<String> args, FileSystem files) { |
| 55 if (config == 'dev') { | 56 if (config == 'dev') { |
| 56 libDir = joinPaths(homedir, '/lib'); // Default value for --libdir. | 57 libDir = joinPaths(homedir, '/lib'); // Default value for --libdir. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 throwOnWarnings = true; | 128 throwOnWarnings = true; |
| 128 continue loop; | 129 continue loop; |
| 129 | 130 |
| 130 case '--compile-only': | 131 case '--compile-only': |
| 131 // As opposed to compiling and running, the default behavior. | 132 // As opposed to compiling and running, the default behavior. |
| 132 compileOnly = true; | 133 compileOnly = true; |
| 133 continue loop; | 134 continue loop; |
| 134 | 135 |
| 135 case '--force_dynamic': | 136 case '--force_dynamic': |
| 136 forceDynamic = true; | 137 forceDynamic = true; |
| 137 continue loop; | 138 continue loop; |
|
Bob Nystrom
2011/12/06 22:47:43
Is this still needed? I believe break is working n
Siggi Cherem (dart-lang)
2011/12/06 23:37:38
Done.
| |
| 138 | 139 |
| 140 case '--no_colors': | |
| 141 useColors = false; | |
| 142 continue loop; | |
| 143 | |
| 139 default: | 144 default: |
| 140 if (arg.endsWith('.dart')) { | 145 if (arg.endsWith('.dart')) { |
| 141 dartScript = arg; | 146 dartScript = arg; |
| 142 childArgs = args.getRange(i + 1, args.length - i - 1); | 147 childArgs = args.getRange(i + 1, args.length - i - 1); |
| 143 break loop; | 148 break loop; |
| 144 } else if (arg.startsWith('--out=')) { | 149 } else if (arg.startsWith('--out=')) { |
| 145 outfile = arg.substring('--out='.length); | 150 outfile = arg.substring('--out='.length); |
| 146 } else if (arg.startsWith('--libdir=')) { | 151 } else if (arg.startsWith('--libdir=')) { |
| 147 libDir = arg.substring('--libdir='.length); | 152 libDir = arg.substring('--libdir='.length); |
| 148 passedLibDir = true; | 153 passedLibDir = true; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 159 // Try locally | 164 // Try locally |
| 160 var temp = 'frog/lib'; | 165 var temp = 'frog/lib'; |
| 161 if (files.fileExists(temp)) { | 166 if (files.fileExists(temp)) { |
| 162 libDir = temp; | 167 libDir = temp; |
| 163 } else { | 168 } else { |
| 164 libDir = 'lib'; | 169 libDir = 'lib'; |
| 165 } | 170 } |
| 166 } | 171 } |
| 167 } | 172 } |
| 168 } | 173 } |
| OLD | NEW |