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

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

Issue 10010009: Calculator App for ChromeOS with fixes for templates/CSS to support this application. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Mininimal templates and more text node tests. Created 8 years, 8 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
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 // 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 class Tokenizer extends TokenizerBase { 5 class Tokenizer extends TokenizerBase {
6 TokenKind tmplTokens; 6 TokenKind tmplTokens;
7 7
8 bool _selectorParsing; 8 bool _selectorParsing;
9 9
10 Tokenizer(SourceFile source, bool skipWhitespace, [int index = 0]) 10 Tokenizer(SourceFile source, bool skipWhitespace, [int index = 0])
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return finishQuotedAttrValue( 73 return finishQuotedAttrValue(
74 tmplTokens.tokens[TokenKind.DOUBLE_QUOTE]); 74 tmplTokens.tokens[TokenKind.DOUBLE_QUOTE]);
75 } else if (isAttributeValueStart(_peekChar())) { 75 } else if (isAttributeValueStart(_peekChar())) {
76 return finishAttrValue(); 76 return finishAttrValue();
77 } 77 }
78 } 78 }
79 return _finishToken(TokenKind.EQUAL); 79 return _finishToken(TokenKind.EQUAL);
80 case tmplTokens.tokens[TokenKind.SLASH]: 80 case tmplTokens.tokens[TokenKind.SLASH]:
81 if (_maybeEatChar(tmplTokens.tokens[TokenKind.GREATER_THAN])) { 81 if (_maybeEatChar(tmplTokens.tokens[TokenKind.GREATER_THAN])) {
82 return _finishToken(TokenKind.END_NO_SCOPE_TAG); // /> 82 return _finishToken(TokenKind.END_NO_SCOPE_TAG); // />
83 } else if (_maybeEatChar(tmplTokens.tokens[TokenKind.ASTERISK])) {
84 return finishMultiLineComment();
83 } else { 85 } else {
84 return _finishToken(TokenKind.SLASH); 86 return _finishToken(TokenKind.SLASH);
85 } 87 }
86 case tmplTokens.tokens[TokenKind.DOLLAR]: 88 case tmplTokens.tokens[TokenKind.DOLLAR]:
87 if (_maybeEatChar(tmplTokens.tokens[TokenKind.LBRACE])) { 89 if (_maybeEatChar(tmplTokens.tokens[TokenKind.LBRACE])) {
88 if (_maybeEatChar(tmplTokens.tokens[TokenKind.HASH])) { 90 if (_maybeEatChar(tmplTokens.tokens[TokenKind.HASH])) {
89 return _finishToken(TokenKind.START_COMMAND); // ${# 91 return _finishToken(TokenKind.START_COMMAND); // ${#
90 } else if (_maybeEatChar(tmplTokens.tokens[TokenKind.SLASH])) { 92 } else if (_maybeEatChar(tmplTokens.tokens[TokenKind.SLASH])) {
91 return _finishToken(TokenKind.END_COMMAND); // ${/ 93 return _finishToken(TokenKind.END_COMMAND); // ${/
92 } else { 94 } else {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 299 }
298 300
299 static bool isSlash(int c) { 301 static bool isSlash(int c) {
300 return (c == 47/* / */); 302 return (c == 47/* / */);
301 } 303 }
302 304
303 static bool isCloseTag(int c) { 305 static bool isCloseTag(int c) {
304 return (c == 62/* > */); 306 return (c == 62/* > */);
305 } 307 }
306 } 308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698