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

Side by Side Diff: pkg/dev_compiler/lib/src/analyzer/context.dart

Issue 2578463004: update DDC to use analyzer extractDefinedVariables (Closed)
Patch Set: merge Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/command.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'package:args/args.dart' show ArgParser, ArgResults; 5 import 'package:args/args.dart' show ArgParser, ArgResults;
6 import 'package:analyzer/file_system/file_system.dart' 6 import 'package:analyzer/file_system/file_system.dart'
7 show ResourceProvider, ResourceUriResolver; 7 show ResourceProvider, ResourceUriResolver;
8 import 'package:analyzer/file_system/physical_file_system.dart' 8 import 'package:analyzer/file_system/physical_file_system.dart'
9 show PhysicalResourceProvider; 9 show PhysicalResourceProvider;
10 import 'package:analyzer/source/custom_resolver.dart'; 10 import 'package:analyzer/source/custom_resolver.dart';
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return sdk; 168 return sdk;
169 } 169 }
170 170
171 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath]. 171 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath].
172 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) { 172 DartUriResolver createSdkPathResolver(String sdkSummaryPath, String sdkPath) {
173 var sdk = (sdkSummaryPath != null) 173 var sdk = (sdkSummaryPath != null)
174 ? new SummaryBasedDartSdk(sdkSummaryPath, true) 174 ? new SummaryBasedDartSdk(sdkSummaryPath, true)
175 : _createFolderBasedDartSdk(sdkPath); 175 : _createFolderBasedDartSdk(sdkPath);
176 return new DartUriResolver(sdk); 176 return new DartUriResolver(sdk);
177 } 177 }
178
179 List<String> parseDeclaredVariables(
180 List<String> args, Map<String, String> declaredVars) {
181 var count = args.length;
182 var remainingArgs = <String>[];
183 for (int i = 0; i < count; i++) {
184 var arg = args[i];
185 if (arg == '--') {
186 while (i < count) {
187 remainingArgs.add(args[i++]);
188 }
189 } else if (arg.startsWith("-D")) {
190 // The format for defined variables is:
191 // -D<name>=<value>
192 var parts = arg.substring(2).split('=');
193 declaredVars[parts[0]] = parts.length > 1 ? parts[1] : '';
194 } else {
195 remainingArgs.add(arg);
196 }
197 }
198 return remainingArgs;
199 }
OLDNEW
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698