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

Side by Side Diff: utils/template/parser.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « utils/pub/yaml/yaml_map.dart ('k') | utils/template/utils.dart » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 3
4 class TagStack { 4 class TagStack {
5 List<ASTNode> _stack; 5 List<ASTNode> _stack;
6 6
7 TagStack(var elem) : _stack = [] { 7 TagStack(var elem) : _stack = [] {
8 _stack.add(elem); 8 _stack.add(elem);
9 } 9 }
10 10
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 int scopeType; // 1 implies scoped, 2 implies non-scoped element. 447 int scopeType; // 1 implies scoped, 2 implies non-scoped element.
448 if (_maybeEat(TokenKind.GREATER_THAN)) { 448 if (_maybeEat(TokenKind.GREATER_THAN)) {
449 // Scoped unless the tag is explicitly known as an unscoped tag 449 // Scoped unless the tag is explicitly known as an unscoped tag
450 // e.g., <br>. 450 // e.g., <br>.
451 scopeType = TokenKind.unscopedTag(tagToken.kind) ? 2 : 1; 451 scopeType = TokenKind.unscopedTag(tagToken.kind) ? 2 : 1;
452 } else if (_maybeEat(TokenKind.END_NO_SCOPE_TAG)) { 452 } else if (_maybeEat(TokenKind.END_NO_SCOPE_TAG)) {
453 scopeType = 2; 453 scopeType = 2;
454 } 454 }
455 if (scopeType > 0) { 455 if (scopeType > 0) {
456 var elem = new TemplateElement.attributes(tagToken.kind, 456 var elem = new TemplateElement.attributes(tagToken.kind,
457 attrs.values, varName, _makeSpan(start)); 457 attrs.values.toList(), varName, _makeSpan(start));
458 stack.top().add(elem); 458 stack.top().add(elem);
459 459
460 if (scopeType == 1) { 460 if (scopeType == 1) {
461 // Maybe more nested tags/text? 461 // Maybe more nested tags/text?
462 stack.push(elem); 462 stack.push(elem);
463 } 463 }
464 } 464 }
465 } else { 465 } else {
466 // Close tag 466 // Close tag
467 _eat(TokenKind.SLASH); 467 _eat(TokenKind.SLASH);
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 } 711 }
712 712
713 if (stringValue.length > 0) { 713 if (stringValue.length > 0) {
714 nodes.add(new TemplateText(stringValue.toString(), _makeSpan(start))); 714 nodes.add(new TemplateText(stringValue.toString(), _makeSpan(start)));
715 } 715 }
716 716
717 return nodes; 717 return nodes;
718 } 718 }
719 719
720 } 720 }
OLDNEW
« no previous file with comments | « utils/pub/yaml/yaml_map.dart ('k') | utils/template/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698