Index: third_party/pkg/angular/bin/parser_generator_for_spec.dart |
diff --git a/third_party/pkg/angular/bin/parser_generator_for_spec.dart b/third_party/pkg/angular/bin/parser_generator_for_spec.dart |
index b1e6396c828b312e7bca7c42c79071bb47182d71..b4248b64bb14e0317e1c3ff0cbca16e7c0510fff 100644 |
--- a/third_party/pkg/angular/bin/parser_generator_for_spec.dart |
+++ b/third_party/pkg/angular/bin/parser_generator_for_spec.dart |
@@ -1,26 +1,19 @@ |
+import 'dart:io' as io; |
+ |
import 'package:di/di.dart'; |
import 'package:di/dynamic_injector.dart'; |
-import 'package:angular/core/module.dart'; |
import 'package:angular/core/parser/parser.dart'; |
-import 'package:angular/tools/parser_generator/generator.dart'; |
import 'package:angular/tools/parser_getter_setter/generator.dart'; |
main(arguments) { |
- var isGetter = !arguments.isEmpty; |
- |
Module module = new Module()..type(Parser, implementedBy: DynamicParser); |
- if (isGetter) { |
- module.type(ParserBackend, implementedBy: DartGetterSetterGen); |
- } else { |
- module.type(ParserBackend, implementedBy: DynamicParserBackend); |
- module.type(FilterMap, implementedBy: NullFilterMap); |
- } |
+ module.type(ParserBackend, implementedBy: DartGetterSetterGen); |
Injector injector = new DynamicInjector(modules: [module], |
allowImplicitInjection: true); |
// List generated using: |
// node node_modules/karma/bin/karma run | grep -Eo ":XNAY:.*:XNAY:" | sed -e 's/:XNAY://g' | sed -e "s/^/'/" | sed -e "s/$/',/" | sort | uniq > missing_expressions |
- injector.get(isGetter ? ParserGetterSetter : ParserGenerator).generateParser([ |
+ injector.get(ParserGetterSetter).generateParser([ |
"foo == 'bar' ||\nbaz", |
"nonmap['hello']", |
"nonmap['hello']=3", |
@@ -120,6 +113,14 @@ main(arguments) { |
'true', |
'true || run()', |
'undefined', |
+ 'null < 0', |
+ 'null * 3', |
+ 'null + 6', |
+ '5 + null', |
+ 'null - 4', |
+ '3 - null', |
+ 'null + null', |
+ 'null - null', |
';;1;;', |
'1==1', |
@@ -167,6 +168,7 @@ main(arguments) { |
'add(a,b)', |
'notAProperty', |
"'Foo'|uppercase", |
+ "'f' + ('o'|uppercase) + 'o'", |
"1|increment:2", |
"'abcd'|substring:1:offset", |
"'abcd'|substring:1:3|uppercase", |
@@ -426,5 +428,67 @@ main(arguments) { |
"o.void()", |
"o.while()", |
"o.with()", |
- ]); |
+ |
+ '"Foo"|(', |
+ '"Foo"|1234', |
+ '"Foo"|"uppercase"', |
+ 'x.(', |
+ 'x. 1234', |
+ 'x."foo"', |
+ '{(:0}', |
+ '{1234:0}', |
+ |
+ "sub1(1)", |
+ "sub1(3, b: 2)", |
+ "sub2()", |
+ "sub2(a: 3)", |
+ "sub2(a: 3, b: 2)", |
+ "sub2(b: 4)", |
+ |
+ "o.sub1(1)", |
+ "o.sub1(3, b: 2)", |
+ "o.sub2()", |
+ "o.sub2(a: 3)", |
+ "o.sub2(a: 3, b: 2)", |
+ "o.sub2(b: 4)", |
+ |
+ "(sub1)(1)", |
+ "(sub1)(3, b: 2)", |
+ "(sub2)()", |
+ "(sub2)(a: 3)", |
+ "(sub2)(a: 3, b: 2)", |
+ "(sub2)(b: 4)", |
+ |
+ 'foo(a: 0, a: 1)', |
+ 'foo(a: 0, b: 1, a: 2)', |
+ 'foo(0, a: 1, a: 2)', |
+ 'foo(0, a: 1, b: 2, a: 3)', |
+ |
+ 'foo(if: 0)', |
+ 'foo(a: 0, class: 0)', |
+ |
+ 'foo(a: 0)', |
+ 'foo(a: 0, b: 1)', |
+ 'foo(b: 1, a: 0)', |
+ 'foo(0)', |
+ 'foo(0, a: 0)', |
+ 'foo(0, a: 0, b: 1)', |
+ 'foo(0, b: 1, a: 0)', |
+ |
+ 'o.foo(a: 0)', |
+ 'o.foo(a: 0, b: 1)', |
+ 'o.foo(b: 1, a: 0)', |
+ 'o.foo(0)', |
+ 'o.foo(0, a: 0)', |
+ 'o.foo(0, a: 0, b: 1)', |
+ 'o.foo(0, b: 1, a: 0)', |
+ |
+ '(foo)(a: 0)', |
+ '(foo)(a: 0, b: 1)', |
+ '(foo)(b: 1, a: 0)', |
+ '(foo)(0)', |
+ '(foo)(0, a: 0)', |
+ '(foo)(0, a: 0, b: 1)', |
+ '(foo)(0, b: 1, a: 0)', |
+ ], io.stdout); |
} |