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

Side by Side Diff: pkg/csslib/lib/src/tokenizer_base.dart

Issue 679773003: Initialize TokenizerBase int fields for better dart2js codegen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Generated by scripts/tokenizer_gen.py. 4 // Generated by scripts/tokenizer_gen.py.
5 5
6 part of csslib.parser; 6 part of csslib.parser;
7 7
8 /** Tokenizer state to support look ahead for Less' nested selectors. */ 8 /** Tokenizer state to support look ahead for Less' nested selectors. */
9 class TokenizerState { 9 class TokenizerState {
10 final int index; 10 final int index;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // places where an identifier is expected. This was breaking selectors like: 45 // places where an identifier is expected. This was breaking selectors like:
46 // :lang(fr) 46 // :lang(fr)
47 // The assumption that "fr" always means fraction (and similar issue with 47 // The assumption that "fr" always means fraction (and similar issue with
48 // other units) doesn't seem valid. We probably should defer this 48 // other units) doesn't seem valid. We probably should defer this
49 // analysis until we reach places in the parser where units are expected. 49 // analysis until we reach places in the parser where units are expected.
50 // I'm not sure this is tokenizing as described in the specs: 50 // I'm not sure this is tokenizing as described in the specs:
51 // http://dev.w3.org/csswg/css-syntax/ 51 // http://dev.w3.org/csswg/css-syntax/
52 // http://dev.w3.org/csswg/selectors4/ 52 // http://dev.w3.org/csswg/selectors4/
53 bool inSelector = false; 53 bool inSelector = false;
54 54
55 int _index; 55 int _index = 0;
56 int _startIndex; 56 int _startIndex = 0;
57 57
58 static const String _CDATA_START = '<![CDATA['; 58 static const String _CDATA_START = '<![CDATA[';
59 static const String _CDATA_END = ']]>'; 59 static const String _CDATA_END = ']]>';
60 60
61 TokenizerBase(this._file, this._text, this._skipWhitespace, 61 TokenizerBase(this._file, this._text, this._skipWhitespace,
62 [this._index = 0]); 62 [this._index = 0]);
63 63
64 Token next(); 64 Token next();
65 int getIdentifierKind(); 65 int getIdentifierKind();
66 66
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 Token finishDot() { 429 Token finishDot() {
430 if (TokenizerHelpers.isDigit(_peekChar())) { 430 if (TokenizerHelpers.isDigit(_peekChar())) {
431 eatDigits(); 431 eatDigits();
432 return finishNumberExtra(TokenKind.DOUBLE); 432 return finishNumberExtra(TokenKind.DOUBLE);
433 } else { 433 } else {
434 return _finishToken(TokenKind.DOT); 434 return _finishToken(TokenKind.DOT);
435 } 435 }
436 } 436 }
437 } 437 }
438
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698