OLD | NEW |
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 Loading... |
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 Loading... |
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 | |
OLD | NEW |