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

Side by Side Diff: lib/src/js/builder.dart

Issue 1016003003: sort classes in dependency order, or load lazily if needed, fixes #78 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/dart/_interceptors.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Utilities for building JS ASTs at runtime. Contains a builder class 5 // Utilities for building JS ASTs at runtime. Contains a builder class
6 // and a parser that parses part of the language. 6 // and a parser that parses part of the language.
7 7
8 part of js_ast; 8 part of js_ast;
9 9
10 10
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 bool isGetter = false; 1474 bool isGetter = false;
1475 bool isSetter = false; 1475 bool isSetter = false;
1476 Expression name = null; 1476 Expression name = null;
1477 if (acceptCategory(HASH)) { 1477 if (acceptCategory(HASH)) {
1478 if (lastCategory != LPAREN && (onlyMethods || lastCategory != COLON)) { 1478 if (lastCategory != LPAREN && (onlyMethods || lastCategory != COLON)) {
1479 // Interpolated method 1479 // Interpolated method
1480 var member = new InterpolatedMethod(parseHash()); 1480 var member = new InterpolatedMethod(parseHash());
1481 interpolatedValues.add(member); 1481 interpolatedValues.add(member);
1482 return member; 1482 return member;
1483 } 1483 }
1484 name = parseInterpolatedExpression(); 1484 var interpolated = new InterpolatedExpression(parseHash());
1485 interpolatedValues.add(interpolated);
1486 name = interpolated;
1485 } else { 1487 } else {
1486 name = parsePropertyName(); 1488 name = parsePropertyName();
1487 } 1489 }
1488 1490
1489 // Allow get or set to be followed by another property name. 1491 // Allow get or set to be followed by another property name.
1490 if (lastCategory == ALPHA && name is PropertyName) { 1492 if (name is PropertyName &&
1493 (lastCategory == ALPHA || lastCategory == HASH)) {
1491 PropertyName p = name; 1494 PropertyName p = name;
1492 isGetter = p.name == 'get'; 1495 isGetter = p.name == 'get';
1493 isSetter = p.name == 'set'; 1496 isSetter = p.name == 'set';
1494 if (isGetter || isSetter) { 1497 if (isGetter || isSetter) {
1495 name = parsePropertyName(); 1498 name = parsePropertyName();
1496 } 1499 }
1497 } 1500 }
1498 1501
1499 if (!onlyMethods && acceptCategory(COLON)) { 1502 if (!onlyMethods && acceptCategory(COLON)) {
1500 Expression value = parseAssignment(); 1503 Expression value = parseAssignment();
(...skipping 12 matching lines...) Expand all
1513 } else if (acceptCategory(STRING)) { 1516 } else if (acceptCategory(STRING)) {
1514 return new LiteralString(identifier); 1517 return new LiteralString(identifier);
1515 } else if (acceptCategory(SYMBOL)) { 1518 } else if (acceptCategory(SYMBOL)) {
1516 // e.g. void 1519 // e.g. void
1517 return new LiteralString('"$identifier"'); 1520 return new LiteralString('"$identifier"');
1518 } else if (acceptCategory(LSQUARE)) { 1521 } else if (acceptCategory(LSQUARE)) {
1519 var expr = parseAssignment(); 1522 var expr = parseAssignment();
1520 expectCategory(RSQUARE); 1523 expectCategory(RSQUARE);
1521 return expr; 1524 return expr;
1522 } else if (acceptCategory(HASH)) { 1525 } else if (acceptCategory(HASH)) {
1523 return parseInterpolatedExpression(); 1526 var member = new InterpolatedPropertyName(parseHash());
1527 interpolatedValues.add(member);
1528 return member;
1524 } else { 1529 } else {
1525 error('Expected property name'); 1530 error('Expected property name');
1526 return null; 1531 return null;
1527 } 1532 }
1528 } 1533 }
1529
1530 InterpolatedExpression parseInterpolatedExpression() {
1531 var interpolated = new InterpolatedExpression(parseHash());
1532 interpolatedValues.add(interpolated);
1533 return interpolated;
1534 }
1535 } 1534 }
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/dart/_interceptors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698