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

Unified Diff: pkg/analyzer/lib/analyzer.dart

Issue 1602803002: Clean-up imports (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/example/resolver_driver.dart ('k') | pkg/analyzer/lib/dart/element/element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/analyzer.dart
diff --git a/pkg/analyzer/lib/analyzer.dart b/pkg/analyzer/lib/analyzer.dart
index d0fdc6578136485d15fee683fd4008d5ae6d1e1e..78de42e172f1c2c8514e935be5d943b1cb8741b1 100644
--- a/pkg/analyzer/lib/analyzer.dart
+++ b/pkg/analyzer/lib/analyzer.dart
@@ -6,8 +6,8 @@ library analyzer;
import 'dart:io';
+import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/error.dart';
-import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/parser.dart';
import 'package:analyzer/src/generated/scanner.dart';
@@ -15,8 +15,10 @@ import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/string_source.dart';
import 'package:path/path.dart' as pathos;
+export 'package:analyzer/dart/ast/ast.dart';
+export 'package:analyzer/dart/ast/visitor.dart';
+export 'package:analyzer/src/dart/ast/utilities.dart';
export 'package:analyzer/src/error.dart';
-export 'package:analyzer/src/generated/ast.dart';
export 'package:analyzer/src/generated/error.dart';
export 'package:analyzer/src/generated/utilities_dart.dart';
@@ -63,22 +65,6 @@ CompilationUnit parseDartFile(String path,
suppressErrors: suppressErrors, parseFunctionBodies: parseFunctionBodies);
}
-CompilationUnit _parseSource(String contents, Source source,
- {bool suppressErrors: false, bool parseFunctionBodies: true}) {
- var reader = new CharSequenceReader(contents);
- var errorCollector = new _ErrorCollector();
- var scanner = new Scanner(source, reader, errorCollector);
- var token = scanner.tokenize();
- var parser = new Parser(source, errorCollector)
- ..parseFunctionBodies = parseFunctionBodies;
- var unit = parser.parseCompilationUnit(token)
- ..lineInfo = new LineInfo(scanner.lineStarts);
-
- if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
-
- return unit;
-}
-
/// Parses the script tag and directives in a string of Dart code into an AST.
///
/// Stops parsing when the first non-directive is encountered. The rest of the
@@ -111,6 +97,22 @@ String stringLiteralToString(StringLiteral literal) {
return literal.stringValue;
}
+CompilationUnit _parseSource(String contents, Source source,
+ {bool suppressErrors: false, bool parseFunctionBodies: true}) {
+ var reader = new CharSequenceReader(contents);
+ var errorCollector = new _ErrorCollector();
+ var scanner = new Scanner(source, reader, errorCollector);
+ var token = scanner.tokenize();
+ var parser = new Parser(source, errorCollector)
+ ..parseFunctionBodies = parseFunctionBodies;
+ var unit = parser.parseCompilationUnit(token)
+ ..lineInfo = new LineInfo(scanner.lineStarts);
+
+ if (errorCollector.hasErrors && !suppressErrors) throw errorCollector.group;
+
+ return unit;
+}
+
/// A simple error listener that collects errors into an [AnalysisErrorGroup].
class _ErrorCollector extends AnalysisErrorListener {
final _errors = <AnalysisError>[];
« no previous file with comments | « pkg/analyzer/example/resolver_driver.dart ('k') | pkg/analyzer/lib/dart/element/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698