Lines Matching refs:token

71         $token = $this->parser->getCurrentToken();
72 …while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $pre…
73 $op = $this->binaryOperators[$token->getValue()];
76 if ('is not' === $token->getValue()) {
78 } elseif ('is' === $token->getValue()) {
85 $expr = new $class($expr, $expr1, $token->getLine());
88 $token = $this->parser->getCurrentToken();
108 $token = $stream->expect(/* Token::NAME_TYPE */ 5);
109 $names = [new AssignNameExpression($token->getValue(), $token->getLine())];
138 $token = $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, '(');
139 $line = $token->getLine();
143 $token = $stream->expect(/* Token::NAME_TYPE */ 5);
144 $names[] = new AssignNameExpression($token->getValue(), $token->getLine());
158 $token = $this->parser->getCurrentToken();
160 if ($this->isUnary($token)) {
161 $operator = $this->unaryOperators[$token->getValue()];
166 return $this->parsePostfixExpression(new $class($expr, $token->getLine()));
167 } elseif ($token->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) {
199 private function isUnary(Token $token): bool argument
201 …return $token->test(/* Token::OPERATOR_TYPE */ 8) && isset($this->unaryOperators[$token->getValue(…
204 private function isBinary(Token $token): bool argument
206 …return $token->test(/* Token::OPERATOR_TYPE */ 8) && isset($this->binaryOperators[$token->getValue…
211 $token = $this->parser->getCurrentToken();
212 switch ($token->getType()) {
215 switch ($token->getValue()) {
218 $node = new ConstantExpression(true, $token->getLine());
223 $node = new ConstantExpression(false, $token->getLine());
230 $node = new ConstantExpression(null, $token->getLine());
235 $node = $this->getFunctionNode($token->getValue(), $token->getLine());
237 $node = new NameExpression($token->getValue(), $token->getLine());
244 $node = new ConstantExpression($token->getValue(), $token->getLine());
253 …if (preg_match(Lexer::REGEX_NAME, $token->getValue(), $matches) && $matches[0] == $token->getValue…
256 $node = new NameExpression($token->getValue(), $token->getLine());
258 } elseif (isset($this->unaryOperators[$token->getValue()])) {
259 $class = $this->unaryOperators[$token->getValue()]['class'];
266 …ow new SyntaxError(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine…
272 $node = new $class($expr, $token->getLine());
278 if ($token->test(/* Token::PUNCTUATION_TYPE */ 9, '[')) {
280 } elseif ($token->test(/* Token::PUNCTUATION_TYPE */ 9, '{')) {
282 …} elseif ($token->test(/* Token::OPERATOR_TYPE */ 8, '=') && ('==' === $this->parser->getStream()-…
283 …==" for strict comparison? Use "is same as(value)" instead.', $token->getValue()), $token->getLine…
285 …ed token "%s" of value "%s".', Token::typeToEnglish($token->getType()), $token->getValue()), $toke…
300 if ($nextCanBeString && $token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) {
301 $nodes[] = new ConstantExpression($token->getValue(), $token->getLine());
369 if ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) {
370 $key = new ConstantExpression($token->getValue(), $token->getLine());
378 …} elseif (($token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) || $token = $stream->nextIf(/* To…
379 $key = new ConstantExpression($token->getValue(), $token->getLine());
401 $token = $this->parser->getCurrentToken();
402 if (/* Token::PUNCTUATION_TYPE */ 9 == $token->getType()) {
403 if ('.' == $token->getValue() || '[' == $token->getValue()) {
405 } elseif ('|' == $token->getValue()) {
469 $token = $stream->next();
470 $lineno = $token->getLine();
473 if ('.' == $token->getValue()) {
474 $token = $stream->next();
476 /* Token::NAME_TYPE */ 5 == $token->getType()
478 /* Token::NUMBER_TYPE */ 6 == $token->getType()
480 …(/* Token::OPERATOR_TYPE */ 8 == $token->getType() && preg_match(Lexer::REGEX_NAME, $token->getVal…
482 $arg = new ConstantExpression($token->getValue(), $lineno);
491 …pected name or number, got value "%s" of type %s.', $token->getValue(), Token::typeToEnglish($toke…
496 …ames are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $strea…
513 $arg = new ConstantExpression(0, $token->getLine());
524 $length = new ConstantExpression(null, $token->getLine());
529 $class = $this->getFilterNodeClass('slice', $token->getLine());
531 …lter = new $class($node, new ConstantExpression('slice', $token->getLine()), $arguments, $token->g…
554 $token = $this->parser->getStream()->expect(/* Token::NAME_TYPE */ 5);
556 $name = new ConstantExpression($token->getValue(), $token->getLine());
563 $class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine());
565 $node = new $class($node, $name, $arguments, $token->getLine(), $tag);
604 … $token = $stream->expect(/* Token::NAME_TYPE */ 5, null, 'An argument must be a name');
605 … $value = new NameExpression($token->getValue(), $this->parser->getCurrentToken()->getLine());
611 if ($namedArguments && $token = $stream->nextIf(/* Token::OPERATOR_TYPE */ 8, '=')) {
613 …f('A parameter name must be a string, "%s" given.', \get_class($value)), $token->getLine(), $strea…
621 …ument must be a constant (a boolean, a string, a number, or an array).', $token->getLine(), $strea…
652 $token = $this->parser->getCurrentToken();
653 …if ($stream->test(/* Token::OPERATOR_TYPE */ 8) && preg_match(Lexer::REGEX_NAME, $token->getValue(…
659 $value = $token->getValue();
661 …throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $s…
663 $targets[] = new AssignNameExpression($value, $token->getLine());