Lexes a template string.
More...
Lexes a template string.
- Author
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Definition at line 18 of file Lexer.php.
pushToken |
( |
|
$type, |
|
|
|
$value = '' |
|
) |
| |
|
protected |
tokenize |
( |
|
$code, |
|
|
|
$filename = null |
|
) |
| |
Tokenizes a source code.
- Parameters
-
string | $code | The source code |
string | $filename | A unique identifier for the source code |
- Returns
- Twig_TokenStream A token stream instance
Implements Twig_LexerInterface.
Definition at line 83 of file Lexer.php.
const PUNCTUATION = '()[]{}?:.,|' |
const REGEX_DQ_STRING_DELIM = '/"/A' |
const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As' |
const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A' |
const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A' |
const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As' |
const STATE_INTERPOLATION = 4 |
The documentation for this class was generated from the following file: