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

Unified Diff: third_party/pkg/angular/lib/core/parser/static_parser.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 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: third_party/pkg/angular/lib/core/parser/static_parser.dart
diff --git a/third_party/pkg/angular/lib/core/parser/static_parser.dart b/third_party/pkg/angular/lib/core/parser/static_parser.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5d0db008c4aa1276822ab7728eb3cb2b931e7e72
--- /dev/null
+++ b/third_party/pkg/angular/lib/core/parser/static_parser.dart
@@ -0,0 +1,32 @@
+part of angular.core.parser;
+
+class StaticParserFunctions {
+ StaticParserFunctions(Map this.functions);
+
+ Map<String, dynamic> functions;
+}
+
+@NgInjectableService()
+class StaticParser implements Parser {
+ Map<String, dynamic> _functions;
+ Parser _fallbackParser;
+
+ StaticParser(StaticParserFunctions functions,
+ DynamicParser this._fallbackParser) {
+ assert(functions != null);
+ _functions = functions.functions;
+ }
+
+ call(String exp) {
+ if (exp == null) exp = "";
+ if (!_functions.containsKey(exp)) {
+ //print("Expression [$exp] is not supported in static parser");
+ return _fallbackParser.call(exp);
+ }
+ return _functions[exp];
+ }
+
+ primaryFromToken(Token token, parserError) {
+ throw 'Not Implemented';
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698