diff options
| author | Uwe Tews <uwe.tews@googlemail.com> | 2015-05-16 16:33:50 +0200 |
|---|---|---|
| committer | Uwe Tews <uwe.tews@googlemail.com> | 2015-05-16 16:33:50 +0200 |
| commit | e3123c04273b26a354efbf7aa4dd41bc4bb0af6b (patch) | |
| tree | f20c688045a78be9ae6626b037431ac2350fec1a /lexer/smarty_internal_templatelexer.plex | |
| parent | d21921de229119e95ba5589e7efdd8328437ddf8 (diff) | |
| download | smarty-e3123c04273b26a354efbf7aa4dd41bc4bb0af6b.tar.gz smarty-e3123c04273b26a354efbf7aa4dd41bc4bb0af6b.tar.bz2 smarty-e3123c04273b26a354efbf7aa4dd41bc4bb0af6b.zip | |
- improvement higher compilation speed by modified lexer/parser generator at "smarty/smarty-lexer"
Diffstat (limited to 'lexer/smarty_internal_templatelexer.plex')
| -rw-r--r-- | lexer/smarty_internal_templatelexer.plex | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex index 6bbf1ddb..e062a7bf 100644 --- a/lexer/smarty_internal_templatelexer.plex +++ b/lexer/smarty_internal_templatelexer.plex @@ -132,26 +132,29 @@ class Smarty_Internal_Templatelexer * * @var array */ - public $state_name = array(1 => 'TEXT', 2 => 'SMARTY', 3 => 'LITERAL', 4 => 'DOUBLEQUOTEDSTRING', 5 => 'CHILDBODY'); + public $state_name = array(1 => 'TEXT', 2 => 'SMARTY', 3 => 'LITERAL', 4 => 'DOUBLEQUOTEDSTRING', + 5 => 'CHILDBODY', 6 => 'CHILDBLOCK', 7 => 'CHILDLITERAL'); + + /** + * storage for assembled token patterns + * + * @var sring + */ + private $yy_global_pattern1 = null; + private $yy_global_pattern2 = null; + private $yy_global_pattern3 = null; + private $yy_global_pattern4 = null; + private $yy_global_pattern5 = null; + private $yy_global_pattern6 = null; + private $yy_global_pattern7 = null; + /** * token names * * @var array */ - public $smarty_token_names = array( // Text for parser error messages - 'IDENTITY' => '===', - 'NONEIDENTITY' => '!==', - 'EQUALS' => '==', - 'NOTEQUALS' => '!=', - 'GREATEREQUAL' => '(>=,ge)', - 'LESSEQUAL' => '(<=,le)', - 'GREATERTHAN' => '(>,gt)', - 'LESSTHAN' => '(<,lt)', - 'MOD' => '(%,mod)', + public $smarty_token_names = array( // Text for parser error messages 'NOT' => '(!,not)', - 'LAND' => '(&&,and)', - 'LOR' => '(||,or)', - 'LXOR' => 'xor', 'OPENP' => '(', 'CLOSEP' => ')', 'OPENB' => '[', @@ -172,22 +175,21 @@ class Smarty_Internal_Templatelexer 'HATCH' => '#', 'QUOTE' => '"', 'BACKTICK' => '`', - 'VERT' => '|', + 'VERT' => '"|" modifier', 'DOT' => '.', 'COMMA' => '","', - 'ANDSYM' => '"&"', 'QMARK' => '"?"', - 'ID' => 'identifier', + 'ID' => 'id, name', 'TEXT' => 'text', - 'FAKEPHPSTARTTAG' => 'Fake PHP start tag', - 'PHPSTARTTAG' => 'PHP start tag', - 'PHPENDTAG' => 'PHP end tag', - 'LITERALSTART' => 'Literal start', - 'LITERALEND' => 'Literal end', - 'LDELSLASH' => 'closing tag', + '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', ); /** |
