2014-12-14 00:49:42 +01:00
<?php
2015-09-01 01:54:28 +02:00
/*
* This file is part of Smarty.
*
* (c) 2015 Uwe Tews
2014-12-14 00:49:42 +01:00
*
2015-09-01 01:54:28 +02:00
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2014-12-14 00:49:42 +01:00
*/
/**
* Smarty_Internal_Templatelexer
* This is the template file lexer.
* It is generated from the smarty_internal_templatelexer.plex file
*
2015-09-01 01:54:28 +02:00
*
* @author Uwe Tews <uwe.tews@googlemail.com>
2014-12-14 00:49:42 +01:00
*/
class Smarty_Internal_Templatelexer
{
/**
* Source
*
* @var string
*/
public $data;
2015-09-01 01:54:28 +02:00
2016-11-07 03:08:11 +01:00
/**
* Source length
*
* @var int
*/
2016-11-11 21:17:32 +01:00
public $dataLength = null;
2016-11-07 03:08:11 +01:00
2014-12-14 00:49:42 +01:00
/**
* byte counter
*
* @var int
*/
public $counter;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
* token number
*
* @var int
*/
public $token;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
* token value
*
* @var string
*/
public $value;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
* current line
*
* @var int
*/
public $line;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
* tag start line
*
* @var
*/
public $taglineno;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
2015-05-06 00:03:26 +02:00
* php code type
*
* @var string
*/
public $phpType = '';
2015-09-01 01:54:28 +02:00
2017-10-21 13:14:14 +02:00
/**
2014-12-14 00:49:42 +01:00
* state number
*
* @var int
*/
public $state = 1;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
* Smarty object
*
* @var Smarty
*/
public $smarty = null;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
* compiler object
*
* @var Smarty_Internal_TemplateCompilerBase
*/
2015-05-23 18:56:00 +02:00
public $compiler = null;
2015-09-01 01:54:28 +02:00
2014-12-14 00:49:42 +01:00
/**
* trace file
*
* @var resource
*/
public $yyTraceFILE;
2015-05-23 18:56:00 +02:00
2014-12-14 00:49:42 +01:00
/**
* trace prompt
*
* @var string
*/
public $yyTracePrompt;
2015-05-23 18:56:00 +02:00
2015-06-01 22:26:45 +02:00
/**
2017-10-07 08:20:18 +02:00
* XML flag true while processing xml
*
* @var bool
*/
2015-06-01 22:26:45 +02:00
public $is_xml = false;
2014-12-14 00:49:42 +01:00
/**
* state names
*
* @var array
*/
2015-09-01 01:54:28 +02:00
public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',);
2015-05-16 16:33:50 +02:00
/**
2017-10-07 08:20:18 +02:00
* token names
*
* @var array
*/
public $smarty_token_names = array( // Text for parser error messages
'NOT' => '(!,not)',
'OPENP' => '(',
'CLOSEP' => ')',
'OPENB' => '[',
'CLOSEB' => ']',
'PTR' => '->',
'APTR' => '=>',
'EQUAL' => '=',
'NUMBER' => 'number',
'UNIMATH' => '+" , "-',
'MATH' => '*" , "/" , "%',
'INCDEC' => '++" , "--',
'SPACE' => ' ',
'DOLLAR' => '$',
'SEMICOLON' => ';',
'COLON' => ':',
'DOUBLECOLON' => '::',
'AT' => '@',
'HATCH' => '#',
'QUOTE' => '"',
'BACKTICK' => '`',
'VERT' => '"|" modifier',
'DOT' => '.',
'COMMA' => '","',
'QMARK' => '"?"',
'ID' => 'id, name',
'TEXT' => 'text',
'LDELSLASH' => '{/..} closing tag',
'LDEL' => '{...} Smarty tag',
'COMMENT' => 'comment',
'AS' => 'as',
'TO' => 'to',
'PHP' => '"<?php", "<%", "{php}" tag',
'LOGOP' => '"<", "==" ... logical operator',
'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition',
'SCOND' => '"is even" ... if condition',
);
/**
* literal tag nesting level
*
* @var int
*/
private $literal_cnt = 0;
/**
* preg token pattern for state TEXT
2015-05-16 16:33:50 +02:00
*
2015-05-23 18:56:00 +02:00
* @var string
2015-05-16 16:33:50 +02:00
*/
private $yy_global_pattern1 = null;
2015-05-23 18:56:00 +02:00
2017-10-07 08:20:18 +02:00
/**
* preg token pattern for state TAG
*
* @var string
*/
2015-05-16 16:33:50 +02:00
private $yy_global_pattern2 = null;
2015-05-23 18:56:00 +02:00
2017-10-07 08:20:18 +02:00
/**
* preg token pattern for state TAGBODY
*
* @var string
*/
2015-05-16 16:33:50 +02:00
private $yy_global_pattern3 = null;
2015-05-23 18:56:00 +02:00
2017-10-07 08:20:18 +02:00
/**
* preg token pattern for state LITERAL
*
* @var string
*/
2015-05-16 16:33:50 +02:00
private $yy_global_pattern4 = null;
2015-05-23 18:56:00 +02:00
2014-12-14 00:49:42 +01:00
/**
2017-10-07 08:20:18 +02:00
* preg token pattern for state DOUBLEQUOTEDSTRING
2014-12-14 00:49:42 +01:00
*
2017-10-07 08:20:18 +02:00
* @var null
2014-12-14 00:49:42 +01:00
*/
2017-10-07 08:20:18 +02:00
private $yy_global_pattern5 = null;
2014-12-14 00:49:42 +01:00
/**
* constructor
*
2017-10-07 08:20:18 +02:00
* @param string $source template source
2014-12-14 00:49:42 +01:00
* @param Smarty_Internal_TemplateCompilerBase $compiler
*/
2017-10-07 08:20:18 +02:00
function __construct($source, Smarty_Internal_TemplateCompilerBase $compiler)
2014-12-14 00:49:42 +01:00
{
2017-10-07 08:20:18 +02:00
$this->data = $source;
$this->dataLength = strlen($this->data);
2014-12-14 00:49:42 +01:00
$this->counter = 0;
2016-08-05 01:00:51 +02:00
if (preg_match('/^\xEF\xBB\xBF/i', $this->data, $match)) {
2014-12-14 00:49:42 +01:00
$this->counter += strlen($match[0]);
}
$this->line = 1;
2017-10-21 13:14:14 +02:00
$this->smarty = $compiler->template->smarty;
2014-12-14 00:49:42 +01:00
$this->compiler = $compiler;
2017-10-21 13:14:14 +02:00
$this->compiler->initDelimiterPreg();
$this->smarty_token_names['LDEL'] = $this->smarty->getLeftDelimiter();
$this->smarty_token_names['RDEL'] = $this->smarty->getRightDelimiter();
2014-12-14 00:49:42 +01:00
}
2017-10-07 08:20:18 +02:00
/**
* open lexer/parser trace file
*
*/
public function PrintTrace()
{
2014-12-14 00:49:42 +01:00
$this->yyTraceFILE = fopen('php://output', 'w');
$this->yyTracePrompt = '<br>';
2017-10-07 08:20:18 +02:00
}
/**
* replace placeholders with runtime preg code
*
2017-10-21 13:14:14 +02:00
* @param string $preg
2017-10-07 08:20:18 +02:00
*
* @return string
*/
2017-10-21 13:14:14 +02:00
public function replace($preg)
2017-08-09 12:20:33 +02:00
{
2017-10-21 13:14:14 +02:00
return $this->compiler->replaceDelimiter($preg);
2017-08-09 12:20:33 +02:00
}
2017-10-07 08:20:18 +02:00
/**
* check if current value is an autoliteral left delimiter
*
* @return bool
*/
public function isAutoLiteral()
{
2017-10-21 13:14:14 +02:00
return $this->smarty->getAutoLiteral() && isset($this->value[ $this->compiler->getLdelLength() ]) ?
strpos(" \n\t\r", $this->value[ $this->compiler->getLdelLength() ]) !== false : false;
2017-10-07 08:20:18 +02:00
}
2014-12-14 00:49:42 +01:00
/*!lex2php
%input $this->data
%counter $this->counter
%token $this->token
%value $this->value
%line $this->line
2017-10-21 13:14:14 +02:00
userliteral = ~(SMARTYldel)SMARTYautoliteral\s+SMARTYliteral~
2017-10-07 08:20:18 +02:00
char = ~[\S\s]~
2017-10-21 13:14:14 +02:00
textdoublequoted = ~([^"\\]*?)((?:\\.[^"\\]*?)*?)(?=((SMARTYldel)SMARTYal|\$|`\$|"SMARTYliteral))~
2015-05-23 18:56:00 +02:00
namespace = ~([0-9]*[a-zA-Z_]\w*)?(\\[0-9]*[a-zA-Z_]\w*)+~
emptyjava = ~[{][}]~
2017-10-21 13:14:14 +02:00
phptag = ~(SMARTYldel)SMARTYalphp([ ].*?)?SMARTYrdel|(SMARTYldel)SMARTYal[/]phpSMARTYrdel~
phpstart = ~[<][?]((php\s+|=)|\s+)|[<][%]|[<][?]xml\s+|[<]script\s+language\s*=\s*["']?\s*php\s*["']?\s*[>]|[?][>]|[%][>]~
2015-05-23 18:56:00 +02:00
slash = ~[/]~
2017-10-21 13:14:14 +02:00
ldel = ~(SMARTYldel)SMARTYal~
2015-05-23 18:56:00 +02:00
rdel = ~\s*SMARTYrdel~
nocacherdel = ~(\s+nocache)?\s*SMARTYrdel~
2018-03-28 07:14:29 +02:00
smartyblockchildparent = ~[\$]smarty\.block\.(child|parent)~
2015-05-23 18:56:00 +02:00
integer = ~\d+~
hex = ~0[xX][0-9a-fA-F]+~
math = ~\s*([*]{1,2}|[%/^&]|[<>]{2})\s*~
2017-10-21 13:14:14 +02:00
comment = ~(SMARTYldel)SMARTYal[*]~
2015-05-23 18:56:00 +02:00
incdec = ~([+]|[-]){2}~
unimath = ~\s*([+]|[-])\s*~
openP = ~\s*[(]\s*~
closeP = ~\s*[)]~
openB = ~\[\s*~
closeB = ~\s*\]~
dollar = ~[$]~
dot = ~[.]~
comma = ~\s*[,]\s*~
doublecolon = ~[:]{2}~
colon = ~\s*[:]\s*~
at = ~[@]~
hatch = ~[#]~
semicolon = ~\s*[;]\s*~
equal = ~\s*[=]\s*~
space = ~\s+~
ptr = ~\s*[-][>]\s*~
aptr = ~\s*[=][>]\s*~
singlequotestring = ~'[^'\\]*(?:\\.[^'\\]*)*'~
backtick = ~[`]~
2017-11-05 20:04:32 +01:00
vert = ~[|][@]?~
2015-05-23 18:56:00 +02:00
qmark = ~\s*[?]\s*~
2017-10-21 13:14:14 +02:00
constant = ~[_]+[A-Z0-9][0-9A-Z_]*|[A-Z][0-9A-Z_]*(?![0-9A-Z_]*[a-z])~
2015-05-23 18:56:00 +02:00
attr = ~\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\s*[=]\s*~
id = ~[0-9]*[a-zA-Z_]\w*~
literal = ~literal~
strip = ~strip~
2017-10-21 13:14:14 +02:00
lop = ~\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\s*~
2016-02-10 03:19:25 +01:00
slop = ~\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\s+~
2017-10-21 13:14:14 +02:00
tlop = ~\s+is\s+(not\s+)?(odd|even|div)\s+by\s+~
2015-05-23 18:56:00 +02:00
scond = ~\s+is\s+(not\s+)?(odd|even)~
isin = ~\s+is\s+in\s+~
as = ~\s+as\s+~
to = ~\s+to\s+~
step = ~\s+step\s+~
if = ~(if|elseif|else if|while)\s+~
for = ~for\s+~
2016-02-14 02:54:38 +01:00
makenocache = ~make_nocache\s+~
2015-05-23 18:56:00 +02:00
foreach = ~foreach(?![^\s])~
setfilter = ~setfilter\s+~
instanceof = ~\s+instanceof\s+~
2017-10-21 13:14:14 +02:00
not = ~[!]\s*|not\s+~
2015-05-23 18:56:00 +02:00
typecast = ~[(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\s*~
double_quote = ~["]~
2017-10-21 13:14:14 +02:00
text = ~(.*?)(?=((SMARTYldel)SMARTYal|[<][?]((php\s+|=)|\s+)|[<][%]|[<][?]xml\s+|[<]script\s+language\s*=\s*["']?\s*php\s*["']?\s*[>]|[?][>]|[%][>]SMARTYliteral))|[\s\S]+~
literaltext = ~(.*?)(?=(SMARTYldel)SMARTYal[/]?literalSMARTYrdel)~
2014-12-14 00:49:42 +01:00
*/
/*!lex2php
%statename TEXT
emptyjava {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
2014-12-14 00:49:42 +01:00
}
comment {
2017-11-20 04:07:51 +01:00
preg_match("/[*]{$this->compiler->getRdelPreg()}[\n]?/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);
2015-05-23 18:56:00 +02:00
if (isset($match[0][1])) {
$to = $match[0][1] + strlen($match[0][0]);
} else {
2017-11-05 20:04:32 +01:00
$this->compiler->trigger_template_error ("missing or misspelled comment closing tag '{$this->smarty->getRightDelimiter()}'");
2015-05-23 18:56:00 +02:00
}
$this->value = substr($this->data,$this->counter,$to-$this->counter);
return false;
}
2015-06-27 16:09:50 +02:00
phptag {
2017-10-07 08:20:18 +02:00
$this->compiler->getTagCompiler('private_php')->parsePhp($this);
2015-06-27 16:09:50 +02:00
}
2017-10-07 08:20:18 +02:00
userliteral {
2017-08-09 11:15:33 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
2014-12-14 00:49:42 +01:00
ldel literal rdel {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
$this->yypushstate(self::LITERAL);
2017-08-09 11:15:33 +02:00
}
ldel slash literal rdel {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
$this->yypushstate(self::LITERAL);
2014-12-14 00:49:42 +01:00
}
ldel {
2017-10-07 08:20:18 +02:00
$this->yypushstate(self::TAG);
return true;
2014-12-14 00:49:42 +01:00
}
2015-06-27 15:35:27 +02:00
phpstart {
2017-10-07 08:20:18 +02:00
$this->compiler->getTagCompiler('private_php')->parsePhp($this);
2015-06-27 15:35:27 +02:00
}
2014-12-14 00:49:42 +01:00
text {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
2014-12-14 00:49:42 +01:00
}
*/
/*!lex2php
2015-05-18 04:12:40 +02:00
%statename TAG
ldel if {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDELIF;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
ldel for {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
ldel foreach {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
ldel setfilter {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
2016-02-14 02:54:38 +01:00
ldel makenocache {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDELMAKENOCACHE;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2016-02-14 02:54:38 +01:00
}
2015-05-18 04:12:40 +02:00
ldel id nocacherdel {
2017-10-07 08:20:18 +02:00
$this->yypopstate();
$this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG;
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
2018-03-28 07:14:29 +02:00
ldel smartyblockchildparent rdel {
$this->yypopstate();
$this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT;
$this->taglineno = $this->line;
}
ldel slash id rdel {
2017-10-07 08:20:18 +02:00
$this->yypopstate();
$this->token = Smarty_Internal_Templateparser::TP_CLOSETAG;
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
ldel dollar id nocacherdel {
2017-10-21 13:14:14 +02:00
if ($this->_yy_stack[count($this->_yy_stack)-1] === self::TEXT) {
2015-06-08 23:54:46 +02:00
$this->yypopstate();
2015-09-01 01:54:28 +02:00
$this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT;
2015-06-08 23:54:46 +02:00
$this->taglineno = $this->line;
2017-10-07 08:20:18 +02:00
} else {
2017-10-21 13:14:14 +02:00
$this->value = $this->smarty->getLeftDelimiter();
2015-06-08 23:54:46 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2017-10-07 08:20:18 +02:00
}
2015-05-18 04:12:40 +02:00
}
ldel slash {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
ldel {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yybegin(self::TAGBODY);
$this->taglineno = $this->line;
2015-05-18 04:12:40 +02:00
}
*/
/*!lex2php
2015-09-01 01:54:28 +02:00
%statename TAGBODY
2015-05-18 04:12:40 +02:00
rdel {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_RDEL;
$this->yypopstate();
2015-05-18 04:12:40 +02:00
}
2015-11-25 21:19:23 +01:00
ldel {
2017-10-07 08:20:18 +02:00
$this->yypushstate(self::TAG);
return true;
2015-11-25 21:19:23 +01:00
}
2017-10-07 08:20:18 +02:00
double_quote {
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypushstate(self::DOUBLEQUOTEDSTRING);
2017-10-12 20:15:42 +02:00
$this->compiler->enterDoubleQuote();
2014-12-14 00:49:42 +01:00
}
singlequotestring {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
2014-12-14 00:49:42 +01:00
}
2015-05-18 04:12:40 +02:00
dollar id {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
2015-05-18 04:12:40 +02:00
}
2014-12-14 00:49:42 +01:00
dollar {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
2014-12-14 00:49:42 +01:00
}
isin {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_ISIN;
2014-12-14 00:49:42 +01:00
}
as {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_AS;
2014-12-14 00:49:42 +01:00
}
to {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TO;
2014-12-14 00:49:42 +01:00
}
step {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_STEP;
2014-12-14 00:49:42 +01:00
}
instanceof {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
2014-12-14 00:49:42 +01:00
}
2015-05-16 14:47:12 +02:00
lop {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LOGOP;
2014-12-14 00:49:42 +01:00
}
2016-02-10 03:19:25 +01:00
slop {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_SLOGOP;
2016-02-10 03:19:25 +01:00
}
2015-05-16 14:47:12 +02:00
tlop {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TLOGOP;
2014-12-14 00:49:42 +01:00
}
2015-05-16 14:47:12 +02:00
scond {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_SINGLECOND;
2014-12-14 00:49:42 +01:00
}
not{
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_NOT;
2014-12-14 00:49:42 +01:00
}
typecast {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
2014-12-14 00:49:42 +01:00
}
openP {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_OPENP;
2014-12-14 00:49:42 +01:00
}
closeP {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
2014-12-14 00:49:42 +01:00
}
openB {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_OPENB;
2014-12-14 00:49:42 +01:00
}
closeB {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
2014-12-14 00:49:42 +01:00
}
ptr {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_PTR;
2014-12-14 00:49:42 +01:00
}
aptr {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_APTR;
2014-12-14 00:49:42 +01:00
}
equal {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_EQUAL;
2014-12-14 00:49:42 +01:00
}
incdec {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_INCDEC;
2014-12-14 00:49:42 +01:00
}
unimath {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
2014-12-14 00:49:42 +01:00
}
math {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_MATH;
2014-12-14 00:49:42 +01:00
}
at {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_AT;
2014-12-14 00:49:42 +01:00
}
hatch {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_HATCH;
2014-12-14 00:49:42 +01:00
}
attr {
2017-10-07 08:20:18 +02:00
// resolve conflicts with shorttag and right_delimiter starting with '='
2017-10-21 13:14:14 +02:00
if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) === $this->smarty->getRightDelimiter()) {
2017-11-20 12:26:48 +01:00
preg_match('/\s+/',$this->value,$match);
2017-10-07 08:20:18 +02:00
$this->value = $match[0];
$this->token = Smarty_Internal_Templateparser::TP_SPACE;
} else {
$this->token = Smarty_Internal_Templateparser::TP_ATTR;
}
2014-12-14 00:49:42 +01:00
}
namespace {
$this->token = Smarty_Internal_Templateparser::TP_NAMESPACE;
}
id {
$this->token = Smarty_Internal_Templateparser::TP_ID;
}
integer {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_INTEGER;
2014-12-14 00:49:42 +01:00
}
backtick {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
$this->yypopstate();
2014-12-14 00:49:42 +01:00
}
vert {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_VERT;
2014-12-14 00:49:42 +01:00
}
dot {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_DOT;
2014-12-14 00:49:42 +01:00
}
comma {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_COMMA;
2014-12-14 00:49:42 +01:00
}
semicolon {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
2014-12-14 00:49:42 +01:00
}
doublecolon {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
2014-12-14 00:49:42 +01:00
}
colon {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_COLON;
2014-12-14 00:49:42 +01:00
}
qmark {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_QMARK;
2014-12-14 00:49:42 +01:00
}
hex {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_HEX;
2014-12-14 00:49:42 +01:00
}
space {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_SPACE;
2014-12-14 00:49:42 +01:00
}
2017-10-07 08:20:18 +02:00
char {
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
2014-12-14 00:49:42 +01:00
}
*/
/*!lex2php
%statename LITERAL
ldel literal rdel {
2017-10-07 08:20:18 +02:00
$this->literal_cnt++;
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
2014-12-14 00:49:42 +01:00
}
ldel slash literal rdel {
2017-10-07 08:20:18 +02:00
if ($this->literal_cnt) {
$this->literal_cnt--;
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
$this->yypopstate();
}
2014-12-14 00:49:42 +01:00
}
2017-10-07 08:20:18 +02:00
literaltext {
$this->token = Smarty_Internal_Templateparser::TP_LITERAL;
}
2014-12-14 00:49:42 +01:00
*/
/*!lex2php
%statename DOUBLEQUOTEDSTRING
2017-10-07 08:20:18 +02:00
userliteral {
2017-08-09 11:15:33 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
2014-12-14 00:49:42 +01:00
ldel literal rdel {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
2014-12-14 00:49:42 +01:00
}
ldel slash literal rdel {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
2014-12-14 00:49:42 +01:00
}
ldel slash {
2017-10-07 08:20:18 +02:00
$this->yypushstate(self::TAG);
return true;
2015-05-18 04:12:40 +02:00
}
ldel id {
2017-10-07 08:20:18 +02:00
$this->yypushstate(self::TAG);
return true;
2014-12-14 00:49:42 +01:00
}
ldel {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->taglineno = $this->line;
$this->yypushstate(self::TAGBODY);
2014-12-14 00:49:42 +01:00
}
double_quote {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypopstate();
2014-12-14 00:49:42 +01:00
}
2015-05-18 04:12:40 +02:00
backtick dollar {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
$this->value = substr($this->value,0,-1);
$this->yypushstate(self::TAGBODY);
$this->taglineno = $this->line;
2014-12-14 00:49:42 +01:00
}
2015-05-18 04:12:40 +02:00
dollar id {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
2014-12-14 00:49:42 +01:00
}
dollar {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
2014-12-14 00:49:42 +01:00
}
textdoublequoted {
2017-10-07 08:20:18 +02:00
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
2014-12-14 00:49:42 +01:00
}
*/
2015-09-01 01:54:28 +02:00
}
2014-12-14 00:49:42 +01:00