Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('dart2js'); | 5 #library('dart2js'); |
| 6 | 6 |
| 7 #import('dart:io'); | 7 #import('dart:io'); |
| 8 #import('dart:uri'); | 8 #import('dart:uri'); |
| 9 #import('dart:utf'); | 9 #import('dart:utf'); |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 List<String> options = new List<String>(); | 59 List<String> options = new List<String>(); |
| 60 bool explicitOut = false; | 60 bool explicitOut = false; |
| 61 bool wantHelp = false; | 61 bool wantHelp = false; |
| 62 | 62 |
| 63 passThrough(String argument) => options.add(argument); | 63 passThrough(String argument) => options.add(argument); |
| 64 | 64 |
| 65 List<String> arguments = <String>[]; | 65 List<String> arguments = <String>[]; |
| 66 List<OptionHandler> handlers = <OptionHandler>[ | 66 List<OptionHandler> handlers = <OptionHandler>[ |
| 67 new OptionHandler('--throw-on-error', (_) => throwOnError = true), | 67 new OptionHandler('--throw-on-error', (_) => throwOnError = true), |
| 68 new OptionHandler('--suppress-warnings', (_) => showWarnings = false), | 68 new OptionHandler('--suppress-warnings', (_) => showWarnings = false), |
| 69 new OptionHandler('--output-type=dart|--output-type=js', passThrough), | |
| 69 new OptionHandler('--verbose|-v', (_) => verbose = true), | 70 new OptionHandler('--verbose|-v', (_) => verbose = true), |
| 70 new OptionHandler('--library-root=.+', (String argument) { | 71 new OptionHandler('--library-root=.+', (String argument) { |
| 71 String path = nativeToUriPath(extractParameter(argument)); | 72 String path = nativeToUriPath(extractParameter(argument)); |
| 72 if (!path.endsWith("/")) path = "$path/"; | 73 if (!path.endsWith("/")) path = "$path/"; |
| 73 libraryRoot = cwd.resolve(path); | 74 libraryRoot = cwd.resolve(path); |
| 74 }), | 75 }), |
| 75 new OptionHandler('--out=.+|-o.+', (String argument) { | 76 new OptionHandler('--out=.+|-o.+', (String argument) { |
| 76 explicitOut = true; | 77 explicitOut = true; |
| 77 out = cwd.resolve(nativeToUriPath(extractParameter(argument))); | 78 out = cwd.resolve(nativeToUriPath(extractParameter(argument))); |
| 78 }), | 79 }), |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 | 232 |
| 232 -c, --enable-checked-mode, --checked | 233 -c, --enable-checked-mode, --checked |
| 233 Insert runtime type checks and enable assertions (checked mode). | 234 Insert runtime type checks and enable assertions (checked mode). |
| 234 | 235 |
| 235 -h, /h, /?, --help | 236 -h, /h, /?, --help |
| 236 Display this message (add -v for information about all options). | 237 Display this message (add -v for information about all options). |
| 237 | 238 |
| 238 -v, --verbose | 239 -v, --verbose |
| 239 Display verbose information. | 240 Display verbose information. |
| 240 | 241 |
| 242 --output-type=<value> | |
| 243 Output either JavaScript code (if value is 'js') or Dart code (if value is ' dart'). | |
|
ahe
2012/05/22 10:36:07
FYI: long line (please stay below 80 characters in
| |
| 244 Default value is 'js'. | |
| 245 | |
| 241 --suppress-warnings | 246 --suppress-warnings |
| 242 Do not display any warnings. | 247 Do not display any warnings. |
| 243 | 248 |
| 244 --no-colors | 249 --no-colors |
| 245 Do not add colors to diagnostic messages. | 250 Do not add colors to diagnostic messages. |
| 246 | 251 |
| 247 The following options are only used for compiler development and may | 252 The following options are only used for compiler development and may |
| 248 be removed in a future version: | 253 be removed in a future version: |
| 249 --throw-on-error | 254 --throw-on-error |
| 250 Throw an exception if a compile-time error is detected. | 255 Throw an exception if a compile-time error is detected. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 281 } catch (var ignored) { | 286 } catch (var ignored) { |
| 282 print('Internal error: error while printing exception'); | 287 print('Internal error: error while printing exception'); |
| 283 } | 288 } |
| 284 try { | 289 try { |
| 285 print(trace); | 290 print(trace); |
| 286 } finally { | 291 } finally { |
| 287 exit(253); // 253 is recognized as a crash by our test scripts. | 292 exit(253); // 253 is recognized as a crash by our test scripts. |
| 288 } | 293 } |
| 289 } | 294 } |
| 290 } | 295 } |
| OLD | NEW |