3 * Smarty Internal Plugin Templatelexer
4 * This is the lexer to break the template source into tokens
12 * Smarty Internal Plugin Templatelexer
14 class Smarty_Internal_Templatelexer
23 public $is_phpScript = false;
26 public $literal_cnt = 0;
27 private $heredoc_id_stack = Array();
29 public $yyTracePrompt;
30 public $state_name = array(1 => 'TEXT', 2 => 'SMARTY', 3 => 'LITERAL', 4 => 'DOUBLEQUOTEDSTRING', 5 => 'CHILDBODY');
31 public $smarty_token_names = array( // Text for parser error messages
33 'NONEIDENTITY' => '!==',
36 'GREATEREQUAL' => '(>=,ge)',
37 'LESSEQUAL' => '(<=,le)',
38 'GREATERTHAN' => '(>,gt)',
39 'LESSTHAN' => '(<,lt)',
53 'UNIMATH' => '+" , "-',
54 'MATH' => '*" , "/" , "%',
55 'INCDEC' => '++" , "--',
60 'DOUBLECOLON' => '::',
72 'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
73 'PHPSTARTTAG' => 'PHP start tag',
74 'PHPENDTAG' => 'PHP end tag',
75 'LITERALSTART' => 'Literal start',
76 'LITERALEND' => 'Literal end',
77 'LDELSLASH' => 'closing tag',
78 'COMMENT' => 'comment',
83 function __construct($data, $compiler)
85 // $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
88 if (preg_match('/^\xEF\xBB\xBF/', $this->data
, $match)) {
89 $this->counter +
= strlen($match[0]);
92 $this->smarty
= $compiler->smarty
;
93 $this->compiler
= $compiler;
94 $this->ldel
= preg_quote($this->smarty
->left_delimiter
, '/');
95 $this->ldel_length
= strlen($this->smarty
->left_delimiter
);
96 $this->rdel
= preg_quote($this->smarty
->right_delimiter
, '/');
97 $this->rdel_length
= strlen($this->smarty
->right_delimiter
);
98 $this->smarty_token_names
['LDEL'] = $this->smarty
->left_delimiter
;
99 $this->smarty_token_names
['RDEL'] = $this->smarty
->right_delimiter
;
102 public function PrintTrace()
104 $this->yyTraceFILE
= fopen('php://output', 'w');
105 $this->yyTracePrompt
= '<br>';
108 private $_yy_state = 1;
109 private $_yy_stack = array();
111 public function yylex()
113 return $this->{'yylex' . $this->_yy_state
}();
116 public function yypushstate($state)
118 if ($this->yyTraceFILE
) {
119 fprintf($this->yyTraceFILE
, "%sState push %s\n", $this->yyTracePrompt
, isset($this->state_name
[$this->_yy_state
]) ?
$this->state_name
[$this->_yy_state
] : $this->_yy_state
);
121 array_push($this->_yy_stack
, $this->_yy_state
);
122 $this->_yy_state
= $state;
123 if ($this->yyTraceFILE
) {
124 fprintf($this->yyTraceFILE
, "%snew State %s\n", $this->yyTracePrompt
, isset($this->state_name
[$this->_yy_state
]) ?
$this->state_name
[$this->_yy_state
] : $this->_yy_state
);
128 public function yypopstate()
130 if ($this->yyTraceFILE
) {
131 fprintf($this->yyTraceFILE
, "%sState pop %s\n", $this->yyTracePrompt
, isset($this->state_name
[$this->_yy_state
]) ?
$this->state_name
[$this->_yy_state
] : $this->_yy_state
);
133 $this->_yy_state
= array_pop($this->_yy_stack
);
134 if ($this->yyTraceFILE
) {
135 fprintf($this->yyTraceFILE
, "%snew State %s\n", $this->yyTracePrompt
, isset($this->state_name
[$this->_yy_state
]) ?
$this->state_name
[$this->_yy_state
] : $this->_yy_state
);
139 public function yybegin($state)
141 $this->_yy_state
= $state;
142 if ($this->yyTraceFILE
) {
143 fprintf($this->yyTraceFILE
, "%sState set %s\n", $this->yyTracePrompt
, isset($this->state_name
[$this->_yy_state
]) ?
$this->state_name
[$this->_yy_state
] : $this->_yy_state
);
147 public function yylex1()
169 if ($this->counter
>= strlen($this->data
)) {
170 return false; // end of input
172 $yy_global_pattern = "/\G(\\{\\})|\G(" . $this->ldel
. "\\*([\S\s]*?)\\*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*strip\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*\/strip\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*literal\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel
. "\\s*for\\s+)|\G(" . $this->ldel
. "\\s*foreach(?![^\s]))|\G(" . $this->ldel
. "\\s*setfilter\\s+)|\G(" . $this->ldel
. "\\s*\/)|\G(" . $this->ldel
. "\\s*)|\G((<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|(<\\?(?:php\\w+|=|[a-zA-Z]+)?))|\G(\\?>)|\G(<\/script>)|\G(\\s*" . $this->rdel
. ")|\G(<%)|\G(%>)|\G([\S\s])/iS";
175 if (preg_match($yy_global_pattern, $this->data
, $yymatches, null, $this->counter
)) {
176 $yysubmatches = $yymatches;
177 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
178 if (!count($yymatches)) {
179 throw new Exception('Error: lexing failed because a rule matched' .
180 ' an empty string. Input "' . substr($this->data
,
181 $this->counter
, 5) . '... state TEXT');
183 next($yymatches); // skip global match
184 $this->token
= key($yymatches); // token number
185 if ($tokenMap[$this->token
]) {
186 // extract sub-patterns for passing to lex function
187 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
188 $tokenMap[$this->token
]);
190 $yysubmatches = array();
192 $this->value
= current($yymatches); // token value
193 $r = $this->{'yy_r1_' . $this->token
}($yysubmatches);
195 $this->counter +
= strlen($this->value
);
196 $this->line +
= substr_count($this->value
, "\n");
199 } elseif ($r === true) {
200 // we have changed state
201 // process this token in the new state
202 return $this->yylex();
203 } elseif ($r === false) {
204 $this->counter +
= strlen($this->value
);
205 $this->line +
= substr_count($this->value
, "\n");
206 if ($this->counter
>= strlen($this->data
)) {
207 return false; // end of input
213 throw new Exception('Unexpected input at line' . $this->line
.
214 ': ' . $this->data
[$this->counter
]);
222 function yy_r1_1($yy_subpatterns)
225 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
228 function yy_r1_2($yy_subpatterns)
231 $this->token
= Smarty_Internal_Templateparser
::TP_COMMENT
;
234 function yy_r1_4($yy_subpatterns)
237 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
238 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
240 $this->token
= Smarty_Internal_Templateparser
::TP_STRIPON
;
244 function yy_r1_5($yy_subpatterns)
247 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
248 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
250 $this->token
= Smarty_Internal_Templateparser
::TP_STRIPOFF
;
254 function yy_r1_6($yy_subpatterns)
257 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
258 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
260 $this->token
= Smarty_Internal_Templateparser
::TP_LITERALSTART
;
261 $this->yypushstate(self
::LITERAL
);
265 function yy_r1_7($yy_subpatterns)
268 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
269 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
271 $this->token
= Smarty_Internal_Templateparser
::TP_LDELIF
;
272 $this->yypushstate(self
::SMARTY
);
273 $this->taglineno
= $this->line
;
277 function yy_r1_9($yy_subpatterns)
280 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
281 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
283 $this->token
= Smarty_Internal_Templateparser
::TP_LDELFOR
;
284 $this->yypushstate(self
::SMARTY
);
285 $this->taglineno
= $this->line
;
289 function yy_r1_10($yy_subpatterns)
292 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
293 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
295 $this->token
= Smarty_Internal_Templateparser
::TP_LDELFOREACH
;
296 $this->yypushstate(self
::SMARTY
);
297 $this->taglineno
= $this->line
;
301 function yy_r1_11($yy_subpatterns)
304 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
305 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
307 $this->token
= Smarty_Internal_Templateparser
::TP_LDELSETFILTER
;
308 $this->yypushstate(self
::SMARTY
);
309 $this->taglineno
= $this->line
;
313 function yy_r1_12($yy_subpatterns)
316 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
317 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
319 $this->token
= Smarty_Internal_Templateparser
::TP_LDELSLASH
;
320 $this->yypushstate(self
::SMARTY
);
321 $this->taglineno
= $this->line
;
325 function yy_r1_13($yy_subpatterns)
328 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
329 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
331 $this->token
= Smarty_Internal_Templateparser
::TP_LDEL
;
332 $this->yypushstate(self
::SMARTY
);
333 $this->taglineno
= $this->line
;
337 function yy_r1_14($yy_subpatterns)
340 if (($script = strpos($this->value
, '<s') === 0) ||
in_array($this->value
, Array('<?', '<?=', '<?php'))) {
342 $this->is_phpScript
= true;
344 $this->token
= Smarty_Internal_Templateparser
::TP_PHPSTARTTAG
;
345 } elseif ($this->value
== '<?xml') {
346 $this->token
= Smarty_Internal_Templateparser
::TP_XMLTAG
;
348 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
349 //$this->value = substr($this->value, 0, 2);
353 function yy_r1_17($yy_subpatterns)
356 $this->token
= Smarty_Internal_Templateparser
::TP_PHPENDTAG
;
359 function yy_r1_18($yy_subpatterns)
362 $this->token
= Smarty_Internal_Templateparser
::TP_PHPENDSCRIPT
;
365 function yy_r1_19($yy_subpatterns)
368 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
371 function yy_r1_20($yy_subpatterns)
374 $this->token
= Smarty_Internal_Templateparser
::TP_ASPSTARTTAG
;
377 function yy_r1_21($yy_subpatterns)
380 $this->token
= Smarty_Internal_Templateparser
::TP_ASPENDTAG
;
383 function yy_r1_22($yy_subpatterns)
386 $phpEndScript = $this->is_phpScript ?
'|<\\/script>' : '';
387 $to = strlen($this->data
);
388 preg_match("/{$this->ldel}|<\?|<%|\?>|%>|<script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*>{$phpEndScript}/", $this->data
, $match, PREG_OFFSET_CAPTURE
, $this->counter
);
389 if (isset($match[0][1])) {
392 $this->value
= substr($this->data
, $this->counter
, $to - $this->counter
);
393 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
396 public function yylex2()
466 if ($this->counter
>= strlen($this->data
)) {
467 return false; // end of input
469 $yy_global_pattern = "/\G(\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$]smarty\\.block\\.(child|parent))|\G(\\$)|\G(\\s*" . $this->rdel
. ")|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*===\\s*)|\G(\\s*!==\\s*)|\G(\\s*==\\s*|\\s+eq\\s+)|\G(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|\G(\\s*>=\\s*|\\s+(ge|gte)\\s+)|\G(\\s*<=\\s*|\\s+(le|lte)\\s+)|\G(\\s*>\\s*|\\s+gt\\s+)|\G(\\s*<\\s*|\\s+lt\\s+)|\G(\\s+mod\\s+)|\G(!\\s*|not\\s+)|\G(\\s*&&\\s*|\\s*and\\s+)|\G(\\s*\\|\\|\\s*|\\s*or\\s+)|\G(\\s*xor\\s+)|\G(\\s+is\\s+odd\\s+by\\s+)|\G(\\s+is\\s+not\\s+odd\\s+by\\s+)|\G(\\s+is\\s+odd)|\G(\\s+is\\s+not\\s+odd)|\G(\\s+is\\s+even\\s+by\\s+)|\G(\\s+is\\s+not\\s+even\\s+by\\s+)|\G(\\s+is\\s+even)|\G(\\s+is\\s+not\\s+even)|\G(\\s+is\\s+div\\s+by\\s+)|\G(\\s+is\\s+not\\s+div\\s+by\\s+)|\G(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\)\\s*)|\G(\\s*\\(\\s*)|\G(\\s*\\))|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*->\\s*)|\G(\\s*=>\\s*)|\G(\\s*=\\s*)|\G(\\+\\+|--)|\G(\\s*(\\+|-)\\s*)|\G(\\s*(\\*|\/|%)\\s*)|\G(@)|\G(#)|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*=\\s*)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G(`)|\G(\\|)|\G(\\.)|\G(\\s*,\\s*)|\G(\\s*;)|\G(::)|\G(\\s*:\\s*)|\G(\\s*&\\s*)|\G(\\s*\\?\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G(" . $this->ldel
. "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel
. "\\s*for\\s+)|\G(" . $this->ldel
. "\\s*foreach(?![^\s]))|\G(" . $this->ldel
. "\\s*\/)|\G(" . $this->ldel
. "\\s*)|\G([\S\s])/iS";
472 if (preg_match($yy_global_pattern, $this->data
, $yymatches, null, $this->counter
)) {
473 $yysubmatches = $yymatches;
474 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
475 if (!count($yymatches)) {
476 throw new Exception('Error: lexing failed because a rule matched' .
477 ' an empty string. Input "' . substr($this->data
,
478 $this->counter
, 5) . '... state SMARTY');
480 next($yymatches); // skip global match
481 $this->token
= key($yymatches); // token number
482 if ($tokenMap[$this->token
]) {
483 // extract sub-patterns for passing to lex function
484 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
485 $tokenMap[$this->token
]);
487 $yysubmatches = array();
489 $this->value
= current($yymatches); // token value
490 $r = $this->{'yy_r2_' . $this->token
}($yysubmatches);
492 $this->counter +
= strlen($this->value
);
493 $this->line +
= substr_count($this->value
, "\n");
496 } elseif ($r === true) {
497 // we have changed state
498 // process this token in the new state
499 return $this->yylex();
500 } elseif ($r === false) {
501 $this->counter +
= strlen($this->value
);
502 $this->line +
= substr_count($this->value
, "\n");
503 if ($this->counter
>= strlen($this->data
)) {
504 return false; // end of input
510 throw new Exception('Unexpected input at line' . $this->line
.
511 ': ' . $this->data
[$this->counter
]);
519 function yy_r2_1($yy_subpatterns)
522 $this->token
= Smarty_Internal_Templateparser
::TP_QUOTE
;
523 $this->yypushstate(self
::DOUBLEQUOTEDSTRING
);
526 function yy_r2_2($yy_subpatterns)
529 $this->token
= Smarty_Internal_Templateparser
::TP_SINGLEQUOTESTRING
;
532 function yy_r2_3($yy_subpatterns)
535 $this->token
= Smarty_Internal_Templateparser
::TP_SMARTYBLOCKCHILDPARENT
;
536 $this->taglineno
= $this->line
;
539 function yy_r2_5($yy_subpatterns)
542 $this->token
= Smarty_Internal_Templateparser
::TP_DOLLAR
;
545 function yy_r2_6($yy_subpatterns)
548 $this->token
= Smarty_Internal_Templateparser
::TP_RDEL
;
552 function yy_r2_7($yy_subpatterns)
555 $this->token
= Smarty_Internal_Templateparser
::TP_ISIN
;
558 function yy_r2_8($yy_subpatterns)
561 $this->token
= Smarty_Internal_Templateparser
::TP_AS
;
564 function yy_r2_9($yy_subpatterns)
567 $this->token
= Smarty_Internal_Templateparser
::TP_TO
;
570 function yy_r2_10($yy_subpatterns)
573 $this->token
= Smarty_Internal_Templateparser
::TP_STEP
;
576 function yy_r2_11($yy_subpatterns)
579 $this->token
= Smarty_Internal_Templateparser
::TP_INSTANCEOF
;
582 function yy_r2_12($yy_subpatterns)
585 $this->token
= Smarty_Internal_Templateparser
::TP_IDENTITY
;
588 function yy_r2_13($yy_subpatterns)
591 $this->token
= Smarty_Internal_Templateparser
::TP_NONEIDENTITY
;
594 function yy_r2_14($yy_subpatterns)
597 $this->token
= Smarty_Internal_Templateparser
::TP_EQUALS
;
600 function yy_r2_15($yy_subpatterns)
603 $this->token
= Smarty_Internal_Templateparser
::TP_NOTEQUALS
;
606 function yy_r2_17($yy_subpatterns)
609 $this->token
= Smarty_Internal_Templateparser
::TP_GREATEREQUAL
;
612 function yy_r2_19($yy_subpatterns)
615 $this->token
= Smarty_Internal_Templateparser
::TP_LESSEQUAL
;
618 function yy_r2_21($yy_subpatterns)
621 $this->token
= Smarty_Internal_Templateparser
::TP_GREATERTHAN
;
624 function yy_r2_22($yy_subpatterns)
627 $this->token
= Smarty_Internal_Templateparser
::TP_LESSTHAN
;
630 function yy_r2_23($yy_subpatterns)
633 $this->token
= Smarty_Internal_Templateparser
::TP_MOD
;
636 function yy_r2_24($yy_subpatterns)
639 $this->token
= Smarty_Internal_Templateparser
::TP_NOT
;
642 function yy_r2_25($yy_subpatterns)
645 $this->token
= Smarty_Internal_Templateparser
::TP_LAND
;
648 function yy_r2_26($yy_subpatterns)
651 $this->token
= Smarty_Internal_Templateparser
::TP_LOR
;
654 function yy_r2_27($yy_subpatterns)
657 $this->token
= Smarty_Internal_Templateparser
::TP_LXOR
;
660 function yy_r2_28($yy_subpatterns)
663 $this->token
= Smarty_Internal_Templateparser
::TP_ISODDBY
;
666 function yy_r2_29($yy_subpatterns)
669 $this->token
= Smarty_Internal_Templateparser
::TP_ISNOTODDBY
;
672 function yy_r2_30($yy_subpatterns)
675 $this->token
= Smarty_Internal_Templateparser
::TP_ISODD
;
678 function yy_r2_31($yy_subpatterns)
681 $this->token
= Smarty_Internal_Templateparser
::TP_ISNOTODD
;
684 function yy_r2_32($yy_subpatterns)
687 $this->token
= Smarty_Internal_Templateparser
::TP_ISEVENBY
;
690 function yy_r2_33($yy_subpatterns)
693 $this->token
= Smarty_Internal_Templateparser
::TP_ISNOTEVENBY
;
696 function yy_r2_34($yy_subpatterns)
699 $this->token
= Smarty_Internal_Templateparser
::TP_ISEVEN
;
702 function yy_r2_35($yy_subpatterns)
705 $this->token
= Smarty_Internal_Templateparser
::TP_ISNOTEVEN
;
708 function yy_r2_36($yy_subpatterns)
711 $this->token
= Smarty_Internal_Templateparser
::TP_ISDIVBY
;
714 function yy_r2_37($yy_subpatterns)
717 $this->token
= Smarty_Internal_Templateparser
::TP_ISNOTDIVBY
;
720 function yy_r2_38($yy_subpatterns)
723 $this->token
= Smarty_Internal_Templateparser
::TP_TYPECAST
;
726 function yy_r2_42($yy_subpatterns)
729 $this->token
= Smarty_Internal_Templateparser
::TP_OPENP
;
732 function yy_r2_43($yy_subpatterns)
735 $this->token
= Smarty_Internal_Templateparser
::TP_CLOSEP
;
738 function yy_r2_44($yy_subpatterns)
741 $this->token
= Smarty_Internal_Templateparser
::TP_OPENB
;
744 function yy_r2_45($yy_subpatterns)
747 $this->token
= Smarty_Internal_Templateparser
::TP_CLOSEB
;
750 function yy_r2_46($yy_subpatterns)
753 $this->token
= Smarty_Internal_Templateparser
::TP_PTR
;
756 function yy_r2_47($yy_subpatterns)
759 $this->token
= Smarty_Internal_Templateparser
::TP_APTR
;
762 function yy_r2_48($yy_subpatterns)
765 $this->token
= Smarty_Internal_Templateparser
::TP_EQUAL
;
768 function yy_r2_49($yy_subpatterns)
771 $this->token
= Smarty_Internal_Templateparser
::TP_INCDEC
;
774 function yy_r2_50($yy_subpatterns)
777 $this->token
= Smarty_Internal_Templateparser
::TP_UNIMATH
;
780 function yy_r2_52($yy_subpatterns)
783 $this->token
= Smarty_Internal_Templateparser
::TP_MATH
;
786 function yy_r2_54($yy_subpatterns)
789 $this->token
= Smarty_Internal_Templateparser
::TP_AT
;
792 function yy_r2_55($yy_subpatterns)
795 $this->token
= Smarty_Internal_Templateparser
::TP_HATCH
;
798 function yy_r2_56($yy_subpatterns)
801 // resolve conflicts with shorttag and right_delimiter starting with '='
802 if (substr($this->data
, $this->counter +
strlen($this->value
) - 1, $this->rdel_length
) == $this->smarty
->right_delimiter
) {
803 preg_match("/\s+/", $this->value
, $match);
804 $this->value
= $match[0];
805 $this->token
= Smarty_Internal_Templateparser
::TP_SPACE
;
807 $this->token
= Smarty_Internal_Templateparser
::TP_ATTR
;
811 function yy_r2_57($yy_subpatterns)
814 $this->token
= Smarty_Internal_Templateparser
::TP_ID
;
817 function yy_r2_58($yy_subpatterns)
820 $this->token
= Smarty_Internal_Templateparser
::TP_INTEGER
;
823 function yy_r2_59($yy_subpatterns)
826 $this->token
= Smarty_Internal_Templateparser
::TP_BACKTICK
;
830 function yy_r2_60($yy_subpatterns)
833 $this->token
= Smarty_Internal_Templateparser
::TP_VERT
;
836 function yy_r2_61($yy_subpatterns)
839 $this->token
= Smarty_Internal_Templateparser
::TP_DOT
;
842 function yy_r2_62($yy_subpatterns)
845 $this->token
= Smarty_Internal_Templateparser
::TP_COMMA
;
848 function yy_r2_63($yy_subpatterns)
851 $this->token
= Smarty_Internal_Templateparser
::TP_SEMICOLON
;
854 function yy_r2_64($yy_subpatterns)
857 $this->token
= Smarty_Internal_Templateparser
::TP_DOUBLECOLON
;
860 function yy_r2_65($yy_subpatterns)
863 $this->token
= Smarty_Internal_Templateparser
::TP_COLON
;
866 function yy_r2_66($yy_subpatterns)
869 $this->token
= Smarty_Internal_Templateparser
::TP_ANDSYM
;
872 function yy_r2_67($yy_subpatterns)
875 $this->token
= Smarty_Internal_Templateparser
::TP_QMARK
;
878 function yy_r2_68($yy_subpatterns)
881 $this->token
= Smarty_Internal_Templateparser
::TP_HEX
;
884 function yy_r2_69($yy_subpatterns)
887 $this->token
= Smarty_Internal_Templateparser
::TP_SPACE
;
890 function yy_r2_70($yy_subpatterns)
893 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
894 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
896 $this->token
= Smarty_Internal_Templateparser
::TP_LDELIF
;
897 $this->yypushstate(self
::SMARTY
);
898 $this->taglineno
= $this->line
;
902 function yy_r2_72($yy_subpatterns)
905 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
906 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
908 $this->token
= Smarty_Internal_Templateparser
::TP_LDELFOR
;
909 $this->yypushstate(self
::SMARTY
);
910 $this->taglineno
= $this->line
;
914 function yy_r2_73($yy_subpatterns)
917 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
918 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
920 $this->token
= Smarty_Internal_Templateparser
::TP_LDELFOREACH
;
921 $this->yypushstate(self
::SMARTY
);
922 $this->taglineno
= $this->line
;
926 function yy_r2_74($yy_subpatterns)
929 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
930 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
932 $this->token
= Smarty_Internal_Templateparser
::TP_LDELSLASH
;
933 $this->yypushstate(self
::SMARTY
);
934 $this->taglineno
= $this->line
;
938 function yy_r2_75($yy_subpatterns)
941 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
942 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
944 $this->token
= Smarty_Internal_Templateparser
::TP_LDEL
;
945 $this->yypushstate(self
::SMARTY
);
946 $this->taglineno
= $this->line
;
950 function yy_r2_76($yy_subpatterns)
953 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
956 public function yylex3()
963 if ($this->counter
>= strlen($this->data
)) {
964 return false; // end of input
966 $yy_global_pattern = "/\G(" . $this->ldel
. "\\s*literal\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*\/literal\\s*" . $this->rdel
. ")|\G([\S\s])/iS";
969 if (preg_match($yy_global_pattern, $this->data
, $yymatches, null, $this->counter
)) {
970 $yysubmatches = $yymatches;
971 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
972 if (!count($yymatches)) {
973 throw new Exception('Error: lexing failed because a rule matched' .
974 ' an empty string. Input "' . substr($this->data
,
975 $this->counter
, 5) . '... state LITERAL');
977 next($yymatches); // skip global match
978 $this->token
= key($yymatches); // token number
979 if ($tokenMap[$this->token
]) {
980 // extract sub-patterns for passing to lex function
981 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
982 $tokenMap[$this->token
]);
984 $yysubmatches = array();
986 $this->value
= current($yymatches); // token value
987 $r = $this->{'yy_r3_' . $this->token
}($yysubmatches);
989 $this->counter +
= strlen($this->value
);
990 $this->line +
= substr_count($this->value
, "\n");
993 } elseif ($r === true) {
994 // we have changed state
995 // process this token in the new state
996 return $this->yylex();
997 } elseif ($r === false) {
998 $this->counter +
= strlen($this->value
);
999 $this->line +
= substr_count($this->value
, "\n");
1000 if ($this->counter
>= strlen($this->data
)) {
1001 return false; // end of input
1007 throw new Exception('Unexpected input at line' . $this->line
.
1008 ': ' . $this->data
[$this->counter
]);
1016 function yy_r3_1($yy_subpatterns)
1019 $this->literal_cnt ++
;
1020 $this->token
= Smarty_Internal_Templateparser
::TP_LITERAL
;
1023 function yy_r3_2($yy_subpatterns)
1026 if ($this->literal_cnt
) {
1027 $this->literal_cnt
--;
1028 $this->token
= Smarty_Internal_Templateparser
::TP_LITERAL
;
1030 $this->token
= Smarty_Internal_Templateparser
::TP_LITERALEND
;
1031 $this->yypopstate();
1035 function yy_r3_3($yy_subpatterns)
1038 $to = strlen($this->data
);
1039 preg_match("/{$this->ldel}\/?literal{$this->rdel}/", $this->data
, $match, PREG_OFFSET_CAPTURE
, $this->counter
);
1040 if (isset($match[0][1])) {
1043 $this->compiler
->trigger_template_error("missing or misspelled literal closing tag");
1045 $this->value
= substr($this->data
, $this->counter
, $to - $this->counter
);
1046 $this->token
= Smarty_Internal_Templateparser
::TP_LITERAL
;
1049 public function yylex4()
1066 if ($this->counter
>= strlen($this->data
)) {
1067 return false; // end of input
1069 $yy_global_pattern = "/\G(" . $this->ldel
. "\\s*(if|elseif|else if|while)\\s+)|\G(" . $this->ldel
. "\\s*for\\s+)|\G(" . $this->ldel
. "\\s*foreach(?![^\s]))|\G(" . $this->ldel
. "\\s*literal\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*\/literal\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*\/)|\G(" . $this->ldel
. "\\s*)|\G(\")|\G(`\\$)|\G(\\$[0-9]*[a-zA-Z_]\\w*)|\G(\\$)|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(" . $this->ldel
. "|\\$|`\\$|\")))|\G([\S\s])/iS";
1072 if (preg_match($yy_global_pattern, $this->data
, $yymatches, null, $this->counter
)) {
1073 $yysubmatches = $yymatches;
1074 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1075 if (!count($yymatches)) {
1076 throw new Exception('Error: lexing failed because a rule matched' .
1077 ' an empty string. Input "' . substr($this->data
,
1078 $this->counter
, 5) . '... state DOUBLEQUOTEDSTRING');
1080 next($yymatches); // skip global match
1081 $this->token
= key($yymatches); // token number
1082 if ($tokenMap[$this->token
]) {
1083 // extract sub-patterns for passing to lex function
1084 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1085 $tokenMap[$this->token
]);
1087 $yysubmatches = array();
1089 $this->value
= current($yymatches); // token value
1090 $r = $this->{'yy_r4_' . $this->token
}($yysubmatches);
1092 $this->counter +
= strlen($this->value
);
1093 $this->line +
= substr_count($this->value
, "\n");
1094 // accept this token
1096 } elseif ($r === true) {
1097 // we have changed state
1098 // process this token in the new state
1099 return $this->yylex();
1100 } elseif ($r === false) {
1101 $this->counter +
= strlen($this->value
);
1102 $this->line +
= substr_count($this->value
, "\n");
1103 if ($this->counter
>= strlen($this->data
)) {
1104 return false; // end of input
1110 throw new Exception('Unexpected input at line' . $this->line
.
1111 ': ' . $this->data
[$this->counter
]);
1117 const DOUBLEQUOTEDSTRING
= 4;
1119 function yy_r4_1($yy_subpatterns)
1122 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1123 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1125 $this->token
= Smarty_Internal_Templateparser
::TP_LDELIF
;
1126 $this->yypushstate(self
::SMARTY
);
1127 $this->taglineno
= $this->line
;
1131 function yy_r4_3($yy_subpatterns)
1134 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1135 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1137 $this->token
= Smarty_Internal_Templateparser
::TP_LDELFOR
;
1138 $this->yypushstate(self
::SMARTY
);
1139 $this->taglineno
= $this->line
;
1143 function yy_r4_4($yy_subpatterns)
1146 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1147 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1149 $this->token
= Smarty_Internal_Templateparser
::TP_LDELFOREACH
;
1150 $this->yypushstate(self
::SMARTY
);
1151 $this->taglineno
= $this->line
;
1155 function yy_r4_5($yy_subpatterns)
1158 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1161 function yy_r4_6($yy_subpatterns)
1164 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1167 function yy_r4_7($yy_subpatterns)
1170 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1171 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1173 $this->token
= Smarty_Internal_Templateparser
::TP_LDELSLASH
;
1174 $this->yypushstate(self
::SMARTY
);
1175 $this->taglineno
= $this->line
;
1179 function yy_r4_8($yy_subpatterns)
1182 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1183 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1185 $this->token
= Smarty_Internal_Templateparser
::TP_LDEL
;
1186 $this->yypushstate(self
::SMARTY
);
1187 $this->taglineno
= $this->line
;
1191 function yy_r4_9($yy_subpatterns)
1194 $this->token
= Smarty_Internal_Templateparser
::TP_QUOTE
;
1195 $this->yypopstate();
1198 function yy_r4_10($yy_subpatterns)
1201 $this->token
= Smarty_Internal_Templateparser
::TP_BACKTICK
;
1202 $this->value
= substr($this->value
, 0, - 1);
1203 $this->yypushstate(self
::SMARTY
);
1204 $this->taglineno
= $this->line
;
1207 function yy_r4_11($yy_subpatterns)
1210 $this->token
= Smarty_Internal_Templateparser
::TP_DOLLARID
;
1213 function yy_r4_12($yy_subpatterns)
1216 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1219 function yy_r4_13($yy_subpatterns)
1222 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1225 function yy_r4_17($yy_subpatterns)
1228 $to = strlen($this->data
);
1229 $this->value
= substr($this->data
, $this->counter
, $to - $this->counter
);
1230 $this->token
= Smarty_Internal_Templateparser
::TP_TEXT
;
1233 public function yylex5()
1241 if ($this->counter
>= strlen($this->data
)) {
1242 return false; // end of input
1244 $yy_global_pattern = "/\G(" . $this->ldel
. "\\s*strip\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*\/strip\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*block)|\G([\S\s])/iS";
1247 if (preg_match($yy_global_pattern, $this->data
, $yymatches, null, $this->counter
)) {
1248 $yysubmatches = $yymatches;
1249 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1250 if (!count($yymatches)) {
1251 throw new Exception('Error: lexing failed because a rule matched' .
1252 ' an empty string. Input "' . substr($this->data
,
1253 $this->counter
, 5) . '... state CHILDBODY');
1255 next($yymatches); // skip global match
1256 $this->token
= key($yymatches); // token number
1257 if ($tokenMap[$this->token
]) {
1258 // extract sub-patterns for passing to lex function
1259 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1260 $tokenMap[$this->token
]);
1262 $yysubmatches = array();
1264 $this->value
= current($yymatches); // token value
1265 $r = $this->{'yy_r5_' . $this->token
}($yysubmatches);
1267 $this->counter +
= strlen($this->value
);
1268 $this->line +
= substr_count($this->value
, "\n");
1269 // accept this token
1271 } elseif ($r === true) {
1272 // we have changed state
1273 // process this token in the new state
1274 return $this->yylex();
1275 } elseif ($r === false) {
1276 $this->counter +
= strlen($this->value
);
1277 $this->line +
= substr_count($this->value
, "\n");
1278 if ($this->counter
>= strlen($this->data
)) {
1279 return false; // end of input
1285 throw new Exception('Unexpected input at line' . $this->line
.
1286 ': ' . $this->data
[$this->counter
]);
1292 const CHILDBODY
= 5;
1294 function yy_r5_1($yy_subpatterns)
1297 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1300 $this->token
= Smarty_Internal_Templateparser
::TP_STRIPON
;
1304 function yy_r5_2($yy_subpatterns)
1307 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1310 $this->token
= Smarty_Internal_Templateparser
::TP_STRIPOFF
;
1314 function yy_r5_3($yy_subpatterns)
1317 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1320 $this->yypopstate();
1325 function yy_r5_4($yy_subpatterns)
1328 $to = strlen($this->data
);
1329 preg_match("/" . $this->ldel
. "\s*((\/)?strip\s*" . $this->rdel
. "|block\s+)/", $this->data
, $match, PREG_OFFSET_CAPTURE
, $this->counter
);
1330 if (isset($match[0][1])) {
1333 $this->value
= substr($this->data
, $this->counter
, $to - $this->counter
);
1337 public function yylex6()
1346 if ($this->counter
>= strlen($this->data
)) {
1347 return false; // end of input
1349 $yy_global_pattern = "/\G(" . $this->ldel
. "\\s*literal\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*block)|\G(" . $this->ldel
. "\\s*\/block)|\G(" . $this->ldel
. "\\s*[$]smarty\\.block\\.(child|parent))|\G([\S\s])/iS";
1352 if (preg_match($yy_global_pattern, $this->data
, $yymatches, null, $this->counter
)) {
1353 $yysubmatches = $yymatches;
1354 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1355 if (!count($yymatches)) {
1356 throw new Exception('Error: lexing failed because a rule matched' .
1357 ' an empty string. Input "' . substr($this->data
,
1358 $this->counter
, 5) . '... state CHILDBLOCK');
1360 next($yymatches); // skip global match
1361 $this->token
= key($yymatches); // token number
1362 if ($tokenMap[$this->token
]) {
1363 // extract sub-patterns for passing to lex function
1364 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1365 $tokenMap[$this->token
]);
1367 $yysubmatches = array();
1369 $this->value
= current($yymatches); // token value
1370 $r = $this->{'yy_r6_' . $this->token
}($yysubmatches);
1372 $this->counter +
= strlen($this->value
);
1373 $this->line +
= substr_count($this->value
, "\n");
1374 // accept this token
1376 } elseif ($r === true) {
1377 // we have changed state
1378 // process this token in the new state
1379 return $this->yylex();
1380 } elseif ($r === false) {
1381 $this->counter +
= strlen($this->value
);
1382 $this->line +
= substr_count($this->value
, "\n");
1383 if ($this->counter
>= strlen($this->data
)) {
1384 return false; // end of input
1390 throw new Exception('Unexpected input at line' . $this->line
.
1391 ': ' . $this->data
[$this->counter
]);
1397 const CHILDBLOCK
= 6;
1399 function yy_r6_1($yy_subpatterns)
1402 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1403 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1405 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1406 $this->yypushstate(self
::CHILDLITERAL
);
1410 function yy_r6_2($yy_subpatterns)
1413 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1414 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1416 $this->yypopstate();
1421 function yy_r6_3($yy_subpatterns)
1424 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1425 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1427 $this->yypopstate();
1432 function yy_r6_4($yy_subpatterns)
1435 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1436 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1438 $this->yypopstate();
1443 function yy_r6_6($yy_subpatterns)
1446 $to = strlen($this->data
);
1447 preg_match("/" . $this->ldel
. "\s*(literal\s*" . $this->rdel
. "|(\/)?block(\s|" . $this->rdel
. ")|[\$]smarty\.block\.(child|parent))/", $this->data
, $match, PREG_OFFSET_CAPTURE
, $this->counter
);
1448 if (isset($match[0][1])) {
1451 $this->value
= substr($this->data
, $this->counter
, $to - $this->counter
);
1452 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1455 public function yylex7()
1462 if ($this->counter
>= strlen($this->data
)) {
1463 return false; // end of input
1465 $yy_global_pattern = "/\G(" . $this->ldel
. "\\s*literal\\s*" . $this->rdel
. ")|\G(" . $this->ldel
. "\\s*\/literal\\s*" . $this->rdel
. ")|\G([\S\s])/iS";
1468 if (preg_match($yy_global_pattern, $this->data
, $yymatches, null, $this->counter
)) {
1469 $yysubmatches = $yymatches;
1470 $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
1471 if (!count($yymatches)) {
1472 throw new Exception('Error: lexing failed because a rule matched' .
1473 ' an empty string. Input "' . substr($this->data
,
1474 $this->counter
, 5) . '... state CHILDLITERAL');
1476 next($yymatches); // skip global match
1477 $this->token
= key($yymatches); // token number
1478 if ($tokenMap[$this->token
]) {
1479 // extract sub-patterns for passing to lex function
1480 $yysubmatches = array_slice($yysubmatches, $this->token +
1,
1481 $tokenMap[$this->token
]);
1483 $yysubmatches = array();
1485 $this->value
= current($yymatches); // token value
1486 $r = $this->{'yy_r7_' . $this->token
}($yysubmatches);
1488 $this->counter +
= strlen($this->value
);
1489 $this->line +
= substr_count($this->value
, "\n");
1490 // accept this token
1492 } elseif ($r === true) {
1493 // we have changed state
1494 // process this token in the new state
1495 return $this->yylex();
1496 } elseif ($r === false) {
1497 $this->counter +
= strlen($this->value
);
1498 $this->line +
= substr_count($this->value
, "\n");
1499 if ($this->counter
>= strlen($this->data
)) {
1500 return false; // end of input
1506 throw new Exception('Unexpected input at line' . $this->line
.
1507 ': ' . $this->data
[$this->counter
]);
1513 const CHILDLITERAL
= 7;
1515 function yy_r7_1($yy_subpatterns)
1518 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1519 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1521 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1522 $this->yypushstate(self
::CHILDLITERAL
);
1526 function yy_r7_2($yy_subpatterns)
1529 if ($this->smarty
->auto_literal
&& isset($this->value
[$this->ldel_length
]) ?
strpos(" \n\t\r", $this->value
[$this->ldel_length
]) !== false : false) {
1530 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1532 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;
1533 $this->yypopstate();
1537 function yy_r7_3($yy_subpatterns)
1540 $to = strlen($this->data
);
1541 preg_match("/{$this->ldel}\/?literal\s*{$this->rdel}/", $this->data
, $match, PREG_OFFSET_CAPTURE
, $this->counter
);
1542 if (isset($match[0][1])) {
1545 $this->compiler
->trigger_template_error("missing or misspelled literal closing tag");
1547 $this->value
= substr($this->data
, $this->counter
, $to - $this->counter
);
1548 $this->token
= Smarty_Internal_Templateparser
::TP_BLOCKSOURCE
;