| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
| 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 currentCharacter<SrcCharacterType>() += 2; | 1172 currentCharacter<SrcCharacterType>() += 2; |
| 1173 if (m_parser.m_observer) { | 1173 if (m_parser.m_observer) { |
| 1174 unsigned endOffset = currentCharacter<SrcCharacterType>() - data
Start<SrcCharacterType>(); | 1174 unsigned endOffset = currentCharacter<SrcCharacterType>() - data
Start<SrcCharacterType>(); |
| 1175 unsigned userTextEndOffset = static_cast<unsigned>(m_length - 1
- m_parsedTextSuffixLength); | 1175 unsigned userTextEndOffset = static_cast<unsigned>(m_length - 1
- m_parsedTextSuffixLength); |
| 1176 m_parser.m_observer->endComment(std::min(endOffset, userTextEndO
ffset) - m_parsedTextPrefixLength); | 1176 m_parser.m_observer->endComment(std::min(endOffset, userTextEndO
ffset) - m_parsedTextPrefixLength); |
| 1177 } | 1177 } |
| 1178 goto restartAfterComment; | 1178 goto restartAfterComment; |
| 1179 } | 1179 } |
| 1180 break; | 1180 break; |
| 1181 | 1181 |
| 1182 case CharacterDollar: | |
| 1183 if (*currentCharacter<SrcCharacterType>() == '=') { | |
| 1184 ++currentCharacter<SrcCharacterType>(); | |
| 1185 m_token = ENDSWITH; | |
| 1186 } | |
| 1187 break; | |
| 1188 | |
| 1189 case CharacterAsterisk: | |
| 1190 if (*currentCharacter<SrcCharacterType>() == '=') { | |
| 1191 ++currentCharacter<SrcCharacterType>(); | |
| 1192 m_token = CONTAINS; | |
| 1193 } | |
| 1194 break; | |
| 1195 | |
| 1196 case CharacterPlus: | |
| 1197 break; | |
| 1198 | |
| 1199 case CharacterLess: | 1182 case CharacterLess: |
| 1200 if (currentCharacter<SrcCharacterType>()[0] == '!' && currentCharacter<S
rcCharacterType>()[1] == '-' && currentCharacter<SrcCharacterType>()[2] == '-')
{ | 1183 if (currentCharacter<SrcCharacterType>()[0] == '!' && currentCharacter<S
rcCharacterType>()[1] == '-' && currentCharacter<SrcCharacterType>()[2] == '-')
{ |
| 1201 currentCharacter<SrcCharacterType>() += 3; | 1184 currentCharacter<SrcCharacterType>() += 3; |
| 1202 m_token = SGML_CD; | 1185 m_token = SGML_CD; |
| 1203 } | 1186 } |
| 1204 break; | 1187 break; |
| 1205 | 1188 |
| 1206 case CharacterAt: | 1189 case CharacterAt: |
| 1207 if (isIdentifierStart<SrcCharacterType>()) { | 1190 if (isIdentifierStart<SrcCharacterType>()) { |
| 1208 m_token = ATKEYWORD; | 1191 m_token = ATKEYWORD; |
| 1209 ++result; | 1192 ++result; |
| 1210 parseIdentifier(result, resultString, hasEscape); | 1193 parseIdentifier(result, resultString, hasEscape); |
| 1211 // The standard enables unicode escapes in at-rules. In this case on
ly the resultString will contain the | 1194 // The standard enables unicode escapes in at-rules. In this case on
ly the resultString will contain the |
| 1212 // correct identifier, hence we have to use it to determine its leng
th instead of the usual pointer arithmetic. | 1195 // correct identifier, hence we have to use it to determine its leng
th instead of the usual pointer arithmetic. |
| 1213 detectAtToken<SrcCharacterType>(resultString.length() + 1, hasEscape
); | 1196 detectAtToken<SrcCharacterType>(resultString.length() + 1, hasEscape
); |
| 1214 } | 1197 } |
| 1215 break; | 1198 break; |
| 1216 | 1199 |
| 1217 case CharacterBackSlash: | 1200 case CharacterBackSlash: |
| 1218 if (isCSSEscape(*currentCharacter<SrcCharacterType>())) { | 1201 if (isCSSEscape(*currentCharacter<SrcCharacterType>())) { |
| 1219 --currentCharacter<SrcCharacterType>(); | 1202 --currentCharacter<SrcCharacterType>(); |
| 1220 parseIdentifier(result, yylval->string, hasEscape); | 1203 parseIdentifier(result, yylval->string, hasEscape); |
| 1221 m_token = IDENT; | 1204 m_token = IDENT; |
| 1222 } | 1205 } |
| 1223 break; | 1206 break; |
| 1224 | 1207 |
| 1208 // TODO(esprehn): Remove these and fix the assert about trying to parse them |
| 1209 // as identifiers. |
| 1210 case CharacterDollar: |
| 1211 case CharacterAsterisk: |
| 1212 case CharacterPlus: |
| 1225 case CharacterXor: | 1213 case CharacterXor: |
| 1226 if (*currentCharacter<SrcCharacterType>() == '=') { | |
| 1227 ++currentCharacter<SrcCharacterType>(); | |
| 1228 m_token = BEGINSWITH; | |
| 1229 } | |
| 1230 break; | |
| 1231 | |
| 1232 case CharacterVerticalBar: | 1214 case CharacterVerticalBar: |
| 1233 if (*currentCharacter<SrcCharacterType>() == '=') { | |
| 1234 ++currentCharacter<SrcCharacterType>(); | |
| 1235 m_token = DASHMATCH; | |
| 1236 } | |
| 1237 break; | |
| 1238 | |
| 1239 case CharacterTilde: | 1215 case CharacterTilde: |
| 1240 if (*currentCharacter<SrcCharacterType>() == '=') { | |
| 1241 ++currentCharacter<SrcCharacterType>(); | |
| 1242 m_token = INCLUDES; | |
| 1243 } | |
| 1244 break; | 1216 break; |
| 1245 | 1217 |
| 1246 default: | 1218 default: |
| 1247 ASSERT_NOT_REACHED(); | 1219 ASSERT_NOT_REACHED(); |
| 1248 break; | 1220 break; |
| 1249 } | 1221 } |
| 1250 | 1222 |
| 1251 return m_token; | 1223 return m_token; |
| 1252 } | 1224 } |
| 1253 | 1225 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 m_dataStart16[length - 1] = 0; | 1281 m_dataStart16[length - 1] = 0; |
| 1310 | 1282 |
| 1311 m_is8BitSource = false; | 1283 m_is8BitSource = false; |
| 1312 m_currentCharacter8 = 0; | 1284 m_currentCharacter8 = 0; |
| 1313 m_currentCharacter16 = m_dataStart16.get(); | 1285 m_currentCharacter16 = m_dataStart16.get(); |
| 1314 setTokenStart<UChar>(m_currentCharacter16); | 1286 setTokenStart<UChar>(m_currentCharacter16); |
| 1315 m_lexFunc = &CSSTokenizer::realLex<UChar>; | 1287 m_lexFunc = &CSSTokenizer::realLex<UChar>; |
| 1316 } | 1288 } |
| 1317 | 1289 |
| 1318 } // namespace blink | 1290 } // namespace blink |
| OLD | NEW |