[fasta] Commandline option to leave environment constants unevaluated.

Also, outdated description of -D option corrected.

Change-Id: Ie1dc011adc3ce2f5293826c96f22700a6528c9a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96880
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
Aske Simon Christensen 2019-03-14 11:30:07 +00:00 committed by commit-bot@chromium.org
parent 10a8663e74
commit dbea5c6884
3 changed files with 13 additions and 4 deletions

View file

@ -3329,7 +3329,10 @@ const MessageCode messageFastaUsageLong =
-Dname
-Dname=value
Ignored for now.
Define an environment variable in the compile-time environment.
--no-defines
Ignore all -D options and leave environment constants unevaluated.
--
Stop option parsing, the rest of the command line is assumed to be

View file

@ -1538,7 +1538,10 @@ FastaUsageLong:
-Dname
-Dname=value
Ignored for now.
Define an environment variable in the compile-time environment.
--no-defines
Ignore all -D options and leave environment constants unevaluated.
--
Stop option parsing, the rest of the command line is assumed to be

View file

@ -251,6 +251,7 @@ const Map<String, dynamic> optionSpecification = const <String, dynamic>{
"--legacy": "--legacy-mode",
"--legacy-mode": false,
"--libraries-json": Uri,
"--no-defines": false,
"--output": Uri,
"--packages": Uri,
"--platform": Uri,
@ -310,6 +311,8 @@ ProcessedOptions analyzeCommandLine(
"Valid targets are:\n ${targets.keys.join("\n ")}");
}
final bool noDefines = options["--no-defines"];
final bool enableAsserts = options["--enable-asserts"];
final bool verify = options["--verify"];
@ -385,7 +388,7 @@ ProcessedOptions analyzeCommandLine(
..verify = verify
..bytecode = bytecode
..experimentalFlags = experimentalFlags
..environmentDefines = parsedArguments.defines,
..environmentDefines = noDefines ? null : parsedArguments.defines,
inputs: <Uri>[Uri.parse(arguments[0])],
output: resolveInputUri(arguments[3]));
} else if (arguments.isEmpty) {
@ -421,7 +424,7 @@ ProcessedOptions analyzeCommandLine(
..verbose = verbose
..verify = verify
..experimentalFlags = experimentalFlags
..environmentDefines = parsedArguments.defines;
..environmentDefines = noDefines ? null : parsedArguments.defines;
// TODO(ahe): What about chase dependencies?