You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smarty_internal_configfilelexer.php 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <?php
  2. /**
  3. * Smarty Internal Plugin Configfilelexer
  4. *
  5. * This is the lexer to break the config file source into tokens
  6. *
  7. * @package Smarty
  8. * @subpackage Config
  9. * @author Uwe Tews
  10. */
  11. /**
  12. * Smarty_Internal_Configfilelexer
  13. *
  14. * This is the config file lexer.
  15. * It is generated from the smarty_internal_configfilelexer.plex file
  16. *
  17. * @package Smarty
  18. * @subpackage Compiler
  19. * @author Uwe Tews
  20. */
  21. class Smarty_Internal_Configfilelexer
  22. {
  23. const START = 1;
  24. const VALUE = 2;
  25. const NAKED_STRING_VALUE = 3;
  26. const COMMENT = 4;
  27. const SECTION = 5;
  28. const TRIPPLE = 6;
  29. /**
  30. * Source
  31. *
  32. * @var string
  33. */
  34. public $data;
  35. /**
  36. * Source length
  37. *
  38. * @var int
  39. */
  40. public $dataLength = null;
  41. /**
  42. * byte counter
  43. *
  44. * @var int
  45. */
  46. public $counter;
  47. /**
  48. * token number
  49. *
  50. * @var int
  51. */
  52. public $token;
  53. /**
  54. * token value
  55. *
  56. * @var string
  57. */
  58. public $value;
  59. /**
  60. * current line
  61. *
  62. * @var int
  63. */
  64. public $line;
  65. /**
  66. * state number
  67. *
  68. * @var int
  69. */
  70. public $state = 1;
  71. /**
  72. * Smarty object
  73. *
  74. * @var Smarty
  75. */
  76. public $smarty = null;
  77. /**
  78. * trace file
  79. *
  80. * @var resource
  81. */
  82. public $yyTraceFILE;
  83. /**
  84. * trace prompt
  85. *
  86. * @var string
  87. */
  88. public $yyTracePrompt;
  89. /**
  90. * state names
  91. *
  92. * @var array
  93. */
  94. public $state_name = array(1 => 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION',
  95. 6 => 'TRIPPLE');
  96. /**
  97. * token names
  98. *
  99. * @var array
  100. */
  101. public $smarty_token_names = array( // Text for parser error messages
  102. );
  103. /**
  104. * compiler object
  105. *
  106. * @var Smarty_Internal_Config_File_Compiler
  107. */
  108. private $compiler = null;
  109. /**
  110. * copy of config_booleanize
  111. *
  112. * @var bool
  113. */
  114. private $configBooleanize = false;
  115. /**
  116. * storage for assembled token patterns
  117. *
  118. * @var string
  119. */
  120. private $yy_global_pattern1 = null;
  121. private $yy_global_pattern2 = null;
  122. private $yy_global_pattern3 = null;
  123. private $yy_global_pattern4 = null;
  124. private $yy_global_pattern5 = null;
  125. private $yy_global_pattern6 = null;
  126. private $_yy_state = 1;
  127. private $_yy_stack = array();
  128. /**
  129. * constructor
  130. *
  131. * @param string $data template source
  132. * @param Smarty_Internal_Config_File_Compiler $compiler
  133. */
  134. function __construct($data, Smarty_Internal_Config_File_Compiler $compiler)
  135. {
  136. $this->data = $data . "\n"; //now all lines are \n-terminated
  137. $this->dataLength = strlen($data);
  138. $this->counter = 0;
  139. if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) {
  140. $this->counter += strlen($match[ 0 ]);
  141. }
  142. $this->line = 1;
  143. $this->compiler = $compiler;
  144. $this->smarty = $compiler->smarty;
  145. $this->configBooleanize = $this->smarty->config_booleanize;
  146. }
  147. public function replace($input)
  148. {
  149. return $input;
  150. } // end function
  151. public function PrintTrace()
  152. {
  153. $this->yyTraceFILE = fopen('php://output', 'w');
  154. $this->yyTracePrompt = '<br>';
  155. }
  156. public function yylex()
  157. {
  158. return $this->{'yylex' . $this->_yy_state}();
  159. }
  160. public function yypushstate($state)
  161. {
  162. if ($this->yyTraceFILE) {
  163. fprintf($this->yyTraceFILE,
  164. "%sState push %s\n",
  165. $this->yyTracePrompt,
  166. isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :
  167. $this->_yy_state);
  168. }
  169. array_push($this->_yy_stack, $this->_yy_state);
  170. $this->_yy_state = $state;
  171. if ($this->yyTraceFILE) {
  172. fprintf($this->yyTraceFILE,
  173. "%snew State %s\n",
  174. $this->yyTracePrompt,
  175. isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :
  176. $this->_yy_state);
  177. }
  178. }
  179. public function yypopstate()
  180. {
  181. if ($this->yyTraceFILE) {
  182. fprintf($this->yyTraceFILE,
  183. "%sState pop %s\n",
  184. $this->yyTracePrompt,
  185. isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :
  186. $this->_yy_state);
  187. }
  188. $this->_yy_state = array_pop($this->_yy_stack);
  189. if ($this->yyTraceFILE) {
  190. fprintf($this->yyTraceFILE,
  191. "%snew State %s\n",
  192. $this->yyTracePrompt,
  193. isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :
  194. $this->_yy_state);
  195. }
  196. }
  197. public function yybegin($state)
  198. {
  199. $this->_yy_state = $state;
  200. if ($this->yyTraceFILE) {
  201. fprintf($this->yyTraceFILE,
  202. "%sState set %s\n",
  203. $this->yyTracePrompt,
  204. isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] :
  205. $this->_yy_state);
  206. }
  207. }
  208. public function yylex1()
  209. {
  210. if (!isset($this->yy_global_pattern1)) {
  211. $this->yy_global_pattern1 =
  212. $this->replace("/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/isS");
  213. }
  214. if (!isset($this->dataLength)) {
  215. $this->dataLength = strlen($this->data);
  216. }
  217. if ($this->counter >= $this->dataLength) {
  218. return false; // end of input
  219. }
  220. do {
  221. if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, 0, $this->counter)) {
  222. if (!isset($yymatches[ 0 ][ 1 ])) {
  223. $yymatches = preg_grep("/(.|\s)+/", $yymatches);
  224. } else {
  225. $yymatches = array_filter($yymatches);
  226. }
  227. if (empty($yymatches)) {
  228. throw new Exception('Error: lexing failed because a rule matched' .
  229. ' an empty string. Input "' . substr($this->data,
  230. $this->counter,
  231. 5) . '... state START');
  232. }
  233. next($yymatches); // skip global match
  234. $this->token = key($yymatches); // token number
  235. $this->value = current($yymatches); // token value
  236. $r = $this->{'yy_r1_' . $this->token}();
  237. if ($r === null) {
  238. $this->counter += strlen($this->value);
  239. $this->line += substr_count($this->value, "\n");
  240. // accept this token
  241. return true;
  242. } else if ($r === true) {
  243. // we have changed state
  244. // process this token in the new state
  245. return $this->yylex();
  246. } else if ($r === false) {
  247. $this->counter += strlen($this->value);
  248. $this->line += substr_count($this->value, "\n");
  249. if ($this->counter >= $this->dataLength) {
  250. return false; // end of input
  251. }
  252. // skip this token
  253. continue;
  254. }
  255. } else {
  256. throw new Exception('Unexpected input at line' . $this->line .
  257. ': ' . $this->data[ $this->counter ]);
  258. }
  259. break;
  260. } while (true);
  261. }
  262. function yy_r1_1()
  263. {
  264. $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART;
  265. $this->yypushstate(self::COMMENT);
  266. }
  267. function yy_r1_2()
  268. {
  269. $this->token = Smarty_Internal_Configfileparser::TPC_OPENB;
  270. $this->yypushstate(self::SECTION);
  271. }
  272. function yy_r1_3()
  273. {
  274. $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB;
  275. }
  276. function yy_r1_4()
  277. {
  278. $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL;
  279. $this->yypushstate(self::VALUE);
  280. } // end function
  281. function yy_r1_5()
  282. {
  283. return false;
  284. }
  285. function yy_r1_6()
  286. {
  287. $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
  288. }
  289. function yy_r1_7()
  290. {
  291. $this->token = Smarty_Internal_Configfileparser::TPC_ID;
  292. }
  293. function yy_r1_8()
  294. {
  295. $this->token = Smarty_Internal_Configfileparser::TPC_OTHER;
  296. }
  297. public function yylex2()
  298. {
  299. if (!isset($this->yy_global_pattern2)) {
  300. $this->yy_global_pattern2 =
  301. $this->replace("/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS");
  302. }
  303. if (!isset($this->dataLength)) {
  304. $this->dataLength = strlen($this->data);
  305. }
  306. if ($this->counter >= $this->dataLength) {
  307. return false; // end of input
  308. }
  309. do {
  310. if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, 0, $this->counter)) {
  311. if (!isset($yymatches[ 0 ][ 1 ])) {
  312. $yymatches = preg_grep("/(.|\s)+/", $yymatches);
  313. } else {
  314. $yymatches = array_filter($yymatches);
  315. }
  316. if (empty($yymatches)) {
  317. throw new Exception('Error: lexing failed because a rule matched' .
  318. ' an empty string. Input "' . substr($this->data,
  319. $this->counter,
  320. 5) . '... state VALUE');
  321. }
  322. next($yymatches); // skip global match
  323. $this->token = key($yymatches); // token number
  324. $this->value = current($yymatches); // token value
  325. $r = $this->{'yy_r2_' . $this->token}();
  326. if ($r === null) {
  327. $this->counter += strlen($this->value);
  328. $this->line += substr_count($this->value, "\n");
  329. // accept this token
  330. return true;
  331. } else if ($r === true) {
  332. // we have changed state
  333. // process this token in the new state
  334. return $this->yylex();
  335. } else if ($r === false) {
  336. $this->counter += strlen($this->value);
  337. $this->line += substr_count($this->value, "\n");
  338. if ($this->counter >= $this->dataLength) {
  339. return false; // end of input
  340. }
  341. // skip this token
  342. continue;
  343. }
  344. } else {
  345. throw new Exception('Unexpected input at line' . $this->line .
  346. ': ' . $this->data[ $this->counter ]);
  347. }
  348. break;
  349. } while (true);
  350. }
  351. function yy_r2_1()
  352. {
  353. return false;
  354. }
  355. function yy_r2_2()
  356. {
  357. $this->token = Smarty_Internal_Configfileparser::TPC_FLOAT;
  358. $this->yypopstate();
  359. }
  360. function yy_r2_3()
  361. {
  362. $this->token = Smarty_Internal_Configfileparser::TPC_INT;
  363. $this->yypopstate();
  364. }
  365. function yy_r2_4()
  366. {
  367. $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES;
  368. $this->yypushstate(self::TRIPPLE);
  369. }
  370. function yy_r2_5()
  371. {
  372. $this->token = Smarty_Internal_Configfileparser::TPC_SINGLE_QUOTED_STRING;
  373. $this->yypopstate();
  374. }
  375. function yy_r2_6()
  376. {
  377. $this->token = Smarty_Internal_Configfileparser::TPC_DOUBLE_QUOTED_STRING;
  378. $this->yypopstate();
  379. } // end function
  380. function yy_r2_7()
  381. {
  382. if (!$this->configBooleanize ||
  383. !in_array(strtolower($this->value), array('true', 'false', 'on', 'off', 'yes', 'no'))) {
  384. $this->yypopstate();
  385. $this->yypushstate(self::NAKED_STRING_VALUE);
  386. return true; //reprocess in new state
  387. } else {
  388. $this->token = Smarty_Internal_Configfileparser::TPC_BOOL;
  389. $this->yypopstate();
  390. }
  391. }
  392. function yy_r2_8()
  393. {
  394. $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
  395. $this->yypopstate();
  396. }
  397. function yy_r2_9()
  398. {
  399. $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
  400. $this->value = '';
  401. $this->yypopstate();
  402. } // end function
  403. public function yylex3()
  404. {
  405. if (!isset($this->yy_global_pattern3)) {
  406. $this->yy_global_pattern3 = $this->replace("/\G([^\n]+?(?=[ \t\r]*\n))/isS");
  407. }
  408. if (!isset($this->dataLength)) {
  409. $this->dataLength = strlen($this->data);
  410. }
  411. if ($this->counter >= $this->dataLength) {
  412. return false; // end of input
  413. }
  414. do {
  415. if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, 0, $this->counter)) {
  416. if (!isset($yymatches[ 0 ][ 1 ])) {
  417. $yymatches = preg_grep("/(.|\s)+/", $yymatches);
  418. } else {
  419. $yymatches = array_filter($yymatches);
  420. }
  421. if (empty($yymatches)) {
  422. throw new Exception('Error: lexing failed because a rule matched' .
  423. ' an empty string. Input "' . substr($this->data,
  424. $this->counter,
  425. 5) . '... state NAKED_STRING_VALUE');
  426. }
  427. next($yymatches); // skip global match
  428. $this->token = key($yymatches); // token number
  429. $this->value = current($yymatches); // token value
  430. $r = $this->{'yy_r3_' . $this->token}();
  431. if ($r === null) {
  432. $this->counter += strlen($this->value);
  433. $this->line += substr_count($this->value, "\n");
  434. // accept this token
  435. return true;
  436. } else if ($r === true) {
  437. // we have changed state
  438. // process this token in the new state
  439. return $this->yylex();
  440. } else if ($r === false) {
  441. $this->counter += strlen($this->value);
  442. $this->line += substr_count($this->value, "\n");
  443. if ($this->counter >= $this->dataLength) {
  444. return false; // end of input
  445. }
  446. // skip this token
  447. continue;
  448. }
  449. } else {
  450. throw new Exception('Unexpected input at line' . $this->line .
  451. ': ' . $this->data[ $this->counter ]);
  452. }
  453. break;
  454. } while (true);
  455. }
  456. function yy_r3_1()
  457. {
  458. $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
  459. $this->yypopstate();
  460. }
  461. public function yylex4()
  462. {
  463. if (!isset($this->yy_global_pattern4)) {
  464. $this->yy_global_pattern4 = $this->replace("/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS");
  465. }
  466. if (!isset($this->dataLength)) {
  467. $this->dataLength = strlen($this->data);
  468. }
  469. if ($this->counter >= $this->dataLength) {
  470. return false; // end of input
  471. }
  472. do {
  473. if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, 0, $this->counter)) {
  474. if (!isset($yymatches[ 0 ][ 1 ])) {
  475. $yymatches = preg_grep("/(.|\s)+/", $yymatches);
  476. } else {
  477. $yymatches = array_filter($yymatches);
  478. }
  479. if (empty($yymatches)) {
  480. throw new Exception('Error: lexing failed because a rule matched' .
  481. ' an empty string. Input "' . substr($this->data,
  482. $this->counter,
  483. 5) . '... state COMMENT');
  484. }
  485. next($yymatches); // skip global match
  486. $this->token = key($yymatches); // token number
  487. $this->value = current($yymatches); // token value
  488. $r = $this->{'yy_r4_' . $this->token}();
  489. if ($r === null) {
  490. $this->counter += strlen($this->value);
  491. $this->line += substr_count($this->value, "\n");
  492. // accept this token
  493. return true;
  494. } else if ($r === true) {
  495. // we have changed state
  496. // process this token in the new state
  497. return $this->yylex();
  498. } else if ($r === false) {
  499. $this->counter += strlen($this->value);
  500. $this->line += substr_count($this->value, "\n");
  501. if ($this->counter >= $this->dataLength) {
  502. return false; // end of input
  503. }
  504. // skip this token
  505. continue;
  506. }
  507. } else {
  508. throw new Exception('Unexpected input at line' . $this->line .
  509. ': ' . $this->data[ $this->counter ]);
  510. }
  511. break;
  512. } while (true);
  513. }
  514. function yy_r4_1()
  515. {
  516. return false;
  517. }
  518. function yy_r4_2()
  519. {
  520. $this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
  521. } // end function
  522. function yy_r4_3()
  523. {
  524. $this->token = Smarty_Internal_Configfileparser::TPC_NEWLINE;
  525. $this->yypopstate();
  526. }
  527. public function yylex5()
  528. {
  529. if (!isset($this->yy_global_pattern5)) {
  530. $this->yy_global_pattern5 = $this->replace("/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS");
  531. }
  532. if (!isset($this->dataLength)) {
  533. $this->dataLength = strlen($this->data);
  534. }
  535. if ($this->counter >= $this->dataLength) {
  536. return false; // end of input
  537. }
  538. do {
  539. if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, 0, $this->counter)) {
  540. if (!isset($yymatches[ 0 ][ 1 ])) {
  541. $yymatches = preg_grep("/(.|\s)+/", $yymatches);
  542. } else {
  543. $yymatches = array_filter($yymatches);
  544. }
  545. if (empty($yymatches)) {
  546. throw new Exception('Error: lexing failed because a rule matched' .
  547. ' an empty string. Input "' . substr($this->data,
  548. $this->counter,
  549. 5) . '... state SECTION');
  550. }
  551. next($yymatches); // skip global match
  552. $this->token = key($yymatches); // token number
  553. $this->value = current($yymatches); // token value
  554. $r = $this->{'yy_r5_' . $this->token}();
  555. if ($r === null) {
  556. $this->counter += strlen($this->value);
  557. $this->line += substr_count($this->value, "\n");
  558. // accept this token
  559. return true;
  560. } else if ($r === true) {
  561. // we have changed state
  562. // process this token in the new state
  563. return $this->yylex();
  564. } else if ($r === false) {
  565. $this->counter += strlen($this->value);
  566. $this->line += substr_count($this->value, "\n");
  567. if ($this->counter >= $this->dataLength) {
  568. return false; // end of input
  569. }
  570. // skip this token
  571. continue;
  572. }
  573. } else {
  574. throw new Exception('Unexpected input at line' . $this->line .
  575. ': ' . $this->data[ $this->counter ]);
  576. }
  577. break;
  578. } while (true);
  579. }
  580. function yy_r5_1()
  581. {
  582. $this->token = Smarty_Internal_Configfileparser::TPC_DOT;
  583. }
  584. function yy_r5_2()
  585. {
  586. $this->token = Smarty_Internal_Configfileparser::TPC_SECTION;
  587. $this->yypopstate();
  588. } // end function
  589. public function yylex6()
  590. {
  591. if (!isset($this->yy_global_pattern6)) {
  592. $this->yy_global_pattern6 = $this->replace("/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS");
  593. }
  594. if (!isset($this->dataLength)) {
  595. $this->dataLength = strlen($this->data);
  596. }
  597. if ($this->counter >= $this->dataLength) {
  598. return false; // end of input
  599. }
  600. do {
  601. if (preg_match($this->yy_global_pattern6, $this->data, $yymatches, 0, $this->counter)) {
  602. if (!isset($yymatches[ 0 ][ 1 ])) {
  603. $yymatches = preg_grep("/(.|\s)+/", $yymatches);
  604. } else {
  605. $yymatches = array_filter($yymatches);
  606. }
  607. if (empty($yymatches)) {
  608. throw new Exception('Error: lexing failed because a rule matched' .
  609. ' an empty string. Input "' . substr($this->data,
  610. $this->counter,
  611. 5) . '... state TRIPPLE');
  612. }
  613. next($yymatches); // skip global match
  614. $this->token = key($yymatches); // token number
  615. $this->value = current($yymatches); // token value
  616. $r = $this->{'yy_r6_' . $this->token}();
  617. if ($r === null) {
  618. $this->counter += strlen($this->value);
  619. $this->line += substr_count($this->value, "\n");
  620. // accept this token
  621. return true;
  622. } else if ($r === true) {
  623. // we have changed state
  624. // process this token in the new state
  625. return $this->yylex();
  626. } else if ($r === false) {
  627. $this->counter += strlen($this->value);
  628. $this->line += substr_count($this->value, "\n");
  629. if ($this->counter >= $this->dataLength) {
  630. return false; // end of input
  631. }
  632. // skip this token
  633. continue;
  634. }
  635. } else {
  636. throw new Exception('Unexpected input at line' . $this->line .
  637. ': ' . $this->data[ $this->counter ]);
  638. }
  639. break;
  640. } while (true);
  641. }
  642. function yy_r6_1()
  643. {
  644. $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_QUOTES_END;
  645. $this->yypopstate();
  646. $this->yypushstate(self::START);
  647. }
  648. function yy_r6_2()
  649. {
  650. $to = strlen($this->data);
  651. preg_match("/\"\"\"[ \t\r]*[\n#;]/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter);
  652. if (isset($match[ 0 ][ 1 ])) {
  653. $to = $match[ 0 ][ 1 ];
  654. } else {
  655. $this->compiler->trigger_template_error('missing or misspelled literal closing tag');
  656. }
  657. $this->value = substr($this->data, $this->counter, $to - $this->counter);
  658. $this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_TEXT;
  659. }
  660. }