lexer
class lexer extends Lexer
Methods
No description
Strip surrounding quotes
Fix tokens that may have inline variables
Add surrounding quotes
Fix begin tokens (convert our BEGIN to Twig for)
Fix IF statements
Fix DEFINE statements and {$VARNAME} variables
Replace Twig tag masks with Twig tag calls
Details
at line 18
tokenize(Source $source)
No description
at line 142
protected string
strip_surrounding_quotes(array $tokens, string $code)
Strip surrounding quotes
First step to fix tokens that may have inline variables E.g. <!-- INCLUDE '{TEST}.html' to <!-- INCLUDE {TEST}.html
at line 161
protected string
fix_inline_variable_tokens(array $tokens, string $code)
Fix tokens that may have inline variables
Second step to fix tokens that may have inline variables E.g. <!-- INCLUDE '{TEST}.html' to <!-- INCLUDE ' ~ {TEST} ~ '.html
at line 184
protected string
add_surrounding_quotes(array $tokens, string $code)
Add surrounding quotes
Last step to fix tokens that may have inline variables E.g. <!-- INCLUDE '{TEST}.html' to <!-- INCLUDE '' ~ {TEST} ~ '.html'
at line 198
string
fix_begin_tokens(string $code, array $parent_nodes = array())
Fix begin tokens (convert our BEGIN to Twig for)
Not meant to be used outside of this context, public because the anonymous function calls this
at line 271
protected string
fix_if_tokens(string $code)
Fix IF statements
at line 303
protected string
fix_define_tokens(string $code)
Fix DEFINE statements and {$VARNAME} variables
at line 341
protected string
replace_twig_tag_masks(string $code, array $twig_tags)
Replace Twig tag masks with Twig tag calls
E.g. with {% block foo %}