blob: 18d0a8674d4acdfcf28cd0500e0646a84870b944 [file] [log] [blame]
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Utility function shared between different parts of analyzer2dart.
library analyzer2dart.util;
import 'package:analyzer/analyzer.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:compiler/src/universe/universe.dart';
import 'package:compiler/src/source_file.dart';
Selector createSelectorFromMethodInvocation(ArgumentList node,
String name) {
int arity = 0;
List<String> namedArguments = <String>[];
for (Expression argument in node.arguments) {
if (argument is NamedExpression) {
} else {
return new, null, arity, namedArguments);
/// Prints [message] together with source code pointed to by [node] from
/// [source].
void reportSourceMessage(Source source, AstNode node, String message) {
SourceFile sourceFile =
new StringSourceFile(source.fullName,;
print(sourceFile.getLocationMessage(message, node.offset, node.end));