/usr/share/php/Symfony/Component/ExpressionLanguage
NameSizeModeActions
Node/-0755rm
autoload.php28180644editdlrm
Compiler.php30620644editdlrm
Expression.php6830644editdlrm
ExpressionFunction.php34770644editdlrm
ExpressionFunctionProviderInterface.php4820644editdlrm
ExpressionLanguage.php52050644editdlrm
Lexer.php41630644editdlrm
ParsedExpression.php7350644editdlrm
Parser.php166770644editdlrm
SerializedParsedExpression.php8470644editdlrm
SyntaxError.php12520644editdlrm
Token.php16150644editdlrm
TokenStream.php21220644editdlrm
Edit: /usr/share/php/Symfony/Component/ExpressionLanguage/Token.php (1615B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\ExpressionLanguage; /** * Represents a Token. * * @author Fabien Potencier */ class Token { public $value; public $type; public $cursor; public const EOF_TYPE = 'end of expression'; public const NAME_TYPE = 'name'; public const NUMBER_TYPE = 'number'; public const STRING_TYPE = 'string'; public const OPERATOR_TYPE = 'operator'; public const PUNCTUATION_TYPE = 'punctuation'; /** * @param string $type The type of the token (self::*_TYPE) * @param string|int|float|null $value The token value * @param int $cursor The cursor position in the source */ public function __construct(string $type, $value, ?int $cursor) { $this->type = $type; $this->value = $value; $this->cursor = $cursor; } /** * Returns a string representation of the token. * * @return string */ public function __toString() { return sprintf('%3d %-11s %s', $this->cursor, strtoupper($this->type), $this->value); } /** * Tests the current token for a type and/or a value. * * @return bool */ public function test(string $type, string $value = null) { return $this->type === $type && (null === $value || $this->value == $value); } }