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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 static const int UNIT_RESOLUTION_DPCM = 619; | 135 static const int UNIT_RESOLUTION_DPCM = 619; |
136 static const int UNIT_RESOLUTION_DPPX = 620; | 136 static const int UNIT_RESOLUTION_DPPX = 620; |
137 static const int UNIT_CH = 621; // Measure of "0" U+0030 glyph. | 137 static const int UNIT_CH = 621; // Measure of "0" U+0030 glyph. |
138 static const int UNIT_REM = 622; // computed value ‘font-size’ on root elem. | 138 static const int UNIT_REM = 622; // computed value ‘font-size’ on root elem. |
139 static const int UNIT_VIEWPORT_VW = 623; | 139 static const int UNIT_VIEWPORT_VW = 623; |
140 static const int UNIT_VIEWPORT_VH = 624; | 140 static const int UNIT_VIEWPORT_VH = 624; |
141 static const int UNIT_VIEWPORT_VMIN = 625; | 141 static const int UNIT_VIEWPORT_VMIN = 625; |
142 static const int UNIT_VIEWPORT_VMAX = 626; | 142 static const int UNIT_VIEWPORT_VMAX = 626; |
143 | 143 |
144 // Directives (@nnnn) | 144 // Directives (@nnnn) |
145 static const int DIRECTIVE_NONE = 650; | 145 static const int DIRECTIVE_NONE = 640; |
146 static const int DIRECTIVE_IMPORT = 651; | 146 static const int DIRECTIVE_IMPORT = 641; |
147 static const int DIRECTIVE_MEDIA = 652; | 147 static const int DIRECTIVE_MEDIA = 642; |
148 static const int DIRECTIVE_PAGE = 653; | 148 static const int DIRECTIVE_PAGE = 643; |
149 static const int DIRECTIVE_CHARSET = 654; | 149 static const int DIRECTIVE_CHARSET = 644; |
150 static const int DIRECTIVE_STYLET = 655; | 150 static const int DIRECTIVE_STYLET = 645; |
151 static const int DIRECTIVE_KEYFRAMES = 656; | 151 static const int DIRECTIVE_KEYFRAMES = 646; |
152 static const int DIRECTIVE_WEB_KIT_KEYFRAMES = 657; | 152 static const int DIRECTIVE_WEB_KIT_KEYFRAMES = 647; |
153 static const int DIRECTIVE_MOZ_KEYFRAMES = 658; | 153 static const int DIRECTIVE_MOZ_KEYFRAMES = 648; |
154 static const int DIRECTIVE_MS_KEYFRAMES = 659; | 154 static const int DIRECTIVE_MS_KEYFRAMES = 649; |
155 static const int DIRECTIVE_O_KEYFRAMES = 660; | 155 static const int DIRECTIVE_O_KEYFRAMES = 650; |
156 static const int DIRECTIVE_FONTFACE = 661; | 156 static const int DIRECTIVE_FONTFACE = 651; |
157 static const int DIRECTIVE_NAMESPACE = 662; | 157 static const int DIRECTIVE_NAMESPACE = 652; |
158 static const int DIRECTIVE_HOST = 663; | 158 static const int DIRECTIVE_HOST = 653; |
| 159 static const int DIRECTIVE_MIXIN = 654; |
| 160 static const int DIRECTIVE_INCLUDE = 655; |
| 161 static const int DIRECTIVE_CONTENT = 656; |
| 162 static const int DIRECTIVE_EXTEND = 657; |
159 | 163 |
160 // Media query operators | 164 // Media query operators |
161 static const int MEDIA_OP_ONLY = 665; // Unary. | 165 static const int MEDIA_OP_ONLY = 665; // Unary. |
162 static const int MEDIA_OP_NOT = 666; // Unary. | 166 static const int MEDIA_OP_NOT = 666; // Unary. |
163 static const int MEDIA_OP_AND = 667; // Binary. | 167 static const int MEDIA_OP_AND = 667; // Binary. |
164 | 168 |
165 // Directives inside of a @page (margin sym). | 169 // Directives inside of a @page (margin sym). |
166 static const int MARGIN_DIRECTIVE_TOPLEFTCORNER = 670; | 170 static const int MARGIN_DIRECTIVE_TOPLEFTCORNER = 670; |
167 static const int MARGIN_DIRECTIVE_TOPLEFT = 671; | 171 static const int MARGIN_DIRECTIVE_TOPLEFT = 671; |
168 static const int MARGIN_DIRECTIVE_TOPCENTER = 672; | 172 static const int MARGIN_DIRECTIVE_TOPCENTER = 672; |
(...skipping 29 matching lines...) Expand all Loading... |
198 const {'type': TokenKind.DIRECTIVE_KEYFRAMES, 'value' : 'keyframes'}, | 202 const {'type': TokenKind.DIRECTIVE_KEYFRAMES, 'value' : 'keyframes'}, |
199 const {'type': TokenKind.DIRECTIVE_WEB_KIT_KEYFRAMES, | 203 const {'type': TokenKind.DIRECTIVE_WEB_KIT_KEYFRAMES, |
200 'value' : '-webkit-keyframes'}, | 204 'value' : '-webkit-keyframes'}, |
201 const {'type': TokenKind.DIRECTIVE_MOZ_KEYFRAMES, | 205 const {'type': TokenKind.DIRECTIVE_MOZ_KEYFRAMES, |
202 'value' : '-moz-keyframes'}, | 206 'value' : '-moz-keyframes'}, |
203 const {'type': TokenKind.DIRECTIVE_MS_KEYFRAMES, 'value' : '-ms-keyframes'}, | 207 const {'type': TokenKind.DIRECTIVE_MS_KEYFRAMES, 'value' : '-ms-keyframes'}, |
204 const {'type': TokenKind.DIRECTIVE_O_KEYFRAMES, 'value' : '-o-keyframes'}, | 208 const {'type': TokenKind.DIRECTIVE_O_KEYFRAMES, 'value' : '-o-keyframes'}, |
205 const {'type': TokenKind.DIRECTIVE_FONTFACE, 'value' : 'font-face'}, | 209 const {'type': TokenKind.DIRECTIVE_FONTFACE, 'value' : 'font-face'}, |
206 const {'type': TokenKind.DIRECTIVE_NAMESPACE, 'value' : 'namespace'}, | 210 const {'type': TokenKind.DIRECTIVE_NAMESPACE, 'value' : 'namespace'}, |
207 const {'type': TokenKind.DIRECTIVE_HOST, 'value' : 'host'}, | 211 const {'type': TokenKind.DIRECTIVE_HOST, 'value' : 'host'}, |
| 212 const {'type': TokenKind.DIRECTIVE_MIXIN, 'value' : 'mixin'}, |
| 213 const {'type': TokenKind.DIRECTIVE_INCLUDE, 'value' : 'include'}, |
| 214 const {'type': TokenKind.DIRECTIVE_CONTENT, 'value' : 'content'}, |
| 215 const {'type': TokenKind.DIRECTIVE_EXTEND, 'value' : 'extend'}, |
208 ]; | 216 ]; |
209 | 217 |
210 static const List<Map<int, String>> MEDIA_OPERATORS = const [ | 218 static const List<Map<int, String>> MEDIA_OPERATORS = const [ |
211 const {'type': TokenKind.MEDIA_OP_ONLY, 'value' : 'only'}, | 219 const {'type': TokenKind.MEDIA_OP_ONLY, 'value' : 'only'}, |
212 const {'type': TokenKind.MEDIA_OP_NOT, 'value' : 'not'}, | 220 const {'type': TokenKind.MEDIA_OP_NOT, 'value' : 'not'}, |
213 const {'type': TokenKind.MEDIA_OP_AND, 'value' : 'and'}, | 221 const {'type': TokenKind.MEDIA_OP_AND, 'value' : 'and'}, |
214 ]; | 222 ]; |
215 | 223 |
216 static const List<Map<int, String>> MARGIN_DIRECTIVES = const [ | 224 static const List<Map<int, String>> MARGIN_DIRECTIVES = const [ |
217 const {'type': TokenKind.MARGIN_DIRECTIVE_TOPLEFTCORNER, | 225 const {'type': TokenKind.MARGIN_DIRECTIVE_TOPLEFTCORNER, |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 case TokenKind.DIRECTIVE_CHARSET: | 685 case TokenKind.DIRECTIVE_CHARSET: |
678 case TokenKind.DIRECTIVE_STYLET: | 686 case TokenKind.DIRECTIVE_STYLET: |
679 case TokenKind.DIRECTIVE_KEYFRAMES: | 687 case TokenKind.DIRECTIVE_KEYFRAMES: |
680 case TokenKind.DIRECTIVE_WEB_KIT_KEYFRAMES: | 688 case TokenKind.DIRECTIVE_WEB_KIT_KEYFRAMES: |
681 case TokenKind.DIRECTIVE_MOZ_KEYFRAMES: | 689 case TokenKind.DIRECTIVE_MOZ_KEYFRAMES: |
682 case TokenKind.DIRECTIVE_MS_KEYFRAMES: | 690 case TokenKind.DIRECTIVE_MS_KEYFRAMES: |
683 case TokenKind.DIRECTIVE_O_KEYFRAMES: | 691 case TokenKind.DIRECTIVE_O_KEYFRAMES: |
684 case TokenKind.DIRECTIVE_FONTFACE: | 692 case TokenKind.DIRECTIVE_FONTFACE: |
685 case TokenKind.DIRECTIVE_NAMESPACE: | 693 case TokenKind.DIRECTIVE_NAMESPACE: |
686 case TokenKind.DIRECTIVE_HOST: | 694 case TokenKind.DIRECTIVE_HOST: |
| 695 case TokenKind.DIRECTIVE_MIXIN: |
| 696 case TokenKind.DIRECTIVE_INCLUDE: |
| 697 case TokenKind.DIRECTIVE_CONTENT: |
687 case TokenKind.UNIT_EM: | 698 case TokenKind.UNIT_EM: |
688 case TokenKind.UNIT_EX: | 699 case TokenKind.UNIT_EX: |
689 case TokenKind.UNIT_LENGTH_PX: | 700 case TokenKind.UNIT_LENGTH_PX: |
690 case TokenKind.UNIT_LENGTH_CM: | 701 case TokenKind.UNIT_LENGTH_CM: |
691 case TokenKind.UNIT_LENGTH_MM: | 702 case TokenKind.UNIT_LENGTH_MM: |
692 case TokenKind.UNIT_LENGTH_IN: | 703 case TokenKind.UNIT_LENGTH_IN: |
693 case TokenKind.UNIT_LENGTH_PT: | 704 case TokenKind.UNIT_LENGTH_PT: |
694 case TokenKind.UNIT_LENGTH_PC: | 705 case TokenKind.UNIT_LENGTH_PC: |
695 case TokenKind.UNIT_ANGLE_DEG: | 706 case TokenKind.UNIT_ANGLE_DEG: |
696 case TokenKind.UNIT_ANGLE_RAD: | 707 case TokenKind.UNIT_ANGLE_RAD: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 static const int EQUALS = 0x3d; // "=".codeUnitAt(0) | 758 static const int EQUALS = 0x3d; // "=".codeUnitAt(0) |
748 static const int OR = 0x7c; // "|".codeUnitAt(0) | 759 static const int OR = 0x7c; // "|".codeUnitAt(0) |
749 static const int CARET = 0x5e; // "^".codeUnitAt(0) | 760 static const int CARET = 0x5e; // "^".codeUnitAt(0) |
750 static const int DOLLAR = 0x24; // "\$".codeUnitAt(0) | 761 static const int DOLLAR = 0x24; // "\$".codeUnitAt(0) |
751 static const int LESS = 0x3c; // "<".codeUnitAt(0) | 762 static const int LESS = 0x3c; // "<".codeUnitAt(0) |
752 static const int BANG = 0x21; // "!".codeUnitAt(0) | 763 static const int BANG = 0x21; // "!".codeUnitAt(0) |
753 static const int MINUS = 0x2d; // "-".codeUnitAt(0) | 764 static const int MINUS = 0x2d; // "-".codeUnitAt(0) |
754 static const int BACKSLASH = 0x5c; // "\".codeUnitAt(0) | 765 static const int BACKSLASH = 0x5c; // "\".codeUnitAt(0) |
755 static const int AMPERSAND = 0x26; // "&".codeUnitAt(0) | 766 static const int AMPERSAND = 0x26; // "&".codeUnitAt(0) |
756 } | 767 } |
OLD | NEW |