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

Unified Diff: pkg/polymer_expressions/test/parser_test.dart

Issue 74543003: Split out Index AST node from Invoke (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Split out Getter too Created 7 years, 1 month 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: pkg/polymer_expressions/test/parser_test.dart
diff --git a/pkg/polymer_expressions/test/parser_test.dart b/pkg/polymer_expressions/test/parser_test.dart
index 66c1d046b58c699acd69bc7f06f5d055e4c19a5c..4b3f2b1532c90c645db469a1bf1fc8258a2a845a 100644
--- a/pkg/polymer_expressions/test/parser_test.dart
+++ b/pkg/polymer_expressions/test/parser_test.dart
@@ -80,15 +80,15 @@ main() {
});
test('should parse a dot operator', () {
- expectParse('a.b', invoke(ident('a'), 'b'));
+ expectParse('a.b', getter(ident('a'), 'b'));
});
test('should parse chained dot operators', () {
- expectParse('a.b.c', invoke(invoke(ident('a'), 'b'), 'c'));
+ expectParse('a.b.c', getter(getter(ident('a'), 'b'), 'c'));
});
test('should give dot high associativity', () {
- expectParse('a * b.c', binary(ident('a'), '*', invoke(ident('b'), 'c')));
+ expectParse('a * b.c', binary(ident('a'), '*', getter(ident('b'), 'c')));
});
test('should parse a function with no arguments', () {
@@ -146,20 +146,19 @@ main() {
});
test('should parse an index operator', () {
- expectParse('a[b]', invoke(ident('a'), '[]', [ident('b')]));
- expectParse('a.b[c]', invoke(invoke(ident('a'), 'b', null),
- '[]', [ident('c')]));
+ expectParse('a[b]', index(ident('a'), ident('b')));
+ expectParse('a.b[c]', index(getter(ident('a'), 'b'), ident('c')));
});
test('should parse chained index operators', () {
- expectParse('a[][]', invoke(invoke(ident('a'), '[]', []), '[]', []));
+ expectParse('a[][]', index(index(ident('a'), null), null));
});
test('should parse multiple index operators', () {
expectParse('a[b] + c[d]', binary(
- invoke(ident('a'), '[]', [ident('b')]),
+ index(ident('a'), ident('b')),
'+',
- invoke(ident('c'), '[]', [ident('d')])));
+ index(ident('c'), ident('d'))));
});
test('should parse a filter chain', () {
@@ -170,7 +169,7 @@ main() {
test('should parse comprehension', () {
expectParse('a in b', inExpr(ident('a'), ident('b')));
expectParse('a in b.c',
- inExpr(ident('a'), invoke(ident('b'), 'c', null)));
+ inExpr(ident('a'), getter(ident('b'), 'c')));
expectParse('a in b + c',
inExpr(ident('a'), binary(ident('b'), '+', ident('c'))));
});
@@ -201,7 +200,7 @@ main() {
test('should parse map literals with method calls', () {
expectParse("{'a': 1}.length",
- invoke(mapLiteral([mapLiteralEntry(literal('a'), literal(1))]),
+ getter(mapLiteral([mapLiteralEntry(literal('a'), literal(1))]),
'length'));
});
});
« pkg/polymer_expressions/lib/eval.dart ('K') | « pkg/polymer_expressions/lib/visitor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698