OLD | NEW |
| (Empty) |
1 import 'package:di/di.dart'; | |
2 import 'package:di/dynamic_injector.dart'; | |
3 import 'package:angular/core/module.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'; | |
7 | |
8 main(arguments) { | |
9 var isGetter = !arguments.isEmpty; | |
10 | |
11 Module module = new Module()..type(Parser, implementedBy: DynamicParser); | |
12 if (isGetter) { | |
13 module.type(ParserBackend, implementedBy: DartGetterSetterGen); | |
14 } else { | |
15 module.type(ParserBackend, implementedBy: DynamicParserBackend); | |
16 module.type(FilterMap, implementedBy: NullFilterMap); | |
17 } | |
18 Injector injector = new DynamicInjector(modules: [module], | |
19 allowImplicitInjection: true); | |
20 | |
21 // List generated using: | |
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 | |
23 injector.get(isGetter ? ParserGetterSetter : ParserGenerator).generateParser([ | |
24 "foo == 'bar' ||\nbaz", | |
25 "nonmap['hello']", | |
26 "nonmap['hello']=3", | |
27 "this['a'].b", | |
28 "const", | |
29 "null", | |
30 "[1, 2].length", | |
31 | |
32 "doesNotExist", | |
33 "doesNotExist()", | |
34 "doesNotExist(1)", | |
35 "doesNotExist(1, 2)", | |
36 "a.doesNotExist()", | |
37 "a.doesNotExist(1)", | |
38 "a.doesNotExist(1, 2)", | |
39 | |
40 "a.b.c", | |
41 "x.b.c", | |
42 "e1.b", | |
43 "o.f()", | |
44 "1", "-1", "+1", | |
45 "true?1", | |
46 "!true", | |
47 "3*4/2%5", "3+6-2", | |
48 "2<3", "2>3", "2<=2", "2>=2", | |
49 "2==3", "2!=3", | |
50 "true&&true", "true&&false", | |
51 "true||true", "true||false", "false||false", | |
52 "'str ' + 4", "4 + ' str'", "4 + 4", "4 + 4 + ' str'", | |
53 "'str ' + 4 + 4", | |
54 "a", "b.c" , "x.y.z", | |
55 'ident.id(6)', 'ident.doubleId(4,5)', | |
56 "a.b.c.d.e.f.g.h.i.j.k.l.m.n", | |
57 'b', 'a.x', 'a.b.c.d', | |
58 "(1+2)*3", | |
59 "a=12", "arr[c=1]", "x.y.z=123;", | |
60 "a=123; b=234", | |
61 "constN()", | |
62 "add(1,2)", | |
63 "getter()()", | |
64 "obj.elementAt(0)", | |
65 "[]", | |
66 "[1, 2]", | |
67 "[1][0]", | |
68 "[[1]][0][0]", | |
69 "[].length", | |
70 "{}", | |
71 "{a:'b'}", | |
72 "{'a':'b'}", | |
73 "{\"a\":'b'}", | |
74 "{false:'WC', true:'CC'}[false]", | |
75 ')', | |
76 '[{}]', | |
77 '0&&2', | |
78 '1%2', | |
79 '1 + 2.5', | |
80 '1+undefined', | |
81 '4()', | |
82 '5=4', | |
83 '6[3]', | |
84 '{a', | |
85 'a[1]=2', | |
86 'a=1;b=3;a+b', | |
87 'a.b', | |
88 'a(b', | |
89 '\'a\' + \'b c\'', | |
90 'a().name', | |
91 'a[x()]()', | |
92 'boo', | |
93 'getNoSuchMethod', | |
94 '[].count(', | |
95 'false', | |
96 'false && run()', | |
97 '!false || true', | |
98 'foo()', | |
99 '\$id', | |
100 'items[1] = "abc"', | |
101 'items[1].name', | |
102 'list[3] = 2', | |
103 'map["square"] = 6', | |
104 'method', | |
105 'method()', | |
106 'notAFn()', | |
107 'notmixed', | |
108 'obj[0].name=1', | |
109 'obj.field = 1', | |
110 'obj.field.key = 4', | |
111 'obj.integer = "hello"', | |
112 'obj.map.mapKey = 3', | |
113 'obj.nested.field = 1', | |
114 'obj.overload = 7', | |
115 'obj.setter = 2', | |
116 'str', | |
117 'str="bob"', | |
118 'suffix = "!"', | |
119 'taxRate / 100 * subTotal', | |
120 'true', | |
121 'true || run()', | |
122 'undefined', | |
123 | |
124 ';;1;;', | |
125 '1==1', | |
126 '!(11 == 10)', | |
127 '1 + -2.5', | |
128 '[{a', | |
129 'array[5=4]', | |
130 '\$root', | |
131 'subTotal * taxRate / 100', | |
132 '!!true', | |
133 | |
134 '1!=2', | |
135 '1+2*3/4', | |
136 '\$parent', | |
137 '{true', | |
138 | |
139 '0--1+1.5', | |
140 '1<2', | |
141 '1<=1', | |
142 | |
143 '1>2', | |
144 '{a:\'-\'}', | |
145 '{a:a}', | |
146 '[{a:[]}, {b:1}]', | |
147 '{true:"a", false:"b"}[!!true]', | |
148 | |
149 '2>=1', | |
150 'true==2<3', | |
151 '6[3]=2', | |
152 | |
153 'map.dot = 7', | |
154 'map.null', | |
155 'exists(doesNotExist())', | |
156 'doesNotExists(exists())', | |
157 'a[0]()', | |
158 '{}()', | |
159 'items[1]', | |
160 "-0--1++2*-3/-4", | |
161 "1/2*3", | |
162 "0||2", | |
163 "0||1&&2", | |
164 'undefined+1', | |
165 "12/6/2", | |
166 "a=undefined", | |
167 'add(a,b)', | |
168 'notAProperty', | |
169 "'Foo'|uppercase", | |
170 "1|increment:2", | |
171 "'abcd'|substring:1:offset", | |
172 "'abcd'|substring:1:3|uppercase", | |
173 "3*4~/2%5", | |
174 "7==3+4?10:20", | |
175 "false?10:20", | |
176 "5?10:20", | |
177 "null?10:20", | |
178 "true||false?10:20", | |
179 "true&&false?10:20", | |
180 "true?a=10:a=20", | |
181 "b=true?a=false?11:c=12:a=13", | |
182 '0?0:2', | |
183 '1?0:2', | |
184 '0?0?0:0:2', | |
185 '1?0?0:0:2', | |
186 '0?1?0:0:2', | |
187 '0?0?1:0:2', | |
188 '0?0?0:2:3', | |
189 '1?1?0:0:2', | |
190 '1?1?1:0:2', | |
191 '1?1?1:2:3', | |
192 '0?0:0?0:2', | |
193 '1?0:0?0:2', | |
194 '0?1:0?0:2', | |
195 '0?0:1?0:2', | |
196 '0?0:0?2:3', | |
197 '1?1:0?0:2', | |
198 '1?1:1?0:2', | |
199 '1?1:1?2:3', | |
200 '0&&1?0:1', | |
201 '1||0?0:0', | |
202 '0?0&&1:2', | |
203 '0?1&&1:2', | |
204 '0?0||0:1', | |
205 '0?0||1:2', | |
206 '1?0&&1:2', | |
207 '1?1&&1:2', | |
208 '1?0||0:1', | |
209 '1?0||1:2', | |
210 '0?1:0&&1', | |
211 '0?2:1&&1', | |
212 '0?1:0||0', | |
213 '0?2:0||1', | |
214 '1?1:0&&1', | |
215 '1?2:1&&1', | |
216 '1?1:0||0', | |
217 '1?2:0||1', | |
218 'returnTrue() ? returnString() : returnInt()', | |
219 'returnFalse() ? returnString() : returnInt()', | |
220 'identity(returnFalse() ? returnString() : returnInt())', | |
221 "taxRate ~/ 100 * subTotal", | |
222 "'fOo'|uppercase|lowercase", | |
223 "n = (name|lowercase)", | |
224 "n", | |
225 "1|nonexistent", | |
226 "publicField", | |
227 "_privateField", | |
228 "'World'|hello", | |
229 "1;'World'|hello", | |
230 "'World'|hello;1", | |
231 | |
232 "assert", | |
233 "break", | |
234 "case", | |
235 "catch", | |
236 "class", | |
237 "const", | |
238 "continue", | |
239 "default", | |
240 "do", | |
241 "else", | |
242 "enum", | |
243 "extends", | |
244 "final", | |
245 "finally", | |
246 "for", | |
247 "if", | |
248 "in", | |
249 "is", | |
250 "new", | |
251 "rethrow", | |
252 "return", | |
253 "super", | |
254 "switch", | |
255 "this", | |
256 "throw", | |
257 "try", | |
258 "var", | |
259 "void", | |
260 "while", | |
261 "with", | |
262 | |
263 "assert = 42", | |
264 "break = 42", | |
265 "case = 42", | |
266 "catch = 42", | |
267 "class = 42", | |
268 "const = 42", | |
269 "continue = 42", | |
270 "default = 42", | |
271 "do = 42", | |
272 "else = 42", | |
273 "enum = 42", | |
274 "extends = 42", | |
275 "false = 42", | |
276 "final = 42", | |
277 "finally = 42", | |
278 "for = 42", | |
279 "if = 42", | |
280 "in = 42", | |
281 "is = 42", | |
282 "new = 42", | |
283 "null = 42", | |
284 "rethrow = 42", | |
285 "return = 42", | |
286 "super = 42", | |
287 "switch = 42", | |
288 "this = 42", | |
289 "throw = 42", | |
290 "true = 42", | |
291 "try = 42", | |
292 "var = 42", | |
293 "void = 42", | |
294 "while = 42", | |
295 "with = 42", | |
296 | |
297 "assert()", | |
298 "break()", | |
299 "case()", | |
300 "catch()", | |
301 "class()", | |
302 "const()", | |
303 "continue()", | |
304 "default()", | |
305 "do()", | |
306 "else()", | |
307 "enum()", | |
308 "extends()", | |
309 "final()", | |
310 "finally()", | |
311 "for()", | |
312 "if()", | |
313 "in()", | |
314 "is()", | |
315 "new()", | |
316 "rethrow()", | |
317 "return()", | |
318 "super()", | |
319 "switch()", | |
320 "this()", | |
321 "throw()", | |
322 "try()", | |
323 "var()", | |
324 "void()", | |
325 "while()", | |
326 "with()", | |
327 | |
328 "o.assert", | |
329 "o.break", | |
330 "o.case", | |
331 "o.catch", | |
332 "o.class", | |
333 "o.const", | |
334 "o.continue", | |
335 "o.default", | |
336 "o.do", | |
337 "o.else", | |
338 "o.enum", | |
339 "o.extends", | |
340 "o.false", | |
341 "o.final", | |
342 "o.finally", | |
343 "o.for", | |
344 "o.if", | |
345 "o.in", | |
346 "o.is", | |
347 "o.new", | |
348 "o.null", | |
349 "o.rethrow", | |
350 "o.return", | |
351 "o.super", | |
352 "o.switch", | |
353 "o.this", | |
354 "o.throw", | |
355 "o.true", | |
356 "o.try", | |
357 "o.var", | |
358 "o.void", | |
359 "o.while", | |
360 "o.with", | |
361 | |
362 "o.assert = 42", | |
363 "o.break = 42", | |
364 "o.case = 42", | |
365 "o.catch = 42", | |
366 "o.class = 42", | |
367 "o.const = 42", | |
368 "o.continue = 42", | |
369 "o.default = 42", | |
370 "o.do = 42", | |
371 "o.else = 42", | |
372 "o.enum = 42", | |
373 "o.extends = 42", | |
374 "o.false = 42", | |
375 "o.final = 42", | |
376 "o.finally = 42", | |
377 "o.for = 42", | |
378 "o.if = 42", | |
379 "o.in = 42", | |
380 "o.is = 42", | |
381 "o.new = 42", | |
382 "o.null = 42", | |
383 "o.rethrow = 42", | |
384 "o.return = 42", | |
385 "o.super = 42", | |
386 "o.switch = 42", | |
387 "o.this = 42", | |
388 "o.throw = 42", | |
389 "o.true = 42", | |
390 "o.try = 42", | |
391 "o.var = 42", | |
392 "o.void = 42", | |
393 "o.while = 42", | |
394 "o.with = 42", | |
395 | |
396 "o.assert()", | |
397 "o.break()", | |
398 "o.case()", | |
399 "o.catch()", | |
400 "o.class()", | |
401 "o.const()", | |
402 "o.continue()", | |
403 "o.default()", | |
404 "o.do()", | |
405 "o.else()", | |
406 "o.enum()", | |
407 "o.extends()", | |
408 "o.false()", | |
409 "o.final()", | |
410 "o.finally()", | |
411 "o.for()", | |
412 "o.if()", | |
413 "o.in()", | |
414 "o.is()", | |
415 "o.new()", | |
416 "o.null()", | |
417 "o.rethrow()", | |
418 "o.return()", | |
419 "o.super()", | |
420 "o.switch()", | |
421 "o.this()", | |
422 "o.throw()", | |
423 "o.true()", | |
424 "o.try()", | |
425 "o.var()", | |
426 "o.void()", | |
427 "o.while()", | |
428 "o.with()", | |
429 ]); | |
430 } | |
OLD | NEW |