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

Side by Side Diff: pkg/analyzer2dart/lib/src/util.dart

Issue 609783002: Support static field access in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer2dart/lib/src/tree_shaker.dart ('k') | pkg/analyzer2dart/test/end2end_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4
5 // Utility function shared between different parts of analyzer2dart.
6
7 library analyzer2dart.util;
8
9 import 'package:analyzer/analyzer.dart';
10 import 'package:analyzer/src/generated/source.dart';
11 import 'package:compiler/implementation/universe/universe.dart';
12 import 'package:compiler/implementation/source_file.dart';
13
14 Selector createSelectorFromMethodInvocation(MethodInvocation node,
15 String name) {
16 int arity = 0;
17 List<String> namedArguments = <String>[];
18 for (var x in node.argumentList.arguments) {
19 if (x is NamedExpression) {
20 namedArguments.add(x.name.label.name);
21 } else {
22 arity++;
23 }
24 }
25 return new Selector.call(name, null, arity, namedArguments);
26 }
27
28 /// Prints [message] together with source code pointed to by [node] from
29 /// [source].
30 void reportSourceMessage(Source source, AstNode node, String message) {
31 SourceFile sourceFile =
32 new StringSourceFile(source.fullName, source.contents.data);
33
34 print(sourceFile.getLocationMessage(message, node.offset, node.end));
35 }
OLDNEW
« no previous file with comments | « pkg/analyzer2dart/lib/src/tree_shaker.dart ('k') | pkg/analyzer2dart/test/end2end_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698