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

Unified Diff: utils/css/css.dart

Issue 9695048: Template parser (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Siggi's comments Created 8 years, 9 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 | « utils/css/css ('k') | utils/css/css.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/css/css.dart
diff --git a/utils/css/css.dart b/utils/css/css.dart
index 2cdac1acf6c16fd9ec7a57a02e5aec1d7784df6e..34b4eb370b638bb96e888baab79242a6446e9b02 100644
--- a/utils/css/css.dart
+++ b/utils/css/css.dart
@@ -4,47 +4,53 @@
#library('css');
-#import('../../frog/lang.dart', prefix:'lang');
-#import('../../frog/file_system.dart');
-#import('../../frog/file_system_memory.dart');
+#import("../lib/file_system.dart");
+#import('../lib/file_system_memory.dart');
+
+#source('cssoptions.dart');
+#source('source.dart');
#source('tokenkind.dart');
+#source('token.dart');
+#source('tokenizer_base.dart');
#source('tokenizer.dart');
+#source('treebase.dart');
#source('tree.dart');
#source('cssselectorexception.dart');
#source('cssworld.dart');
#source('parser.dart');
#source('validate.dart');
#source('generate.dart');
+#source('world.dart');
void initCssWorld([bool commandLine = true]) {
- var fs = new MemoryFileSystem();
- lang.parseOptions('', [], fs);
- lang.initializeWorld(fs);
- lang.world.process();
- lang.world.resolveAll();
+ FileSystem fs = new MemoryFileSystem();
+ parseOptions([], fs);
+ initializeWorld(fs);
// TODO(terry): Should be set by arguments. When run as a tool these aren't
// set when run internaly set these so we can compile CSS and catch any
// problems programmatically.
- lang.options.throwOnErrors = true;
- lang.options.throwOnFatal = true;
- lang.options.useColors = commandLine ? true : false;
+ options.throwOnErrors = true;
+ options.throwOnFatal = true;
+ options.useColors = commandLine ? true : false;
+ options.warningsAsErrors = false;
+ options.showWarnings = true;
}
// TODO(terry): Add obfuscation mapping file.
-void cssParseAndValidate(String cssExpression, CssWorld world) {
- Parser parser = new Parser(new lang.SourceFile(lang.SourceFile.IN_MEMORY_FILE,
+void cssParseAndValidate(String cssExpression, CssWorld cssworld) {
+ Parser parser = new Parser(new SourceFile(SourceFile.IN_MEMORY_FILE,
cssExpression));
var tree = parser.parseTemplate();
if (tree != null) {
- Validate.template(tree.selectors, world);
+ Validate.template(tree.selectors, cssworld);
}
}
// Returns pretty printed tree of the expression.
-String cssParseAndValidateDebug(String cssExpression, CssWorld world) {
- Parser parser = new Parser(new lang.SourceFile(lang.SourceFile.IN_MEMORY_FILE,
+String cssParseAndValidateDebug(String cssExpression, CssWorld cssworld) {
+ Parser parser = new Parser(new SourceFile(SourceFile.IN_MEMORY_FILE,
cssExpression));
String output = "";
String prettyTree = "";
@@ -52,7 +58,7 @@ String cssParseAndValidateDebug(String cssExpression, CssWorld world) {
var tree = parser.parseTemplate();
if (tree != null) {
prettyTree = tree.toDebugString();
- Validate.template(tree.selectors, world);
+ Validate.template(tree.selectors, cssworld);
output = prettyTree;
}
} catch (var e) {
« no previous file with comments | « utils/css/css ('k') | utils/css/css.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698