summaryrefslogtreecommitdiff
path: root/lexer/smarty_internal_templatelexer.plex
diff options
context:
space:
mode:
authorUwe Tews <uwe.tews@gmail.com>2018-03-28 07:14:29 +0200
committerUwe Tews <uwe.tews@gmail.com>2018-03-28 07:14:29 +0200
commitcf22e986c0ebe5b42a366df1200347ebf62cb7a7 (patch)
tree61b03bb22236dbe65db3170690a2805a123ad876 /lexer/smarty_internal_templatelexer.plex
parent0dbace832119c40c2f1d18a87ae96f5b532ddc67 (diff)
downloadsmarty-cf22e986c0ebe5b42a366df1200347ebf62cb7a7.tar.gz
smarty-cf22e986c0ebe5b42a366df1200347ebf62cb7a7.tar.bz2
smarty-cf22e986c0ebe5b42a366df1200347ebf62cb7a7.zip
- new feature {parent} = {$smarty.block.parent} {child} = {$smarty.block.child}
Diffstat (limited to 'lexer/smarty_internal_templatelexer.plex')
-rw-r--r--lexer/smarty_internal_templatelexer.plex10
1 files changed, 7 insertions, 3 deletions
diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex
index 95d575ce..52ee2d7b 100644
--- a/lexer/smarty_internal_templatelexer.plex
+++ b/lexer/smarty_internal_templatelexer.plex
@@ -281,7 +281,7 @@ class Smarty_Internal_Templatelexer
ldel = ~(SMARTYldel)SMARTYal~
rdel = ~\s*SMARTYrdel~
nocacherdel = ~(\s+nocache)?\s*SMARTYrdel~
- notblockid = ~(?:(?!block)[0-9]*[a-zA-Z_]\w*)~
+ smartyblockchildparent = ~[\$]smarty\.block\.(child|parent)~
integer = ~\d+~
hex = ~0[xX][0-9a-fA-F]+~
math = ~\s*([*]{1,2}|[%/^&]|[<>]{2})\s*~
@@ -321,7 +321,6 @@ class Smarty_Internal_Templatelexer
as = ~\s+as\s+~
to = ~\s+to\s+~
step = ~\s+step\s+~
- block = ~block~
if = ~(if|elseif|else if|while)\s+~
for = ~for\s+~
makenocache = ~make_nocache\s+~
@@ -406,7 +405,12 @@ class Smarty_Internal_Templatelexer
$this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG;
$this->taglineno = $this->line;
}
- ldel slash notblockid rdel {
+ ldel smartyblockchildparent rdel {
+ $this->yypopstate();
+ $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT;
+ $this->taglineno = $this->line;
+ }
+ ldel slash id rdel {
$this->yypopstate();
$this->token = Smarty_Internal_Templateparser::TP_CLOSETAG;
$this->taglineno = $this->line;