Home
last modified time | relevance | path

Searched refs:Token (Results 1 – 22 of 22) sorted by relevance

/PHP-Parser/test/PhpParser/
H A DLexerTest.php103 new Token(T_OPEN_TAG, '<?php ', 1, 0),
104 new Token(T_CONSTANT_ENCAPSED_STRING, '"a"', 1, 6),
105 new Token(\ord(';'), ';', 1, 9),
106 new Token(T_WHITESPACE, "\n", 1, 10),
107 new Token(T_COMMENT, '// foo', 2, 11),
108 new Token(T_WHITESPACE, "\n", 2, 17),
109 new Token(T_COMMENT, '// bar', 3, 18),
110 new Token(T_WHITESPACE, "\n\n", 3, 24),
111 new Token(T_CONSTANT_ENCAPSED_STRING, '"b"', 5, 26),
112 new Token(\ord(';'), ';', 5, 29),
[all …]
H A DTokenTest.php7 $token = new Token(\ord(','), ',');
9 $token = new Token(\T_WHITESPACE, ' ');
14 $token = new Token(\ord(','), ',');
27 $token = new Token($id, $text);
42 $token = new Token(\ord(','), ',');
44 $token = new Token(\T_STRING, 'foo');
H A DParserTestAbstract.php197 new Token(\T_OPEN_TAG, '<?php ', 1, 0),
198 new Token(\T_ECHO, 'echo', 1, 6),
199 new Token(\T_WHITESPACE, ' ', 1, 10),
200 new Token(\T_CONSTANT_ENCAPSED_STRING, '"Foo"', 1, 11),
201 new Token(ord(';'), ';', 1, 16),
202 new Token(0, "\0", 1, 17),
210 new Token(999, 'foobar', 42),
/PHP-Parser/lib/PhpParser/Lexer/TokenEmulator/
H A DTokenEmulator.php6 use PhpParser\Token; alias
15 * @param Token[] $tokens Original tokens
16 * @return Token[] Modified Tokens
21 * @param Token[] $tokens Original tokens
22 * @return Token[] Modified Tokens
H A DAsymmetricVisibilityTokenEmulator.php6 use PhpParser\Token; alias
33 new Token(
58 new Token($reverseMap[$token->id], $modifier, $token->line, $token->pos),
59 new Token(\ord('('), '(', $token->line, $token->pos + $modifierLen),
60 new Token(\T_STRING, $set, $token->line, $token->pos + $modifierLen + 1),
61 new Token(\ord(')'), ')', $token->line, $token->pos + $modifierLen + 4),
71 /** @param Token[] $tokens */
81 /** @param Token[] $tokens */
82 private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token {
H A DNullsafeTokenEmulator.php6 use PhpParser\Token; alias
24 new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos),
36 new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos),
37 new Token(\T_STRING, $matches[1], $token->line, $token->pos + 3),
41 $replacement[] = new Token(
H A DKeywordEmulator.php5 use PhpParser\Token; alias
15 /** @param Token[] $tokens */
37 /** @param Token[] $tokens */
38 private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token {
H A DAttributeEmulator.php6 use PhpParser\Token; alias
24 new Token(\T_ATTRIBUTE, '#[', $token->line, $token->pos),
H A DExplicitOctalEmulator.php6 use PhpParser\Token; alias
26 new Token($tokenKind, '0' . $tokens[$i + 1]->text, $token->line, $token->pos),
/PHP-Parser/test/PhpParser/Lexer/
H A DEmulativeTest.php10 use PhpParser\Token; alias
26 new Token(\T_OPEN_TAG, '<?php ', 1, 0),
28 new Token(0, "\0", 1, \strlen($code)),
40 new Token(\T_OPEN_TAG, '<?php ', 1, 0),
42 new Token(0, "\0", 1, \strlen($code)),
54 new Token(\T_OPEN_TAG, '<?php ', 1, 0),
56 new Token(\T_STRING, $keyword, 1, 8),
57 new Token(0, "\0", 1, \strlen($code)),
72 new Token(\T_STRING, $keyword, 1, 12),
73 new Token(0, "\0", 1, \strlen($code)),
[all …]
/PHP-Parser/lib/PhpParser/
H A DLexer.php22 * @return Token[] Tokens
31 $tokens = @Token::tokenize($code);
41 private function handleInvalidCharacter(Token $token, ErrorHandler $errorHandler): void {
60 private function isUnterminatedComment(Token $token): bool {
79 $tokens[] = new Token(0, "\0", 1, 0);
114 $tokens[] = new Token(0, "\0", $lastToken->getEndLine(), $lastToken->getEndPos());
H A DParser.php21 * @return Token[]
H A DToken.php8 class Token extends Internal\TokenPolyfill { class
H A DPrettyPrinter.php48 * @param Token[] $origTokens Tokens of the original code
H A DParserAbstract.php133 /** @var Token[] Tokens for the current parse */
891 protected function createCommentFromToken(Token $token, int $tokenPos): Comment {
H A DPrettyPrinterAbstract.php554 * @param Token[] $origTokens Tokens of the original code
/PHP-Parser/lib/PhpParser/NodeVisitor/
H A DCommentAnnotatingVisitor.php8 use PhpParser\Token; alias
13 /** @var Token[] Token array */
21 * @param Token[] $tokens Token array
/PHP-Parser/lib/PhpParser/Internal/
H A DTokenStream.php5 use PhpParser\Token; alias
13 /** @var Token[] Tokens (in PhpToken::tokenize() format) */
21 * @param Token[] $tokens Tokens in PhpToken::tokenize() format
/PHP-Parser/doc/component/
H A DLexer.markdown16 previous versions. The `PhpParser\Token` class either extends `PhpToken` (on PHP 8.0) or a polyfill…
40 The `Lexer::tokenize()` method returns an array of `PhpParser\Token`s. The most important parts of …
44 class Token {
45 /** @var int Token ID, either T_* or ord($char) for single-character tokens. */
54 /** @param int|string|(int|string)[] $kind Token ID or text (or array of them) */
90 /** @param PhpParser\Token[] $tokens */
/PHP-Parser/lib/PhpParser/Lexer/
H A DEmulative.php20 use PhpParser\Token; alias
/PHP-Parser/
H A DUPGRADE-5.0.md473 Tokens are now internally represented using the `PhpParser\Token` class, which exposes the same bas…
474 the `PhpToken` class introduced in PHP 8.0. On PHP 8.0 or newer, `PhpParser\Token` extends from `Ph…
478 class Token {
488 The token array is now an array of `Token`s, rather than an array of arrays and strings.
H A DCHANGELOG.md243 * The internal token representation now uses a `PhpParser\Token` class, which is compatible with
1230 * Token constants are now defined on `PhpParser\Parser\Tokens` rather than `PhpParser\Parser`.

Completed in 44 milliseconds