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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 return !m_parsedProperties.isEmpty() && m_parsedProperties.first().id() == C
SSPropertyColor; | 1267 return !m_parsedProperties.isEmpty() && m_parsedProperties.first().id() == C
SSPropertyColor; |
1268 } | 1268 } |
1269 | 1269 |
1270 bool CSSParser::parseSystemColor(RGBA32& color, const String& string, Document*
document) | 1270 bool CSSParser::parseSystemColor(RGBA32& color, const String& string, Document*
document) |
1271 { | 1271 { |
1272 if (!document || !document->page()) | 1272 if (!document || !document->page()) |
1273 return false; | 1273 return false; |
1274 | 1274 |
1275 CSSParserString cssColor; | 1275 CSSParserString cssColor; |
1276 cssColor.init(string); | 1276 cssColor.init(string); |
1277 int id = cssValueKeywordID(cssColor); | 1277 CSSValueID id = cssValueKeywordID(cssColor); |
1278 if (id <= 0) | 1278 if (id <= 0) |
1279 return false; | 1279 return false; |
1280 | 1280 |
1281 color = document->page()->theme()->systemColor(id).rgb(); | 1281 color = document->page()->theme()->systemColor(id).rgb(); |
1282 return true; | 1282 return true; |
1283 } | 1283 } |
1284 | 1284 |
1285 void CSSParser::parseSelector(const String& string, CSSSelectorList& selectorLis
t) | 1285 void CSSParser::parseSelector(const String& string, CSSSelectorList& selectorLis
t) |
1286 { | 1286 { |
1287 m_selectorListForParseSelector = &selectorList; | 1287 m_selectorListForParseSelector = &selectorList; |
(...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3654 { | 3654 { |
3655 if ((value1 == CSSValueLeft || value1 == CSSValueRight) && (value2 == CSSVal
ueLeft || value2 == CSSValueRight)) | 3655 if ((value1 == CSSValueLeft || value1 == CSSValueRight) && (value2 == CSSVal
ueLeft || value2 == CSSValueRight)) |
3656 return true; | 3656 return true; |
3657 | 3657 |
3658 if ((value1 == CSSValueTop || value1 == CSSValueBottom) && (value2 == CSSVal
ueTop || value2 == CSSValueBottom)) | 3658 if ((value1 == CSSValueTop || value1 == CSSValueBottom) && (value2 == CSSVal
ueTop || value2 == CSSValueBottom)) |
3659 return true; | 3659 return true; |
3660 | 3660 |
3661 return false; | 3661 return false; |
3662 } | 3662 } |
3663 | 3663 |
3664 static bool isFillPositionKeyword(int value) | 3664 static bool isFillPositionKeyword(CSSValueID value) |
3665 { | 3665 { |
3666 return value == CSSValueLeft || value == CSSValueTop || value == CSSValueBot
tom || value == CSSValueRight || value == CSSValueCenter; | 3666 return value == CSSValueLeft || value == CSSValueTop || value == CSSValueBot
tom || value == CSSValueRight || value == CSSValueCenter; |
3667 } | 3667 } |
3668 | 3668 |
3669 void CSSParser::parse4ValuesFillPosition(CSSParserValueList* valueList, RefPtr<C
SSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsed
Value1, PassRefPtr<CSSPrimitiveValue> parsedValue2) | 3669 void CSSParser::parse4ValuesFillPosition(CSSParserValueList* valueList, RefPtr<C
SSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsed
Value1, PassRefPtr<CSSPrimitiveValue> parsedValue2) |
3670 { | 3670 { |
3671 // [ left | right ] [ <percentage] | <length> ] && [ top | bottom ] [ <perce
ntage> | <length> ] | 3671 // [ left | right ] [ <percentage] | <length> ] && [ top | bottom ] [ <perce
ntage> | <length> ] |
3672 // In the case of 4 values <position> requires the second value to be a leng
th or a percentage. | 3672 // In the case of 4 values <position> requires the second value to be a leng
th or a percentage. |
3673 if (isFillPositionKeyword(parsedValue2->getIdent())) | 3673 if (isFillPositionKeyword(parsedValue2->getValueID())) |
3674 return; | 3674 return; |
3675 | 3675 |
3676 unsigned cumulativeFlags = 0; | 3676 unsigned cumulativeFlags = 0; |
3677 FillPositionFlag value3Flag = InvalidFillPosition; | 3677 FillPositionFlag value3Flag = InvalidFillPosition; |
3678 RefPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cum
ulativeFlags, value3Flag, ResolveValuesAsKeyword); | 3678 RefPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cum
ulativeFlags, value3Flag, ResolveValuesAsKeyword); |
3679 if (!value3) | 3679 if (!value3) |
3680 return; | 3680 return; |
3681 | 3681 |
3682 int ident1 = parsedValue1->getIdent(); | 3682 CSSValueID ident1 = parsedValue1->getValueID(); |
3683 int ident3 = value3->getIdent(); | 3683 CSSValueID ident3 = value3->getValueID(); |
3684 | 3684 |
3685 if (ident1 == CSSValueCenter) | 3685 if (ident1 == CSSValueCenter) |
3686 return; | 3686 return; |
3687 | 3687 |
3688 if (!isFillPositionKeyword(ident3) || ident3 == CSSValueCenter) | 3688 if (!isFillPositionKeyword(ident3) || ident3 == CSSValueCenter) |
3689 return; | 3689 return; |
3690 | 3690 |
3691 // We need to check if the values are not conflicting, e.g. they are not on
the same edge. It is | 3691 // We need to check if the values are not conflicting, e.g. they are not on
the same edge. It is |
3692 // needed as the second call to parseFillPositionComponent was on purpose no
t checking it. In the | 3692 // needed as the second call to parseFillPositionComponent was on purpose no
t checking it. In the |
3693 // case of two values top 20px is invalid but in the case of 4 values it bec
omes valid. | 3693 // case of two values top 20px is invalid but in the case of 4 values it bec
omes valid. |
3694 if (isValueConflictingWithCurrentEdge(ident1, ident3)) | 3694 if (isValueConflictingWithCurrentEdge(ident1, ident3)) |
3695 return; | 3695 return; |
3696 | 3696 |
3697 valueList->next(); | 3697 valueList->next(); |
3698 | 3698 |
3699 cumulativeFlags = 0; | 3699 cumulativeFlags = 0; |
3700 FillPositionFlag value4Flag = InvalidFillPosition; | 3700 FillPositionFlag value4Flag = InvalidFillPosition; |
3701 RefPtr<CSSPrimitiveValue> value4 = parseFillPositionComponent(valueList, cum
ulativeFlags, value4Flag, ResolveValuesAsKeyword); | 3701 RefPtr<CSSPrimitiveValue> value4 = parseFillPositionComponent(valueList, cum
ulativeFlags, value4Flag, ResolveValuesAsKeyword); |
3702 if (!value4) | 3702 if (!value4) |
3703 return; | 3703 return; |
3704 | 3704 |
3705 // 4th value must be a length or a percentage. | 3705 // 4th value must be a length or a percentage. |
3706 if (isFillPositionKeyword(value4->getIdent())) | 3706 if (isFillPositionKeyword(value4->getValueID())) |
3707 return; | 3707 return; |
3708 | 3708 |
3709 value1 = createPrimitiveValuePair(parsedValue1, parsedValue2); | 3709 value1 = createPrimitiveValuePair(parsedValue1, parsedValue2); |
3710 value2 = createPrimitiveValuePair(value3, value4); | 3710 value2 = createPrimitiveValuePair(value3, value4); |
3711 | 3711 |
3712 if (ident1 == CSSValueTop || ident1 == CSSValueBottom) | 3712 if (ident1 == CSSValueTop || ident1 == CSSValueBottom) |
3713 value1.swap(value2); | 3713 value1.swap(value2); |
3714 | 3714 |
3715 valueList->next(); | 3715 valueList->next(); |
3716 } | 3716 } |
3717 void CSSParser::parse3ValuesFillPosition(CSSParserValueList* valueList, RefPtr<C
SSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsed
Value1, PassRefPtr<CSSPrimitiveValue> parsedValue2) | 3717 void CSSParser::parse3ValuesFillPosition(CSSParserValueList* valueList, RefPtr<C
SSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsed
Value1, PassRefPtr<CSSPrimitiveValue> parsedValue2) |
3718 { | 3718 { |
3719 unsigned cumulativeFlags = 0; | 3719 unsigned cumulativeFlags = 0; |
3720 FillPositionFlag value3Flag = InvalidFillPosition; | 3720 FillPositionFlag value3Flag = InvalidFillPosition; |
3721 RefPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cum
ulativeFlags, value3Flag, ResolveValuesAsKeyword); | 3721 RefPtr<CSSPrimitiveValue> value3 = parseFillPositionComponent(valueList, cum
ulativeFlags, value3Flag, ResolveValuesAsKeyword); |
3722 | 3722 |
3723 // value3 is not an expected value, we return. | 3723 // value3 is not an expected value, we return. |
3724 if (!value3) | 3724 if (!value3) |
3725 return; | 3725 return; |
3726 | 3726 |
3727 valueList->next(); | 3727 valueList->next(); |
3728 | 3728 |
3729 bool swapNeeded = false; | 3729 bool swapNeeded = false; |
3730 CSSValueID ident1 = static_cast<CSSValueID>(parsedValue1->getIdent()); | 3730 CSSValueID ident1 = parsedValue1->getValueID(); |
3731 CSSValueID ident2 = static_cast<CSSValueID>(parsedValue2->getIdent()); | 3731 CSSValueID ident2 = parsedValue2->getValueID(); |
3732 CSSValueID ident3 = static_cast<CSSValueID>(value3->getIdent()); | 3732 CSSValueID ident3 = value3->getValueID(); |
3733 | 3733 |
3734 CSSValueID firstPositionKeyword; | 3734 CSSValueID firstPositionKeyword; |
3735 CSSValueID secondPositionKeyword; | 3735 CSSValueID secondPositionKeyword; |
3736 | 3736 |
3737 if (ident1 == CSSValueCenter) { | 3737 if (ident1 == CSSValueCenter) { |
3738 // <position> requires the first 'center' to be followed by a keyword. | 3738 // <position> requires the first 'center' to be followed by a keyword. |
3739 if (!isFillPositionKeyword(ident2)) | 3739 if (!isFillPositionKeyword(ident2)) |
3740 return; | 3740 return; |
3741 | 3741 |
3742 // If 'center' is the first keyword then the last one needs to be a leng
th. | 3742 // If 'center' is the first keyword then the last one needs to be a leng
th. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3791 value1 = createPrimitiveValuePair(parsedValue1, firstPositionValue); | 3791 value1 = createPrimitiveValuePair(parsedValue1, firstPositionValue); |
3792 value2 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(s
econdPositionKeyword), secondPositionValue); | 3792 value2 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(s
econdPositionKeyword), secondPositionValue); |
3793 } | 3793 } |
3794 | 3794 |
3795 if (ident1 == CSSValueTop || ident1 == CSSValueBottom || swapNeeded) | 3795 if (ident1 == CSSValueTop || ident1 == CSSValueBottom || swapNeeded) |
3796 value1.swap(value2); | 3796 value1.swap(value2); |
3797 | 3797 |
3798 #ifndef NDEBUG | 3798 #ifndef NDEBUG |
3799 CSSPrimitiveValue* first = toCSSPrimitiveValue(value1.get()); | 3799 CSSPrimitiveValue* first = toCSSPrimitiveValue(value1.get()); |
3800 CSSPrimitiveValue* second = toCSSPrimitiveValue(value2.get()); | 3800 CSSPrimitiveValue* second = toCSSPrimitiveValue(value2.get()); |
3801 ident1 = static_cast<CSSValueID>(first->getPairValue()->first()->getIdent())
; | 3801 ident1 = first->getPairValue()->first()->getValueID(); |
3802 ident2 = static_cast<CSSValueID>(second->getPairValue()->first()->getIdent()
); | 3802 ident2 = second->getPairValue()->first()->getValueID(); |
3803 ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight); | 3803 ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight); |
3804 ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop); | 3804 ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop); |
3805 #endif | 3805 #endif |
3806 } | 3806 } |
3807 | 3807 |
3808 inline bool CSSParser::isPotentialPositionValue(CSSParserValue* value) | 3808 inline bool CSSParser::isPotentialPositionValue(CSSParserValue* value) |
3809 { | 3809 { |
3810 return isFillPositionKeyword(value->id) || validUnit(value, FPercent | FLeng
th, ReleaseParsedCalcValue); | 3810 return isFillPositionKeyword(value->id) || validUnit(value, FPercent | FLeng
th, ReleaseParsedCalcValue); |
3811 } | 3811 } |
3812 | 3812 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3857 return; | 3857 return; |
3858 } | 3858 } |
3859 | 3859 |
3860 RefPtr<CSSPrimitiveValue> parsedValue1 = toCSSPrimitiveValue(value1.get()); | 3860 RefPtr<CSSPrimitiveValue> parsedValue1 = toCSSPrimitiveValue(value1.get()); |
3861 RefPtr<CSSPrimitiveValue> parsedValue2 = toCSSPrimitiveValue(value2.get()); | 3861 RefPtr<CSSPrimitiveValue> parsedValue2 = toCSSPrimitiveValue(value2.get()); |
3862 | 3862 |
3863 value1.clear(); | 3863 value1.clear(); |
3864 value2.clear(); | 3864 value2.clear(); |
3865 | 3865 |
3866 // Per CSS3 syntax, <position> can't have 'center' as its second keyword as
we have more arguments to follow. | 3866 // Per CSS3 syntax, <position> can't have 'center' as its second keyword as
we have more arguments to follow. |
3867 if (parsedValue2->getIdent() == CSSValueCenter) | 3867 if (parsedValue2->getValueID() == CSSValueCenter) |
3868 return; | 3868 return; |
3869 | 3869 |
3870 if (numberOfValues == 3) | 3870 if (numberOfValues == 3) |
3871 parse3ValuesFillPosition(valueList, value1, value2, parsedValue1.release
(), parsedValue2.release()); | 3871 parse3ValuesFillPosition(valueList, value1, value2, parsedValue1.release
(), parsedValue2.release()); |
3872 else | 3872 else |
3873 parse4ValuesFillPosition(valueList, value1, value2, parsedValue1.release
(), parsedValue2.release()); | 3873 parse4ValuesFillPosition(valueList, value1, value2, parsedValue1.release
(), parsedValue2.release()); |
3874 } | 3874 } |
3875 | 3875 |
3876 void CSSParser::parse2ValuesFillPosition(CSSParserValueList* valueList, RefPtr<C
SSValue>& value1, RefPtr<CSSValue>& value2) | 3876 void CSSParser::parse2ValuesFillPosition(CSSParserValueList* valueList, RefPtr<C
SSValue>& value1, RefPtr<CSSValue>& value2) |
3877 { | 3877 { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3948 id = value->id; | 3948 id = value->id; |
3949 if (id == CSSValueRepeat || id == CSSValueNoRepeat || id == CSSValueRoun
d || id == CSSValueSpace) { | 3949 if (id == CSSValueRepeat || id == CSSValueNoRepeat || id == CSSValueRoun
d || id == CSSValueSpace) { |
3950 value2 = cssValuePool().createIdentifierValue(id); | 3950 value2 = cssValuePool().createIdentifierValue(id); |
3951 m_valueList->next(); | 3951 m_valueList->next(); |
3952 return; | 3952 return; |
3953 } | 3953 } |
3954 } | 3954 } |
3955 | 3955 |
3956 // If only one value was specified, value2 is the same as value1. | 3956 // If only one value was specified, value2 is the same as value1. |
3957 m_implicitShorthand = true; | 3957 m_implicitShorthand = true; |
3958 value2 = cssValuePool().createIdentifierValue(static_cast<CSSValueID>(toCSSP
rimitiveValue(value1.get())->getIdent())); | 3958 value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1.get
())->getValueID()); |
3959 } | 3959 } |
3960 | 3960 |
3961 PassRefPtr<CSSValue> CSSParser::parseFillSize(CSSPropertyID propId, bool& allowC
omma) | 3961 PassRefPtr<CSSValue> CSSParser::parseFillSize(CSSPropertyID propId, bool& allowC
omma) |
3962 { | 3962 { |
3963 allowComma = true; | 3963 allowComma = true; |
3964 CSSParserValue* value = m_valueList->current(); | 3964 CSSParserValue* value = m_valueList->current(); |
3965 | 3965 |
3966 if (value->id == CSSValueContain || value->id == CSSValueCover) | 3966 if (value->id == CSSValueContain || value->id == CSSValueCover) |
3967 return cssValuePool().createIdentifierValue(value->id); | 3967 return cssValuePool().createIdentifierValue(value->id); |
3968 | 3968 |
(...skipping 3424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7393 return false; | 7393 return false; |
7394 } | 7394 } |
7395 } else | 7395 } else |
7396 break; | 7396 break; |
7397 } | 7397 } |
7398 | 7398 |
7399 // You can specify size as a keyword or a length/percentage, not both. | 7399 // You can specify size as a keyword or a length/percentage, not both. |
7400 if (sizeValue && horizontalSize) | 7400 if (sizeValue && horizontalSize) |
7401 return false; | 7401 return false; |
7402 // Circles must have 0 or 1 lengths. | 7402 // Circles must have 0 or 1 lengths. |
7403 if (shapeValue && shapeValue->getIdent() == CSSValueCircle && verticalSize) | 7403 if (shapeValue && shapeValue->getValueID() == CSSValueCircle && verticalSize
) |
7404 return false; | 7404 return false; |
7405 // Ellipses must have 0 or 2 length/percentages. | 7405 // Ellipses must have 0 or 2 length/percentages. |
7406 if (shapeValue && shapeValue->getIdent() == CSSValueEllipse && horizontalSiz
e && !verticalSize) | 7406 if (shapeValue && shapeValue->getValueID() == CSSValueEllipse && horizontalS
ize && !verticalSize) |
7407 return false; | 7407 return false; |
7408 // If there's only one size, it must be a length. | 7408 // If there's only one size, it must be a length. |
7409 if (!verticalSize && horizontalSize && horizontalSize->isPercentage()) | 7409 if (!verticalSize && horizontalSize && horizontalSize->isPercentage()) |
7410 return false; | 7410 return false; |
7411 | 7411 |
7412 result->setShape(shapeValue); | 7412 result->setShape(shapeValue); |
7413 result->setSizingBehavior(sizeValue); | 7413 result->setSizingBehavior(sizeValue); |
7414 result->setEndHorizontalSize(horizontalSize); | 7414 result->setEndHorizontalSize(horizontalSize); |
7415 result->setEndVerticalSize(verticalSize); | 7415 result->setEndVerticalSize(verticalSize); |
7416 | 7416 |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8005 if (a->unit != CSSParserValue::Operator || a->iValue != ',') | 8005 if (a->unit != CSSParserValue::Operator || a->iValue != ',') |
8006 return 0; | 8006 return 0; |
8007 a = args->next(); | 8007 a = args->next(); |
8008 | 8008 |
8009 argNumber++; | 8009 argNumber++; |
8010 } | 8010 } |
8011 | 8011 |
8012 return transformValue.release(); | 8012 return transformValue.release(); |
8013 } | 8013 } |
8014 | 8014 |
8015 bool CSSParser::isBlendMode(int ident) | 8015 bool CSSParser::isBlendMode(CSSValueID valueID) |
8016 { | 8016 { |
8017 return (ident >= CSSValueMultiply && ident <= CSSValueLuminosity) | 8017 return (valueID >= CSSValueMultiply && valueID <= CSSValueLuminosity) |
8018 || ident == CSSValueNormal | 8018 || valueID == CSSValueNormal |
8019 || ident == CSSValueOverlay; | 8019 || valueID == CSSValueOverlay; |
8020 } | 8020 } |
8021 | 8021 |
8022 bool CSSParser::isCompositeOperator(int ident) | 8022 bool CSSParser::isCompositeOperator(CSSValueID valueID) |
8023 { | 8023 { |
8024 // FIXME: Add CSSValueDestination and CSSValueLighter when the Compositing s
pec updates. | 8024 // FIXME: Add CSSValueDestination and CSSValueLighter when the Compositing s
pec updates. |
8025 return ident >= CSSValueClear && ident <= CSSValueXor; | 8025 return valueID >= CSSValueClear && valueID <= CSSValueXor; |
8026 } | 8026 } |
8027 | 8027 |
8028 static void filterInfoForName(const CSSParserString& name, CSSFilterValue::Filte
rOperationType& filterType, unsigned& maximumArgumentCount) | 8028 static void filterInfoForName(const CSSParserString& name, CSSFilterValue::Filte
rOperationType& filterType, unsigned& maximumArgumentCount) |
8029 { | 8029 { |
8030 if (equalIgnoringCase(name, "grayscale(")) | 8030 if (equalIgnoringCase(name, "grayscale(")) |
8031 filterType = CSSFilterValue::GrayscaleFilterOperation; | 8031 filterType = CSSFilterValue::GrayscaleFilterOperation; |
8032 else if (equalIgnoringCase(name, "sepia(")) | 8032 else if (equalIgnoringCase(name, "sepia(")) |
8033 filterType = CSSFilterValue::SepiaFilterOperation; | 8033 filterType = CSSFilterValue::SepiaFilterOperation; |
8034 else if (equalIgnoringCase(name, "saturate(")) | 8034 else if (equalIgnoringCase(name, "saturate(")) |
8035 filterType = CSSFilterValue::SaturateFilterOperation; | 8035 filterType = CSSFilterValue::SaturateFilterOperation; |
(...skipping 3712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11748 { | 11748 { |
11749 // The tokenizer checks for the construct of an+b. | 11749 // The tokenizer checks for the construct of an+b. |
11750 // However, since the {ident} rule precedes the {nth} rule, some of those | 11750 // However, since the {ident} rule precedes the {nth} rule, some of those |
11751 // tokens are identified as string literal. Furthermore we need to accept | 11751 // tokens are identified as string literal. Furthermore we need to accept |
11752 // "odd" and "even" which does not match to an+b. | 11752 // "odd" and "even" which does not match to an+b. |
11753 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") | 11753 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") |
11754 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 11754 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
11755 } | 11755 } |
11756 | 11756 |
11757 } | 11757 } |
OLD | NEW |