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 | 4 |
5 part of csslib.parser; | 5 part of csslib.parser; |
6 | 6 |
7 // TODO(terry): Need to be consistent with tokens either they're ASCII tokens | 7 // TODO(terry): Need to be consistent with tokens either they're ASCII tokens |
8 // e.g., ASTERISK or they're CSS e.g., PSEUDO, COMBINATOR_*. | 8 // e.g., ASTERISK or they're CSS e.g., PSEUDO, COMBINATOR_*. |
9 class TokenKind { | 9 class TokenKind { |
10 // Common shared tokens used in TokenizerBase. | 10 // Common shared tokens used in TokenizerBase. |
(...skipping 21 matching lines...) Expand all Loading... |
32 static const int COMMA = 19; // , | 32 static const int COMMA = 19; // , |
33 static const int SPACE = 20; | 33 static const int SPACE = 20; |
34 static const int TAB = 21; // /t | 34 static const int TAB = 21; // /t |
35 static const int NEWLINE = 22; // /n | 35 static const int NEWLINE = 22; // /n |
36 static const int RETURN = 23; // /r | 36 static const int RETURN = 23; // /r |
37 static const int PERCENT = 24; // % | 37 static const int PERCENT = 24; // % |
38 static const int SINGLE_QUOTE = 25; // ' | 38 static const int SINGLE_QUOTE = 25; // ' |
39 static const int DOUBLE_QUOTE = 26; // " | 39 static const int DOUBLE_QUOTE = 26; // " |
40 static const int SLASH = 27; // / | 40 static const int SLASH = 27; // / |
41 static const int EQUALS = 28; // = | 41 static const int EQUALS = 28; // = |
42 static const int OR = 29; // | | |
43 static const int CARET = 30; // ^ | 42 static const int CARET = 30; // ^ |
44 static const int DOLLAR = 31; // $ | 43 static const int DOLLAR = 31; // $ |
45 static const int LESS = 32; // < | 44 static const int LESS = 32; // < |
46 static const int BANG = 33; // ! | 45 static const int BANG = 33; // ! |
47 static const int MINUS = 34; // - | 46 static const int MINUS = 34; // - |
48 static const int BACKSLASH = 35; // \ | 47 static const int BACKSLASH = 35; // \ |
49 static const int AMPERSAND = 36; // & | 48 static const int AMPERSAND = 36; // & |
50 | 49 |
51 // WARNING: Tokens from this point and above must have the corresponding ASCII | 50 // WARNING: Tokens from this point and above must have the corresponding ASCII |
52 // character in the TokenChar list at the bottom of this file. The | 51 // character in the TokenChar list at the bottom of this file. The |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 case TokenKind.COMMA: return ","; | 656 case TokenKind.COMMA: return ","; |
658 case TokenKind.SPACE: return " "; | 657 case TokenKind.SPACE: return " "; |
659 case TokenKind.TAB: return "\t"; | 658 case TokenKind.TAB: return "\t"; |
660 case TokenKind.NEWLINE: return "\n"; | 659 case TokenKind.NEWLINE: return "\n"; |
661 case TokenKind.RETURN: return "\r"; | 660 case TokenKind.RETURN: return "\r"; |
662 case TokenKind.PERCENT: return "%"; | 661 case TokenKind.PERCENT: return "%"; |
663 case TokenKind.SINGLE_QUOTE: return "'"; | 662 case TokenKind.SINGLE_QUOTE: return "'"; |
664 case TokenKind.DOUBLE_QUOTE: return "\""; | 663 case TokenKind.DOUBLE_QUOTE: return "\""; |
665 case TokenKind.SLASH: return "/"; | 664 case TokenKind.SLASH: return "/"; |
666 case TokenKind.EQUALS: return '='; | 665 case TokenKind.EQUALS: return '='; |
667 case TokenKind.OR: return '|'; | |
668 case TokenKind.CARET: return '^'; | 666 case TokenKind.CARET: return '^'; |
669 case TokenKind.DOLLAR: return '\$'; | 667 case TokenKind.DOLLAR: return '\$'; |
670 case TokenKind.LESS: return '<'; | 668 case TokenKind.LESS: return '<'; |
671 case TokenKind.BANG: return '!'; | 669 case TokenKind.BANG: return '!'; |
672 case TokenKind.MINUS: return '-'; | 670 case TokenKind.MINUS: return '-'; |
673 case TokenKind.BACKSLASH: return '\\'; | 671 case TokenKind.BACKSLASH: return '\\'; |
674 default: | 672 default: |
675 throw "Unknown TOKEN"; | 673 throw "Unknown TOKEN"; |
676 } | 674 } |
677 } | 675 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 static const int EQUALS = 0x3d; // "=".codeUnitAt(0) | 756 static const int EQUALS = 0x3d; // "=".codeUnitAt(0) |
759 static const int OR = 0x7c; // "|".codeUnitAt(0) | 757 static const int OR = 0x7c; // "|".codeUnitAt(0) |
760 static const int CARET = 0x5e; // "^".codeUnitAt(0) | 758 static const int CARET = 0x5e; // "^".codeUnitAt(0) |
761 static const int DOLLAR = 0x24; // "\$".codeUnitAt(0) | 759 static const int DOLLAR = 0x24; // "\$".codeUnitAt(0) |
762 static const int LESS = 0x3c; // "<".codeUnitAt(0) | 760 static const int LESS = 0x3c; // "<".codeUnitAt(0) |
763 static const int BANG = 0x21; // "!".codeUnitAt(0) | 761 static const int BANG = 0x21; // "!".codeUnitAt(0) |
764 static const int MINUS = 0x2d; // "-".codeUnitAt(0) | 762 static const int MINUS = 0x2d; // "-".codeUnitAt(0) |
765 static const int BACKSLASH = 0x5c; // "\".codeUnitAt(0) | 763 static const int BACKSLASH = 0x5c; // "\".codeUnitAt(0) |
766 static const int AMPERSAND = 0x26; // "&".codeUnitAt(0) | 764 static const int AMPERSAND = 0x26; // "&".codeUnitAt(0) |
767 } | 765 } |
OLD | NEW |