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

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

Issue 9728009: Template bug fixes and new features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Undid css.status change Created 8 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 | Annotate | Revision Log
« no previous file with comments | « utils/template/parser.dart ('k') | utils/tests/template/callview.tmpl » ('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 // 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 25 matching lines...) Expand all
36 36
37 int ch; 37 int ch;
38 ch = _nextChar(); 38 ch = _nextChar();
39 switch(ch) { 39 switch(ch) {
40 case 0: 40 case 0:
41 return _finishToken(TokenKind.END_OF_FILE); 41 return _finishToken(TokenKind.END_OF_FILE);
42 case tmplTokens.tokens[TokenKind.SPACE]: 42 case tmplTokens.tokens[TokenKind.SPACE]:
43 case tmplTokens.tokens[TokenKind.TAB]: 43 case tmplTokens.tokens[TokenKind.TAB]:
44 case tmplTokens.tokens[TokenKind.NEWLINE]: 44 case tmplTokens.tokens[TokenKind.NEWLINE]:
45 case tmplTokens.tokens[TokenKind.RETURN]: 45 case tmplTokens.tokens[TokenKind.RETURN]:
46 return finishWhitespace(); 46 if (inTag) {
47 return finishWhitespace();
48 } else {
49 return _finishToken(TokenKind.WHITESPACE);
50 }
47 case tmplTokens.tokens[TokenKind.END_OF_FILE]: 51 case tmplTokens.tokens[TokenKind.END_OF_FILE]:
48 return _finishToken(TokenKind.END_OF_FILE); 52 return _finishToken(TokenKind.END_OF_FILE);
49 case tmplTokens.tokens[TokenKind.LPAREN]: 53 case tmplTokens.tokens[TokenKind.LPAREN]:
50 return _finishToken(TokenKind.LPAREN); 54 return _finishToken(TokenKind.LPAREN);
51 case tmplTokens.tokens[TokenKind.RPAREN]: 55 case tmplTokens.tokens[TokenKind.RPAREN]:
52 return _finishToken(TokenKind.RPAREN); 56 return _finishToken(TokenKind.RPAREN);
53 case tmplTokens.tokens[TokenKind.COMMA]: 57 case tmplTokens.tokens[TokenKind.COMMA]:
54 return _finishToken(TokenKind.COMMA); 58 return _finishToken(TokenKind.COMMA);
55 case tmplTokens.tokens[TokenKind.LBRACE]: 59 case tmplTokens.tokens[TokenKind.LBRACE]:
56 return _finishToken(TokenKind.LBRACE); 60 return _finishToken(TokenKind.LBRACE);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 297 }
294 298
295 static bool isSlash(int c) { 299 static bool isSlash(int c) {
296 return (c == 47/* / */); 300 return (c == 47/* / */);
297 } 301 }
298 302
299 static bool isCloseTag(int c) { 303 static bool isCloseTag(int c) {
300 return (c == 62/* > */); 304 return (c == 62/* > */);
301 } 305 }
302 } 306 }
OLDNEW
« no previous file with comments | « utils/template/parser.dart ('k') | utils/tests/template/callview.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698