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

Unified Diff: frog/world.dart

Issue 9270048: Lots of frog cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: frog/world.dart
diff --git a/frog/world.dart b/frog/world.dart
index f41e934d29338a3a7b825a418cf8c95fcf953985..0e06f4130ebd96023ca062973f1a0b642649032b 100644
--- a/frog/world.dart
+++ b/frog/world.dart
@@ -406,6 +406,7 @@ class World {
if (experimentalAwaitPhase != null) {
withTiming('await translation', experimentalAwaitPhase);
}
+ withTiming('analyze pass', () { analyzeCode(lib); });
withTiming('generate code', () { generateCode(lib); });
}
@@ -484,8 +485,18 @@ class World {
return main;
}
- generateCode(Library lib) {
+ /**
+ * Walks all code in lib and imports for analysis.
+ */
+ analyzeCode(Library lib) {
gen = new WorldGenerator(findMainMethod(lib), new CodeWriter());
+ gen.analyze();
+ }
+
+ /**
+ * Walks all live code to generate JS source for output.
+ */
+ generateCode(Library lib) {
gen.run();
frogCode = gen.writer.text;
jsBytesWritten = frogCode.length;
« frog/gen.dart ('K') | « frog/var_member.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698