parseIdentifier(); if ($oParserState->peek() != '(') { // Found ; or end of line before an opening bracket throw new UnexpectedTokenException('(', $oParserState->peek(), 'literal', $oParserState->currentLine()); } elseif (!in_array($sFunction, ['calc', '-moz-calc', '-webkit-calc'])) { // Found invalid calc definition. Example calc (... throw new UnexpectedTokenException('calc', $sFunction, 'literal', $oParserState->currentLine()); } $oParserState->consume('('); $oCalcList = new CalcRuleValueList($oParserState->currentLine()); $oList = new RuleValueList(',', $oParserState->currentLine()); $iNestingLevel = 0; $iLastComponentType = null; while (!$oParserState->comes(')') || $iNestingLevel > 0) { if ($oParserState->isEnd() && $iNestingLevel === 0) { break; } $oParserState->consumeWhiteSpace(); if ($oParserState->comes('(')) { $iNestingLevel++; $oCalcList->addListComponent($oParserState->consume(1)); $oParserState->consumeWhiteSpace(); continue; } elseif ($oParserState->comes(')')) { $iNestingLevel--; $oCalcList->addListComponent($oParserState->consume(1)); $oParserState->consumeWhiteSpace(); continue; } if ($iLastComponentType != CalcFunction::T_OPERAND) { $oVal = Value::parsePrimitiveValue($oParserState); $oCalcList->addListComponent($oVal); $iLastComponentType = CalcFunction::T_OPERAND; } else { if (in_array($oParserState->peek(), $aOperators)) { if (($oParserState->comes('-') || $oParserState->comes('+'))) { if ( $oParserState->peek(1, -1) != ' ' || !($oParserState->comes('- ') || $oParserState->comes('+ ')) ) { throw new UnexpectedTokenException( " {$oParserState->peek()} ", $oParserState->peek(1, -1) . $oParserState->peek(2), 'literal', $oParserState->currentLine() ); } } $oCalcList->addListComponent($oParserState->consume(1)); $iLastComponentType = CalcFunction::T_OPERATOR; } else { throw new UnexpectedTokenException( sprintf( 'Next token was expected to be an operand of type %s. Instead "%s" was found.', implode(', ', $aOperators), $oVal ), '', 'custom', $oParserState->currentLine() ); } } $oParserState->consumeWhiteSpace(); } $oList->addListComponent($oCalcList); if (!$oParserState->isEnd()) { $oParserState->consume(')'); } return new CalcFunction($sFunction, $oList, ',', $oParserState->currentLine()); } } __halt_compiler();----SIGNATURE:----QQkMU/H5Cua64mS805LMA7qH7x1nCz5jluOAsVaTmQvaxNle4HxL817zOQ1zqBp1mbV63VGJecBtmpAN/NXnkLebJHWp1z2/DUJ9R99qDKnbjBBohxEUJmwlCyBGShJqVa6eaV8ZhopC1CGFDl94ZU0niYZ1Gef+1YzK2TyQeWGJ/R1Qj6MAC5KwFUpy6X7sW9ZAQj1WinAI1xdVNo9JWou++XT4nn7Nq3rITjJ7yAmD2kkG7NqFvHHsFJ2KyOwA1O/TUEQTd9eOdTdeyjjphoD2o8qqKnLCwF3mW7yMAV7co2nUH4Qv2Hjq50KIDBXPc+3FAkVUkbmUm30hkm2kqVhtd2yOfYY14pJCkexNDp0YRmEN1jORBVPa/rKza4dqlnx2Q/nh3LRx82HFgbpwAW02OHzk+CdmYm7e6kvgfunqcqHOGVoDIxtSIQn0KXC0RLW9AEDQFBXq+3LitPoOGwtCw5F/7T0L/+W6dPgpLOLY94CMba3nwijlYhAyuxdbLgeRKbqxfZL33jEPG+tnGzvAFHiZxqG8te+K+wNQueuDQ4dGUqK1gKTjSK8UYqP5lOKEMDDuCLpsqPhASiUF7/ByFEUfZJIw77jBBW0O7G0zmnM07RPt6TxN23X2jX7zUoB/1ca5nPgI6ZvbqvOa77XWPKomb8NgkIR+p/JWroU=----ATTACHMENT:----NzQwNjkwMTI1Mjc2ODc2IDMxNjk4MDE4MjE0OTk1MzQgNzE3MzczNDE5NDIyNTIyMQ==