Provides operations on token streams, for use by pretty printer.
Methods | ||
---|---|---|
public
|
__construct(Token[] $tokens, int $tabWidth)
|
# |
public
|
haveParens(int $startPos, int $endPos): bool
|
# |
public
|
haveBraces(int $startPos, int $endPos): bool
|
# |
public
|
haveTokenImmediatelyBefore(int $pos, int|string $expectedTokenType): bool
|
# |
public
|
haveTokenImmediatelyAfter(int $pos, int|string $expectedTokenType): bool
|
# |
public
|
skipLeft(int $pos, int|string|(int|string)[] $skipTokenType): int
|
# |
public
|
skipRight(int $pos, int|string|(int|string)[] $skipTokenType): int
|
# |
public
|
skipLeftWhitespace(int $pos): int
|
# |
public
|
skipRightWhitespace(int $pos): int
|
# |
public
|
findRight(int $pos, int|string|(int|string)[] $findTokenType): int
|
# |
public
|
haveTokenInRange(int $startPos, int $endPos, int|string $tokenType): bool
|
# |
public
|
haveTagInRange(int $startPos, int $endPos): bool
|
# |
public
|
getIndentationBefore(int $pos): int
|
# |
public
|
getTokenCode(int $from, int $to, int $indent): string
|
# |