| OLD | NEW |
| 1 import 'dart:io' as io; | |
| 2 | |
| 3 import 'package:di/di.dart'; | 1 import 'package:di/di.dart'; |
| 4 import 'package:di/dynamic_injector.dart'; | 2 import 'package:di/dynamic_injector.dart'; |
| 3 import 'package:angular/core/module.dart'; |
| 5 import 'package:angular/core/parser/parser.dart'; | 4 import 'package:angular/core/parser/parser.dart'; |
| 5 import 'package:angular/tools/parser_generator/generator.dart'; |
| 6 import 'package:angular/tools/parser_getter_setter/generator.dart'; | 6 import 'package:angular/tools/parser_getter_setter/generator.dart'; |
| 7 | 7 |
| 8 main(arguments) { | 8 main(arguments) { |
| 9 var isGetter = !arguments.isEmpty; |
| 10 |
| 9 Module module = new Module()..type(Parser, implementedBy: DynamicParser); | 11 Module module = new Module()..type(Parser, implementedBy: DynamicParser); |
| 10 module.type(ParserBackend, implementedBy: DartGetterSetterGen); | 12 if (isGetter) { |
| 13 module.type(ParserBackend, implementedBy: DartGetterSetterGen); |
| 14 } else { |
| 15 module.type(ParserBackend, implementedBy: DynamicParserBackend); |
| 16 module.type(FilterMap, implementedBy: NullFilterMap); |
| 17 } |
| 11 Injector injector = new DynamicInjector(modules: [module], | 18 Injector injector = new DynamicInjector(modules: [module], |
| 12 allowImplicitInjection: true); | 19 allowImplicitInjection: true); |
| 13 | 20 |
| 14 // List generated using: | 21 // List generated using: |
| 15 // 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_expre
ssions | 22 // 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_expre
ssions |
| 16 injector.get(ParserGetterSetter).generateParser([ | 23 injector.get(isGetter ? ParserGetterSetter : ParserGenerator).generateParser([ |
| 17 "foo == 'bar' ||\nbaz", | 24 "foo == 'bar' ||\nbaz", |
| 18 "nonmap['hello']", | 25 "nonmap['hello']", |
| 19 "nonmap['hello']=3", | 26 "nonmap['hello']=3", |
| 20 "this['a'].b", | 27 "this['a'].b", |
| 21 "const", | 28 "const", |
| 22 "null", | 29 "null", |
| 23 "[1, 2].length", | 30 "[1, 2].length", |
| 24 | 31 |
| 25 "doesNotExist", | 32 "doesNotExist", |
| 26 "doesNotExist()", | 33 "doesNotExist()", |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 'obj.nested.field = 1', | 113 'obj.nested.field = 1', |
| 107 'obj.overload = 7', | 114 'obj.overload = 7', |
| 108 'obj.setter = 2', | 115 'obj.setter = 2', |
| 109 'str', | 116 'str', |
| 110 'str="bob"', | 117 'str="bob"', |
| 111 'suffix = "!"', | 118 'suffix = "!"', |
| 112 'taxRate / 100 * subTotal', | 119 'taxRate / 100 * subTotal', |
| 113 'true', | 120 'true', |
| 114 'true || run()', | 121 'true || run()', |
| 115 'undefined', | 122 'undefined', |
| 116 'null < 0', | |
| 117 'null * 3', | |
| 118 'null + 6', | |
| 119 '5 + null', | |
| 120 'null - 4', | |
| 121 '3 - null', | |
| 122 'null + null', | |
| 123 'null - null', | |
| 124 | 123 |
| 125 ';;1;;', | 124 ';;1;;', |
| 126 '1==1', | 125 '1==1', |
| 127 '!(11 == 10)', | 126 '!(11 == 10)', |
| 128 '1 + -2.5', | 127 '1 + -2.5', |
| 129 '[{a', | 128 '[{a', |
| 130 'array[5=4]', | 129 'array[5=4]', |
| 131 '\$root', | 130 '\$root', |
| 132 'subTotal * taxRate / 100', | 131 'subTotal * taxRate / 100', |
| 133 '!!true', | 132 '!!true', |
| (...skipping 27 matching lines...) Expand all Loading... |
| 161 "-0--1++2*-3/-4", | 160 "-0--1++2*-3/-4", |
| 162 "1/2*3", | 161 "1/2*3", |
| 163 "0||2", | 162 "0||2", |
| 164 "0||1&&2", | 163 "0||1&&2", |
| 165 'undefined+1', | 164 'undefined+1', |
| 166 "12/6/2", | 165 "12/6/2", |
| 167 "a=undefined", | 166 "a=undefined", |
| 168 'add(a,b)', | 167 'add(a,b)', |
| 169 'notAProperty', | 168 'notAProperty', |
| 170 "'Foo'|uppercase", | 169 "'Foo'|uppercase", |
| 171 "'f' + ('o'|uppercase) + 'o'", | |
| 172 "1|increment:2", | 170 "1|increment:2", |
| 173 "'abcd'|substring:1:offset", | 171 "'abcd'|substring:1:offset", |
| 174 "'abcd'|substring:1:3|uppercase", | 172 "'abcd'|substring:1:3|uppercase", |
| 175 "3*4~/2%5", | 173 "3*4~/2%5", |
| 176 "7==3+4?10:20", | 174 "7==3+4?10:20", |
| 177 "false?10:20", | 175 "false?10:20", |
| 178 "5?10:20", | 176 "5?10:20", |
| 179 "null?10:20", | 177 "null?10:20", |
| 180 "true||false?10:20", | 178 "true||false?10:20", |
| 181 "true&&false?10:20", | 179 "true&&false?10:20", |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 "o.super()", | 419 "o.super()", |
| 422 "o.switch()", | 420 "o.switch()", |
| 423 "o.this()", | 421 "o.this()", |
| 424 "o.throw()", | 422 "o.throw()", |
| 425 "o.true()", | 423 "o.true()", |
| 426 "o.try()", | 424 "o.try()", |
| 427 "o.var()", | 425 "o.var()", |
| 428 "o.void()", | 426 "o.void()", |
| 429 "o.while()", | 427 "o.while()", |
| 430 "o.with()", | 428 "o.with()", |
| 431 | 429 ]); |
| 432 '"Foo"|(', | |
| 433 '"Foo"|1234', | |
| 434 '"Foo"|"uppercase"', | |
| 435 'x.(', | |
| 436 'x. 1234', | |
| 437 'x."foo"', | |
| 438 '{(:0}', | |
| 439 '{1234:0}', | |
| 440 | |
| 441 "sub1(1)", | |
| 442 "sub1(3, b: 2)", | |
| 443 "sub2()", | |
| 444 "sub2(a: 3)", | |
| 445 "sub2(a: 3, b: 2)", | |
| 446 "sub2(b: 4)", | |
| 447 | |
| 448 "o.sub1(1)", | |
| 449 "o.sub1(3, b: 2)", | |
| 450 "o.sub2()", | |
| 451 "o.sub2(a: 3)", | |
| 452 "o.sub2(a: 3, b: 2)", | |
| 453 "o.sub2(b: 4)", | |
| 454 | |
| 455 "(sub1)(1)", | |
| 456 "(sub1)(3, b: 2)", | |
| 457 "(sub2)()", | |
| 458 "(sub2)(a: 3)", | |
| 459 "(sub2)(a: 3, b: 2)", | |
| 460 "(sub2)(b: 4)", | |
| 461 | |
| 462 'foo(a: 0, a: 1)', | |
| 463 'foo(a: 0, b: 1, a: 2)', | |
| 464 'foo(0, a: 1, a: 2)', | |
| 465 'foo(0, a: 1, b: 2, a: 3)', | |
| 466 | |
| 467 'foo(if: 0)', | |
| 468 'foo(a: 0, class: 0)', | |
| 469 | |
| 470 'foo(a: 0)', | |
| 471 'foo(a: 0, b: 1)', | |
| 472 'foo(b: 1, a: 0)', | |
| 473 'foo(0)', | |
| 474 'foo(0, a: 0)', | |
| 475 'foo(0, a: 0, b: 1)', | |
| 476 'foo(0, b: 1, a: 0)', | |
| 477 | |
| 478 'o.foo(a: 0)', | |
| 479 'o.foo(a: 0, b: 1)', | |
| 480 'o.foo(b: 1, a: 0)', | |
| 481 'o.foo(0)', | |
| 482 'o.foo(0, a: 0)', | |
| 483 'o.foo(0, a: 0, b: 1)', | |
| 484 'o.foo(0, b: 1, a: 0)', | |
| 485 | |
| 486 '(foo)(a: 0)', | |
| 487 '(foo)(a: 0, b: 1)', | |
| 488 '(foo)(b: 1, a: 0)', | |
| 489 '(foo)(0)', | |
| 490 '(foo)(0, a: 0)', | |
| 491 '(foo)(0, a: 0, b: 1)', | |
| 492 '(foo)(0, b: 1, a: 0)', | |
| 493 ], io.stdout); | |
| 494 } | 430 } |
| OLD | NEW |