OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #library('css'); | 5 #library('css'); |
6 | 6 |
7 #import('dart:math', prefix: 'Math'); | 7 #import('dart:math', prefix: 'Math'); |
8 #import("../lib/file_system.dart"); | 8 #import("../lib/file_system.dart"); |
9 #import('../lib/file_system_memory.dart'); | 9 #import('../lib/file_system_memory.dart'); |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 cssExpression)); | 55 cssExpression)); |
56 String output = ""; | 56 String output = ""; |
57 String prettyTree = ""; | 57 String prettyTree = ""; |
58 try { | 58 try { |
59 var tree = parser.parseTemplate(); | 59 var tree = parser.parseTemplate(); |
60 if (tree != null) { | 60 if (tree != null) { |
61 prettyTree = tree.toDebugString(); | 61 prettyTree = tree.toDebugString(); |
62 Validate.template(tree.selectors, cssworld); | 62 Validate.template(tree.selectors, cssworld); |
63 output = prettyTree; | 63 output = prettyTree; |
64 } | 64 } |
65 } catch (var e) { | 65 } catch (e) { |
66 String error = e.toString(); | 66 String error = e.toString(); |
67 output = "$error\n$prettyTree"; | 67 output = "$error\n$prettyTree"; |
68 throw e; | 68 throw e; |
69 } | 69 } |
70 | 70 |
71 return output; | 71 return output; |
72 } | 72 } |
OLD | NEW |