WooCommerce Code Reference

Token
in package

Represents a range of characters represented by a lexical token within a Source.

Tags
see
TokenTest

Table of Contents

AMP  = '&'
AT  = '@'
BANG  = '!'
BLOCK_STRING  = 'BlockString'
BRACE_L  = '{'
BRACE_R  = '}'
BRACKET_L  = '['
BRACKET_R  = ']'
COLON  = ':'
COMMENT  = 'Comment'
DOLLAR  = '$'
EOF  = '<EOF>'
EQUALS  = '='
FLOAT  = 'Float'
INT  = 'Int'
NAME  = 'Name'
PAREN_L  = '('
PAREN_R  = ')'
PIPE  = '|'
SOF  = '<SOF>'
SPREAD  = '...'
STRING  = 'String'
$column  : int
The 1-indexed column number at which this Token begins.
$end  : int
The character offset at which this Node ends.
$kind  : string
The kind of Token (see one of constants above).
$line  : int
The 1-indexed line number on which this Token appears.
$next  : Token|null
$prev  : Token|null
Tokens exist as nodes in a double-linked-list amongst all tokens including ignored tokens. <SOF> is always the first node and <EOF> the last.
$start  : int
The character offset at which this Node begins.
$value  : string|null
__construct()  : mixed
getDescription()  : string
toArray()  : array{kind: string, value: string|null, line: int, column: int}

Constants

Properties

Methods

__construct()

public __construct(string $kind, int $start, int $end, int $line, int $column[, Token|null $previous = null ][, string|null $value = null ]) : mixed
Parameters
$kind : string
$start : int
$end : int
$line : int
$column : int
$previous : Token|null = null
$value : string|null = null
Return values
mixed

toArray()

public toArray() : array{kind: string, value: string|null, line: int, column: int}
Return values
array{kind: string, value: string|null, line: int, column: int}