API Enable namespaced-localisation keys in templates

BUG Fix whitespaces in SSTemplateParser.peg
This commit is contained in:
Damian Mooyman 2017-04-10 14:11:58 +12:00
parent d294709aec
commit f2768c85b1
5 changed files with 3886 additions and 5457 deletions

View File

@ -79,6 +79,9 @@ script:
- if [[ $BEHAT_TEST == framework ]]; then vendor/bin/behat --config tests/behat/config.yml .; fi - if [[ $BEHAT_TEST == framework ]]; then vendor/bin/behat --config tests/behat/config.yml .; fi
- if [[ $BEHAT_TEST == cms ]]; then vendor/bin/behat @cms --config tests/behat/cms-config.yml; fi - if [[ $BEHAT_TEST == cms ]]; then vendor/bin/behat @cms --config tests/behat/cms-config.yml; fi
- if [[ $PHPCS_TEST ]]; then composer run-script lint; fi - if [[ $PHPCS_TEST ]]; then composer run-script lint; fi
- if [[ $PHPCS_TEST ]]; then composer run-script php-peg; fi
- if [[ $PHPCS_TEST ]]; then git diff-files --quiet -w --relative=src; fi
- if [[ $PHPCS_TEST ]]; then git diff -w --no-color --relative=src; fi
after_success: after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi

View File

@ -72,7 +72,8 @@
"thirdparty/" "thirdparty/"
], ],
"scripts": { "scripts": {
"lint": "phpcs --standard=tests/phpcs/ruleset.xml src/ tests/php" "lint": "phpcs --standard=tests/phpcs/ruleset.xml src/ tests/php",
"php-peg": "php thirdparty/php-peg/cli.php src/View/SSTemplateParser.peg > src/View/SSTemplateParser.php"
}, },
"minimum-stability": "dev", "minimum-stability": "dev",
"prefer-stable": true "prefer-stable": true

View File

@ -10,20 +10,20 @@ It gets run through the php-peg parser compiler to have those comments turned in
template language, producing the executable version SSTemplateParser.php template language, producing the executable version SSTemplateParser.php
To recompile after changing this file, run this from the 'framework/View' directory via command line (in most cases To recompile after changing this file, run this from the 'framework/View' directory via command line (in most cases
this is: sapphire/view): this is: framework/src/View):
php ../thirdparty/php-peg/cli.php SSTemplateParser.peg > SSTemplateParser.php php ../../thirdparty/php-peg/cli.php SSTemplateParser.peg > SSTemplateParser.php
See the php-peg docs for more information on the parser format, and how to convert this file into SSTemplateParser.php See the php-peg docs for more information on the parser format, and how to convert this file into SSTemplateParser.php
TODO: TODO:
Template comments - <%-- --%> Template comments - <%-- --%>
$Iteration $Iteration
Partial cache blocks Partial cache blocks
i18n - we dont support then deprecated _t() or sprintf(_t()) methods; or the new <% t %> block yet i18n - we dont support then deprecated _t() or sprintf(_t()) methods; or the new <% t %> block yet
Add with and loop blocks Add with and loop blocks
Add Up and Top Add Up and Top
More error detection? More error detection?
This comment will not appear in the output This comment will not appear in the output
*/ */
@ -211,13 +211,13 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* SSTemplateParser /*!* SSTemplateParser
# Template is any structurally-complete portion of template (a full nested level in other words). It's the # Template is any structurally-complete portion of template (a full nested level in other words). It's the
# primary matcher, and is used by all enclosing blocks, as well as a base for the top level. # primary matcher, and is used by all enclosing blocks, as well as a base for the top level.
# Any new template elements need to be included in this list, if they are to work. # Any new template elements need to be included in this list, if they are to work.
Template: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | Template: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock |
OpenBlock | MalformedBlock | Injection | Text)+ OpenBlock | MalformedBlock | Injection | Text)+
*/ */
function Template_STR(&$res, $sub) function Template_STR(&$res, $sub)
{ {
$res['php'] .= $sub['php'] . PHP_EOL ; $res['php'] .= $sub['php'] . PHP_EOL ;
@ -225,16 +225,16 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
Word: / [A-Za-z_] [A-Za-z0-9_]* / Word: / [A-Za-z_] [A-Za-z0-9_]* /
NamespacedWord: / [A-Za-z_\/\\] [A-Za-z0-9_\/\\]* / NamespacedWord: / [A-Za-z_\/\\] [A-Za-z0-9_\/\\]* /
Number: / [0-9]+ / Number: / [0-9]+ /
Value: / [A-Za-z0-9_]+ / Value: / [A-Za-z0-9_]+ /
# CallArguments is a list of one or more comma seperated "arguments" (lookups or strings, either bare or marked) # CallArguments is a list of one or more comma seperated "arguments" (lookups or strings, either bare or marked)
# as passed to a Call within brackets # as passed to a Call within brackets
CallArguments: :Argument ( < "," < :Argument )* CallArguments: :Argument ( < "," < :Argument )*
*/ */
/** /**
* Values are bare words in templates, but strings in PHP. We rely on PHP's type conversion to back-convert * Values are bare words in templates, but strings in PHP. We rely on PHP's type conversion to back-convert
@ -252,20 +252,20 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Call is a php-style function call, e.g. Method(Argument, ...). Unlike PHP, the brackets are optional if no # Call is a php-style function call, e.g. Method(Argument, ...). Unlike PHP, the brackets are optional if no
# arguments are passed # arguments are passed
Call: Method:Word ( "(" < :CallArguments? > ")" )? Call: Method:Word ( "(" < :CallArguments? > ")" )?
# A lookup is a lookup of a value on the current scope object. It's a sequence of calls seperated by "." # A lookup is a lookup of a value on the current scope object. It's a sequence of calls seperated by "."
# characters. This final call in the sequence needs handling specially, as different structures need different # characters. This final call in the sequence needs handling specially, as different structures need different
# sorts of values, which require a different final method to be called to get the right return value # sorts of values, which require a different final method to be called to get the right return value
LookupStep: :Call &"." LookupStep: :Call &"."
LastLookupStep: :Call LastLookupStep: :Call
Lookup: LookupStep ("." LookupStep)* "." LastLookupStep | LastLookupStep Lookup: LookupStep ("." LookupStep)* "." LastLookupStep | LastLookupStep
*/ */
function Lookup__construct(&$res) function Lookup__construct(&$res)
{ {
@ -304,15 +304,15 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# New Translatable Syntax # New Translatable Syntax
# <%t Entity DefaultString is Context name1=string name2=$functionCall # <%t Entity DefaultString is Context name1=string name2=$functionCall
# (This is a new way to call translatable strings. The parser transforms this into a call to the _t() method) # (This is a new way to call translatable strings. The parser transforms this into a call to the _t() method)
Translate: "<%t" < Entity < (Default:QuotedString)? < (!("is" "=") < "is" < Context:QuotedString)? < Translate: "<%t" < Entity < (Default:QuotedString)? < (!("is" "=") < "is" < Context:QuotedString)? <
(InjectionVariables)? > "%>" (InjectionVariables)? > "%>"
InjectionVariables: (< InjectionName:Word "=" Argument)+ InjectionVariables: (< InjectionName:Word "=" Argument)+
Entity: / [A-Za-z_] [\w\.]* / Entity: / [A-Za-z_\\] [\w\.\\]* /
*/ */
function Translate__construct(&$res) function Translate__construct(&$res)
{ {
@ -370,13 +370,13 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Injections are where, outside of a block, a value needs to be inserted into the output. You can either # Injections are where, outside of a block, a value needs to be inserted into the output. You can either
# just do $Foo, or {$Foo} if the surrounding text would cause a problem (e.g. {$Foo}Bar) # just do $Foo, or {$Foo} if the surrounding text would cause a problem (e.g. {$Foo}Bar)
SimpleInjection: '$' :Lookup SimpleInjection: '$' :Lookup
BracketInjection: '{$' :Lookup "}" BracketInjection: '{$' :Lookup "}"
Injection: BracketInjection | SimpleInjection Injection: BracketInjection | SimpleInjection
*/ */
function Injection_STR(&$res, $sub) function Injection_STR(&$res, $sub)
{ {
$res['php'] = '$val .= '. str_replace('$$FINAL', 'XML_val', $sub['Lookup']['php']) . ';'; $res['php'] = '$val .= '. str_replace('$$FINAL', 'XML_val', $sub['Lookup']['php']) . ';';
@ -384,12 +384,12 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Inside a block's arguments you can still use the same format as a simple injection ($Foo). In this case # Inside a block's arguments you can still use the same format as a simple injection ($Foo). In this case
# it marks the argument as being a lookup, not a string (if it was bare it might still be used as a lookup, # it marks the argument as being a lookup, not a string (if it was bare it might still be used as a lookup,
# but that depends on where it's used, a la 2.4) # but that depends on where it's used, a la 2.4)
DollarMarkedLookup: SimpleInjection DollarMarkedLookup: SimpleInjection
*/ */
function DollarMarkedLookup_STR(&$res, $sub) function DollarMarkedLookup_STR(&$res, $sub)
{ {
$res['Lookup'] = $sub['Lookup']; $res['Lookup'] = $sub['Lookup'];
@ -397,29 +397,29 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Inside a block's arguments you can explictly mark a string by surrounding it with quotes (single or double, # Inside a block's arguments you can explictly mark a string by surrounding it with quotes (single or double,
# but they must be matching). If you do, inside the quote you can escape any character, but the only character # but they must be matching). If you do, inside the quote you can escape any character, but the only character
# that _needs_ escaping is the matching closing quote # that _needs_ escaping is the matching closing quote
QuotedString: q:/['"]/ String:/ (\\\\ | \\. | [^$q\\])* / '$q' QuotedString: q:/['"]/ String:/ (\\\\ | \\. | [^$q\\])* / '$q'
# In order to support 2.4's base syntax, we also need to detect free strings - strings not surrounded by # In order to support 2.4's base syntax, we also need to detect free strings - strings not surrounded by
# quotes, and containing spaces or punctuation, but supported as a single string. We support almost as flexible # quotes, and containing spaces or punctuation, but supported as a single string. We support almost as flexible
# a string as 2.4 - we don't attempt to determine the closing character by context, but just break on any # a string as 2.4 - we don't attempt to determine the closing character by context, but just break on any
# character which, in some context, would indicate the end of a free string, regardless of if we're actually in # character which, in some context, would indicate the end of a free string, regardless of if we're actually in
# that context or not # that context or not
FreeString: /[^,)%!=><|&]+/ FreeString: /[^,)%!=><|&]+/
# An argument - either a marked value, or a bare value, prefering lookup matching on the bare value over # An argument - either a marked value, or a bare value, prefering lookup matching on the bare value over
# freestring matching as long as that would give a successful parse # freestring matching as long as that would give a successful parse
Argument: Argument:
:DollarMarkedLookup | :DollarMarkedLookup |
:QuotedString | :QuotedString |
:Lookup !(< FreeString)| :Lookup !(< FreeString)|
:FreeString :FreeString
*/ */
/** /**
* If we get a bare value, we don't know enough to determine exactly what php would be the translation, because * If we get a bare value, we don't know enough to determine exactly what php would be the translation, because
@ -467,12 +467,12 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# if and else_if blocks allow basic comparisons between arguments # if and else_if blocks allow basic comparisons between arguments
ComparisonOperator: "!=" | "==" | ">=" | ">" | "<=" | "<" | "=" ComparisonOperator: "!=" | "==" | ">=" | ">" | "<=" | "<" | "="
Comparison: Argument < ComparisonOperator > Argument Comparison: Argument < ComparisonOperator > Argument
*/ */
function Comparison_Argument(&$res, $sub) function Comparison_Argument(&$res, $sub)
{ {
if ($sub['ArgumentMode'] == 'default') { if ($sub['ArgumentMode'] == 'default') {
@ -493,12 +493,12 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# If a comparison operator is not used in an if or else_if block, then the statement is a 'presence check', # If a comparison operator is not used in an if or else_if block, then the statement is a 'presence check',
# which checks if the argument given is present or not. For explicit strings (which were not allowed in 2.4) # which checks if the argument given is present or not. For explicit strings (which were not allowed in 2.4)
# this falls back to simple truthiness check # this falls back to simple truthiness check
PresenceCheck: (Not:'not' <)? Argument PresenceCheck: (Not:'not' <)? Argument
*/ */
function PresenceCheck_Not(&$res, $sub) function PresenceCheck_Not(&$res, $sub)
{ {
$res['php'] = '!'; $res['php'] = '!';
@ -518,11 +518,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# if and else_if arguments are a series of presence checks and comparisons, optionally seperated by boolean # if and else_if arguments are a series of presence checks and comparisons, optionally seperated by boolean
# operators # operators
IfArgumentPortion: Comparison | PresenceCheck IfArgumentPortion: Comparison | PresenceCheck
*/ */
function IfArgumentPortion_STR(&$res, $sub) function IfArgumentPortion_STR(&$res, $sub)
{ {
$res['php'] = $sub['php']; $res['php'] = $sub['php'];
@ -530,15 +530,15 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# if and else_if arguments can be combined via these two boolean operators. No precendence overriding is # if and else_if arguments can be combined via these two boolean operators. No precendence overriding is
# supported # supported
BooleanOperator: "||" | "&&" BooleanOperator: "||" | "&&"
# This is the combination of the previous if and else_if argument portions # This is the combination of the previous if and else_if argument portions
IfArgument: :IfArgumentPortion ( < :BooleanOperator < :IfArgumentPortion )* IfArgument: :IfArgumentPortion ( < :BooleanOperator < :IfArgumentPortion )*
*/ */
function IfArgument_IfArgumentPortion(&$res, $sub) function IfArgument_IfArgumentPortion(&$res, $sub)
{ {
$res['php'] .= $sub['php']; $res['php'] .= $sub['php'];
@ -551,16 +551,16 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# ifs are handled seperately from other closed block tags, because (A) their structure is different - they # ifs are handled seperately from other closed block tags, because (A) their structure is different - they
# can have else_if and else tags in between the if tag and the end_if tag, and (B) they have a different # can have else_if and else tags in between the if tag and the end_if tag, and (B) they have a different
# argument structure to every other block # argument structure to every other block
IfPart: '<%' < 'if' [ :IfArgument > '%>' Template:$TemplateMatcher? IfPart: '<%' < 'if' [ :IfArgument > '%>' Template:$TemplateMatcher?
ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher? ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher?
ElsePart: '<%' < 'else' > '%>' Template:$TemplateMatcher? ElsePart: '<%' < 'else' > '%>' Template:$TemplateMatcher?
If: IfPart ElseIfPart* ElsePart? '<%' < 'end_if' > '%>' If: IfPart ElseIfPart* ElsePart? '<%' < 'end_if' > '%>'
*/ */
function If_IfPart(&$res, $sub) function If_IfPart(&$res, $sub)
{ {
$res['php'] = $res['php'] =
@ -587,11 +587,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# The require block is handled seperately to the other open blocks as the argument syntax is different # The require block is handled seperately to the other open blocks as the argument syntax is different
# - must have one call style argument, must pass arguments to that call style argument # - must have one call style argument, must pass arguments to that call style argument
Require: '<%' < 'require' [ Call:(Method:Word "(" < :CallArguments > ")") > '%>' Require: '<%' < 'require' [ Call:(Method:Word "(" < :CallArguments > ")") > '%>'
*/ */
function Require_Call(&$res, $sub) function Require_Call(&$res, $sub)
{ {
$requirements = '\\SilverStripe\\View\\Requirements'; $requirements = '\\SilverStripe\\View\\Requirements';
@ -601,16 +601,16 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Cache block arguments don't support free strings # Cache block arguments don't support free strings
CacheBlockArgument: CacheBlockArgument:
!( "if " | "unless " ) !( "if " | "unless " )
( (
:DollarMarkedLookup | :DollarMarkedLookup |
:QuotedString | :QuotedString |
:Lookup :Lookup
) )
*/ */
function CacheBlockArgument_DollarMarkedLookup(&$res, $sub) function CacheBlockArgument_DollarMarkedLookup(&$res, $sub)
{ {
$res['php'] = $sub['Lookup']['php']; $res['php'] = $sub['Lookup']['php'];
@ -628,11 +628,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Collects the arguments passed in to be part of the key of a cacheblock # Collects the arguments passed in to be part of the key of a cacheblock
CacheBlockArguments: CacheBlockArgument ( < "," < CacheBlockArgument )* CacheBlockArguments: CacheBlockArgument ( < "," < CacheBlockArgument )*
*/ */
function CacheBlockArguments_CacheBlockArgument(&$res, $sub) function CacheBlockArguments_CacheBlockArgument(&$res, $sub)
{ {
if (!empty($res['php'])) { if (!empty($res['php'])) {
@ -645,18 +645,18 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/*!* /*!*
# CacheBlockTemplate is the same as Template, but doesn't include cache blocks (because they're handled seperately) # CacheBlockTemplate is the same as Template, but doesn't include cache blocks (because they're handled seperately)
CacheBlockTemplate extends Template (TemplateMatcher = CacheRestrictedTemplate); CacheBlock | UncachedBlock | => '' CacheBlockTemplate extends Template (TemplateMatcher = CacheRestrictedTemplate); CacheBlock | UncachedBlock | => ''
*/ */
/*!* /*!*
UncachedBlock: UncachedBlock:
'<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>' '<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>'
Template:$TemplateMatcher? Template:$TemplateMatcher?
'<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>' '<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>'
*/ */
function UncachedBlock_Template(&$res, $sub) function UncachedBlock_Template(&$res, $sub)
{ {
$res['php'] = $sub['php']; $res['php'] = $sub['php'];
@ -664,10 +664,10 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# CacheRestrictedTemplate is the same as Template, but doesn't allow cache blocks # CacheRestrictedTemplate is the same as Template, but doesn't allow cache blocks
CacheRestrictedTemplate extends Template CacheRestrictedTemplate extends Template
*/ */
function CacheRestrictedTemplate_CacheBlock(&$res, $sub) function CacheRestrictedTemplate_CacheBlock(&$res, $sub)
{ {
throw new SSTemplateParseException('You cant have cache blocks nested within with, loop or control blocks ' . throw new SSTemplateParseException('You cant have cache blocks nested within with, loop or control blocks ' .
@ -681,15 +681,15 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/*!* /*!*
# The partial caching block # The partial caching block
CacheBlock: CacheBlock:
'<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") > '<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") >
Condition:IfArgument )? > '%>' Condition:IfArgument )? > '%>'
(CacheBlock | UncachedBlock | CacheBlockTemplate)* (CacheBlock | UncachedBlock | CacheBlockTemplate)*
'<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>' '<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>'
*/ */
function CacheBlock__construct(&$res) function CacheBlock__construct(&$res)
{ {
$res['subblocks'] = 0; $res['subblocks'] = 0;
@ -752,16 +752,16 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Deprecated old-style i18n _t and sprintf(_t block tags. We support a slightly more flexible version than we used # Deprecated old-style i18n _t and sprintf(_t block tags. We support a slightly more flexible version than we used
# to, but just because it's easier to do so. It's strongly recommended to use the new syntax # to, but just because it's easier to do so. It's strongly recommended to use the new syntax
# This is the core used by both syntaxes, without the block start & end tags # This is the core used by both syntaxes, without the block start & end tags
OldTPart: "_t" N "(" N QuotedString (N "," N CallArguments)? N ")" N (";")? OldTPart: "_t" N "(" N QuotedString (N "," N CallArguments)? N ")" N (";")?
# whitespace with a newline # whitespace with a newline
N: / [\s\n]* / N: / [\s\n]* /
*/ */
function OldTPart__construct(&$res) function OldTPart__construct(&$res)
{ {
$res['php'] = "_t("; $res['php'] = "_t(";
@ -789,11 +789,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# This is the old <% _t() %> tag # This is the old <% _t() %> tag
OldTTag: "<%" < OldTPart > "%>" OldTTag: "<%" < OldTPart > "%>"
*/ */
function OldTTag_OldTPart(&$res, $sub) function OldTTag_OldTPart(&$res, $sub)
{ {
$res['php'] = $sub['php']; $res['php'] = $sub['php'];
@ -801,11 +801,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# This is the old <% sprintf(_t()) %> tag # This is the old <% sprintf(_t()) %> tag
OldSprintfTag: "<%" < "sprintf" < "(" < OldTPart < "," < CallArguments > ")" > "%>" OldSprintfTag: "<%" < "sprintf" < "(" < OldTPart < "," < CallArguments > ")" > "%>"
*/ */
function OldSprintfTag__construct(&$res) function OldSprintfTag__construct(&$res)
{ {
$res['php'] = "sprintf("; $res['php'] = "sprintf(";
@ -823,13 +823,13 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# This matches either the old style sprintf(_t()) or _t() tags. As well as including the output portion of the # This matches either the old style sprintf(_t()) or _t() tags. As well as including the output portion of the
# php, this rule combines all the old i18n stuff into a single match rule to make it easy to not support these # php, this rule combines all the old i18n stuff into a single match rule to make it easy to not support these
# tags later # tags later
OldI18NTag: OldSprintfTag | OldTTag OldI18NTag: OldSprintfTag | OldTTag
*/ */
function OldI18NTag_STR(&$res, $sub) function OldI18NTag_STR(&$res, $sub)
{ {
$res['php'] = '$val .= ' . $sub['php'] . ';'; $res['php'] = '$val .= ' . $sub['php'] . ';';
@ -837,11 +837,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# An argument that can be passed through to an included template # An argument that can be passed through to an included template
NamedArgument: Name:Word "=" Value:Argument NamedArgument: Name:Word "=" Value:Argument
*/ */
function NamedArgument_Name(&$res, $sub) function NamedArgument_Name(&$res, $sub)
{ {
$res['php'] = "'" . $sub['text'] . "' => "; $res['php'] = "'" . $sub['text'] . "' => ";
@ -866,11 +866,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# The include tag # The include tag
Include: "<%" < "include" < Template:NamespacedWord < (NamedArgument ( < "," < NamedArgument )*)? > "%>" Include: "<%" < "include" < Template:NamespacedWord < (NamedArgument ( < "," < NamedArgument )*)? > "%>"
*/ */
function Include__construct(&$res) function Include__construct(&$res)
{ {
$res['arguments'] = array(); $res['arguments'] = array();
@ -904,24 +904,24 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# To make the block support reasonably extendable, we don't explicitly define each closed block and it's structure, # To make the block support reasonably extendable, we don't explicitly define each closed block and it's structure,
# but instead match against a generic <% block_name argument, ... %> pattern. Each argument is left as per the # but instead match against a generic <% block_name argument, ... %> pattern. Each argument is left as per the
# output of the Argument matcher, and the handler (see the PHPDoc block later for more on this) is responsible # output of the Argument matcher, and the handler (see the PHPDoc block later for more on this) is responsible
# for pulling out the info required # for pulling out the info required
BlockArguments: :Argument ( < "," < :Argument)* BlockArguments: :Argument ( < "," < :Argument)*
# NotBlockTag matches against any word that might come after a "<%" that the generic open and closed block handlers # NotBlockTag matches against any word that might come after a "<%" that the generic open and closed block handlers
# shouldn't attempt to match against, because they're handled by more explicit matchers # shouldn't attempt to match against, because they're handled by more explicit matchers
NotBlockTag: "end_" | (("if" | "else_if" | "else" | "require" | "cached" | "uncached" | "cacheblock" | "include")]) NotBlockTag: "end_" | (("if" | "else_if" | "else" | "require" | "cached" | "uncached" | "cacheblock" | "include")])
# Match against closed blocks - blocks with an opening and a closing tag that surround some internal portion of # Match against closed blocks - blocks with an opening and a closing tag that surround some internal portion of
# template # template
ClosedBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > Zap:'%>' Template:$TemplateMatcher? ClosedBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > Zap:'%>' Template:$TemplateMatcher?
'<%' < 'end_' '$BlockName' > '%>' '<%' < 'end_' '$BlockName' > '%>'
*/ */
/** /**
* As mentioned in the parser comment, block handling is kept fairly generic for extensibility. The match rule * As mentioned in the parser comment, block handling is kept fairly generic for extensibility. The match rule
@ -1023,11 +1023,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Open blocks are handled in the same generic manner as closed blocks. There is no need to define which blocks # Open blocks are handled in the same generic manner as closed blocks. There is no need to define which blocks
# are which - closed is tried first, and if no matching end tag is found, open is tried next # are which - closed is tried first, and if no matching end tag is found, open is tried next
OpenBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > '%>' OpenBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > '%>'
*/ */
function OpenBlock__construct(&$res) function OpenBlock__construct(&$res)
{ {
$res['ArgumentCount'] = 0; $res['ArgumentCount'] = 0;
@ -1104,12 +1104,12 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# This is used to detect when we have a mismatched closing tag (i.e., one with no equivilent opening tag) # This is used to detect when we have a mismatched closing tag (i.e., one with no equivilent opening tag)
# Because of parser limitations, this can only be used at the top nesting level of a template. Other mismatched # Because of parser limitations, this can only be used at the top nesting level of a template. Other mismatched
# closing tags are detected as an invalid open tag # closing tags are detected as an invalid open tag
MismatchedEndBlock: '<%' < 'end_' :Word > '%>' MismatchedEndBlock: '<%' < 'end_' :Word > '%>'
*/ */
function MismatchedEndBlock__finalise(&$res) function MismatchedEndBlock__finalise(&$res)
{ {
$blockname = $res['Word']['text']; $blockname = $res['Word']['text'];
@ -1119,11 +1119,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# This is used to detect a malformed opening tag - one where the tag is opened with the "<%" characters, but # This is used to detect a malformed opening tag - one where the tag is opened with the "<%" characters, but
# the tag is not structured properly # the tag is not structured properly
MalformedOpenTag: '<%' < !NotBlockTag Tag:Word !( ( [ :BlockArguments ] )? > '%>' ) MalformedOpenTag: '<%' < !NotBlockTag Tag:Word !( ( [ :BlockArguments ] )? > '%>' )
*/ */
function MalformedOpenTag__finalise(&$res) function MalformedOpenTag__finalise(&$res)
{ {
$tag = $res['Tag']['text']; $tag = $res['Tag']['text'];
@ -1132,11 +1132,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# This is used to detect a malformed end tag - one where the tag is opened with the "<%" characters, but # This is used to detect a malformed end tag - one where the tag is opened with the "<%" characters, but
# the tag is not structured properly # the tag is not structured properly
MalformedCloseTag: '<%' < Tag:('end_' :Word ) !( > '%>' ) MalformedCloseTag: '<%' < Tag:('end_' :Word ) !( > '%>' )
*/ */
function MalformedCloseTag__finalise(&$res) function MalformedCloseTag__finalise(&$res)
{ {
$tag = $res['Tag']['text']; $tag = $res['Tag']['text'];
@ -1146,17 +1146,17 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# This is used to detect a malformed tag. It's mostly to keep the Template match rule a bit shorter # This is used to detect a malformed tag. It's mostly to keep the Template match rule a bit shorter
MalformedBlock: MalformedOpenTag | MalformedCloseTag MalformedBlock: MalformedOpenTag | MalformedCloseTag
*/ */
/*!* /*!*
# This is used to remove template comments # This is used to remove template comments
Comment: "<%--" (!"--%>" /(?s)./)+ "--%>" Comment: "<%--" (!"--%>" /(?s)./)+ "--%>"
*/ */
function Comment__construct(&$res) function Comment__construct(&$res)
{ {
$res['php'] = ''; $res['php'] = '';
@ -1164,11 +1164,11 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# TopTemplate is the same as Template, but should only be used at the top level (not nested), as it includes # TopTemplate is the same as Template, but should only be used at the top level (not nested), as it includes
# MismatchedEndBlock detection, which only works at the top level # MismatchedEndBlock detection, which only works at the top level
TopTemplate extends Template (TemplateMatcher = Template); MalformedBlock => MalformedBlock | MismatchedEndBlock TopTemplate extends Template (TemplateMatcher = Template); MalformedBlock => MalformedBlock | MismatchedEndBlock
*/ */
/** /**
* The TopTemplate also includes the opening stanza to start off the template * The TopTemplate also includes the opening stanza to start off the template
@ -1180,23 +1180,23 @@ class SSTemplateParser extends Parser implements TemplateParser
/*!* /*!*
# Text matches anything that isn't a template command (not an injection, block of any kind or comment) # Text matches anything that isn't a template command (not an injection, block of any kind or comment)
Text: ( Text: (
# Any set of characters that aren't potentially a control mark or an escaped character # Any set of characters that aren't potentially a control mark or an escaped character
/ [^<${\\]+ / | / [^<${\\]+ / |
# An escaped character # An escaped character
/ (\\.) / | / (\\.) / |
# A '<' that isn't the start of a block tag # A '<' that isn't the start of a block tag
'<' !'%' | '<' !'%' |
# A '$' that isn't the start of an injection # A '$' that isn't the start of an injection
'$' !(/[A-Za-z_]/) | '$' !(/[A-Za-z_]/) |
# A '{' that isn't the start of an injection # A '{' that isn't the start of an injection
'{' !'$' | '{' !'$' |
# A '{$' that isn't the start of an injection # A '{$' that isn't the start of an injection
'{$' !(/[A-Za-z_]/) '{$' !(/[A-Za-z_]/)
)+ )+
*/ */
/** /**
* We convert text * We convert text
@ -1213,8 +1213,8 @@ class SSTemplateParser extends Parser implements TemplateParser
// non-dynamically calculated // non-dynamically calculated
$code = <<<'EOC' $code = <<<'EOC'
(\SilverStripe\View\SSViewer::config()->get('rewrite_hash_links') (\SilverStripe\View\SSViewer::config()->get('rewrite_hash_links')
? \SilverStripe\Core\Convert::raw2att( preg_replace("/^(\\/)+/", "/", $_SERVER['REQUEST_URI'] ) ) ? \SilverStripe\Core\Convert::raw2att( preg_replace("/^(\\/)+/", "/", $_SERVER['REQUEST_URI'] ) )
: "") : "")
EOC; EOC;
// Because preg_replace replacement requires escaped slashes, addcslashes here // Because preg_replace replacement requires escaped slashes, addcslashes here
$text = preg_replace( $text = preg_replace(
@ -1227,8 +1227,8 @@ EOC;
} }
/****************** /******************
* Here ends the parser itself. Below are utility methods to use the parser * Here ends the parser itself. Below are utility methods to use the parser
*/ */
/** /**
* Compiles some passed template source code into the php code that will execute as per the template source. * Compiles some passed template source code into the php code that will execute as per the template source.

View File

@ -189,332 +189,252 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/* Template: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | /* Template: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock |
OpenBlock | MalformedBlock | Injection | Text)+ */ OpenBlock | MalformedBlock | Injection | Text)+ */
protected $match_Template_typestack = array('Template'); protected $match_Template_typestack = array('Template');
function match_Template($stack = array()) function match_Template ($stack = array()) {
{ $matchrule = "Template"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Template"; $count = 0;
$result = $this->construct($matchrule, $matchrule, null); while (true) {
$count = 0; $res_50 = $result;
while (true) { $pos_50 = $this->pos;
$res_50 = $result; $_49 = NULL;
$pos_50 = $this->pos; do {
$_49 = null; $_47 = NULL;
do { do {
$_47 = null; $res_0 = $result;
do { $pos_0 = $this->pos;
$res_0 = $result; $matcher = 'match_'.'Comment'; $key = $matcher; $pos = $this->pos;
$pos_0 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Comment'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_47 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_0;
$this->store($result, $subres); $this->pos = $pos_0;
$_47 = true; $_45 = NULL;
break; do {
} $res_2 = $result;
$result = $res_0; $pos_2 = $this->pos;
$this->pos = $pos_0; $matcher = 'match_'.'Translate'; $key = $matcher; $pos = $this->pos;
$_45 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_2 = $result; $this->store( $result, $subres );
$pos_2 = $this->pos; $_45 = TRUE; break;
$matcher = 'match_'.'Translate'; }
$key = $matcher; $result = $res_2;
$pos = $this->pos; $this->pos = $pos_2;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_43 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_4 = $result;
$_45 = true; $pos_4 = $this->pos;
break; $matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_2; if ($subres !== FALSE) {
$this->pos = $pos_2; $this->store( $result, $subres );
$_43 = null; $_43 = TRUE; break;
do { }
$res_4 = $result; $result = $res_4;
$pos_4 = $this->pos; $this->pos = $pos_4;
$matcher = 'match_'.'If'; $_41 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_6 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_6 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_43 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_41 = TRUE; break;
$result = $res_4; }
$this->pos = $pos_4; $result = $res_6;
$_41 = null; $this->pos = $pos_6;
do { $_39 = NULL;
$res_6 = $result; do {
$pos_6 = $this->pos; $res_8 = $result;
$matcher = 'match_'.'Require'; $pos_8 = $this->pos;
$key = $matcher; $matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_39 = TRUE; break;
$_41 = true; }
break; $result = $res_8;
} $this->pos = $pos_8;
$result = $res_6; $_37 = NULL;
$this->pos = $pos_6; do {
$_39 = null; $res_10 = $result;
do { $pos_10 = $this->pos;
$res_8 = $result; $matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$pos_8 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'CacheBlock'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_37 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_10;
$this->store($result, $subres); $this->pos = $pos_10;
$_39 = true; $_35 = NULL;
break; do {
} $res_12 = $result;
$result = $res_8; $pos_12 = $this->pos;
$this->pos = $pos_8; $matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$_37 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_10 = $result; $this->store( $result, $subres );
$pos_10 = $this->pos; $_35 = TRUE; break;
$matcher = 'match_'.'UncachedBlock'; }
$key = $matcher; $result = $res_12;
$pos = $this->pos; $this->pos = $pos_12;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_33 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_14 = $result;
$_37 = true; $pos_14 = $this->pos;
break; $matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_10; if ($subres !== FALSE) {
$this->pos = $pos_10; $this->store( $result, $subres );
$_35 = null; $_33 = TRUE; break;
do { }
$res_12 = $result; $result = $res_14;
$pos_12 = $this->pos; $this->pos = $pos_14;
$matcher = 'match_'.'OldI18NTag'; $_31 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_16 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_16 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_35 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_31 = TRUE; break;
$result = $res_12; }
$this->pos = $pos_12; $result = $res_16;
$_33 = null; $this->pos = $pos_16;
do { $_29 = NULL;
$res_14 = $result; do {
$pos_14 = $this->pos; $res_18 = $result;
$matcher = 'match_'.'Include'; $pos_18 = $this->pos;
$key = $matcher; $matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_29 = TRUE; break;
$_33 = true; }
break; $result = $res_18;
} $this->pos = $pos_18;
$result = $res_14; $_27 = NULL;
$this->pos = $pos_14; do {
$_31 = null; $res_20 = $result;
do { $pos_20 = $this->pos;
$res_16 = $result; $matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$pos_16 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'ClosedBlock'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_27 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_20;
$this->store($result, $subres); $this->pos = $pos_20;
$_31 = true; $_25 = NULL;
break; do {
} $res_22 = $result;
$result = $res_16; $pos_22 = $this->pos;
$this->pos = $pos_16; $matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$_29 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_18 = $result; $this->store( $result, $subres );
$pos_18 = $this->pos; $_25 = TRUE; break;
$matcher = 'match_'.'OpenBlock'; }
$key = $matcher; $result = $res_22;
$pos = $this->pos; $this->pos = $pos_22;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $matcher = 'match_'.'Text'; $key = $matcher; $pos = $this->pos;
if ($subres !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->store($result, $subres); if ($subres !== FALSE) {
$_29 = true; $this->store( $result, $subres );
break; $_25 = TRUE; break;
} }
$result = $res_18; $result = $res_22;
$this->pos = $pos_18; $this->pos = $pos_22;
$_27 = null; $_25 = FALSE; break;
do { }
$res_20 = $result; while(0);
$pos_20 = $this->pos; if( $_25 === TRUE ) { $_27 = TRUE; break; }
$matcher = 'match_'.'MalformedBlock'; $result = $res_20;
$key = $matcher; $this->pos = $pos_20;
$pos = $this->pos; $_27 = FALSE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { while(0);
$this->store($result, $subres); if( $_27 === TRUE ) { $_29 = TRUE; break; }
$_27 = true; $result = $res_18;
break; $this->pos = $pos_18;
} $_29 = FALSE; break;
$result = $res_20; }
$this->pos = $pos_20; while(0);
$_25 = null; if( $_29 === TRUE ) { $_31 = TRUE; break; }
do { $result = $res_16;
$res_22 = $result; $this->pos = $pos_16;
$pos_22 = $this->pos; $_31 = FALSE; break;
$matcher = 'match_'.'Injection'; }
$key = $matcher; while(0);
$pos = $this->pos; if( $_31 === TRUE ) { $_33 = TRUE; break; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $result = $res_14;
if ($subres !== false) { $this->pos = $pos_14;
$this->store($result, $subres); $_33 = FALSE; break;
$_25 = true; }
break; while(0);
} if( $_33 === TRUE ) { $_35 = TRUE; break; }
$result = $res_22; $result = $res_12;
$this->pos = $pos_22; $this->pos = $pos_12;
$matcher = 'match_'.'Text'; $_35 = FALSE; break;
$key = $matcher; }
$pos = $this->pos; while(0);
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if( $_35 === TRUE ) { $_37 = TRUE; break; }
if ($subres !== false) { $result = $res_10;
$this->store($result, $subres); $this->pos = $pos_10;
$_25 = true; $_37 = FALSE; break;
break; }
} while(0);
$result = $res_22; if( $_37 === TRUE ) { $_39 = TRUE; break; }
$this->pos = $pos_22; $result = $res_8;
$_25 = false; $this->pos = $pos_8;
break; $_39 = FALSE; break;
} while (0); }
if ($_25 === true) { while(0);
$_27 = true; if( $_39 === TRUE ) { $_41 = TRUE; break; }
break; $result = $res_6;
} $this->pos = $pos_6;
$result = $res_20; $_41 = FALSE; break;
$this->pos = $pos_20; }
$_27 = false; while(0);
break; if( $_41 === TRUE ) { $_43 = TRUE; break; }
} while (0); $result = $res_4;
if ($_27 === true) { $this->pos = $pos_4;
$_29 = true; $_43 = FALSE; break;
break; }
} while(0);
$result = $res_18; if( $_43 === TRUE ) { $_45 = TRUE; break; }
$this->pos = $pos_18; $result = $res_2;
$_29 = false; $this->pos = $pos_2;
break; $_45 = FALSE; break;
} while (0); }
if ($_29 === true) { while(0);
$_31 = true; if( $_45 === TRUE ) { $_47 = TRUE; break; }
break; $result = $res_0;
} $this->pos = $pos_0;
$result = $res_16; $_47 = FALSE; break;
$this->pos = $pos_16; }
$_31 = false; while(0);
break; if( $_47 === FALSE) { $_49 = FALSE; break; }
} while (0); $_49 = TRUE; break;
if ($_31 === true) { }
$_33 = true; while(0);
break; if( $_49 === FALSE) {
} $result = $res_50;
$result = $res_14; $this->pos = $pos_50;
$this->pos = $pos_14; unset( $res_50 );
$_33 = false; unset( $pos_50 );
break; break;
} while (0); }
if ($_33 === true) { $count += 1;
$_35 = true; }
break; if ($count > 0) { return $this->finalise($result); }
} else { return FALSE; }
$result = $res_12;
$this->pos = $pos_12;
$_35 = false;
break;
} while (0);
if ($_35 === true) {
$_37 = true;
break;
}
$result = $res_10;
$this->pos = $pos_10;
$_37 = false;
break;
} while (0);
if ($_37 === true) {
$_39 = true;
break;
}
$result = $res_8;
$this->pos = $pos_8;
$_39 = false;
break;
} while (0);
if ($_39 === true) {
$_41 = true;
break;
}
$result = $res_6;
$this->pos = $pos_6;
$_41 = false;
break;
} while (0);
if ($_41 === true) {
$_43 = true;
break;
}
$result = $res_4;
$this->pos = $pos_4;
$_43 = false;
break;
} while (0);
if ($_43 === true) {
$_45 = true;
break;
}
$result = $res_2;
$this->pos = $pos_2;
$_45 = false;
break;
} while (0);
if ($_45 === true) {
$_47 = true;
break;
}
$result = $res_0;
$this->pos = $pos_0;
$_47 = false;
break;
} while (0);
if ($_47 === false) {
$_49 = false;
break;
}
$_49 = true;
break;
} while (0);
if ($_49 === false) {
$result = $res_50;
$this->pos = $pos_50;
unset($res_50);
unset($pos_50);
break;
}
$count += 1;
}
if ($count > 0) {
return $this->finalise($result);
} else {
return false;
}
} }
@ -526,130 +446,98 @@ class SSTemplateParser extends Parser implements TemplateParser
/* Word: / [A-Za-z_] [A-Za-z0-9_]* / */ /* Word: / [A-Za-z_] [A-Za-z0-9_]* / */
protected $match_Word_typestack = array('Word'); protected $match_Word_typestack = array('Word');
function match_Word($stack = array()) function match_Word ($stack = array()) {
{ $matchrule = "Word"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Word"; if (( $subres = $this->rx( '/ [A-Za-z_] [A-Za-z0-9_]* /' ) ) !== FALSE) {
$result = $this->construct($matchrule, $matchrule, null); $result["text"] .= $subres;
if (( $subres = $this->rx('/ [A-Za-z_] [A-Za-z0-9_]* /') ) !== false) { return $this->finalise($result);
$result["text"] .= $subres; }
return $this->finalise($result); else { return FALSE; }
} else {
return false;
}
} }
/* NamespacedWord: / [A-Za-z_\/\\] [A-Za-z0-9_\/\\]* / */ /* NamespacedWord: / [A-Za-z_\/\\] [A-Za-z0-9_\/\\]* / */
protected $match_NamespacedWord_typestack = array('NamespacedWord'); protected $match_NamespacedWord_typestack = array('NamespacedWord');
function match_NamespacedWord($stack = array()) function match_NamespacedWord ($stack = array()) {
{ $matchrule = "NamespacedWord"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "NamespacedWord"; if (( $subres = $this->rx( '/ [A-Za-z_\/\\\\] [A-Za-z0-9_\/\\\\]* /' ) ) !== FALSE) {
$result = $this->construct($matchrule, $matchrule, null); $result["text"] .= $subres;
if (( $subres = $this->rx('/ [A-Za-z_\/\\\\] [A-Za-z0-9_\/\\\\]* /') ) !== false) { return $this->finalise($result);
$result["text"] .= $subres; }
return $this->finalise($result); else { return FALSE; }
} else {
return false;
}
} }
/* Number: / [0-9]+ / */ /* Number: / [0-9]+ / */
protected $match_Number_typestack = array('Number'); protected $match_Number_typestack = array('Number');
function match_Number($stack = array()) function match_Number ($stack = array()) {
{ $matchrule = "Number"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Number"; if (( $subres = $this->rx( '/ [0-9]+ /' ) ) !== FALSE) {
$result = $this->construct($matchrule, $matchrule, null); $result["text"] .= $subres;
if (( $subres = $this->rx('/ [0-9]+ /') ) !== false) { return $this->finalise($result);
$result["text"] .= $subres; }
return $this->finalise($result); else { return FALSE; }
} else {
return false;
}
} }
/* Value: / [A-Za-z0-9_]+ / */ /* Value: / [A-Za-z0-9_]+ / */
protected $match_Value_typestack = array('Value'); protected $match_Value_typestack = array('Value');
function match_Value($stack = array()) function match_Value ($stack = array()) {
{ $matchrule = "Value"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Value"; if (( $subres = $this->rx( '/ [A-Za-z0-9_]+ /' ) ) !== FALSE) {
$result = $this->construct($matchrule, $matchrule, null); $result["text"] .= $subres;
if (( $subres = $this->rx('/ [A-Za-z0-9_]+ /') ) !== false) { return $this->finalise($result);
$result["text"] .= $subres; }
return $this->finalise($result); else { return FALSE; }
} else {
return false;
}
} }
/* CallArguments: :Argument ( < "," < :Argument )* */ /* CallArguments: :Argument ( < "," < :Argument )* */
protected $match_CallArguments_typestack = array('CallArguments'); protected $match_CallArguments_typestack = array('CallArguments');
function match_CallArguments($stack = array()) function match_CallArguments ($stack = array()) {
{ $matchrule = "CallArguments"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "CallArguments"; $_62 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_62 = null; $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Argument'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "Argument" );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_62 = FALSE; break; }
if ($subres !== false) { while (true) {
$this->store($result, $subres, "Argument"); $res_61 = $result;
} else { $pos_61 = $this->pos;
$_62 = false; $_60 = NULL;
break; do {
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
while (true) { if (substr($this->string,$this->pos,1) == ',') {
$res_61 = $result; $this->pos += 1;
$pos_61 = $this->pos; $result["text"] .= ',';
$_60 = null; }
do { else { $_60 = FALSE; break; }
if (( $subres = $this->whitespace() ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if (substr($this->string, $this->pos, 1) == ',') { if ($subres !== FALSE) {
$this->pos += 1; $this->store( $result, $subres, "Argument" );
$result["text"] .= ','; }
} else { else { $_60 = FALSE; break; }
$_60 = false; $_60 = TRUE; break;
break; }
} while(0);
if (( $subres = $this->whitespace() ) !== false) { if( $_60 === FALSE) {
$result["text"] .= $subres; $result = $res_61;
} $this->pos = $pos_61;
$matcher = 'match_'.'Argument'; unset( $res_61 );
$key = $matcher; unset( $pos_61 );
$pos = $this->pos; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { }
$this->store($result, $subres, "Argument"); $_62 = TRUE; break;
} else { }
$_60 = false; while(0);
break; if( $_62 === TRUE ) { return $this->finalise($result); }
} if( $_62 === FALSE) { return FALSE; }
$_60 = true;
break;
} while (0);
if ($_60 === false) {
$result = $res_61;
$this->pos = $pos_61;
unset($res_61);
unset($pos_61);
break;
}
}
$_62 = true;
break;
} while (0);
if ($_62 === true) {
return $this->finalise($result);
}
if ($_62 === false) {
return false;
}
} }
@ -671,244 +559,182 @@ class SSTemplateParser extends Parser implements TemplateParser
/* Call: Method:Word ( "(" < :CallArguments? > ")" )? */ /* Call: Method:Word ( "(" < :CallArguments? > ")" )? */
protected $match_Call_typestack = array('Call'); protected $match_Call_typestack = array('Call');
function match_Call($stack = array()) function match_Call ($stack = array()) {
{ $matchrule = "Call"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Call"; $_72 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_72 = null; $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Word'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "Method" );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_72 = FALSE; break; }
if ($subres !== false) { $res_71 = $result;
$this->store($result, $subres, "Method"); $pos_71 = $this->pos;
} else { $_70 = NULL;
$_72 = false; do {
break; if (substr($this->string,$this->pos,1) == '(') {
} $this->pos += 1;
$res_71 = $result; $result["text"] .= '(';
$pos_71 = $this->pos; }
$_70 = null; else { $_70 = FALSE; break; }
do { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string, $this->pos, 1) == '(') { $res_67 = $result;
$this->pos += 1; $pos_67 = $this->pos;
$result["text"] .= '('; $matcher = 'match_'.'CallArguments'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_70 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres, "CallArguments" );
} }
if (( $subres = $this->whitespace() ) !== false) { else {
$result["text"] .= $subres; $result = $res_67;
} $this->pos = $pos_67;
$res_67 = $result; unset( $res_67 );
$pos_67 = $this->pos; unset( $pos_67 );
$matcher = 'match_'.'CallArguments'; }
$key = $matcher; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$pos = $this->pos; if (substr($this->string,$this->pos,1) == ')') {
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $this->pos += 1;
if ($subres !== false) { $result["text"] .= ')';
$this->store($result, $subres, "CallArguments"); }
} else { else { $_70 = FALSE; break; }
$result = $res_67; $_70 = TRUE; break;
$this->pos = $pos_67; }
unset($res_67); while(0);
unset($pos_67); if( $_70 === FALSE) {
} $result = $res_71;
if (( $subres = $this->whitespace() ) !== false) { $this->pos = $pos_71;
$result["text"] .= $subres; unset( $res_71 );
} unset( $pos_71 );
if (substr($this->string, $this->pos, 1) == ')') { }
$this->pos += 1; $_72 = TRUE; break;
$result["text"] .= ')'; }
} else { while(0);
$_70 = false; if( $_72 === TRUE ) { return $this->finalise($result); }
break; if( $_72 === FALSE) { return FALSE; }
}
$_70 = true;
break;
} while (0);
if ($_70 === false) {
$result = $res_71;
$this->pos = $pos_71;
unset($res_71);
unset($pos_71);
}
$_72 = true;
break;
} while (0);
if ($_72 === true) {
return $this->finalise($result);
}
if ($_72 === false) {
return false;
}
} }
/* LookupStep: :Call &"." */ /* LookupStep: :Call &"." */
protected $match_LookupStep_typestack = array('LookupStep'); protected $match_LookupStep_typestack = array('LookupStep');
function match_LookupStep($stack = array()) function match_LookupStep ($stack = array()) {
{ $matchrule = "LookupStep"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "LookupStep"; $_76 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_76 = null; $matcher = 'match_'.'Call'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Call'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "Call" );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_76 = FALSE; break; }
if ($subres !== false) { $res_75 = $result;
$this->store($result, $subres, "Call"); $pos_75 = $this->pos;
} else { if (substr($this->string,$this->pos,1) == '.') {
$_76 = false; $this->pos += 1;
break; $result["text"] .= '.';
} $result = $res_75;
$res_75 = $result; $this->pos = $pos_75;
$pos_75 = $this->pos; }
if (substr($this->string, $this->pos, 1) == '.') { else {
$this->pos += 1; $result = $res_75;
$result["text"] .= '.'; $this->pos = $pos_75;
$result = $res_75; $_76 = FALSE; break;
$this->pos = $pos_75; }
} else { $_76 = TRUE; break;
$result = $res_75; }
$this->pos = $pos_75; while(0);
$_76 = false; if( $_76 === TRUE ) { return $this->finalise($result); }
break; if( $_76 === FALSE) { return FALSE; }
}
$_76 = true;
break;
} while (0);
if ($_76 === true) {
return $this->finalise($result);
}
if ($_76 === false) {
return false;
}
} }
/* LastLookupStep: :Call */ /* LastLookupStep: :Call */
protected $match_LastLookupStep_typestack = array('LastLookupStep'); protected $match_LastLookupStep_typestack = array('LastLookupStep');
function match_LastLookupStep($stack = array()) function match_LastLookupStep ($stack = array()) {
{ $matchrule = "LastLookupStep"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "LastLookupStep"; $matcher = 'match_'.'Call'; $key = $matcher; $pos = $this->pos;
$result = $this->construct($matchrule, $matchrule, null); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Call'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "Call" );
$pos = $this->pos; return $this->finalise($result);
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { else { return FALSE; }
$this->store($result, $subres, "Call");
return $this->finalise($result);
} else {
return false;
}
} }
/* Lookup: LookupStep ("." LookupStep)* "." LastLookupStep | LastLookupStep */ /* Lookup: LookupStep ("." LookupStep)* "." LastLookupStep | LastLookupStep */
protected $match_Lookup_typestack = array('Lookup'); protected $match_Lookup_typestack = array('Lookup');
function match_Lookup($stack = array()) function match_Lookup ($stack = array()) {
{ $matchrule = "Lookup"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Lookup"; $_90 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_90 = null; $res_79 = $result;
do { $pos_79 = $this->pos;
$res_79 = $result; $_87 = NULL;
$pos_79 = $this->pos; do {
$_87 = null; $matcher = 'match_'.'LookupStep'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'LookupStep'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_87 = FALSE; break; }
if ($subres !== false) { while (true) {
$this->store($result, $subres); $res_84 = $result;
} else { $pos_84 = $this->pos;
$_87 = false; $_83 = NULL;
break; do {
} if (substr($this->string,$this->pos,1) == '.') {
while (true) { $this->pos += 1;
$res_84 = $result; $result["text"] .= '.';
$pos_84 = $this->pos; }
$_83 = null; else { $_83 = FALSE; break; }
do { $matcher = 'match_'.'LookupStep'; $key = $matcher; $pos = $this->pos;
if (substr($this->string, $this->pos, 1) == '.') { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->pos += 1; if ($subres !== FALSE) {
$result["text"] .= '.'; $this->store( $result, $subres );
} else { }
$_83 = false; else { $_83 = FALSE; break; }
break; $_83 = TRUE; break;
} }
$matcher = 'match_'.'LookupStep'; while(0);
$key = $matcher; if( $_83 === FALSE) {
$pos = $this->pos; $result = $res_84;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $this->pos = $pos_84;
if ($subres !== false) { unset( $res_84 );
$this->store($result, $subres); unset( $pos_84 );
} else { break;
$_83 = false; }
break; }
} if (substr($this->string,$this->pos,1) == '.') {
$_83 = true; $this->pos += 1;
break; $result["text"] .= '.';
} while (0); }
if ($_83 === false) { else { $_87 = FALSE; break; }
$result = $res_84; $matcher = 'match_'.'LastLookupStep'; $key = $matcher; $pos = $this->pos;
$this->pos = $pos_84; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
unset($res_84); if ($subres !== FALSE) {
unset($pos_84); $this->store( $result, $subres );
break; }
} else { $_87 = FALSE; break; }
} $_87 = TRUE; break;
if (substr($this->string, $this->pos, 1) == '.') { }
$this->pos += 1; while(0);
$result["text"] .= '.'; if( $_87 === TRUE ) { $_90 = TRUE; break; }
} else { $result = $res_79;
$_87 = false; $this->pos = $pos_79;
break; $matcher = 'match_'.'LastLookupStep'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'LastLookupStep'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_90 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_79;
$this->store($result, $subres); $this->pos = $pos_79;
} else { $_90 = FALSE; break;
$_87 = false; }
break; while(0);
} if( $_90 === TRUE ) { return $this->finalise($result); }
$_87 = true; if( $_90 === FALSE) { return FALSE; }
break;
} while (0);
if ($_87 === true) {
$_90 = true;
break;
}
$result = $res_79;
$this->pos = $pos_79;
$matcher = 'match_'.'LastLookupStep';
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres);
$_90 = true;
break;
}
$result = $res_79;
$this->pos = $pos_79;
$_90 = false;
break;
} while (0);
if ($_90 === true) {
return $this->finalise($result);
}
if ($_90 === false) {
return false;
}
} }
@ -950,248 +776,173 @@ class SSTemplateParser extends Parser implements TemplateParser
/* Translate: "<%t" < Entity < (Default:QuotedString)? < (!("is" "=") < "is" < Context:QuotedString)? < /* Translate: "<%t" < Entity < (Default:QuotedString)? < (!("is" "=") < "is" < Context:QuotedString)? <
(InjectionVariables)? > "%>" */ (InjectionVariables)? > "%>" */
protected $match_Translate_typestack = array('Translate'); protected $match_Translate_typestack = array('Translate');
function match_Translate($stack = array()) function match_Translate ($stack = array()) {
{ $matchrule = "Translate"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Translate"; $_116 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_116 = null; if (( $subres = $this->literal( '<%t' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_116 = FALSE; break; }
if (( $subres = $this->literal('<%t') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $matcher = 'match_'.'Entity'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_116 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} }
if (( $subres = $this->whitespace() ) !== false) { else { $_116 = FALSE; break; }
$result["text"] .= $subres; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} $res_98 = $result;
$matcher = 'match_'.'Entity'; $pos_98 = $this->pos;
$key = $matcher; $_97 = NULL;
$pos = $this->pos; do {
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $matcher = 'match_'.'QuotedString'; $key = $matcher; $pos = $this->pos;
if ($subres !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->store($result, $subres); if ($subres !== FALSE) {
} else { $this->store( $result, $subres, "Default" );
$_116 = false; }
break; else { $_97 = FALSE; break; }
} $_97 = TRUE; break;
if (( $subres = $this->whitespace() ) !== false) { }
$result["text"] .= $subres; while(0);
} if( $_97 === FALSE) {
$res_98 = $result; $result = $res_98;
$pos_98 = $this->pos; $this->pos = $pos_98;
$_97 = null; unset( $res_98 );
do { unset( $pos_98 );
$matcher = 'match_'.'QuotedString'; }
$key = $matcher; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$pos = $this->pos; $res_109 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_109 = $this->pos;
if ($subres !== false) { $_108 = NULL;
$this->store($result, $subres, "Default"); do {
} else { $res_103 = $result;
$_97 = false; $pos_103 = $this->pos;
break; $_102 = NULL;
} do {
$_97 = true; if (( $subres = $this->literal( 'is' ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_102 = FALSE; break; }
} while (0); if (substr($this->string,$this->pos,1) == '=') {
if ($_97 === false) { $this->pos += 1;
$result = $res_98; $result["text"] .= '=';
$this->pos = $pos_98; }
unset($res_98); else { $_102 = FALSE; break; }
unset($pos_98); $_102 = TRUE; break;
} }
if (( $subres = $this->whitespace() ) !== false) { while(0);
$result["text"] .= $subres; if( $_102 === TRUE ) {
} $result = $res_103;
$res_109 = $result; $this->pos = $pos_103;
$pos_109 = $this->pos; $_108 = FALSE; break;
$_108 = null; }
do { if( $_102 === FALSE) {
$res_103 = $result; $result = $res_103;
$pos_103 = $this->pos; $this->pos = $pos_103;
$_102 = null; }
do { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal('is') ) !== false) { if (( $subres = $this->literal( 'is' ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; else { $_108 = FALSE; break; }
} else { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_102 = false; $matcher = 'match_'.'QuotedString'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (substr($this->string, $this->pos, 1) == '=') { $this->store( $result, $subres, "Context" );
$this->pos += 1; }
$result["text"] .= '='; else { $_108 = FALSE; break; }
} else { $_108 = TRUE; break;
$_102 = false; }
break; while(0);
} if( $_108 === FALSE) {
$_102 = true; $result = $res_109;
break; $this->pos = $pos_109;
} while (0); unset( $res_109 );
if ($_102 === true) { unset( $pos_109 );
$result = $res_103; }
$this->pos = $pos_103; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_108 = false; $res_113 = $result;
break; $pos_113 = $this->pos;
} $_112 = NULL;
if ($_102 === false) { do {
$result = $res_103; $matcher = 'match_'.'InjectionVariables'; $key = $matcher; $pos = $this->pos;
$this->pos = $pos_103; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $this->store( $result, $subres );
$result["text"] .= $subres; }
} else { $_112 = FALSE; break; }
if (( $subres = $this->literal('is') ) !== false) { $_112 = TRUE; break;
$result["text"] .= $subres; }
} else { while(0);
$_108 = false; if( $_112 === FALSE) {
break; $result = $res_113;
} $this->pos = $pos_113;
if (( $subres = $this->whitespace() ) !== false) { unset( $res_113 );
$result["text"] .= $subres; unset( $pos_113 );
} }
$matcher = 'match_'.'QuotedString'; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$key = $matcher; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$pos = $this->pos; else { $_116 = FALSE; break; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_116 = TRUE; break;
if ($subres !== false) { }
$this->store($result, $subres, "Context"); while(0);
} else { if( $_116 === TRUE ) { return $this->finalise($result); }
$_108 = false; if( $_116 === FALSE) { return FALSE; }
break;
}
$_108 = true;
break;
} while (0);
if ($_108 === false) {
$result = $res_109;
$this->pos = $pos_109;
unset($res_109);
unset($pos_109);
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
$res_113 = $result;
$pos_113 = $this->pos;
$_112 = null;
do {
$matcher = 'match_'.'InjectionVariables';
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres);
} else {
$_112 = false;
break;
}
$_112 = true;
break;
} while (0);
if ($_112 === false) {
$result = $res_113;
$this->pos = $pos_113;
unset($res_113);
unset($pos_113);
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_116 = false;
break;
}
$_116 = true;
break;
} while (0);
if ($_116 === true) {
return $this->finalise($result);
}
if ($_116 === false) {
return false;
}
} }
/* InjectionVariables: (< InjectionName:Word "=" Argument)+ */ /* InjectionVariables: (< InjectionName:Word "=" Argument)+ */
protected $match_InjectionVariables_typestack = array('InjectionVariables'); protected $match_InjectionVariables_typestack = array('InjectionVariables');
function match_InjectionVariables($stack = array()) function match_InjectionVariables ($stack = array()) {
{ $matchrule = "InjectionVariables"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "InjectionVariables"; $count = 0;
$result = $this->construct($matchrule, $matchrule, null); while (true) {
$count = 0; $res_123 = $result;
while (true) { $pos_123 = $this->pos;
$res_123 = $result; $_122 = NULL;
$pos_123 = $this->pos; do {
$_122 = null; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
do { $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
if (( $subres = $this->whitespace() ) !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result["text"] .= $subres; if ($subres !== FALSE) {
} $this->store( $result, $subres, "InjectionName" );
$matcher = 'match_'.'Word'; }
$key = $matcher; else { $_122 = FALSE; break; }
$pos = $this->pos; if (substr($this->string,$this->pos,1) == '=') {
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $this->pos += 1;
if ($subres !== false) { $result["text"] .= '=';
$this->store($result, $subres, "InjectionName"); }
} else { else { $_122 = FALSE; break; }
$_122 = false; $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (substr($this->string, $this->pos, 1) == '=') { $this->store( $result, $subres );
$this->pos += 1; }
$result["text"] .= '='; else { $_122 = FALSE; break; }
} else { $_122 = TRUE; break;
$_122 = false; }
break; while(0);
} if( $_122 === FALSE) {
$matcher = 'match_'.'Argument'; $result = $res_123;
$key = $matcher; $this->pos = $pos_123;
$pos = $this->pos; unset( $res_123 );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); unset( $pos_123 );
if ($subres !== false) { break;
$this->store($result, $subres); }
} else { $count += 1;
$_122 = false; }
break; if ($count > 0) { return $this->finalise($result); }
} else { return FALSE; }
$_122 = true;
break;
} while (0);
if ($_122 === false) {
$result = $res_123;
$this->pos = $pos_123;
unset($res_123);
unset($pos_123);
break;
}
$count += 1;
}
if ($count > 0) {
return $this->finalise($result);
} else {
return false;
}
} }
/* Entity: / [A-Za-z_] [\w\.]* / */ /* Entity: / [A-Za-z_\\] [\w\.\\]* / */
protected $match_Entity_typestack = array('Entity'); protected $match_Entity_typestack = array('Entity');
function match_Entity($stack = array()) function match_Entity ($stack = array()) {
{ $matchrule = "Entity"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Entity"; if (( $subres = $this->rx( '/ [A-Za-z_\\\\] [\w\.\\\\]* /' ) ) !== FALSE) {
$result = $this->construct($matchrule, $matchrule, null); $result["text"] .= $subres;
if (( $subres = $this->rx('/ [A-Za-z_] [\w\.]* /') ) !== false) { return $this->finalise($result);
$result["text"] .= $subres; }
return $this->finalise($result); else { return FALSE; }
} else {
return false;
}
} }
@ -1253,125 +1004,85 @@ class SSTemplateParser extends Parser implements TemplateParser
/* SimpleInjection: '$' :Lookup */ /* SimpleInjection: '$' :Lookup */
protected $match_SimpleInjection_typestack = array('SimpleInjection'); protected $match_SimpleInjection_typestack = array('SimpleInjection');
function match_SimpleInjection($stack = array()) function match_SimpleInjection ($stack = array()) {
{ $matchrule = "SimpleInjection"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "SimpleInjection"; $_127 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_127 = null; if (substr($this->string,$this->pos,1) == '$') {
do { $this->pos += 1;
if (substr($this->string, $this->pos, 1) == '$') { $result["text"] .= '$';
$this->pos += 1; }
$result["text"] .= '$'; else { $_127 = FALSE; break; }
} else { $matcher = 'match_'.'Lookup'; $key = $matcher; $pos = $this->pos;
$_127 = false; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
break; if ($subres !== FALSE) {
} $this->store( $result, $subres, "Lookup" );
$matcher = 'match_'.'Lookup'; }
$key = $matcher; else { $_127 = FALSE; break; }
$pos = $this->pos; $_127 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { while(0);
$this->store($result, $subres, "Lookup"); if( $_127 === TRUE ) { return $this->finalise($result); }
} else { if( $_127 === FALSE) { return FALSE; }
$_127 = false;
break;
}
$_127 = true;
break;
} while (0);
if ($_127 === true) {
return $this->finalise($result);
}
if ($_127 === false) {
return false;
}
} }
/* BracketInjection: '{$' :Lookup "}" */ /* BracketInjection: '{$' :Lookup "}" */
protected $match_BracketInjection_typestack = array('BracketInjection'); protected $match_BracketInjection_typestack = array('BracketInjection');
function match_BracketInjection($stack = array()) function match_BracketInjection ($stack = array()) {
{ $matchrule = "BracketInjection"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "BracketInjection"; $_132 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_132 = null; if (( $subres = $this->literal( '{$' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_132 = FALSE; break; }
if (( $subres = $this->literal('{$') ) !== false) { $matcher = 'match_'.'Lookup'; $key = $matcher; $pos = $this->pos;
$result["text"] .= $subres; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} else { if ($subres !== FALSE) {
$_132 = false; $this->store( $result, $subres, "Lookup" );
break; }
} else { $_132 = FALSE; break; }
$matcher = 'match_'.'Lookup'; if (substr($this->string,$this->pos,1) == '}') {
$key = $matcher; $this->pos += 1;
$pos = $this->pos; $result["text"] .= '}';
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { else { $_132 = FALSE; break; }
$this->store($result, $subres, "Lookup"); $_132 = TRUE; break;
} else { }
$_132 = false; while(0);
break; if( $_132 === TRUE ) { return $this->finalise($result); }
} if( $_132 === FALSE) { return FALSE; }
if (substr($this->string, $this->pos, 1) == '}') {
$this->pos += 1;
$result["text"] .= '}';
} else {
$_132 = false;
break;
}
$_132 = true;
break;
} while (0);
if ($_132 === true) {
return $this->finalise($result);
}
if ($_132 === false) {
return false;
}
} }
/* Injection: BracketInjection | SimpleInjection */ /* Injection: BracketInjection | SimpleInjection */
protected $match_Injection_typestack = array('Injection'); protected $match_Injection_typestack = array('Injection');
function match_Injection($stack = array()) function match_Injection ($stack = array()) {
{ $matchrule = "Injection"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Injection"; $_137 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_137 = null; $res_134 = $result;
do { $pos_134 = $this->pos;
$res_134 = $result; $matcher = 'match_'.'BracketInjection'; $key = $matcher; $pos = $this->pos;
$pos_134 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'BracketInjection'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_137 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_134;
$this->store($result, $subres); $this->pos = $pos_134;
$_137 = true; $matcher = 'match_'.'SimpleInjection'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
$result = $res_134; $this->store( $result, $subres );
$this->pos = $pos_134; $_137 = TRUE; break;
$matcher = 'match_'.'SimpleInjection'; }
$key = $matcher; $result = $res_134;
$pos = $this->pos; $this->pos = $pos_134;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_137 = FALSE; break;
if ($subres !== false) { }
$this->store($result, $subres); while(0);
$_137 = true; if( $_137 === TRUE ) { return $this->finalise($result); }
break; if( $_137 === FALSE) { return FALSE; }
}
$result = $res_134;
$this->pos = $pos_134;
$_137 = false;
break;
} while (0);
if ($_137 === true) {
return $this->finalise($result);
}
if ($_137 === false) {
return false;
}
} }
@ -1383,20 +1094,15 @@ class SSTemplateParser extends Parser implements TemplateParser
/* DollarMarkedLookup: SimpleInjection */ /* DollarMarkedLookup: SimpleInjection */
protected $match_DollarMarkedLookup_typestack = array('DollarMarkedLookup'); protected $match_DollarMarkedLookup_typestack = array('DollarMarkedLookup');
function match_DollarMarkedLookup($stack = array()) function match_DollarMarkedLookup ($stack = array()) {
{ $matchrule = "DollarMarkedLookup"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "DollarMarkedLookup"; $matcher = 'match_'.'SimpleInjection'; $key = $matcher; $pos = $this->pos;
$result = $this->construct($matchrule, $matchrule, null); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'SimpleInjection'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; return $this->finalise($result);
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { else { return FALSE; }
$this->store($result, $subres);
return $this->finalise($result);
} else {
return false;
}
} }
@ -1408,202 +1114,150 @@ class SSTemplateParser extends Parser implements TemplateParser
/* QuotedString: q:/['"]/ String:/ (\\\\ | \\. | [^$q\\])* / '$q' */ /* QuotedString: q:/['"]/ String:/ (\\\\ | \\. | [^$q\\])* / '$q' */
protected $match_QuotedString_typestack = array('QuotedString'); protected $match_QuotedString_typestack = array('QuotedString');
function match_QuotedString($stack = array()) function match_QuotedString ($stack = array()) {
{ $matchrule = "QuotedString"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "QuotedString"; $_143 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_143 = null; $stack[] = $result; $result = $this->construct( $matchrule, "q" );
do { if (( $subres = $this->rx( '/[\'"]/' ) ) !== FALSE) {
$stack[] = $result; $result["text"] .= $subres;
$result = $this->construct($matchrule, "q"); $subres = $result; $result = array_pop($stack);
if (( $subres = $this->rx('/[\'"]/') ) !== false) { $this->store( $result, $subres, 'q' );
$result["text"] .= $subres; }
$subres = $result; else {
$result = array_pop($stack); $result = array_pop($stack);
$this->store($result, $subres, 'q'); $_143 = FALSE; break;
} else { }
$result = array_pop($stack); $stack[] = $result; $result = $this->construct( $matchrule, "String" );
$_143 = false; if (( $subres = $this->rx( '/ (\\\\\\\\ | \\\\. | [^'.$this->expression($result, $stack, 'q').'\\\\])* /' ) ) !== FALSE) {
break; $result["text"] .= $subres;
} $subres = $result; $result = array_pop($stack);
$stack[] = $result; $this->store( $result, $subres, 'String' );
$result = $this->construct($matchrule, "String"); }
if (( $subres = $this->rx('/ (\\\\\\\\ | \\\\. | [^'.$this->expression($result, $stack, 'q').'\\\\])* /') ) !== false) { else {
$result["text"] .= $subres; $result = array_pop($stack);
$subres = $result; $_143 = FALSE; break;
$result = array_pop($stack); }
$this->store($result, $subres, 'String'); if (( $subres = $this->literal( ''.$this->expression($result, $stack, 'q').'' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_143 = FALSE; break; }
$result = array_pop($stack); $_143 = TRUE; break;
$_143 = false; }
break; while(0);
} if( $_143 === TRUE ) { return $this->finalise($result); }
if (( $subres = $this->literal(''.$this->expression($result, $stack, 'q').'') ) !== false) { if( $_143 === FALSE) { return FALSE; }
$result["text"] .= $subres;
} else {
$_143 = false;
break;
}
$_143 = true;
break;
} while (0);
if ($_143 === true) {
return $this->finalise($result);
}
if ($_143 === false) {
return false;
}
} }
/* FreeString: /[^,)%!=><|&]+/ */ /* FreeString: /[^,)%!=><|&]+/ */
protected $match_FreeString_typestack = array('FreeString'); protected $match_FreeString_typestack = array('FreeString');
function match_FreeString($stack = array()) function match_FreeString ($stack = array()) {
{ $matchrule = "FreeString"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "FreeString"; if (( $subres = $this->rx( '/[^,)%!=><|&]+/' ) ) !== FALSE) {
$result = $this->construct($matchrule, $matchrule, null); $result["text"] .= $subres;
if (( $subres = $this->rx('/[^,)%!=><|&]+/') ) !== false) { return $this->finalise($result);
$result["text"] .= $subres; }
return $this->finalise($result); else { return FALSE; }
} else {
return false;
}
} }
/* Argument: /* Argument:
:DollarMarkedLookup | :DollarMarkedLookup |
:QuotedString | :QuotedString |
:Lookup !(< FreeString)| :Lookup !(< FreeString)|
:FreeString */ :FreeString */
protected $match_Argument_typestack = array('Argument'); protected $match_Argument_typestack = array('Argument');
function match_Argument($stack = array()) function match_Argument ($stack = array()) {
{ $matchrule = "Argument"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Argument"; $_163 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_163 = null; $res_146 = $result;
do { $pos_146 = $this->pos;
$res_146 = $result; $matcher = 'match_'.'DollarMarkedLookup'; $key = $matcher; $pos = $this->pos;
$pos_146 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'DollarMarkedLookup'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "DollarMarkedLookup" );
$pos = $this->pos; $_163 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_146;
$this->store($result, $subres, "DollarMarkedLookup"); $this->pos = $pos_146;
$_163 = true; $_161 = NULL;
break; do {
} $res_148 = $result;
$result = $res_146; $pos_148 = $this->pos;
$this->pos = $pos_146; $matcher = 'match_'.'QuotedString'; $key = $matcher; $pos = $this->pos;
$_161 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_148 = $result; $this->store( $result, $subres, "QuotedString" );
$pos_148 = $this->pos; $_161 = TRUE; break;
$matcher = 'match_'.'QuotedString'; }
$key = $matcher; $result = $res_148;
$pos = $this->pos; $this->pos = $pos_148;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_159 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres, "QuotedString"); $res_150 = $result;
$_161 = true; $pos_150 = $this->pos;
break; $_156 = NULL;
} do {
$result = $res_148; $matcher = 'match_'.'Lookup'; $key = $matcher; $pos = $this->pos;
$this->pos = $pos_148; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_159 = null; if ($subres !== FALSE) {
do { $this->store( $result, $subres, "Lookup" );
$res_150 = $result; }
$pos_150 = $this->pos; else { $_156 = FALSE; break; }
$_156 = null; $res_155 = $result;
do { $pos_155 = $this->pos;
$matcher = 'match_'.'Lookup'; $_154 = NULL;
$key = $matcher; do {
$pos = $this->pos; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $matcher = 'match_'.'FreeString'; $key = $matcher; $pos = $this->pos;
if ($subres !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->store($result, $subres, "Lookup"); if ($subres !== FALSE) {
} else { $this->store( $result, $subres );
$_156 = false; }
break; else { $_154 = FALSE; break; }
} $_154 = TRUE; break;
$res_155 = $result; }
$pos_155 = $this->pos; while(0);
$_154 = null; if( $_154 === TRUE ) {
do { $result = $res_155;
if (( $subres = $this->whitespace() ) !== false) { $this->pos = $pos_155;
$result["text"] .= $subres; $_156 = FALSE; break;
} }
$matcher = 'match_'.'FreeString'; if( $_154 === FALSE) {
$key = $matcher; $result = $res_155;
$pos = $this->pos; $this->pos = $pos_155;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $_156 = TRUE; break;
$this->store($result, $subres); }
} else { while(0);
$_154 = false; if( $_156 === TRUE ) { $_159 = TRUE; break; }
break; $result = $res_150;
} $this->pos = $pos_150;
$_154 = true; $matcher = 'match_'.'FreeString'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} while (0); if ($subres !== FALSE) {
if ($_154 === true) { $this->store( $result, $subres, "FreeString" );
$result = $res_155; $_159 = TRUE; break;
$this->pos = $pos_155; }
$_156 = false; $result = $res_150;
break; $this->pos = $pos_150;
} $_159 = FALSE; break;
if ($_154 === false) { }
$result = $res_155; while(0);
$this->pos = $pos_155; if( $_159 === TRUE ) { $_161 = TRUE; break; }
} $result = $res_148;
$_156 = true; $this->pos = $pos_148;
break; $_161 = FALSE; break;
} while (0); }
if ($_156 === true) { while(0);
$_159 = true; if( $_161 === TRUE ) { $_163 = TRUE; break; }
break; $result = $res_146;
} $this->pos = $pos_146;
$result = $res_150; $_163 = FALSE; break;
$this->pos = $pos_150; }
$matcher = 'match_'.'FreeString'; while(0);
$key = $matcher; if( $_163 === TRUE ) { return $this->finalise($result); }
$pos = $this->pos; if( $_163 === FALSE) { return FALSE; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres, "FreeString");
$_159 = true;
break;
}
$result = $res_150;
$this->pos = $pos_150;
$_159 = false;
break;
} while (0);
if ($_159 === true) {
$_161 = true;
break;
}
$result = $res_148;
$this->pos = $pos_148;
$_161 = false;
break;
} while (0);
if ($_161 === true) {
$_163 = true;
break;
}
$result = $res_146;
$this->pos = $pos_146;
$_163 = false;
break;
} while (0);
if ($_163 === true) {
return $this->finalise($result);
}
if ($_163 === false) {
return false;
}
} }
@ -1655,196 +1309,146 @@ class SSTemplateParser extends Parser implements TemplateParser
/* ComparisonOperator: "!=" | "==" | ">=" | ">" | "<=" | "<" | "=" */ /* ComparisonOperator: "!=" | "==" | ">=" | ">" | "<=" | "<" | "=" */
protected $match_ComparisonOperator_typestack = array('ComparisonOperator'); protected $match_ComparisonOperator_typestack = array('ComparisonOperator');
function match_ComparisonOperator($stack = array()) function match_ComparisonOperator ($stack = array()) {
{ $matchrule = "ComparisonOperator"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "ComparisonOperator"; $_188 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_188 = null; $res_165 = $result;
do { $pos_165 = $this->pos;
$res_165 = $result; if (( $subres = $this->literal( '!=' ) ) !== FALSE) {
$pos_165 = $this->pos; $result["text"] .= $subres;
if (( $subres = $this->literal('!=') ) !== false) { $_188 = TRUE; break;
$result["text"] .= $subres; }
$_188 = true; $result = $res_165;
break; $this->pos = $pos_165;
} $_186 = NULL;
$result = $res_165; do {
$this->pos = $pos_165; $res_167 = $result;
$_186 = null; $pos_167 = $this->pos;
do { if (( $subres = $this->literal( '==' ) ) !== FALSE) {
$res_167 = $result; $result["text"] .= $subres;
$pos_167 = $this->pos; $_186 = TRUE; break;
if (( $subres = $this->literal('==') ) !== false) { }
$result["text"] .= $subres; $result = $res_167;
$_186 = true; $this->pos = $pos_167;
break; $_184 = NULL;
} do {
$result = $res_167; $res_169 = $result;
$this->pos = $pos_167; $pos_169 = $this->pos;
$_184 = null; if (( $subres = $this->literal( '>=' ) ) !== FALSE) {
do { $result["text"] .= $subres;
$res_169 = $result; $_184 = TRUE; break;
$pos_169 = $this->pos; }
if (( $subres = $this->literal('>=') ) !== false) { $result = $res_169;
$result["text"] .= $subres; $this->pos = $pos_169;
$_184 = true; $_182 = NULL;
break; do {
} $res_171 = $result;
$result = $res_169; $pos_171 = $this->pos;
$this->pos = $pos_169; if (substr($this->string,$this->pos,1) == '>') {
$_182 = null; $this->pos += 1;
do { $result["text"] .= '>';
$res_171 = $result; $_182 = TRUE; break;
$pos_171 = $this->pos; }
if (substr($this->string, $this->pos, 1) == '>') { $result = $res_171;
$this->pos += 1; $this->pos = $pos_171;
$result["text"] .= '>'; $_180 = NULL;
$_182 = true; do {
break; $res_173 = $result;
} $pos_173 = $this->pos;
$result = $res_171; if (( $subres = $this->literal( '<=' ) ) !== FALSE) {
$this->pos = $pos_171; $result["text"] .= $subres;
$_180 = null; $_180 = TRUE; break;
do { }
$res_173 = $result; $result = $res_173;
$pos_173 = $this->pos; $this->pos = $pos_173;
if (( $subres = $this->literal('<=') ) !== false) { $_178 = NULL;
$result["text"] .= $subres; do {
$_180 = true; $res_175 = $result;
break; $pos_175 = $this->pos;
} if (substr($this->string,$this->pos,1) == '<') {
$result = $res_173; $this->pos += 1;
$this->pos = $pos_173; $result["text"] .= '<';
$_178 = null; $_178 = TRUE; break;
do { }
$res_175 = $result; $result = $res_175;
$pos_175 = $this->pos; $this->pos = $pos_175;
if (substr($this->string, $this->pos, 1) == '<') { if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1; $this->pos += 1;
$result["text"] .= '<'; $result["text"] .= '=';
$_178 = true; $_178 = TRUE; break;
break; }
} $result = $res_175;
$result = $res_175; $this->pos = $pos_175;
$this->pos = $pos_175; $_178 = FALSE; break;
if (substr($this->string, $this->pos, 1) == '=') { }
$this->pos += 1; while(0);
$result["text"] .= '='; if( $_178 === TRUE ) { $_180 = TRUE; break; }
$_178 = true; $result = $res_173;
break; $this->pos = $pos_173;
} $_180 = FALSE; break;
$result = $res_175; }
$this->pos = $pos_175; while(0);
$_178 = false; if( $_180 === TRUE ) { $_182 = TRUE; break; }
break; $result = $res_171;
} while (0); $this->pos = $pos_171;
if ($_178 === true) { $_182 = FALSE; break;
$_180 = true; }
break; while(0);
} if( $_182 === TRUE ) { $_184 = TRUE; break; }
$result = $res_173; $result = $res_169;
$this->pos = $pos_173; $this->pos = $pos_169;
$_180 = false; $_184 = FALSE; break;
break; }
} while (0); while(0);
if ($_180 === true) { if( $_184 === TRUE ) { $_186 = TRUE; break; }
$_182 = true; $result = $res_167;
break; $this->pos = $pos_167;
} $_186 = FALSE; break;
$result = $res_171; }
$this->pos = $pos_171; while(0);
$_182 = false; if( $_186 === TRUE ) { $_188 = TRUE; break; }
break; $result = $res_165;
} while (0); $this->pos = $pos_165;
if ($_182 === true) { $_188 = FALSE; break;
$_184 = true; }
break; while(0);
} if( $_188 === TRUE ) { return $this->finalise($result); }
$result = $res_169; if( $_188 === FALSE) { return FALSE; }
$this->pos = $pos_169;
$_184 = false;
break;
} while (0);
if ($_184 === true) {
$_186 = true;
break;
}
$result = $res_167;
$this->pos = $pos_167;
$_186 = false;
break;
} while (0);
if ($_186 === true) {
$_188 = true;
break;
}
$result = $res_165;
$this->pos = $pos_165;
$_188 = false;
break;
} while (0);
if ($_188 === true) {
return $this->finalise($result);
}
if ($_188 === false) {
return false;
}
} }
/* Comparison: Argument < ComparisonOperator > Argument */ /* Comparison: Argument < ComparisonOperator > Argument */
protected $match_Comparison_typestack = array('Comparison'); protected $match_Comparison_typestack = array('Comparison');
function match_Comparison($stack = array()) function match_Comparison ($stack = array()) {
{ $matchrule = "Comparison"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Comparison"; $_195 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_195 = null; $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Argument'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_195 = FALSE; break; }
if ($subres !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$this->store($result, $subres); $matcher = 'match_'.'ComparisonOperator'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_195 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} }
if (( $subres = $this->whitespace() ) !== false) { else { $_195 = FALSE; break; }
$result["text"] .= $subres; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$matcher = 'match_'.'ComparisonOperator'; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$key = $matcher; if ($subres !== FALSE) {
$pos = $this->pos; $this->store( $result, $subres );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { else { $_195 = FALSE; break; }
$this->store($result, $subres); $_195 = TRUE; break;
} else { }
$_195 = false; while(0);
break; if( $_195 === TRUE ) { return $this->finalise($result); }
} if( $_195 === FALSE) { return FALSE; }
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
$matcher = 'match_'.'Argument';
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres);
} else {
$_195 = false;
break;
}
$_195 = true;
break;
} while (0);
if ($_195 === true) {
return $this->finalise($result);
}
if ($_195 === false) {
return false;
}
} }
@ -1869,59 +1473,45 @@ class SSTemplateParser extends Parser implements TemplateParser
/* PresenceCheck: (Not:'not' <)? Argument */ /* PresenceCheck: (Not:'not' <)? Argument */
protected $match_PresenceCheck_typestack = array('PresenceCheck'); protected $match_PresenceCheck_typestack = array('PresenceCheck');
function match_PresenceCheck($stack = array()) function match_PresenceCheck ($stack = array()) {
{ $matchrule = "PresenceCheck"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "PresenceCheck"; $_202 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_202 = null; $res_200 = $result;
do { $pos_200 = $this->pos;
$res_200 = $result; $_199 = NULL;
$pos_200 = $this->pos; do {
$_199 = null; $stack[] = $result; $result = $this->construct( $matchrule, "Not" );
do { if (( $subres = $this->literal( 'not' ) ) !== FALSE) {
$stack[] = $result; $result["text"] .= $subres;
$result = $this->construct($matchrule, "Not"); $subres = $result; $result = array_pop($stack);
if (( $subres = $this->literal('not') ) !== false) { $this->store( $result, $subres, 'Not' );
$result["text"] .= $subres; }
$subres = $result; else {
$result = array_pop($stack); $result = array_pop($stack);
$this->store($result, $subres, 'Not'); $_199 = FALSE; break;
} else { }
$result = array_pop($stack); if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_199 = false; $_199 = TRUE; break;
break; }
} while(0);
if (( $subres = $this->whitespace() ) !== false) { if( $_199 === FALSE) {
$result["text"] .= $subres; $result = $res_200;
} $this->pos = $pos_200;
$_199 = true; unset( $res_200 );
break; unset( $pos_200 );
} while (0); }
if ($_199 === false) { $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$result = $res_200; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->pos = $pos_200; if ($subres !== FALSE) {
unset($res_200); $this->store( $result, $subres );
unset($pos_200); }
} else { $_202 = FALSE; break; }
$matcher = 'match_'.'Argument'; $_202 = TRUE; break;
$key = $matcher; }
$pos = $this->pos; while(0);
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if( $_202 === TRUE ) { return $this->finalise($result); }
if ($subres !== false) { if( $_202 === FALSE) { return FALSE; }
$this->store($result, $subres);
} else {
$_202 = false;
break;
}
$_202 = true;
break;
} while (0);
if ($_202 === true) {
return $this->finalise($result);
}
if ($_202 === false) {
return false;
}
} }
@ -1945,45 +1535,33 @@ class SSTemplateParser extends Parser implements TemplateParser
/* IfArgumentPortion: Comparison | PresenceCheck */ /* IfArgumentPortion: Comparison | PresenceCheck */
protected $match_IfArgumentPortion_typestack = array('IfArgumentPortion'); protected $match_IfArgumentPortion_typestack = array('IfArgumentPortion');
function match_IfArgumentPortion($stack = array()) function match_IfArgumentPortion ($stack = array()) {
{ $matchrule = "IfArgumentPortion"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "IfArgumentPortion"; $_207 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_207 = null; $res_204 = $result;
do { $pos_204 = $this->pos;
$res_204 = $result; $matcher = 'match_'.'Comparison'; $key = $matcher; $pos = $this->pos;
$pos_204 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Comparison'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_207 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_204;
$this->store($result, $subres); $this->pos = $pos_204;
$_207 = true; $matcher = 'match_'.'PresenceCheck'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
$result = $res_204; $this->store( $result, $subres );
$this->pos = $pos_204; $_207 = TRUE; break;
$matcher = 'match_'.'PresenceCheck'; }
$key = $matcher; $result = $res_204;
$pos = $this->pos; $this->pos = $pos_204;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_207 = FALSE; break;
if ($subres !== false) { }
$this->store($result, $subres); while(0);
$_207 = true; if( $_207 === TRUE ) { return $this->finalise($result); }
break; if( $_207 === FALSE) { return FALSE; }
}
$result = $res_204;
$this->pos = $pos_204;
$_207 = false;
break;
} while (0);
if ($_207 === true) {
return $this->finalise($result);
}
if ($_207 === false) {
return false;
}
} }
@ -1995,109 +1573,79 @@ class SSTemplateParser extends Parser implements TemplateParser
/* BooleanOperator: "||" | "&&" */ /* BooleanOperator: "||" | "&&" */
protected $match_BooleanOperator_typestack = array('BooleanOperator'); protected $match_BooleanOperator_typestack = array('BooleanOperator');
function match_BooleanOperator($stack = array()) function match_BooleanOperator ($stack = array()) {
{ $matchrule = "BooleanOperator"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "BooleanOperator"; $_212 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_212 = null; $res_209 = $result;
do { $pos_209 = $this->pos;
$res_209 = $result; if (( $subres = $this->literal( '||' ) ) !== FALSE) {
$pos_209 = $this->pos; $result["text"] .= $subres;
if (( $subres = $this->literal('||') ) !== false) { $_212 = TRUE; break;
$result["text"] .= $subres; }
$_212 = true; $result = $res_209;
break; $this->pos = $pos_209;
} if (( $subres = $this->literal( '&&' ) ) !== FALSE) {
$result = $res_209; $result["text"] .= $subres;
$this->pos = $pos_209; $_212 = TRUE; break;
if (( $subres = $this->literal('&&') ) !== false) { }
$result["text"] .= $subres; $result = $res_209;
$_212 = true; $this->pos = $pos_209;
break; $_212 = FALSE; break;
} }
$result = $res_209; while(0);
$this->pos = $pos_209; if( $_212 === TRUE ) { return $this->finalise($result); }
$_212 = false; if( $_212 === FALSE) { return FALSE; }
break;
} while (0);
if ($_212 === true) {
return $this->finalise($result);
}
if ($_212 === false) {
return false;
}
} }
/* IfArgument: :IfArgumentPortion ( < :BooleanOperator < :IfArgumentPortion )* */ /* IfArgument: :IfArgumentPortion ( < :BooleanOperator < :IfArgumentPortion )* */
protected $match_IfArgument_typestack = array('IfArgument'); protected $match_IfArgument_typestack = array('IfArgument');
function match_IfArgument($stack = array()) function match_IfArgument ($stack = array()) {
{ $matchrule = "IfArgument"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "IfArgument"; $_221 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_221 = null; $matcher = 'match_'.'IfArgumentPortion'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'IfArgumentPortion'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "IfArgumentPortion" );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_221 = FALSE; break; }
if ($subres !== false) { while (true) {
$this->store($result, $subres, "IfArgumentPortion"); $res_220 = $result;
} else { $pos_220 = $this->pos;
$_221 = false; $_219 = NULL;
break; do {
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
while (true) { $matcher = 'match_'.'BooleanOperator'; $key = $matcher; $pos = $this->pos;
$res_220 = $result; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$pos_220 = $this->pos; if ($subres !== FALSE) {
$_219 = null; $this->store( $result, $subres, "BooleanOperator" );
do { }
if (( $subres = $this->whitespace() ) !== false) { else { $_219 = FALSE; break; }
$result["text"] .= $subres; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} $matcher = 'match_'.'IfArgumentPortion'; $key = $matcher; $pos = $this->pos;
$matcher = 'match_'.'BooleanOperator'; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$key = $matcher; if ($subres !== FALSE) {
$pos = $this->pos; $this->store( $result, $subres, "IfArgumentPortion" );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { else { $_219 = FALSE; break; }
$this->store($result, $subres, "BooleanOperator"); $_219 = TRUE; break;
} else { }
$_219 = false; while(0);
break; if( $_219 === FALSE) {
} $result = $res_220;
if (( $subres = $this->whitespace() ) !== false) { $this->pos = $pos_220;
$result["text"] .= $subres; unset( $res_220 );
} unset( $pos_220 );
$matcher = 'match_'.'IfArgumentPortion'; break;
$key = $matcher; }
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_221 = TRUE; break;
if ($subres !== false) { }
$this->store($result, $subres, "IfArgumentPortion"); while(0);
} else { if( $_221 === TRUE ) { return $this->finalise($result); }
$_219 = false; if( $_221 === FALSE) { return FALSE; }
break;
}
$_219 = true;
break;
} while (0);
if ($_219 === false) {
$result = $res_220;
$this->pos = $pos_220;
unset($res_220);
unset($pos_220);
break;
}
}
$_221 = true;
break;
} while (0);
if ($_221 === true) {
return $this->finalise($result);
}
if ($_221 === false) {
return false;
}
} }
@ -2114,292 +1662,179 @@ class SSTemplateParser extends Parser implements TemplateParser
/* IfPart: '<%' < 'if' [ :IfArgument > '%>' Template:$TemplateMatcher? */ /* IfPart: '<%' < 'if' [ :IfArgument > '%>' Template:$TemplateMatcher? */
protected $match_IfPart_typestack = array('IfPart'); protected $match_IfPart_typestack = array('IfPart');
function match_IfPart($stack = array()) function match_IfPart ($stack = array()) {
{ $matchrule = "IfPart"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "IfPart"; $_231 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_231 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_231 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'if' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_231 = FALSE; break; }
$_231 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_231 = FALSE; break; }
} $matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
if (( $subres = $this->whitespace() ) !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result["text"] .= $subres; if ($subres !== FALSE) {
} $this->store( $result, $subres, "IfArgument" );
if (( $subres = $this->literal('if') ) !== false) { }
$result["text"] .= $subres; else { $_231 = FALSE; break; }
} else { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_231 = false; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_231 = FALSE; break; }
} $res_230 = $result;
if (( $subres = $this->whitespace() ) !== false) { $pos_230 = $this->pos;
$result["text"] .= $subres; $matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_231 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres, "Template" );
} }
$matcher = 'match_'.'IfArgument'; else {
$key = $matcher; $result = $res_230;
$pos = $this->pos; $this->pos = $pos_230;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); unset( $res_230 );
if ($subres !== false) { unset( $pos_230 );
$this->store($result, $subres, "IfArgument"); }
} else { $_231 = TRUE; break;
$_231 = false; }
break; while(0);
} if( $_231 === TRUE ) { return $this->finalise($result); }
if (( $subres = $this->whitespace() ) !== false) { if( $_231 === FALSE) { return FALSE; }
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_231 = false;
break;
}
$res_230 = $result;
$pos_230 = $this->pos;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher');
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres, "Template");
} else {
$result = $res_230;
$this->pos = $pos_230;
unset($res_230);
unset($pos_230);
}
$_231 = true;
break;
} while (0);
if ($_231 === true) {
return $this->finalise($result);
}
if ($_231 === false) {
return false;
}
} }
/* ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher? */ /* ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher? */
protected $match_ElseIfPart_typestack = array('ElseIfPart'); protected $match_ElseIfPart_typestack = array('ElseIfPart');
function match_ElseIfPart($stack = array()) function match_ElseIfPart ($stack = array()) {
{ $matchrule = "ElseIfPart"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "ElseIfPart"; $_241 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_241 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_241 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_241 = FALSE; break; }
$_241 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_241 = FALSE; break; }
} $matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
if (( $subres = $this->whitespace() ) !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result["text"] .= $subres; if ($subres !== FALSE) {
} $this->store( $result, $subres, "IfArgument" );
if (( $subres = $this->literal('else_if') ) !== false) { }
$result["text"] .= $subres; else { $_241 = FALSE; break; }
} else { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_241 = false; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_241 = FALSE; break; }
} $res_240 = $result;
if (( $subres = $this->whitespace() ) !== false) { $pos_240 = $this->pos;
$result["text"] .= $subres; $matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_241 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres, "Template" );
} }
$matcher = 'match_'.'IfArgument'; else {
$key = $matcher; $result = $res_240;
$pos = $this->pos; $this->pos = $pos_240;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); unset( $res_240 );
if ($subres !== false) { unset( $pos_240 );
$this->store($result, $subres, "IfArgument"); }
} else { $_241 = TRUE; break;
$_241 = false; }
break; while(0);
} if( $_241 === TRUE ) { return $this->finalise($result); }
if (( $subres = $this->whitespace() ) !== false) { if( $_241 === FALSE) { return FALSE; }
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_241 = false;
break;
}
$res_240 = $result;
$pos_240 = $this->pos;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher');
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres, "Template");
} else {
$result = $res_240;
$this->pos = $pos_240;
unset($res_240);
unset($pos_240);
}
$_241 = true;
break;
} while (0);
if ($_241 === true) {
return $this->finalise($result);
}
if ($_241 === false) {
return false;
}
} }
/* ElsePart: '<%' < 'else' > '%>' Template:$TemplateMatcher? */ /* ElsePart: '<%' < 'else' > '%>' Template:$TemplateMatcher? */
protected $match_ElsePart_typestack = array('ElsePart'); protected $match_ElsePart_typestack = array('ElsePart');
function match_ElsePart($stack = array()) function match_ElsePart ($stack = array()) {
{ $matchrule = "ElsePart"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "ElsePart"; $_249 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_249 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_249 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'else' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_249 = FALSE; break; }
$_249 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_249 = FALSE; break; }
if (( $subres = $this->whitespace() ) !== false) { $res_248 = $result;
$result["text"] .= $subres; $pos_248 = $this->pos;
} $matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
if (( $subres = $this->literal('else') ) !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result["text"] .= $subres; if ($subres !== FALSE) {
} else { $this->store( $result, $subres, "Template" );
$_249 = false; }
break; else {
} $result = $res_248;
if (( $subres = $this->whitespace() ) !== false) { $this->pos = $pos_248;
$result["text"] .= $subres; unset( $res_248 );
} unset( $pos_248 );
if (( $subres = $this->literal('%>') ) !== false) { }
$result["text"] .= $subres; $_249 = TRUE; break;
} else { }
$_249 = false; while(0);
break; if( $_249 === TRUE ) { return $this->finalise($result); }
} if( $_249 === FALSE) { return FALSE; }
$res_248 = $result;
$pos_248 = $this->pos;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher');
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres, "Template");
} else {
$result = $res_248;
$this->pos = $pos_248;
unset($res_248);
unset($pos_248);
}
$_249 = true;
break;
} while (0);
if ($_249 === true) {
return $this->finalise($result);
}
if ($_249 === false) {
return false;
}
} }
/* If: IfPart ElseIfPart* ElsePart? '<%' < 'end_if' > '%>' */ /* If: IfPart ElseIfPart* ElsePart? '<%' < 'end_if' > '%>' */
protected $match_If_typestack = array('If'); protected $match_If_typestack = array('If');
function match_If($stack = array()) function match_If ($stack = array()) {
{ $matchrule = "If"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "If"; $_259 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_259 = null; $matcher = 'match_'.'IfPart'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'IfPart'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_259 = FALSE; break; }
if ($subres !== false) { while (true) {
$this->store($result, $subres); $res_252 = $result;
} else { $pos_252 = $this->pos;
$_259 = false; $matcher = 'match_'.'ElseIfPart'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
while (true) { $this->store( $result, $subres );
$res_252 = $result; }
$pos_252 = $this->pos; else {
$matcher = 'match_'.'ElseIfPart'; $result = $res_252;
$key = $matcher; $this->pos = $pos_252;
$pos = $this->pos; unset( $res_252 );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); unset( $pos_252 );
if ($subres !== false) { break;
$this->store($result, $subres); }
} else { }
$result = $res_252; $res_253 = $result;
$this->pos = $pos_252; $pos_253 = $this->pos;
unset($res_252); $matcher = 'match_'.'ElsePart'; $key = $matcher; $pos = $this->pos;
unset($pos_252); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
break; if ($subres !== FALSE) {
} $this->store( $result, $subres );
} }
$res_253 = $result; else {
$pos_253 = $this->pos; $result = $res_253;
$matcher = 'match_'.'ElsePart'; $this->pos = $pos_253;
$key = $matcher; unset( $res_253 );
$pos = $this->pos; unset( $pos_253 );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
$this->store($result, $subres); else { $_259 = FALSE; break; }
} else { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result = $res_253; if (( $subres = $this->literal( 'end_if' ) ) !== FALSE) { $result["text"] .= $subres; }
$this->pos = $pos_253; else { $_259 = FALSE; break; }
unset($res_253); if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
unset($pos_253); if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_259 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { $_259 = TRUE; break;
$result["text"] .= $subres; }
} else { while(0);
$_259 = false; if( $_259 === TRUE ) { return $this->finalise($result); }
break; if( $_259 === FALSE) { return FALSE; }
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('end_if') ) !== false) {
$result["text"] .= $subres;
} else {
$_259 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_259 = false;
break;
}
$_259 = true;
break;
} while (0);
if ($_259 === true) {
return $this->finalise($result);
}
if ($_259 === false) {
return false;
}
} }
@ -2430,108 +1865,63 @@ class SSTemplateParser extends Parser implements TemplateParser
/* Require: '<%' < 'require' [ Call:(Method:Word "(" < :CallArguments > ")") > '%>' */ /* Require: '<%' < 'require' [ Call:(Method:Word "(" < :CallArguments > ")") > '%>' */
protected $match_Require_typestack = array('Require'); protected $match_Require_typestack = array('Require');
function match_Require($stack = array()) function match_Require ($stack = array()) {
{ $matchrule = "Require"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Require"; $_275 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_275 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_275 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'require' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_275 = FALSE; break; }
$_275 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_275 = FALSE; break; }
} $stack[] = $result; $result = $this->construct( $matchrule, "Call" );
if (( $subres = $this->whitespace() ) !== false) { $_271 = NULL;
$result["text"] .= $subres; do {
} $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
if (( $subres = $this->literal('require') ) !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result["text"] .= $subres; if ($subres !== FALSE) {
} else { $this->store( $result, $subres, "Method" );
$_275 = false; }
break; else { $_271 = FALSE; break; }
} if (substr($this->string,$this->pos,1) == '(') {
if (( $subres = $this->whitespace() ) !== false) { $this->pos += 1;
$result["text"] .= $subres; $result["text"] .= '(';
} else { }
$_275 = false; else { $_271 = FALSE; break; }
break; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} $matcher = 'match_'.'CallArguments'; $key = $matcher; $pos = $this->pos;
$stack[] = $result; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $this->construct($matchrule, "Call"); if ($subres !== FALSE) {
$_271 = null; $this->store( $result, $subres, "CallArguments" );
do { }
$matcher = 'match_'.'Word'; else { $_271 = FALSE; break; }
$key = $matcher; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$pos = $this->pos; if (substr($this->string,$this->pos,1) == ')') {
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $this->pos += 1;
if ($subres !== false) { $result["text"] .= ')';
$this->store($result, $subres, "Method"); }
} else { else { $_271 = FALSE; break; }
$_271 = false; $_271 = TRUE; break;
break; }
} while(0);
if (substr($this->string, $this->pos, 1) == '(') { if( $_271 === TRUE ) {
$this->pos += 1; $subres = $result; $result = array_pop($stack);
$result["text"] .= '('; $this->store( $result, $subres, 'Call' );
} else { }
$_271 = false; if( $_271 === FALSE) {
break; $result = array_pop($stack);
} $_275 = FALSE; break;
if (( $subres = $this->whitespace() ) !== false) { }
$result["text"] .= $subres; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'CallArguments'; else { $_275 = FALSE; break; }
$key = $matcher; $_275 = TRUE; break;
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); while(0);
if ($subres !== false) { if( $_275 === TRUE ) { return $this->finalise($result); }
$this->store($result, $subres, "CallArguments"); if( $_275 === FALSE) { return FALSE; }
} else {
$_271 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (substr($this->string, $this->pos, 1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
} else {
$_271 = false;
break;
}
$_271 = true;
break;
} while (0);
if ($_271 === true) {
$subres = $result;
$result = array_pop($stack);
$this->store($result, $subres, 'Call');
}
if ($_271 === false) {
$result = array_pop($stack);
$_275 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_275 = false;
break;
}
$_275 = true;
break;
} while (0);
if ($_275 === true) {
return $this->finalise($result);
}
if ($_275 === false) {
return false;
}
} }
@ -2545,135 +1935,105 @@ class SSTemplateParser extends Parser implements TemplateParser
/* CacheBlockArgument: /* CacheBlockArgument:
!( "if " | "unless " ) !( "if " | "unless " )
( (
:DollarMarkedLookup | :DollarMarkedLookup |
:QuotedString | :QuotedString |
:Lookup :Lookup
) */ ) */
protected $match_CacheBlockArgument_typestack = array('CacheBlockArgument'); protected $match_CacheBlockArgument_typestack = array('CacheBlockArgument');
function match_CacheBlockArgument($stack = array()) function match_CacheBlockArgument ($stack = array()) {
{ $matchrule = "CacheBlockArgument"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "CacheBlockArgument"; $_295 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_295 = null; $res_283 = $result;
do { $pos_283 = $this->pos;
$res_283 = $result; $_282 = NULL;
$pos_283 = $this->pos; do {
$_282 = null; $_280 = NULL;
do { do {
$_280 = null; $res_277 = $result;
do { $pos_277 = $this->pos;
$res_277 = $result; if (( $subres = $this->literal( 'if ' ) ) !== FALSE) {
$pos_277 = $this->pos; $result["text"] .= $subres;
if (( $subres = $this->literal('if ') ) !== false) { $_280 = TRUE; break;
$result["text"] .= $subres; }
$_280 = true; $result = $res_277;
break; $this->pos = $pos_277;
} if (( $subres = $this->literal( 'unless ' ) ) !== FALSE) {
$result = $res_277; $result["text"] .= $subres;
$this->pos = $pos_277; $_280 = TRUE; break;
if (( $subres = $this->literal('unless ') ) !== false) { }
$result["text"] .= $subres; $result = $res_277;
$_280 = true; $this->pos = $pos_277;
break; $_280 = FALSE; break;
} }
$result = $res_277; while(0);
$this->pos = $pos_277; if( $_280 === FALSE) { $_282 = FALSE; break; }
$_280 = false; $_282 = TRUE; break;
break; }
} while (0); while(0);
if ($_280 === false) { if( $_282 === TRUE ) {
$_282 = false; $result = $res_283;
break; $this->pos = $pos_283;
} $_295 = FALSE; break;
$_282 = true; }
break; if( $_282 === FALSE) {
} while (0); $result = $res_283;
if ($_282 === true) { $this->pos = $pos_283;
$result = $res_283; }
$this->pos = $pos_283; $_293 = NULL;
$_295 = false; do {
break; $_291 = NULL;
} do {
if ($_282 === false) { $res_284 = $result;
$result = $res_283; $pos_284 = $this->pos;
$this->pos = $pos_283; $matcher = 'match_'.'DollarMarkedLookup'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_293 = null; if ($subres !== FALSE) {
do { $this->store( $result, $subres, "DollarMarkedLookup" );
$_291 = null; $_291 = TRUE; break;
do { }
$res_284 = $result; $result = $res_284;
$pos_284 = $this->pos; $this->pos = $pos_284;
$matcher = 'match_'.'DollarMarkedLookup'; $_289 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_286 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_286 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'QuotedString'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres, "DollarMarkedLookup"); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_291 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres, "QuotedString" );
} $_289 = TRUE; break;
$result = $res_284; }
$this->pos = $pos_284; $result = $res_286;
$_289 = null; $this->pos = $pos_286;
do { $matcher = 'match_'.'Lookup'; $key = $matcher; $pos = $this->pos;
$res_286 = $result; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$pos_286 = $this->pos; if ($subres !== FALSE) {
$matcher = 'match_'.'QuotedString'; $this->store( $result, $subres, "Lookup" );
$key = $matcher; $_289 = TRUE; break;
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $result = $res_286;
if ($subres !== false) { $this->pos = $pos_286;
$this->store($result, $subres, "QuotedString"); $_289 = FALSE; break;
$_289 = true; }
break; while(0);
} if( $_289 === TRUE ) { $_291 = TRUE; break; }
$result = $res_286; $result = $res_284;
$this->pos = $pos_286; $this->pos = $pos_284;
$matcher = 'match_'.'Lookup'; $_291 = FALSE; break;
$key = $matcher; }
$pos = $this->pos; while(0);
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if( $_291 === FALSE) { $_293 = FALSE; break; }
if ($subres !== false) { $_293 = TRUE; break;
$this->store($result, $subres, "Lookup"); }
$_289 = true; while(0);
break; if( $_293 === FALSE) { $_295 = FALSE; break; }
} $_295 = TRUE; break;
$result = $res_286; }
$this->pos = $pos_286; while(0);
$_289 = false; if( $_295 === TRUE ) { return $this->finalise($result); }
break; if( $_295 === FALSE) { return FALSE; }
} while (0);
if ($_289 === true) {
$_291 = true;
break;
}
$result = $res_284;
$this->pos = $pos_284;
$_291 = false;
break;
} while (0);
if ($_291 === false) {
$_293 = false;
break;
}
$_293 = true;
break;
} while (0);
if ($_293 === false) {
$_295 = false;
break;
}
$_295 = true;
break;
} while (0);
if ($_295 === true) {
return $this->finalise($result);
}
if ($_295 === false) {
return false;
}
} }
@ -2695,70 +2055,50 @@ class SSTemplateParser extends Parser implements TemplateParser
/* CacheBlockArguments: CacheBlockArgument ( < "," < CacheBlockArgument )* */ /* CacheBlockArguments: CacheBlockArgument ( < "," < CacheBlockArgument )* */
protected $match_CacheBlockArguments_typestack = array('CacheBlockArguments'); protected $match_CacheBlockArguments_typestack = array('CacheBlockArguments');
function match_CacheBlockArguments($stack = array()) function match_CacheBlockArguments ($stack = array()) {
{ $matchrule = "CacheBlockArguments"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "CacheBlockArguments"; $_304 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_304 = null; $matcher = 'match_'.'CacheBlockArgument'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'CacheBlockArgument'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_304 = FALSE; break; }
if ($subres !== false) { while (true) {
$this->store($result, $subres); $res_303 = $result;
} else { $pos_303 = $this->pos;
$_304 = false; $_302 = NULL;
break; do {
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
while (true) { if (substr($this->string,$this->pos,1) == ',') {
$res_303 = $result; $this->pos += 1;
$pos_303 = $this->pos; $result["text"] .= ',';
$_302 = null; }
do { else { $_302 = FALSE; break; }
if (( $subres = $this->whitespace() ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $matcher = 'match_'.'CacheBlockArgument'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if (substr($this->string, $this->pos, 1) == ',') { if ($subres !== FALSE) {
$this->pos += 1; $this->store( $result, $subres );
$result["text"] .= ','; }
} else { else { $_302 = FALSE; break; }
$_302 = false; $_302 = TRUE; break;
break; }
} while(0);
if (( $subres = $this->whitespace() ) !== false) { if( $_302 === FALSE) {
$result["text"] .= $subres; $result = $res_303;
} $this->pos = $pos_303;
$matcher = 'match_'.'CacheBlockArgument'; unset( $res_303 );
$key = $matcher; unset( $pos_303 );
$pos = $this->pos; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { }
$this->store($result, $subres); $_304 = TRUE; break;
} else { }
$_302 = false; while(0);
break; if( $_304 === TRUE ) { return $this->finalise($result); }
} if( $_304 === FALSE) { return FALSE; }
$_302 = true;
break;
} while (0);
if ($_302 === false) {
$result = $res_303;
$this->pos = $pos_303;
unset($res_303);
unset($pos_303);
break;
}
}
$_304 = true;
break;
} while (0);
if ($_304 === true) {
return $this->finalise($result);
}
if ($_304 === false) {
return false;
}
} }
@ -2775,513 +2115,375 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/* CacheBlockTemplate: (Comment | Translate | If | Require | OldI18NTag | Include | ClosedBlock | /* CacheBlockTemplate: (Comment | Translate | If | Require | OldI18NTag | Include | ClosedBlock |
OpenBlock | MalformedBlock | Injection | Text)+ */ OpenBlock | MalformedBlock | Injection | Text)+ */
protected $match_CacheBlockTemplate_typestack = array('CacheBlockTemplate','Template'); protected $match_CacheBlockTemplate_typestack = array('CacheBlockTemplate','Template');
function match_CacheBlockTemplate($stack = array()) function match_CacheBlockTemplate ($stack = array()) {
{ $matchrule = "CacheBlockTemplate"; $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'CacheRestrictedTemplate'));
$matchrule = "CacheBlockTemplate"; $count = 0;
$result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'CacheRestrictedTemplate')); while (true) {
$count = 0; $res_348 = $result;
while (true) { $pos_348 = $this->pos;
$res_348 = $result; $_347 = NULL;
$pos_348 = $this->pos; do {
$_347 = null; $_345 = NULL;
do { do {
$_345 = null; $res_306 = $result;
do { $pos_306 = $this->pos;
$res_306 = $result; $matcher = 'match_'.'Comment'; $key = $matcher; $pos = $this->pos;
$pos_306 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Comment'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_345 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_306;
$this->store($result, $subres); $this->pos = $pos_306;
$_345 = true; $_343 = NULL;
break; do {
} $res_308 = $result;
$result = $res_306; $pos_308 = $this->pos;
$this->pos = $pos_306; $matcher = 'match_'.'Translate'; $key = $matcher; $pos = $this->pos;
$_343 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_308 = $result; $this->store( $result, $subres );
$pos_308 = $this->pos; $_343 = TRUE; break;
$matcher = 'match_'.'Translate'; }
$key = $matcher; $result = $res_308;
$pos = $this->pos; $this->pos = $pos_308;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_341 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_310 = $result;
$_343 = true; $pos_310 = $this->pos;
break; $matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_308; if ($subres !== FALSE) {
$this->pos = $pos_308; $this->store( $result, $subres );
$_341 = null; $_341 = TRUE; break;
do { }
$res_310 = $result; $result = $res_310;
$pos_310 = $this->pos; $this->pos = $pos_310;
$matcher = 'match_'.'If'; $_339 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_312 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_312 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_341 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_339 = TRUE; break;
$result = $res_310; }
$this->pos = $pos_310; $result = $res_312;
$_339 = null; $this->pos = $pos_312;
do { $_337 = NULL;
$res_312 = $result; do {
$pos_312 = $this->pos; $res_314 = $result;
$matcher = 'match_'.'Require'; $pos_314 = $this->pos;
$key = $matcher; $matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_337 = TRUE; break;
$_339 = true; }
break; $result = $res_314;
} $this->pos = $pos_314;
$result = $res_312; $_335 = NULL;
$this->pos = $pos_312; do {
$_337 = null; $res_316 = $result;
do { $pos_316 = $this->pos;
$res_314 = $result; $matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
$pos_314 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'OldI18NTag'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_335 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_316;
$this->store($result, $subres); $this->pos = $pos_316;
$_337 = true; $_333 = NULL;
break; do {
} $res_318 = $result;
$result = $res_314; $pos_318 = $this->pos;
$this->pos = $pos_314; $matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$_335 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_316 = $result; $this->store( $result, $subres );
$pos_316 = $this->pos; $_333 = TRUE; break;
$matcher = 'match_'.'Include'; }
$key = $matcher; $result = $res_318;
$pos = $this->pos; $this->pos = $pos_318;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_331 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_320 = $result;
$_335 = true; $pos_320 = $this->pos;
break; $matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_316; if ($subres !== FALSE) {
$this->pos = $pos_316; $this->store( $result, $subres );
$_333 = null; $_331 = TRUE; break;
do { }
$res_318 = $result; $result = $res_320;
$pos_318 = $this->pos; $this->pos = $pos_320;
$matcher = 'match_'.'ClosedBlock'; $_329 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_322 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_322 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_333 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_329 = TRUE; break;
$result = $res_318; }
$this->pos = $pos_318; $result = $res_322;
$_331 = null; $this->pos = $pos_322;
do { $_327 = NULL;
$res_320 = $result; do {
$pos_320 = $this->pos; $res_324 = $result;
$matcher = 'match_'.'OpenBlock'; $pos_324 = $this->pos;
$key = $matcher; $matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_327 = TRUE; break;
$_331 = true; }
break; $result = $res_324;
} $this->pos = $pos_324;
$result = $res_320; $matcher = 'match_'.'Text'; $key = $matcher; $pos = $this->pos;
$this->pos = $pos_320; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_329 = null; if ($subres !== FALSE) {
do { $this->store( $result, $subres );
$res_322 = $result; $_327 = TRUE; break;
$pos_322 = $this->pos; }
$matcher = 'match_'.'MalformedBlock'; $result = $res_324;
$key = $matcher; $this->pos = $pos_324;
$pos = $this->pos; $_327 = FALSE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { while(0);
$this->store($result, $subres); if( $_327 === TRUE ) { $_329 = TRUE; break; }
$_329 = true; $result = $res_322;
break; $this->pos = $pos_322;
} $_329 = FALSE; break;
$result = $res_322; }
$this->pos = $pos_322; while(0);
$_327 = null; if( $_329 === TRUE ) { $_331 = TRUE; break; }
do { $result = $res_320;
$res_324 = $result; $this->pos = $pos_320;
$pos_324 = $this->pos; $_331 = FALSE; break;
$matcher = 'match_'.'Injection'; }
$key = $matcher; while(0);
$pos = $this->pos; if( $_331 === TRUE ) { $_333 = TRUE; break; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $result = $res_318;
if ($subres !== false) { $this->pos = $pos_318;
$this->store($result, $subres); $_333 = FALSE; break;
$_327 = true; }
break; while(0);
} if( $_333 === TRUE ) { $_335 = TRUE; break; }
$result = $res_324; $result = $res_316;
$this->pos = $pos_324; $this->pos = $pos_316;
$matcher = 'match_'.'Text'; $_335 = FALSE; break;
$key = $matcher; }
$pos = $this->pos; while(0);
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if( $_335 === TRUE ) { $_337 = TRUE; break; }
if ($subres !== false) { $result = $res_314;
$this->store($result, $subres); $this->pos = $pos_314;
$_327 = true; $_337 = FALSE; break;
break; }
} while(0);
$result = $res_324; if( $_337 === TRUE ) { $_339 = TRUE; break; }
$this->pos = $pos_324; $result = $res_312;
$_327 = false; $this->pos = $pos_312;
break; $_339 = FALSE; break;
} while (0); }
if ($_327 === true) { while(0);
$_329 = true; if( $_339 === TRUE ) { $_341 = TRUE; break; }
break; $result = $res_310;
} $this->pos = $pos_310;
$result = $res_322; $_341 = FALSE; break;
$this->pos = $pos_322; }
$_329 = false; while(0);
break; if( $_341 === TRUE ) { $_343 = TRUE; break; }
} while (0); $result = $res_308;
if ($_329 === true) { $this->pos = $pos_308;
$_331 = true; $_343 = FALSE; break;
break; }
} while(0);
$result = $res_320; if( $_343 === TRUE ) { $_345 = TRUE; break; }
$this->pos = $pos_320; $result = $res_306;
$_331 = false; $this->pos = $pos_306;
break; $_345 = FALSE; break;
} while (0); }
if ($_331 === true) { while(0);
$_333 = true; if( $_345 === FALSE) { $_347 = FALSE; break; }
break; $_347 = TRUE; break;
} }
$result = $res_318; while(0);
$this->pos = $pos_318; if( $_347 === FALSE) {
$_333 = false; $result = $res_348;
break; $this->pos = $pos_348;
} while (0); unset( $res_348 );
if ($_333 === true) { unset( $pos_348 );
$_335 = true; break;
break; }
} $count += 1;
$result = $res_316; }
$this->pos = $pos_316; if ($count > 0) { return $this->finalise($result); }
$_335 = false; else { return FALSE; }
break;
} while (0);
if ($_335 === true) {
$_337 = true;
break;
}
$result = $res_314;
$this->pos = $pos_314;
$_337 = false;
break;
} while (0);
if ($_337 === true) {
$_339 = true;
break;
}
$result = $res_312;
$this->pos = $pos_312;
$_339 = false;
break;
} while (0);
if ($_339 === true) {
$_341 = true;
break;
}
$result = $res_310;
$this->pos = $pos_310;
$_341 = false;
break;
} while (0);
if ($_341 === true) {
$_343 = true;
break;
}
$result = $res_308;
$this->pos = $pos_308;
$_343 = false;
break;
} while (0);
if ($_343 === true) {
$_345 = true;
break;
}
$result = $res_306;
$this->pos = $pos_306;
$_345 = false;
break;
} while (0);
if ($_345 === false) {
$_347 = false;
break;
}
$_347 = true;
break;
} while (0);
if ($_347 === false) {
$result = $res_348;
$this->pos = $pos_348;
unset($res_348);
unset($pos_348);
break;
}
$count += 1;
}
if ($count > 0) {
return $this->finalise($result);
} else {
return false;
}
} }
/* UncachedBlock: /* UncachedBlock:
'<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>' '<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>'
Template:$TemplateMatcher? Template:$TemplateMatcher?
'<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>' */ '<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>' */
protected $match_UncachedBlock_typestack = array('UncachedBlock'); protected $match_UncachedBlock_typestack = array('UncachedBlock');
function match_UncachedBlock($stack = array()) function match_UncachedBlock ($stack = array()) {
{ $matchrule = "UncachedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "UncachedBlock"; $_385 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_385 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_385 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_385 = FALSE; break; }
$_385 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; $res_353 = $result;
} $pos_353 = $this->pos;
if (( $subres = $this->whitespace() ) !== false) { $matcher = 'match_'.'CacheBlockArguments'; $key = $matcher; $pos = $this->pos;
$result["text"] .= $subres; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (( $subres = $this->literal('uncached') ) !== false) { $this->store( $result, $subres );
$result["text"] .= $subres; }
} else { else {
$_385 = false; $result = $res_353;
break; $this->pos = $pos_353;
} unset( $res_353 );
if (( $subres = $this->whitespace() ) !== false) { unset( $pos_353 );
$result["text"] .= $subres; }
} $res_365 = $result;
$res_353 = $result; $pos_365 = $this->pos;
$pos_353 = $this->pos; $_364 = NULL;
$matcher = 'match_'.'CacheBlockArguments'; do {
$key = $matcher; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$pos = $this->pos; $stack[] = $result; $result = $this->construct( $matchrule, "Conditional" );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_360 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $_358 = NULL;
} else { do {
$result = $res_353; $res_355 = $result;
$this->pos = $pos_353; $pos_355 = $this->pos;
unset($res_353); if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
unset($pos_353); $result["text"] .= $subres;
} $_358 = TRUE; break;
$res_365 = $result; }
$pos_365 = $this->pos; $result = $res_355;
$_364 = null; $this->pos = $pos_355;
do { if (( $subres = $this->literal( 'unless' ) ) !== FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $result["text"] .= $subres;
$result["text"] .= $subres; $_358 = TRUE; break;
} }
$stack[] = $result; $result = $res_355;
$result = $this->construct($matchrule, "Conditional"); $this->pos = $pos_355;
$_360 = null; $_358 = FALSE; break;
do { }
$_358 = null; while(0);
do { if( $_358 === FALSE) { $_360 = FALSE; break; }
$res_355 = $result; $_360 = TRUE; break;
$pos_355 = $this->pos; }
if (( $subres = $this->literal('if') ) !== false) { while(0);
$result["text"] .= $subres; if( $_360 === TRUE ) {
$_358 = true; $subres = $result; $result = array_pop($stack);
break; $this->store( $result, $subres, 'Conditional' );
} }
$result = $res_355; if( $_360 === FALSE) {
$this->pos = $pos_355; $result = array_pop($stack);
if (( $subres = $this->literal('unless') ) !== false) { $_364 = FALSE; break;
$result["text"] .= $subres; }
$_358 = true; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; $matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_355; if ($subres !== FALSE) {
$this->pos = $pos_355; $this->store( $result, $subres, "Condition" );
$_358 = false; }
break; else { $_364 = FALSE; break; }
} while (0); $_364 = TRUE; break;
if ($_358 === false) { }
$_360 = false; while(0);
break; if( $_364 === FALSE) {
} $result = $res_365;
$_360 = true; $this->pos = $pos_365;
break; unset( $res_365 );
} while (0); unset( $pos_365 );
if ($_360 === true) { }
$subres = $result; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result = array_pop($stack); if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$this->store($result, $subres, 'Conditional'); else { $_385 = FALSE; break; }
} $res_368 = $result;
if ($_360 === false) { $pos_368 = $this->pos;
$result = array_pop($stack); $matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
$_364 = false; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
break; if ($subres !== FALSE) {
} $this->store( $result, $subres, "Template" );
if (( $subres = $this->whitespace() ) !== false) { }
$result["text"] .= $subres; else {
} $result = $res_368;
$matcher = 'match_'.'IfArgument'; $this->pos = $pos_368;
$key = $matcher; unset( $res_368 );
$pos = $this->pos; unset( $pos_368 );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
$this->store($result, $subres, "Condition"); else { $_385 = FALSE; break; }
} else { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_364 = false; if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_385 = FALSE; break; }
} $_381 = NULL;
$_364 = true; do {
break; $_379 = NULL;
} while (0); do {
if ($_364 === false) { $res_372 = $result;
$result = $res_365; $pos_372 = $this->pos;
$this->pos = $pos_365; if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
unset($res_365); $result["text"] .= $subres;
unset($pos_365); $_379 = TRUE; break;
} }
if (( $subres = $this->whitespace() ) !== false) { $result = $res_372;
$result["text"] .= $subres; $this->pos = $pos_372;
} $_377 = NULL;
if (( $subres = $this->literal('%>') ) !== false) { do {
$result["text"] .= $subres; $res_374 = $result;
} else { $pos_374 = $this->pos;
$_385 = false; if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
break; $result["text"] .= $subres;
} $_377 = TRUE; break;
$res_368 = $result; }
$pos_368 = $this->pos; $result = $res_374;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $this->pos = $pos_374;
$key = $matcher; if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$pos = $this->pos; $result["text"] .= $subres;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_377 = TRUE; break;
if ($subres !== false) { }
$this->store($result, $subres, "Template"); $result = $res_374;
} else { $this->pos = $pos_374;
$result = $res_368; $_377 = FALSE; break;
$this->pos = $pos_368; }
unset($res_368); while(0);
unset($pos_368); if( $_377 === TRUE ) { $_379 = TRUE; break; }
} $result = $res_372;
if (( $subres = $this->literal('<%') ) !== false) { $this->pos = $pos_372;
$result["text"] .= $subres; $_379 = FALSE; break;
} else { }
$_385 = false; while(0);
break; if( $_379 === FALSE) { $_381 = FALSE; break; }
} $_381 = TRUE; break;
if (( $subres = $this->whitespace() ) !== false) { }
$result["text"] .= $subres; while(0);
} if( $_381 === FALSE) { $_385 = FALSE; break; }
if (( $subres = $this->literal('end_') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_385 = FALSE; break; }
$_385 = false; $_385 = TRUE; break;
break; }
} while(0);
$_381 = null; if( $_385 === TRUE ) { return $this->finalise($result); }
do { if( $_385 === FALSE) { return FALSE; }
$_379 = null;
do {
$res_372 = $result;
$pos_372 = $this->pos;
if (( $subres = $this->literal('uncached') ) !== false) {
$result["text"] .= $subres;
$_379 = true;
break;
}
$result = $res_372;
$this->pos = $pos_372;
$_377 = null;
do {
$res_374 = $result;
$pos_374 = $this->pos;
if (( $subres = $this->literal('cached') ) !== false) {
$result["text"] .= $subres;
$_377 = true;
break;
}
$result = $res_374;
$this->pos = $pos_374;
if (( $subres = $this->literal('cacheblock') ) !== false) {
$result["text"] .= $subres;
$_377 = true;
break;
}
$result = $res_374;
$this->pos = $pos_374;
$_377 = false;
break;
} while (0);
if ($_377 === true) {
$_379 = true;
break;
}
$result = $res_372;
$this->pos = $pos_372;
$_379 = false;
break;
} while (0);
if ($_379 === false) {
$_381 = false;
break;
}
$_381 = true;
break;
} while (0);
if ($_381 === false) {
$_385 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_385 = false;
break;
}
$_385 = true;
break;
} while (0);
if ($_385 === true) {
return $this->finalise($result);
}
if ($_385 === false) {
return false;
}
} }
@ -3292,332 +2494,252 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/* CacheRestrictedTemplate: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | /* CacheRestrictedTemplate: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock |
OpenBlock | MalformedBlock | Injection | Text)+ */ OpenBlock | MalformedBlock | Injection | Text)+ */
protected $match_CacheRestrictedTemplate_typestack = array('CacheRestrictedTemplate','Template'); protected $match_CacheRestrictedTemplate_typestack = array('CacheRestrictedTemplate','Template');
function match_CacheRestrictedTemplate($stack = array()) function match_CacheRestrictedTemplate ($stack = array()) {
{ $matchrule = "CacheRestrictedTemplate"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "CacheRestrictedTemplate"; $count = 0;
$result = $this->construct($matchrule, $matchrule, null); while (true) {
$count = 0; $res_437 = $result;
while (true) { $pos_437 = $this->pos;
$res_437 = $result; $_436 = NULL;
$pos_437 = $this->pos; do {
$_436 = null; $_434 = NULL;
do { do {
$_434 = null; $res_387 = $result;
do { $pos_387 = $this->pos;
$res_387 = $result; $matcher = 'match_'.'Comment'; $key = $matcher; $pos = $this->pos;
$pos_387 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Comment'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_434 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_387;
$this->store($result, $subres); $this->pos = $pos_387;
$_434 = true; $_432 = NULL;
break; do {
} $res_389 = $result;
$result = $res_387; $pos_389 = $this->pos;
$this->pos = $pos_387; $matcher = 'match_'.'Translate'; $key = $matcher; $pos = $this->pos;
$_432 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_389 = $result; $this->store( $result, $subres );
$pos_389 = $this->pos; $_432 = TRUE; break;
$matcher = 'match_'.'Translate'; }
$key = $matcher; $result = $res_389;
$pos = $this->pos; $this->pos = $pos_389;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_430 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_391 = $result;
$_432 = true; $pos_391 = $this->pos;
break; $matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_389; if ($subres !== FALSE) {
$this->pos = $pos_389; $this->store( $result, $subres );
$_430 = null; $_430 = TRUE; break;
do { }
$res_391 = $result; $result = $res_391;
$pos_391 = $this->pos; $this->pos = $pos_391;
$matcher = 'match_'.'If'; $_428 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_393 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_393 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_430 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_428 = TRUE; break;
$result = $res_391; }
$this->pos = $pos_391; $result = $res_393;
$_428 = null; $this->pos = $pos_393;
do { $_426 = NULL;
$res_393 = $result; do {
$pos_393 = $this->pos; $res_395 = $result;
$matcher = 'match_'.'Require'; $pos_395 = $this->pos;
$key = $matcher; $matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_426 = TRUE; break;
$_428 = true; }
break; $result = $res_395;
} $this->pos = $pos_395;
$result = $res_393; $_424 = NULL;
$this->pos = $pos_393; do {
$_426 = null; $res_397 = $result;
do { $pos_397 = $this->pos;
$res_395 = $result; $matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$pos_395 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'CacheBlock'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_424 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_397;
$this->store($result, $subres); $this->pos = $pos_397;
$_426 = true; $_422 = NULL;
break; do {
} $res_399 = $result;
$result = $res_395; $pos_399 = $this->pos;
$this->pos = $pos_395; $matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$_424 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_397 = $result; $this->store( $result, $subres );
$pos_397 = $this->pos; $_422 = TRUE; break;
$matcher = 'match_'.'UncachedBlock'; }
$key = $matcher; $result = $res_399;
$pos = $this->pos; $this->pos = $pos_399;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_420 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_401 = $result;
$_424 = true; $pos_401 = $this->pos;
break; $matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_397; if ($subres !== FALSE) {
$this->pos = $pos_397; $this->store( $result, $subres );
$_422 = null; $_420 = TRUE; break;
do { }
$res_399 = $result; $result = $res_401;
$pos_399 = $this->pos; $this->pos = $pos_401;
$matcher = 'match_'.'OldI18NTag'; $_418 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_403 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_403 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_422 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_418 = TRUE; break;
$result = $res_399; }
$this->pos = $pos_399; $result = $res_403;
$_420 = null; $this->pos = $pos_403;
do { $_416 = NULL;
$res_401 = $result; do {
$pos_401 = $this->pos; $res_405 = $result;
$matcher = 'match_'.'Include'; $pos_405 = $this->pos;
$key = $matcher; $matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_416 = TRUE; break;
$_420 = true; }
break; $result = $res_405;
} $this->pos = $pos_405;
$result = $res_401; $_414 = NULL;
$this->pos = $pos_401; do {
$_418 = null; $res_407 = $result;
do { $pos_407 = $this->pos;
$res_403 = $result; $matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$pos_403 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'ClosedBlock'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_414 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_407;
$this->store($result, $subres); $this->pos = $pos_407;
$_418 = true; $_412 = NULL;
break; do {
} $res_409 = $result;
$result = $res_403; $pos_409 = $this->pos;
$this->pos = $pos_403; $matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$_416 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_405 = $result; $this->store( $result, $subres );
$pos_405 = $this->pos; $_412 = TRUE; break;
$matcher = 'match_'.'OpenBlock'; }
$key = $matcher; $result = $res_409;
$pos = $this->pos; $this->pos = $pos_409;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $matcher = 'match_'.'Text'; $key = $matcher; $pos = $this->pos;
if ($subres !== false) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->store($result, $subres); if ($subres !== FALSE) {
$_416 = true; $this->store( $result, $subres );
break; $_412 = TRUE; break;
} }
$result = $res_405; $result = $res_409;
$this->pos = $pos_405; $this->pos = $pos_409;
$_414 = null; $_412 = FALSE; break;
do { }
$res_407 = $result; while(0);
$pos_407 = $this->pos; if( $_412 === TRUE ) { $_414 = TRUE; break; }
$matcher = 'match_'.'MalformedBlock'; $result = $res_407;
$key = $matcher; $this->pos = $pos_407;
$pos = $this->pos; $_414 = FALSE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { while(0);
$this->store($result, $subres); if( $_414 === TRUE ) { $_416 = TRUE; break; }
$_414 = true; $result = $res_405;
break; $this->pos = $pos_405;
} $_416 = FALSE; break;
$result = $res_407; }
$this->pos = $pos_407; while(0);
$_412 = null; if( $_416 === TRUE ) { $_418 = TRUE; break; }
do { $result = $res_403;
$res_409 = $result; $this->pos = $pos_403;
$pos_409 = $this->pos; $_418 = FALSE; break;
$matcher = 'match_'.'Injection'; }
$key = $matcher; while(0);
$pos = $this->pos; if( $_418 === TRUE ) { $_420 = TRUE; break; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $result = $res_401;
if ($subres !== false) { $this->pos = $pos_401;
$this->store($result, $subres); $_420 = FALSE; break;
$_412 = true; }
break; while(0);
} if( $_420 === TRUE ) { $_422 = TRUE; break; }
$result = $res_409; $result = $res_399;
$this->pos = $pos_409; $this->pos = $pos_399;
$matcher = 'match_'.'Text'; $_422 = FALSE; break;
$key = $matcher; }
$pos = $this->pos; while(0);
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if( $_422 === TRUE ) { $_424 = TRUE; break; }
if ($subres !== false) { $result = $res_397;
$this->store($result, $subres); $this->pos = $pos_397;
$_412 = true; $_424 = FALSE; break;
break; }
} while(0);
$result = $res_409; if( $_424 === TRUE ) { $_426 = TRUE; break; }
$this->pos = $pos_409; $result = $res_395;
$_412 = false; $this->pos = $pos_395;
break; $_426 = FALSE; break;
} while (0); }
if ($_412 === true) { while(0);
$_414 = true; if( $_426 === TRUE ) { $_428 = TRUE; break; }
break; $result = $res_393;
} $this->pos = $pos_393;
$result = $res_407; $_428 = FALSE; break;
$this->pos = $pos_407; }
$_414 = false; while(0);
break; if( $_428 === TRUE ) { $_430 = TRUE; break; }
} while (0); $result = $res_391;
if ($_414 === true) { $this->pos = $pos_391;
$_416 = true; $_430 = FALSE; break;
break; }
} while(0);
$result = $res_405; if( $_430 === TRUE ) { $_432 = TRUE; break; }
$this->pos = $pos_405; $result = $res_389;
$_416 = false; $this->pos = $pos_389;
break; $_432 = FALSE; break;
} while (0); }
if ($_416 === true) { while(0);
$_418 = true; if( $_432 === TRUE ) { $_434 = TRUE; break; }
break; $result = $res_387;
} $this->pos = $pos_387;
$result = $res_403; $_434 = FALSE; break;
$this->pos = $pos_403; }
$_418 = false; while(0);
break; if( $_434 === FALSE) { $_436 = FALSE; break; }
} while (0); $_436 = TRUE; break;
if ($_418 === true) { }
$_420 = true; while(0);
break; if( $_436 === FALSE) {
} $result = $res_437;
$result = $res_401; $this->pos = $pos_437;
$this->pos = $pos_401; unset( $res_437 );
$_420 = false; unset( $pos_437 );
break; break;
} while (0); }
if ($_420 === true) { $count += 1;
$_422 = true; }
break; if ($count > 0) { return $this->finalise($result); }
} else { return FALSE; }
$result = $res_399;
$this->pos = $pos_399;
$_422 = false;
break;
} while (0);
if ($_422 === true) {
$_424 = true;
break;
}
$result = $res_397;
$this->pos = $pos_397;
$_424 = false;
break;
} while (0);
if ($_424 === true) {
$_426 = true;
break;
}
$result = $res_395;
$this->pos = $pos_395;
$_426 = false;
break;
} while (0);
if ($_426 === true) {
$_428 = true;
break;
}
$result = $res_393;
$this->pos = $pos_393;
$_428 = false;
break;
} while (0);
if ($_428 === true) {
$_430 = true;
break;
}
$result = $res_391;
$this->pos = $pos_391;
$_430 = false;
break;
} while (0);
if ($_430 === true) {
$_432 = true;
break;
}
$result = $res_389;
$this->pos = $pos_389;
$_432 = false;
break;
} while (0);
if ($_432 === true) {
$_434 = true;
break;
}
$result = $res_387;
$this->pos = $pos_387;
$_434 = false;
break;
} while (0);
if ($_434 === false) {
$_436 = false;
break;
}
$_436 = true;
break;
} while (0);
if ($_436 === false) {
$result = $res_437;
$this->pos = $pos_437;
unset($res_437);
unset($pos_437);
break;
}
$count += 1;
}
if ($count > 0) {
return $this->finalise($result);
} else {
return false;
}
} }
@ -3635,334 +2757,243 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/* CacheBlock: /* CacheBlock:
'<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") > '<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") >
Condition:IfArgument )? > '%>' Condition:IfArgument )? > '%>'
(CacheBlock | UncachedBlock | CacheBlockTemplate)* (CacheBlock | UncachedBlock | CacheBlockTemplate)*
'<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>' */ '<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>' */
protected $match_CacheBlock_typestack = array('CacheBlock'); protected $match_CacheBlock_typestack = array('CacheBlock');
function match_CacheBlock($stack = array()) function match_CacheBlock ($stack = array()) {
{ $matchrule = "CacheBlock"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "CacheBlock"; $_492 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_492 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_492 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $stack[] = $result; $result = $this->construct( $matchrule, "CacheTag" );
} else { $_445 = NULL;
$_492 = false; do {
break; $_443 = NULL;
} do {
if (( $subres = $this->whitespace() ) !== false) { $res_440 = $result;
$result["text"] .= $subres; $pos_440 = $this->pos;
} if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$stack[] = $result; $result["text"] .= $subres;
$result = $this->construct($matchrule, "CacheTag"); $_443 = TRUE; break;
$_445 = null; }
do { $result = $res_440;
$_443 = null; $this->pos = $pos_440;
do { if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$res_440 = $result; $result["text"] .= $subres;
$pos_440 = $this->pos; $_443 = TRUE; break;
if (( $subres = $this->literal('cached') ) !== false) { }
$result["text"] .= $subres; $result = $res_440;
$_443 = true; $this->pos = $pos_440;
break; $_443 = FALSE; break;
} }
$result = $res_440; while(0);
$this->pos = $pos_440; if( $_443 === FALSE) { $_445 = FALSE; break; }
if (( $subres = $this->literal('cacheblock') ) !== false) { $_445 = TRUE; break;
$result["text"] .= $subres; }
$_443 = true; while(0);
break; if( $_445 === TRUE ) {
} $subres = $result; $result = array_pop($stack);
$result = $res_440; $this->store( $result, $subres, 'CacheTag' );
$this->pos = $pos_440; }
$_443 = false; if( $_445 === FALSE) {
break; $result = array_pop($stack);
} while (0); $_492 = FALSE; break;
if ($_443 === false) { }
$_445 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; $res_450 = $result;
} $pos_450 = $this->pos;
$_445 = true; $_449 = NULL;
break; do {
} while (0); $matcher = 'match_'.'CacheBlockArguments'; $key = $matcher; $pos = $this->pos;
if ($_445 === true) { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = $result; if ($subres !== FALSE) {
$result = array_pop($stack); $this->store( $result, $subres );
$this->store($result, $subres, 'CacheTag'); }
} else { $_449 = FALSE; break; }
if ($_445 === false) { $_449 = TRUE; break;
$result = array_pop($stack); }
$_492 = false; while(0);
break; if( $_449 === FALSE) {
} $result = $res_450;
if (( $subres = $this->whitespace() ) !== false) { $this->pos = $pos_450;
$result["text"] .= $subres; unset( $res_450 );
} unset( $pos_450 );
$res_450 = $result; }
$pos_450 = $this->pos; $res_462 = $result;
$_449 = null; $pos_462 = $this->pos;
do { $_461 = NULL;
$matcher = 'match_'.'CacheBlockArguments'; do {
$key = $matcher; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$pos = $this->pos; $stack[] = $result; $result = $this->construct( $matchrule, "Conditional" );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_457 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $_455 = NULL;
} else { do {
$_449 = false; $res_452 = $result;
break; $pos_452 = $this->pos;
} if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$_449 = true; $result["text"] .= $subres;
break; $_455 = TRUE; break;
} while (0); }
if ($_449 === false) { $result = $res_452;
$result = $res_450; $this->pos = $pos_452;
$this->pos = $pos_450; if (( $subres = $this->literal( 'unless' ) ) !== FALSE) {
unset($res_450); $result["text"] .= $subres;
unset($pos_450); $_455 = TRUE; break;
} }
$res_462 = $result; $result = $res_452;
$pos_462 = $this->pos; $this->pos = $pos_452;
$_461 = null; $_455 = FALSE; break;
do { }
if (( $subres = $this->whitespace() ) !== false) { while(0);
$result["text"] .= $subres; if( $_455 === FALSE) { $_457 = FALSE; break; }
} $_457 = TRUE; break;
$stack[] = $result; }
$result = $this->construct($matchrule, "Conditional"); while(0);
$_457 = null; if( $_457 === TRUE ) {
do { $subres = $result; $result = array_pop($stack);
$_455 = null; $this->store( $result, $subres, 'Conditional' );
do { }
$res_452 = $result; if( $_457 === FALSE) {
$pos_452 = $this->pos; $result = array_pop($stack);
if (( $subres = $this->literal('if') ) !== false) { $_461 = FALSE; break;
$result["text"] .= $subres; }
$_455 = true; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; $matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_452; if ($subres !== FALSE) {
$this->pos = $pos_452; $this->store( $result, $subres, "Condition" );
if (( $subres = $this->literal('unless') ) !== false) { }
$result["text"] .= $subres; else { $_461 = FALSE; break; }
$_455 = true; $_461 = TRUE; break;
break; }
} while(0);
$result = $res_452; if( $_461 === FALSE) {
$this->pos = $pos_452; $result = $res_462;
$_455 = false; $this->pos = $pos_462;
break; unset( $res_462 );
} while (0); unset( $pos_462 );
if ($_455 === false) { }
$_457 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_492 = FALSE; break; }
$_457 = true; while (true) {
break; $res_475 = $result;
} while (0); $pos_475 = $this->pos;
if ($_457 === true) { $_474 = NULL;
$subres = $result; do {
$result = array_pop($stack); $_472 = NULL;
$this->store($result, $subres, 'Conditional'); do {
} $res_465 = $result;
if ($_457 === false) { $pos_465 = $this->pos;
$result = array_pop($stack); $matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$_461 = false; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
break; if ($subres !== FALSE) {
} $this->store( $result, $subres );
if (( $subres = $this->whitespace() ) !== false) { $_472 = TRUE; break;
$result["text"] .= $subres; }
} $result = $res_465;
$matcher = 'match_'.'IfArgument'; $this->pos = $pos_465;
$key = $matcher; $_470 = NULL;
$pos = $this->pos; do {
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $res_467 = $result;
if ($subres !== false) { $pos_467 = $this->pos;
$this->store($result, $subres, "Condition"); $matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_461 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_470 = TRUE; break;
$_461 = true; }
break; $result = $res_467;
} while (0); $this->pos = $pos_467;
if ($_461 === false) { $matcher = 'match_'.'CacheBlockTemplate'; $key = $matcher; $pos = $this->pos;
$result = $res_462; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->pos = $pos_462; if ($subres !== FALSE) {
unset($res_462); $this->store( $result, $subres );
unset($pos_462); $_470 = TRUE; break;
} }
if (( $subres = $this->whitespace() ) !== false) { $result = $res_467;
$result["text"] .= $subres; $this->pos = $pos_467;
} $_470 = FALSE; break;
if (( $subres = $this->literal('%>') ) !== false) { }
$result["text"] .= $subres; while(0);
} else { if( $_470 === TRUE ) { $_472 = TRUE; break; }
$_492 = false; $result = $res_465;
break; $this->pos = $pos_465;
} $_472 = FALSE; break;
while (true) { }
$res_475 = $result; while(0);
$pos_475 = $this->pos; if( $_472 === FALSE) { $_474 = FALSE; break; }
$_474 = null; $_474 = TRUE; break;
do { }
$_472 = null; while(0);
do { if( $_474 === FALSE) {
$res_465 = $result; $result = $res_475;
$pos_465 = $this->pos; $this->pos = $pos_475;
$matcher = 'match_'.'CacheBlock'; unset( $res_475 );
$key = $matcher; unset( $pos_475 );
$pos = $this->pos; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { }
$this->store($result, $subres); if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
$_472 = true; else { $_492 = FALSE; break; }
break; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
$result = $res_465; else { $_492 = FALSE; break; }
$this->pos = $pos_465; $_488 = NULL;
$_470 = null; do {
do { $_486 = NULL;
$res_467 = $result; do {
$pos_467 = $this->pos; $res_479 = $result;
$matcher = 'match_'.'UncachedBlock'; $pos_479 = $this->pos;
$key = $matcher; if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$pos = $this->pos; $result["text"] .= $subres;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_486 = TRUE; break;
if ($subres !== false) { }
$this->store($result, $subres); $result = $res_479;
$_470 = true; $this->pos = $pos_479;
break; $_484 = NULL;
} do {
$result = $res_467; $res_481 = $result;
$this->pos = $pos_467; $pos_481 = $this->pos;
$matcher = 'match_'.'CacheBlockTemplate'; if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
$key = $matcher; $result["text"] .= $subres;
$pos = $this->pos; $_484 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_481;
$this->store($result, $subres); $this->pos = $pos_481;
$_470 = true; if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
break; $result["text"] .= $subres;
} $_484 = TRUE; break;
$result = $res_467; }
$this->pos = $pos_467; $result = $res_481;
$_470 = false; $this->pos = $pos_481;
break; $_484 = FALSE; break;
} while (0); }
if ($_470 === true) { while(0);
$_472 = true; if( $_484 === TRUE ) { $_486 = TRUE; break; }
break; $result = $res_479;
} $this->pos = $pos_479;
$result = $res_465; $_486 = FALSE; break;
$this->pos = $pos_465; }
$_472 = false; while(0);
break; if( $_486 === FALSE) { $_488 = FALSE; break; }
} while (0); $_488 = TRUE; break;
if ($_472 === false) { }
$_474 = false; while(0);
break; if( $_488 === FALSE) { $_492 = FALSE; break; }
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_474 = true; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_492 = FALSE; break; }
} while (0); $_492 = TRUE; break;
if ($_474 === false) { }
$result = $res_475; while(0);
$this->pos = $pos_475; if( $_492 === TRUE ) { return $this->finalise($result); }
unset($res_475); if( $_492 === FALSE) { return FALSE; }
unset($pos_475);
break;
}
}
if (( $subres = $this->literal('<%') ) !== false) {
$result["text"] .= $subres;
} else {
$_492 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('end_') ) !== false) {
$result["text"] .= $subres;
} else {
$_492 = false;
break;
}
$_488 = null;
do {
$_486 = null;
do {
$res_479 = $result;
$pos_479 = $this->pos;
if (( $subres = $this->literal('cached') ) !== false) {
$result["text"] .= $subres;
$_486 = true;
break;
}
$result = $res_479;
$this->pos = $pos_479;
$_484 = null;
do {
$res_481 = $result;
$pos_481 = $this->pos;
if (( $subres = $this->literal('uncached') ) !== false) {
$result["text"] .= $subres;
$_484 = true;
break;
}
$result = $res_481;
$this->pos = $pos_481;
if (( $subres = $this->literal('cacheblock') ) !== false) {
$result["text"] .= $subres;
$_484 = true;
break;
}
$result = $res_481;
$this->pos = $pos_481;
$_484 = false;
break;
} while (0);
if ($_484 === true) {
$_486 = true;
break;
}
$result = $res_479;
$this->pos = $pos_479;
$_486 = false;
break;
} while (0);
if ($_486 === false) {
$_488 = false;
break;
}
$_488 = true;
break;
} while (0);
if ($_488 === false) {
$_492 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_492 = false;
break;
}
$_492 = true;
break;
} while (0);
if ($_492 === true) {
return $this->finalise($result);
}
if ($_492 === false) {
return false;
}
} }
@ -4000,7 +3031,7 @@ class SSTemplateParser extends Parser implements TemplateParser
// the passed cache key, the block index, and the sha hash of the template. // the passed cache key, the block index, and the sha hash of the template.
$res['php'] .= '$keyExpression = function() use ($scope, $cache) {' . PHP_EOL; $res['php'] .= '$keyExpression = function() use ($scope, $cache) {' . PHP_EOL;
$res['php'] .= '$val = \'\';' . PHP_EOL; $res['php'] .= '$val = \'\';' . PHP_EOL;
if ($globalKey = SSViewer::config()->uninherited('global_key')) { if ($globalKey = SSViewer::config()->get('global_key')) {
// Embed the code necessary to evaluate the globalKey directly into the template, // Embed the code necessary to evaluate the globalKey directly into the template,
// so that SSTemplateParser only needs to be called during template regeneration. // so that SSTemplateParser only needs to be called during template regeneration.
// Warning: If the global key is changed, it's necessary to flush the template cache. // Warning: If the global key is changed, it's necessary to flush the template cache.
@ -4029,176 +3060,123 @@ class SSTemplateParser extends Parser implements TemplateParser
/* OldTPart: "_t" N "(" N QuotedString (N "," N CallArguments)? N ")" N (";")? */ /* OldTPart: "_t" N "(" N QuotedString (N "," N CallArguments)? N ")" N (";")? */
protected $match_OldTPart_typestack = array('OldTPart'); protected $match_OldTPart_typestack = array('OldTPart');
function match_OldTPart($stack = array()) function match_OldTPart ($stack = array()) {
{ $matchrule = "OldTPart"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "OldTPart"; $_511 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_511 = null; if (( $subres = $this->literal( '_t' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_511 = FALSE; break; }
if (( $subres = $this->literal('_t') ) !== false) { $matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$result["text"] .= $subres; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} else { if ($subres !== FALSE) {
$_511 = false; $this->store( $result, $subres );
break; }
} else { $_511 = FALSE; break; }
$matcher = 'match_'.'N'; if (substr($this->string,$this->pos,1) == '(') {
$key = $matcher; $this->pos += 1;
$pos = $this->pos; $result["text"] .= '(';
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { else { $_511 = FALSE; break; }
$this->store($result, $subres); $matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_511 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} }
if (substr($this->string, $this->pos, 1) == '(') { else { $_511 = FALSE; break; }
$this->pos += 1; $matcher = 'match_'.'QuotedString'; $key = $matcher; $pos = $this->pos;
$result["text"] .= '('; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} else { if ($subres !== FALSE) {
$_511 = false; $this->store( $result, $subres );
break; }
} else { $_511 = FALSE; break; }
$matcher = 'match_'.'N'; $res_504 = $result;
$key = $matcher; $pos_504 = $this->pos;
$pos = $this->pos; $_503 = NULL;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); do {
if ($subres !== false) { $matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} else { if ($subres !== FALSE) {
$_511 = false; $this->store( $result, $subres );
break; }
} else { $_503 = FALSE; break; }
$matcher = 'match_'.'QuotedString'; if (substr($this->string,$this->pos,1) == ',') {
$key = $matcher; $this->pos += 1;
$pos = $this->pos; $result["text"] .= ',';
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { else { $_503 = FALSE; break; }
$this->store($result, $subres); $matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_511 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} }
$res_504 = $result; else { $_503 = FALSE; break; }
$pos_504 = $this->pos; $matcher = 'match_'.'CallArguments'; $key = $matcher; $pos = $this->pos;
$_503 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$matcher = 'match_'.'N'; $this->store( $result, $subres );
$key = $matcher; }
$pos = $this->pos; else { $_503 = FALSE; break; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_503 = TRUE; break;
if ($subres !== false) { }
$this->store($result, $subres); while(0);
} else { if( $_503 === FALSE) {
$_503 = false; $result = $res_504;
break; $this->pos = $pos_504;
} unset( $res_504 );
if (substr($this->string, $this->pos, 1) == ',') { unset( $pos_504 );
$this->pos += 1; }
$result["text"] .= ','; $matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_503 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} }
$matcher = 'match_'.'N'; else { $_511 = FALSE; break; }
$key = $matcher; if (substr($this->string,$this->pos,1) == ')') {
$pos = $this->pos; $this->pos += 1;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $result["text"] .= ')';
if ($subres !== false) { }
$this->store($result, $subres); else { $_511 = FALSE; break; }
} else { $matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$_503 = false; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
break; if ($subres !== FALSE) {
} $this->store( $result, $subres );
$matcher = 'match_'.'CallArguments'; }
$key = $matcher; else { $_511 = FALSE; break; }
$pos = $this->pos; $res_510 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_510 = $this->pos;
if ($subres !== false) { $_509 = NULL;
$this->store($result, $subres); do {
} else { if (substr($this->string,$this->pos,1) == ';') {
$_503 = false; $this->pos += 1;
break; $result["text"] .= ';';
} }
$_503 = true; else { $_509 = FALSE; break; }
break; $_509 = TRUE; break;
} while (0); }
if ($_503 === false) { while(0);
$result = $res_504; if( $_509 === FALSE) {
$this->pos = $pos_504; $result = $res_510;
unset($res_504); $this->pos = $pos_510;
unset($pos_504); unset( $res_510 );
} unset( $pos_510 );
$matcher = 'match_'.'N'; }
$key = $matcher; $_511 = TRUE; break;
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); while(0);
if ($subres !== false) { if( $_511 === TRUE ) { return $this->finalise($result); }
$this->store($result, $subres); if( $_511 === FALSE) { return FALSE; }
} else {
$_511 = false;
break;
}
if (substr($this->string, $this->pos, 1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
} else {
$_511 = false;
break;
}
$matcher = 'match_'.'N';
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres);
} else {
$_511 = false;
break;
}
$res_510 = $result;
$pos_510 = $this->pos;
$_509 = null;
do {
if (substr($this->string, $this->pos, 1) == ';') {
$this->pos += 1;
$result["text"] .= ';';
} else {
$_509 = false;
break;
}
$_509 = true;
break;
} while (0);
if ($_509 === false) {
$result = $res_510;
$this->pos = $pos_510;
unset($res_510);
unset($pos_510);
}
$_511 = true;
break;
} while (0);
if ($_511 === true) {
return $this->finalise($result);
}
if ($_511 === false) {
return false;
}
} }
/* N: / [\s\n]* / */ /* N: / [\s\n]* / */
protected $match_N_typestack = array('N'); protected $match_N_typestack = array('N');
function match_N($stack = array()) function match_N ($stack = array()) {
{ $matchrule = "N"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "N"; if (( $subres = $this->rx( '/ [\s\n]* /' ) ) !== FALSE) {
$result = $this->construct($matchrule, $matchrule, null); $result["text"] .= $subres;
if (( $subres = $this->rx('/ [\s\n]* /') ) !== false) { return $this->finalise($result);
$result["text"] .= $subres; }
return $this->finalise($result); else { return FALSE; }
} else {
return false;
}
} }
@ -4230,49 +3208,27 @@ class SSTemplateParser extends Parser implements TemplateParser
/* OldTTag: "<%" < OldTPart > "%>" */ /* OldTTag: "<%" < OldTPart > "%>" */
protected $match_OldTTag_typestack = array('OldTTag'); protected $match_OldTTag_typestack = array('OldTTag');
function match_OldTTag($stack = array()) function match_OldTTag ($stack = array()) {
{ $matchrule = "OldTTag"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "OldTTag"; $_519 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_519 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_519 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $matcher = 'match_'.'OldTPart'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_519 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} }
if (( $subres = $this->whitespace() ) !== false) { else { $_519 = FALSE; break; }
$result["text"] .= $subres; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'OldTPart'; else { $_519 = FALSE; break; }
$key = $matcher; $_519 = TRUE; break;
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); while(0);
if ($subres !== false) { if( $_519 === TRUE ) { return $this->finalise($result); }
$this->store($result, $subres); if( $_519 === FALSE) { return FALSE; }
} else {
$_519 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_519 = false;
break;
}
$_519 = true;
break;
} while (0);
if ($_519 === true) {
return $this->finalise($result);
}
if ($_519 === false) {
return false;
}
} }
@ -4284,101 +3240,55 @@ class SSTemplateParser extends Parser implements TemplateParser
/* OldSprintfTag: "<%" < "sprintf" < "(" < OldTPart < "," < CallArguments > ")" > "%>" */ /* OldSprintfTag: "<%" < "sprintf" < "(" < OldTPart < "," < CallArguments > ")" > "%>" */
protected $match_OldSprintfTag_typestack = array('OldSprintfTag'); protected $match_OldSprintfTag_typestack = array('OldSprintfTag');
function match_OldSprintfTag($stack = array()) function match_OldSprintfTag ($stack = array()) {
{ $matchrule = "OldSprintfTag"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "OldSprintfTag"; $_536 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_536 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_536 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'sprintf' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_536 = FALSE; break; }
$_536 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; if (substr($this->string,$this->pos,1) == '(') {
} $this->pos += 1;
if (( $subres = $this->whitespace() ) !== false) { $result["text"] .= '(';
$result["text"] .= $subres; }
} else { $_536 = FALSE; break; }
if (( $subres = $this->literal('sprintf') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $matcher = 'match_'.'OldTPart'; $key = $matcher; $pos = $this->pos;
} else { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_536 = false; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} }
if (( $subres = $this->whitespace() ) !== false) { else { $_536 = FALSE; break; }
$result["text"] .= $subres; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} if (substr($this->string,$this->pos,1) == ',') {
if (substr($this->string, $this->pos, 1) == '(') { $this->pos += 1;
$this->pos += 1; $result["text"] .= ',';
$result["text"] .= '('; }
} else { else { $_536 = FALSE; break; }
$_536 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; $matcher = 'match_'.'CallArguments'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if (( $subres = $this->whitespace() ) !== false) { if ($subres !== FALSE) {
$result["text"] .= $subres; $this->store( $result, $subres );
} }
$matcher = 'match_'.'OldTPart'; else { $_536 = FALSE; break; }
$key = $matcher; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$pos = $this->pos; if (substr($this->string,$this->pos,1) == ')') {
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $this->pos += 1;
if ($subres !== false) { $result["text"] .= ')';
$this->store($result, $subres); }
} else { else { $_536 = FALSE; break; }
$_536 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_536 = FALSE; break; }
if (( $subres = $this->whitespace() ) !== false) { $_536 = TRUE; break;
$result["text"] .= $subres; }
} while(0);
if (substr($this->string, $this->pos, 1) == ',') { if( $_536 === TRUE ) { return $this->finalise($result); }
$this->pos += 1; if( $_536 === FALSE) { return FALSE; }
$result["text"] .= ',';
} else {
$_536 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
$matcher = 'match_'.'CallArguments';
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres);
} else {
$_536 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (substr($this->string, $this->pos, 1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
} else {
$_536 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_536 = false;
break;
}
$_536 = true;
break;
} while (0);
if ($_536 === true) {
return $this->finalise($result);
}
if ($_536 === false) {
return false;
}
} }
@ -4400,45 +3310,33 @@ class SSTemplateParser extends Parser implements TemplateParser
/* OldI18NTag: OldSprintfTag | OldTTag */ /* OldI18NTag: OldSprintfTag | OldTTag */
protected $match_OldI18NTag_typestack = array('OldI18NTag'); protected $match_OldI18NTag_typestack = array('OldI18NTag');
function match_OldI18NTag($stack = array()) function match_OldI18NTag ($stack = array()) {
{ $matchrule = "OldI18NTag"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "OldI18NTag"; $_541 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_541 = null; $res_538 = $result;
do { $pos_538 = $this->pos;
$res_538 = $result; $matcher = 'match_'.'OldSprintfTag'; $key = $matcher; $pos = $this->pos;
$pos_538 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'OldSprintfTag'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_541 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_538;
$this->store($result, $subres); $this->pos = $pos_538;
$_541 = true; $matcher = 'match_'.'OldTTag'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
$result = $res_538; $this->store( $result, $subres );
$this->pos = $pos_538; $_541 = TRUE; break;
$matcher = 'match_'.'OldTTag'; }
$key = $matcher; $result = $res_538;
$pos = $this->pos; $this->pos = $pos_538;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_541 = FALSE; break;
if ($subres !== false) { }
$this->store($result, $subres); while(0);
$_541 = true; if( $_541 === TRUE ) { return $this->finalise($result); }
break; if( $_541 === FALSE) { return FALSE; }
}
$result = $res_538;
$this->pos = $pos_538;
$_541 = false;
break;
} while (0);
if ($_541 === true) {
return $this->finalise($result);
}
if ($_541 === false) {
return false;
}
} }
@ -4450,48 +3348,32 @@ class SSTemplateParser extends Parser implements TemplateParser
/* NamedArgument: Name:Word "=" Value:Argument */ /* NamedArgument: Name:Word "=" Value:Argument */
protected $match_NamedArgument_typestack = array('NamedArgument'); protected $match_NamedArgument_typestack = array('NamedArgument');
function match_NamedArgument($stack = array()) function match_NamedArgument ($stack = array()) {
{ $matchrule = "NamedArgument"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "NamedArgument"; $_546 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_546 = null; $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Word'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "Name" );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_546 = FALSE; break; }
if ($subres !== false) { if (substr($this->string,$this->pos,1) == '=') {
$this->store($result, $subres, "Name"); $this->pos += 1;
} else { $result["text"] .= '=';
$_546 = false; }
break; else { $_546 = FALSE; break; }
} $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
if (substr($this->string, $this->pos, 1) == '=') { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$this->pos += 1; if ($subres !== FALSE) {
$result["text"] .= '='; $this->store( $result, $subres, "Value" );
} else { }
$_546 = false; else { $_546 = FALSE; break; }
break; $_546 = TRUE; break;
} }
$matcher = 'match_'.'Argument'; while(0);
$key = $matcher; if( $_546 === TRUE ) { return $this->finalise($result); }
$pos = $this->pos; if( $_546 === FALSE) { return FALSE; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres, "Value");
} else {
$_546 = false;
break;
}
$_546 = true;
break;
} while (0);
if ($_546 === true) {
return $this->finalise($result);
}
if ($_546 === false) {
return false;
}
} }
@ -4520,123 +3402,79 @@ class SSTemplateParser extends Parser implements TemplateParser
/* Include: "<%" < "include" < Template:NamespacedWord < (NamedArgument ( < "," < NamedArgument )*)? > "%>" */ /* Include: "<%" < "include" < Template:NamespacedWord < (NamedArgument ( < "," < NamedArgument )*)? > "%>" */
protected $match_Include_typestack = array('Include'); protected $match_Include_typestack = array('Include');
function match_Include($stack = array()) function match_Include ($stack = array()) {
{ $matchrule = "Include"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Include"; $_565 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_565 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_565 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'include' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_565 = FALSE; break; }
$_565 = false; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
break; $matcher = 'match_'.'NamespacedWord'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if (( $subres = $this->whitespace() ) !== false) { if ($subres !== FALSE) {
$result["text"] .= $subres; $this->store( $result, $subres, "Template" );
} }
if (( $subres = $this->literal('include') ) !== false) { else { $_565 = FALSE; break; }
$result["text"] .= $subres; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $res_562 = $result;
$_565 = false; $pos_562 = $this->pos;
break; $_561 = NULL;
} do {
if (( $subres = $this->whitespace() ) !== false) { $matcher = 'match_'.'NamedArgument'; $key = $matcher; $pos = $this->pos;
$result["text"] .= $subres; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
$matcher = 'match_'.'NamespacedWord'; $this->store( $result, $subres );
$key = $matcher; }
$pos = $this->pos; else { $_561 = FALSE; break; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); while (true) {
if ($subres !== false) { $res_560 = $result;
$this->store($result, $subres, "Template"); $pos_560 = $this->pos;
} else { $_559 = NULL;
$_565 = false; do {
break; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} if (substr($this->string,$this->pos,1) == ',') {
if (( $subres = $this->whitespace() ) !== false) { $this->pos += 1;
$result["text"] .= $subres; $result["text"] .= ',';
} }
$res_562 = $result; else { $_559 = FALSE; break; }
$pos_562 = $this->pos; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_561 = null; $matcher = 'match_'.'NamedArgument'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'NamedArgument'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_559 = FALSE; break; }
if ($subres !== false) { $_559 = TRUE; break;
$this->store($result, $subres); }
} else { while(0);
$_561 = false; if( $_559 === FALSE) {
break; $result = $res_560;
} $this->pos = $pos_560;
while (true) { unset( $res_560 );
$res_560 = $result; unset( $pos_560 );
$pos_560 = $this->pos; break;
$_559 = null; }
do { }
if (( $subres = $this->whitespace() ) !== false) { $_561 = TRUE; break;
$result["text"] .= $subres; }
} while(0);
if (substr($this->string, $this->pos, 1) == ',') { if( $_561 === FALSE) {
$this->pos += 1; $result = $res_562;
$result["text"] .= ','; $this->pos = $pos_562;
} else { unset( $res_562 );
$_559 = false; unset( $pos_562 );
break; }
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->whitespace() ) !== false) { if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; else { $_565 = FALSE; break; }
} $_565 = TRUE; break;
$matcher = 'match_'.'NamedArgument'; }
$key = $matcher; while(0);
$pos = $this->pos; if( $_565 === TRUE ) { return $this->finalise($result); }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if( $_565 === FALSE) { return FALSE; }
if ($subres !== false) {
$this->store($result, $subres);
} else {
$_559 = false;
break;
}
$_559 = true;
break;
} while (0);
if ($_559 === false) {
$result = $res_560;
$this->pos = $pos_560;
unset($res_560);
unset($pos_560);
break;
}
}
$_561 = true;
break;
} while (0);
if ($_561 === false) {
$result = $res_562;
$this->pos = $pos_562;
unset($res_562);
unset($pos_562);
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_565 = false;
break;
}
$_565 = true;
break;
} while (0);
if ($_565 === true) {
return $this->finalise($result);
}
if ($_565 === false) {
return false;
}
} }
@ -4674,420 +3512,299 @@ class SSTemplateParser extends Parser implements TemplateParser
/* BlockArguments: :Argument ( < "," < :Argument)* */ /* BlockArguments: :Argument ( < "," < :Argument)* */
protected $match_BlockArguments_typestack = array('BlockArguments'); protected $match_BlockArguments_typestack = array('BlockArguments');
function match_BlockArguments($stack = array()) function match_BlockArguments ($stack = array()) {
{ $matchrule = "BlockArguments"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "BlockArguments"; $_574 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_574 = null; $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
do { $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Argument'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres, "Argument" );
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); else { $_574 = FALSE; break; }
if ($subres !== false) { while (true) {
$this->store($result, $subres, "Argument"); $res_573 = $result;
} else { $pos_573 = $this->pos;
$_574 = false; $_572 = NULL;
break; do {
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
while (true) { if (substr($this->string,$this->pos,1) == ',') {
$res_573 = $result; $this->pos += 1;
$pos_573 = $this->pos; $result["text"] .= ',';
$_572 = null; }
do { else { $_572 = FALSE; break; }
if (( $subres = $this->whitespace() ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if (substr($this->string, $this->pos, 1) == ',') { if ($subres !== FALSE) {
$this->pos += 1; $this->store( $result, $subres, "Argument" );
$result["text"] .= ','; }
} else { else { $_572 = FALSE; break; }
$_572 = false; $_572 = TRUE; break;
break; }
} while(0);
if (( $subres = $this->whitespace() ) !== false) { if( $_572 === FALSE) {
$result["text"] .= $subres; $result = $res_573;
} $this->pos = $pos_573;
$matcher = 'match_'.'Argument'; unset( $res_573 );
$key = $matcher; unset( $pos_573 );
$pos = $this->pos; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { }
$this->store($result, $subres, "Argument"); $_574 = TRUE; break;
} else { }
$_572 = false; while(0);
break; if( $_574 === TRUE ) { return $this->finalise($result); }
} if( $_574 === FALSE) { return FALSE; }
$_572 = true;
break;
} while (0);
if ($_572 === false) {
$result = $res_573;
$this->pos = $pos_573;
unset($res_573);
unset($pos_573);
break;
}
}
$_574 = true;
break;
} while (0);
if ($_574 === true) {
return $this->finalise($result);
}
if ($_574 === false) {
return false;
}
} }
/* NotBlockTag: "end_" | (("if" | "else_if" | "else" | "require" | "cached" | "uncached" | "cacheblock" | "include")]) */ /* NotBlockTag: "end_" | (("if" | "else_if" | "else" | "require" | "cached" | "uncached" | "cacheblock" | "include")]) */
protected $match_NotBlockTag_typestack = array('NotBlockTag'); protected $match_NotBlockTag_typestack = array('NotBlockTag');
function match_NotBlockTag($stack = array()) function match_NotBlockTag ($stack = array()) {
{ $matchrule = "NotBlockTag"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "NotBlockTag"; $_612 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_612 = null; $res_576 = $result;
do { $pos_576 = $this->pos;
$res_576 = $result; if (( $subres = $this->literal( 'end_' ) ) !== FALSE) {
$pos_576 = $this->pos; $result["text"] .= $subres;
if (( $subres = $this->literal('end_') ) !== false) { $_612 = TRUE; break;
$result["text"] .= $subres; }
$_612 = true; $result = $res_576;
break; $this->pos = $pos_576;
} $_610 = NULL;
$result = $res_576; do {
$this->pos = $pos_576; $_607 = NULL;
$_610 = null; do {
do { $_605 = NULL;
$_607 = null; do {
do { $res_578 = $result;
$_605 = null; $pos_578 = $this->pos;
do { if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$res_578 = $result; $result["text"] .= $subres;
$pos_578 = $this->pos; $_605 = TRUE; break;
if (( $subres = $this->literal('if') ) !== false) { }
$result["text"] .= $subres; $result = $res_578;
$_605 = true; $this->pos = $pos_578;
break; $_603 = NULL;
} do {
$result = $res_578; $res_580 = $result;
$this->pos = $pos_578; $pos_580 = $this->pos;
$_603 = null; if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) {
do { $result["text"] .= $subres;
$res_580 = $result; $_603 = TRUE; break;
$pos_580 = $this->pos; }
if (( $subres = $this->literal('else_if') ) !== false) { $result = $res_580;
$result["text"] .= $subres; $this->pos = $pos_580;
$_603 = true; $_601 = NULL;
break; do {
} $res_582 = $result;
$result = $res_580; $pos_582 = $this->pos;
$this->pos = $pos_580; if (( $subres = $this->literal( 'else' ) ) !== FALSE) {
$_601 = null; $result["text"] .= $subres;
do { $_601 = TRUE; break;
$res_582 = $result; }
$pos_582 = $this->pos; $result = $res_582;
if (( $subres = $this->literal('else') ) !== false) { $this->pos = $pos_582;
$result["text"] .= $subres; $_599 = NULL;
$_601 = true; do {
break; $res_584 = $result;
} $pos_584 = $this->pos;
$result = $res_582; if (( $subres = $this->literal( 'require' ) ) !== FALSE) {
$this->pos = $pos_582; $result["text"] .= $subres;
$_599 = null; $_599 = TRUE; break;
do { }
$res_584 = $result; $result = $res_584;
$pos_584 = $this->pos; $this->pos = $pos_584;
if (( $subres = $this->literal('require') ) !== false) { $_597 = NULL;
$result["text"] .= $subres; do {
$_599 = true; $res_586 = $result;
break; $pos_586 = $this->pos;
} if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result = $res_584; $result["text"] .= $subres;
$this->pos = $pos_584; $_597 = TRUE; break;
$_597 = null; }
do { $result = $res_586;
$res_586 = $result; $this->pos = $pos_586;
$pos_586 = $this->pos; $_595 = NULL;
if (( $subres = $this->literal('cached') ) !== false) { do {
$result["text"] .= $subres; $res_588 = $result;
$_597 = true; $pos_588 = $this->pos;
break; if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
} $result["text"] .= $subres;
$result = $res_586; $_595 = TRUE; break;
$this->pos = $pos_586; }
$_595 = null; $result = $res_588;
do { $this->pos = $pos_588;
$res_588 = $result; $_593 = NULL;
$pos_588 = $this->pos; do {
if (( $subres = $this->literal('uncached') ) !== false) { $res_590 = $result;
$result["text"] .= $subres; $pos_590 = $this->pos;
$_595 = true; if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
break; $result["text"] .= $subres;
} $_593 = TRUE; break;
$result = $res_588; }
$this->pos = $pos_588; $result = $res_590;
$_593 = null; $this->pos = $pos_590;
do { if (( $subres = $this->literal( 'include' ) ) !== FALSE) {
$res_590 = $result; $result["text"] .= $subres;
$pos_590 = $this->pos; $_593 = TRUE; break;
if (( $subres = $this->literal('cacheblock') ) !== false) { }
$result["text"] .= $subres; $result = $res_590;
$_593 = true; $this->pos = $pos_590;
break; $_593 = FALSE; break;
} }
$result = $res_590; while(0);
$this->pos = $pos_590; if( $_593 === TRUE ) { $_595 = TRUE; break; }
if (( $subres = $this->literal('include') ) !== false) { $result = $res_588;
$result["text"] .= $subres; $this->pos = $pos_588;
$_593 = true; $_595 = FALSE; break;
break; }
} while(0);
$result = $res_590; if( $_595 === TRUE ) { $_597 = TRUE; break; }
$this->pos = $pos_590; $result = $res_586;
$_593 = false; $this->pos = $pos_586;
break; $_597 = FALSE; break;
} while (0); }
if ($_593 === true) { while(0);
$_595 = true; if( $_597 === TRUE ) { $_599 = TRUE; break; }
break; $result = $res_584;
} $this->pos = $pos_584;
$result = $res_588; $_599 = FALSE; break;
$this->pos = $pos_588; }
$_595 = false; while(0);
break; if( $_599 === TRUE ) { $_601 = TRUE; break; }
} while (0); $result = $res_582;
if ($_595 === true) { $this->pos = $pos_582;
$_597 = true; $_601 = FALSE; break;
break; }
} while(0);
$result = $res_586; if( $_601 === TRUE ) { $_603 = TRUE; break; }
$this->pos = $pos_586; $result = $res_580;
$_597 = false; $this->pos = $pos_580;
break; $_603 = FALSE; break;
} while (0); }
if ($_597 === true) { while(0);
$_599 = true; if( $_603 === TRUE ) { $_605 = TRUE; break; }
break; $result = $res_578;
} $this->pos = $pos_578;
$result = $res_584; $_605 = FALSE; break;
$this->pos = $pos_584; }
$_599 = false; while(0);
break; if( $_605 === FALSE) { $_607 = FALSE; break; }
} while (0); $_607 = TRUE; break;
if ($_599 === true) { }
$_601 = true; while(0);
break; if( $_607 === FALSE) { $_610 = FALSE; break; }
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result = $res_582; else { $_610 = FALSE; break; }
$this->pos = $pos_582; $_610 = TRUE; break;
$_601 = false; }
break; while(0);
} while (0); if( $_610 === TRUE ) { $_612 = TRUE; break; }
if ($_601 === true) { $result = $res_576;
$_603 = true; $this->pos = $pos_576;
break; $_612 = FALSE; break;
} }
$result = $res_580; while(0);
$this->pos = $pos_580; if( $_612 === TRUE ) { return $this->finalise($result); }
$_603 = false; if( $_612 === FALSE) { return FALSE; }
break;
} while (0);
if ($_603 === true) {
$_605 = true;
break;
}
$result = $res_578;
$this->pos = $pos_578;
$_605 = false;
break;
} while (0);
if ($_605 === false) {
$_607 = false;
break;
}
$_607 = true;
break;
} while (0);
if ($_607 === false) {
$_610 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
} else {
$_610 = false;
break;
}
$_610 = true;
break;
} while (0);
if ($_610 === true) {
$_612 = true;
break;
}
$result = $res_576;
$this->pos = $pos_576;
$_612 = false;
break;
} while (0);
if ($_612 === true) {
return $this->finalise($result);
}
if ($_612 === false) {
return false;
}
} }
/* ClosedBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > Zap:'%>' Template:$TemplateMatcher? /* ClosedBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > Zap:'%>' Template:$TemplateMatcher?
'<%' < 'end_' '$BlockName' > '%>' */ '<%' < 'end_' '$BlockName' > '%>' */
protected $match_ClosedBlock_typestack = array('ClosedBlock'); protected $match_ClosedBlock_typestack = array('ClosedBlock');
function match_ClosedBlock($stack = array()) function match_ClosedBlock ($stack = array()) {
{ $matchrule = "ClosedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "ClosedBlock"; $_632 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_632 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_632 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $res_616 = $result;
} else { $pos_616 = $this->pos;
$_632 = false; $matcher = 'match_'.'NotBlockTag'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $this->store( $result, $subres );
$result["text"] .= $subres; $result = $res_616;
} $this->pos = $pos_616;
$res_616 = $result; $_632 = FALSE; break;
$pos_616 = $this->pos; }
$matcher = 'match_'.'NotBlockTag'; else {
$key = $matcher; $result = $res_616;
$pos = $this->pos; $this->pos = $pos_616;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_616; if ($subres !== FALSE) {
$this->pos = $pos_616; $this->store( $result, $subres, "BlockName" );
$_632 = false; }
break; else { $_632 = FALSE; break; }
} else { $res_622 = $result;
$result = $res_616; $pos_622 = $this->pos;
$this->pos = $pos_616; $_621 = NULL;
} do {
$matcher = 'match_'.'Word'; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$key = $matcher; else { $_621 = FALSE; break; }
$pos = $this->pos; $matcher = 'match_'.'BlockArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== false) { if ($subres !== FALSE) {
$this->store($result, $subres, "BlockName"); $this->store( $result, $subres, "BlockArguments" );
} else { }
$_632 = false; else { $_621 = FALSE; break; }
break; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_621 = FALSE; break; }
$res_622 = $result; $_621 = TRUE; break;
$pos_622 = $this->pos; }
$_621 = null; while(0);
do { if( $_621 === FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $result = $res_622;
$result["text"] .= $subres; $this->pos = $pos_622;
} else { unset( $res_622 );
$_621 = false; unset( $pos_622 );
break; }
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'BlockArguments'; $stack[] = $result; $result = $this->construct( $matchrule, "Zap" );
$key = $matcher; if (( $subres = $this->literal( '%>' ) ) !== FALSE) {
$pos = $this->pos; $result["text"] .= $subres;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $subres = $result; $result = array_pop($stack);
if ($subres !== false) { $this->store( $result, $subres, 'Zap' );
$this->store($result, $subres, "BlockArguments"); }
} else { else {
$_621 = false; $result = array_pop($stack);
break; $_632 = FALSE; break;
} }
if (( $subres = $this->whitespace() ) !== false) { $res_625 = $result;
$result["text"] .= $subres; $pos_625 = $this->pos;
} else { $matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
$_621 = false; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
break; if ($subres !== FALSE) {
} $this->store( $result, $subres, "Template" );
$_621 = true; }
break; else {
} while (0); $result = $res_625;
if ($_621 === false) { $this->pos = $pos_625;
$result = $res_622; unset( $res_625 );
$this->pos = $pos_622; unset( $pos_625 );
unset($res_622); }
unset($pos_622); if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_632 = FALSE; break; }
if (( $subres = $this->whitespace() ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_632 = FALSE; break; }
$stack[] = $result; if (( $subres = $this->literal( ''.$this->expression($result, $stack, 'BlockName').'' ) ) !== FALSE) { $result["text"] .= $subres; }
$result = $this->construct($matchrule, "Zap"); else { $_632 = FALSE; break; }
if (( $subres = $this->literal('%>') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$subres = $result; else { $_632 = FALSE; break; }
$result = array_pop($stack); $_632 = TRUE; break;
$this->store($result, $subres, 'Zap'); }
} else { while(0);
$result = array_pop($stack); if( $_632 === TRUE ) { return $this->finalise($result); }
$_632 = false; if( $_632 === FALSE) { return FALSE; }
break;
}
$res_625 = $result;
$pos_625 = $this->pos;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher');
$key = $matcher;
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres, "Template");
} else {
$result = $res_625;
$this->pos = $pos_625;
unset($res_625);
unset($pos_625);
}
if (( $subres = $this->literal('<%') ) !== false) {
$result["text"] .= $subres;
} else {
$_632 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('end_') ) !== false) {
$result["text"] .= $subres;
} else {
$_632 = false;
break;
}
if (( $subres = $this->literal(''.$this->expression($result, $stack, 'BlockName').'') ) !== false) {
$result["text"] .= $subres;
} else {
$_632 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_632 = false;
break;
}
$_632 = true;
break;
} while (0);
if ($_632 === true) {
return $this->finalise($result);
}
if ($_632 === false) {
return false;
}
} }
@ -5193,100 +3910,64 @@ class SSTemplateParser extends Parser implements TemplateParser
/* OpenBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > '%>' */ /* OpenBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > '%>' */
protected $match_OpenBlock_typestack = array('OpenBlock'); protected $match_OpenBlock_typestack = array('OpenBlock');
function match_OpenBlock($stack = array()) function match_OpenBlock ($stack = array()) {
{ $matchrule = "OpenBlock"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "OpenBlock"; $_645 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_645 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_645 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $res_636 = $result;
} else { $pos_636 = $this->pos;
$_645 = false; $matcher = 'match_'.'NotBlockTag'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $this->store( $result, $subres );
$result["text"] .= $subres; $result = $res_636;
} $this->pos = $pos_636;
$res_636 = $result; $_645 = FALSE; break;
$pos_636 = $this->pos; }
$matcher = 'match_'.'NotBlockTag'; else {
$key = $matcher; $result = $res_636;
$pos = $this->pos; $this->pos = $pos_636;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_636; if ($subres !== FALSE) {
$this->pos = $pos_636; $this->store( $result, $subres, "BlockName" );
$_645 = false; }
break; else { $_645 = FALSE; break; }
} else { $res_642 = $result;
$result = $res_636; $pos_642 = $this->pos;
$this->pos = $pos_636; $_641 = NULL;
} do {
$matcher = 'match_'.'Word'; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$key = $matcher; else { $_641 = FALSE; break; }
$pos = $this->pos; $matcher = 'match_'.'BlockArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== false) { if ($subres !== FALSE) {
$this->store($result, $subres, "BlockName"); $this->store( $result, $subres, "BlockArguments" );
} else { }
$_645 = false; else { $_641 = FALSE; break; }
break; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_641 = FALSE; break; }
$res_642 = $result; $_641 = TRUE; break;
$pos_642 = $this->pos; }
$_641 = null; while(0);
do { if( $_641 === FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $result = $res_642;
$result["text"] .= $subres; $this->pos = $pos_642;
} else { unset( $res_642 );
$_641 = false; unset( $pos_642 );
break; }
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'BlockArguments'; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$key = $matcher; else { $_645 = FALSE; break; }
$pos = $this->pos; $_645 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { while(0);
$this->store($result, $subres, "BlockArguments"); if( $_645 === TRUE ) { return $this->finalise($result); }
} else { if( $_645 === FALSE) { return FALSE; }
$_641 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
} else {
$_641 = false;
break;
}
$_641 = true;
break;
} while (0);
if ($_641 === false) {
$result = $res_642;
$this->pos = $pos_642;
unset($res_642);
unset($pos_642);
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_645 = false;
break;
}
$_645 = true;
break;
} while (0);
if ($_645 === true) {
return $this->finalise($result);
}
if ($_645 === false) {
return false;
}
} }
@ -5367,55 +4048,29 @@ class SSTemplateParser extends Parser implements TemplateParser
/* MismatchedEndBlock: '<%' < 'end_' :Word > '%>' */ /* MismatchedEndBlock: '<%' < 'end_' :Word > '%>' */
protected $match_MismatchedEndBlock_typestack = array('MismatchedEndBlock'); protected $match_MismatchedEndBlock_typestack = array('MismatchedEndBlock');
function match_MismatchedEndBlock($stack = array()) function match_MismatchedEndBlock ($stack = array()) {
{ $matchrule = "MismatchedEndBlock"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "MismatchedEndBlock"; $_653 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_653 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_653 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_653 = FALSE; break; }
$_653 = false; $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $this->store( $result, $subres, "Word" );
$result["text"] .= $subres; }
} else { $_653 = FALSE; break; }
if (( $subres = $this->literal('end_') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { else { $_653 = FALSE; break; }
$_653 = false; $_653 = TRUE; break;
break; }
} while(0);
$matcher = 'match_'.'Word'; if( $_653 === TRUE ) { return $this->finalise($result); }
$key = $matcher; if( $_653 === FALSE) { return FALSE; }
$pos = $this->pos;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) );
if ($subres !== false) {
$this->store($result, $subres, "Word");
} else {
$_653 = false;
break;
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_653 = false;
break;
}
$_653 = true;
break;
} while (0);
if ($_653 === true) {
return $this->finalise($result);
}
if ($_653 === false) {
return false;
}
} }
@ -5429,117 +4084,80 @@ class SSTemplateParser extends Parser implements TemplateParser
/* MalformedOpenTag: '<%' < !NotBlockTag Tag:Word !( ( [ :BlockArguments ] )? > '%>' ) */ /* MalformedOpenTag: '<%' < !NotBlockTag Tag:Word !( ( [ :BlockArguments ] )? > '%>' ) */
protected $match_MalformedOpenTag_typestack = array('MalformedOpenTag'); protected $match_MalformedOpenTag_typestack = array('MalformedOpenTag');
function match_MalformedOpenTag($stack = array()) function match_MalformedOpenTag ($stack = array()) {
{ $matchrule = "MalformedOpenTag"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "MalformedOpenTag"; $_668 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_668 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_668 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $res_657 = $result;
} else { $pos_657 = $this->pos;
$_668 = false; $matcher = 'match_'.'NotBlockTag'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $this->store( $result, $subres );
$result["text"] .= $subres; $result = $res_657;
} $this->pos = $pos_657;
$res_657 = $result; $_668 = FALSE; break;
$pos_657 = $this->pos; }
$matcher = 'match_'.'NotBlockTag'; else {
$key = $matcher; $result = $res_657;
$pos = $this->pos; $this->pos = $pos_657;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_657; if ($subres !== FALSE) {
$this->pos = $pos_657; $this->store( $result, $subres, "Tag" );
$_668 = false; }
break; else { $_668 = FALSE; break; }
} else { $res_667 = $result;
$result = $res_657; $pos_667 = $this->pos;
$this->pos = $pos_657; $_666 = NULL;
} do {
$matcher = 'match_'.'Word'; $res_663 = $result;
$key = $matcher; $pos_663 = $this->pos;
$pos = $this->pos; $_662 = NULL;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); do {
if ($subres !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$this->store($result, $subres, "Tag"); else { $_662 = FALSE; break; }
} else { $matcher = 'match_'.'BlockArguments'; $key = $matcher; $pos = $this->pos;
$_668 = false; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
break; if ($subres !== FALSE) {
} $this->store( $result, $subres, "BlockArguments" );
$res_667 = $result; }
$pos_667 = $this->pos; else { $_662 = FALSE; break; }
$_666 = null; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_662 = FALSE; break; }
$res_663 = $result; $_662 = TRUE; break;
$pos_663 = $this->pos; }
$_662 = null; while(0);
do { if( $_662 === FALSE) {
if (( $subres = $this->whitespace() ) !== false) { $result = $res_663;
$result["text"] .= $subres; $this->pos = $pos_663;
} else { unset( $res_663 );
$_662 = false; unset( $pos_663 );
break; }
} if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'BlockArguments'; if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$key = $matcher; else { $_666 = FALSE; break; }
$pos = $this->pos; $_666 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { while(0);
$this->store($result, $subres, "BlockArguments"); if( $_666 === TRUE ) {
} else { $result = $res_667;
$_662 = false; $this->pos = $pos_667;
break; $_668 = FALSE; break;
} }
if (( $subres = $this->whitespace() ) !== false) { if( $_666 === FALSE) {
$result["text"] .= $subres; $result = $res_667;
} else { $this->pos = $pos_667;
$_662 = false; }
break; $_668 = TRUE; break;
} }
$_662 = true; while(0);
break; if( $_668 === TRUE ) { return $this->finalise($result); }
} while (0); if( $_668 === FALSE) { return FALSE; }
if ($_662 === false) {
$result = $res_663;
$this->pos = $pos_663;
unset($res_663);
unset($pos_663);
}
if (( $subres = $this->whitespace() ) !== false) {
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_666 = false;
break;
}
$_666 = true;
break;
} while (0);
if ($_666 === true) {
$result = $res_667;
$this->pos = $pos_667;
$_668 = false;
break;
}
if ($_666 === false) {
$result = $res_667;
$this->pos = $pos_667;
}
$_668 = true;
break;
} while (0);
if ($_668 === true) {
return $this->finalise($result);
}
if ($_668 === false) {
return false;
}
} }
@ -5552,89 +4170,59 @@ class SSTemplateParser extends Parser implements TemplateParser
/* MalformedCloseTag: '<%' < Tag:('end_' :Word ) !( > '%>' ) */ /* MalformedCloseTag: '<%' < Tag:('end_' :Word ) !( > '%>' ) */
protected $match_MalformedCloseTag_typestack = array('MalformedCloseTag'); protected $match_MalformedCloseTag_typestack = array('MalformedCloseTag');
function match_MalformedCloseTag($stack = array()) function match_MalformedCloseTag ($stack = array()) {
{ $matchrule = "MalformedCloseTag"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "MalformedCloseTag"; $_680 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_680 = null; if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_680 = FALSE; break; }
if (( $subres = $this->literal('<%') ) !== false) { if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$result["text"] .= $subres; $stack[] = $result; $result = $this->construct( $matchrule, "Tag" );
} else { $_674 = NULL;
$_680 = false; do {
break; if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
} else { $_674 = FALSE; break; }
if (( $subres = $this->whitespace() ) !== false) { $matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$result["text"] .= $subres; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
$stack[] = $result; $this->store( $result, $subres, "Word" );
$result = $this->construct($matchrule, "Tag"); }
$_674 = null; else { $_674 = FALSE; break; }
do { $_674 = TRUE; break;
if (( $subres = $this->literal('end_') ) !== false) { }
$result["text"] .= $subres; while(0);
} else { if( $_674 === TRUE ) {
$_674 = false; $subres = $result; $result = array_pop($stack);
break; $this->store( $result, $subres, 'Tag' );
} }
$matcher = 'match_'.'Word'; if( $_674 === FALSE) {
$key = $matcher; $result = array_pop($stack);
$pos = $this->pos; $_680 = FALSE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $res_679 = $result;
$this->store($result, $subres, "Word"); $pos_679 = $this->pos;
} else { $_678 = NULL;
$_674 = false; do {
break; if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
} if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$_674 = true; else { $_678 = FALSE; break; }
break; $_678 = TRUE; break;
} while (0); }
if ($_674 === true) { while(0);
$subres = $result; if( $_678 === TRUE ) {
$result = array_pop($stack); $result = $res_679;
$this->store($result, $subres, 'Tag'); $this->pos = $pos_679;
} $_680 = FALSE; break;
if ($_674 === false) { }
$result = array_pop($stack); if( $_678 === FALSE) {
$_680 = false; $result = $res_679;
break; $this->pos = $pos_679;
} }
$res_679 = $result; $_680 = TRUE; break;
$pos_679 = $this->pos; }
$_678 = null; while(0);
do { if( $_680 === TRUE ) { return $this->finalise($result); }
if (( $subres = $this->whitespace() ) !== false) { if( $_680 === FALSE) { return FALSE; }
$result["text"] .= $subres;
}
if (( $subres = $this->literal('%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_678 = false;
break;
}
$_678 = true;
break;
} while (0);
if ($_678 === true) {
$result = $res_679;
$this->pos = $pos_679;
$_680 = false;
break;
}
if ($_678 === false) {
$result = $res_679;
$this->pos = $pos_679;
}
$_680 = true;
break;
} while (0);
if ($_680 === true) {
return $this->finalise($result);
}
if ($_680 === false) {
return false;
}
} }
@ -5648,45 +4236,33 @@ class SSTemplateParser extends Parser implements TemplateParser
/* MalformedBlock: MalformedOpenTag | MalformedCloseTag */ /* MalformedBlock: MalformedOpenTag | MalformedCloseTag */
protected $match_MalformedBlock_typestack = array('MalformedBlock'); protected $match_MalformedBlock_typestack = array('MalformedBlock');
function match_MalformedBlock($stack = array()) function match_MalformedBlock ($stack = array()) {
{ $matchrule = "MalformedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "MalformedBlock"; $_685 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_685 = null; $res_682 = $result;
do { $pos_682 = $this->pos;
$res_682 = $result; $matcher = 'match_'.'MalformedOpenTag'; $key = $matcher; $pos = $this->pos;
$pos_682 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'MalformedOpenTag'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_685 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_682;
$this->store($result, $subres); $this->pos = $pos_682;
$_685 = true; $matcher = 'match_'.'MalformedCloseTag'; $key = $matcher; $pos = $this->pos;
break; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
} if ($subres !== FALSE) {
$result = $res_682; $this->store( $result, $subres );
$this->pos = $pos_682; $_685 = TRUE; break;
$matcher = 'match_'.'MalformedCloseTag'; }
$key = $matcher; $result = $res_682;
$pos = $this->pos; $this->pos = $pos_682;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_685 = FALSE; break;
if ($subres !== false) { }
$this->store($result, $subres); while(0);
$_685 = true; if( $_685 === TRUE ) { return $this->finalise($result); }
break; if( $_685 === FALSE) { return FALSE; }
}
$result = $res_682;
$this->pos = $pos_682;
$_685 = false;
break;
} while (0);
if ($_685 === true) {
return $this->finalise($result);
}
if ($_685 === false) {
return false;
}
} }
@ -5694,74 +4270,53 @@ class SSTemplateParser extends Parser implements TemplateParser
/* Comment: "<%--" (!"--%>" /(?s)./)+ "--%>" */ /* Comment: "<%--" (!"--%>" /(?s)./)+ "--%>" */
protected $match_Comment_typestack = array('Comment'); protected $match_Comment_typestack = array('Comment');
function match_Comment($stack = array()) function match_Comment ($stack = array()) {
{ $matchrule = "Comment"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Comment"; $_693 = NULL;
$result = $this->construct($matchrule, $matchrule, null); do {
$_693 = null; if (( $subres = $this->literal( '<%--' ) ) !== FALSE) { $result["text"] .= $subres; }
do { else { $_693 = FALSE; break; }
if (( $subres = $this->literal('<%--') ) !== false) { $count = 0;
$result["text"] .= $subres; while (true) {
} else { $res_691 = $result;
$_693 = false; $pos_691 = $this->pos;
break; $_690 = NULL;
} do {
$count = 0; $res_688 = $result;
while (true) { $pos_688 = $this->pos;
$res_691 = $result; if (( $subres = $this->literal( '--%>' ) ) !== FALSE) {
$pos_691 = $this->pos; $result["text"] .= $subres;
$_690 = null; $result = $res_688;
do { $this->pos = $pos_688;
$res_688 = $result; $_690 = FALSE; break;
$pos_688 = $this->pos; }
if (( $subres = $this->literal('--%>') ) !== false) { else {
$result["text"] .= $subres; $result = $res_688;
$result = $res_688; $this->pos = $pos_688;
$this->pos = $pos_688; }
$_690 = false; if (( $subres = $this->rx( '/(?s)./' ) ) !== FALSE) { $result["text"] .= $subres; }
break; else { $_690 = FALSE; break; }
} else { $_690 = TRUE; break;
$result = $res_688; }
$this->pos = $pos_688; while(0);
} if( $_690 === FALSE) {
if (( $subres = $this->rx('/(?s)./') ) !== false) { $result = $res_691;
$result["text"] .= $subres; $this->pos = $pos_691;
} else { unset( $res_691 );
$_690 = false; unset( $pos_691 );
break; break;
} }
$_690 = true; $count += 1;
break; }
} while (0); if ($count > 0) { }
if ($_690 === false) { else { $_693 = FALSE; break; }
$result = $res_691; if (( $subres = $this->literal( '--%>' ) ) !== FALSE) { $result["text"] .= $subres; }
$this->pos = $pos_691; else { $_693 = FALSE; break; }
unset($res_691); $_693 = TRUE; break;
unset($pos_691); }
break; while(0);
} if( $_693 === TRUE ) { return $this->finalise($result); }
$count += 1; if( $_693 === FALSE) { return FALSE; }
}
if ($count > 0) {
} else {
$_693 = false;
break;
}
if (( $subres = $this->literal('--%>') ) !== false) {
$result["text"] .= $subres;
} else {
$_693 = false;
break;
}
$_693 = true;
break;
} while (0);
if ($_693 === true) {
return $this->finalise($result);
}
if ($_693 === false) {
return false;
}
} }
@ -5772,356 +4327,272 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/* TopTemplate: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | /* TopTemplate: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock |
OpenBlock | MalformedBlock | MismatchedEndBlock | Injection | Text)+ */ OpenBlock | MalformedBlock | MismatchedEndBlock | Injection | Text)+ */
protected $match_TopTemplate_typestack = array('TopTemplate','Template'); protected $match_TopTemplate_typestack = array('TopTemplate','Template');
function match_TopTemplate($stack = array()) function match_TopTemplate ($stack = array()) {
{ $matchrule = "TopTemplate"; $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'Template'));
$matchrule = "TopTemplate"; $count = 0;
$result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'Template')); while (true) {
$count = 0; $res_749 = $result;
while (true) { $pos_749 = $this->pos;
$res_749 = $result; $_748 = NULL;
$pos_749 = $this->pos; do {
$_748 = null; $_746 = NULL;
do { do {
$_746 = null; $res_695 = $result;
do { $pos_695 = $this->pos;
$res_695 = $result; $matcher = 'match_'.'Comment'; $key = $matcher; $pos = $this->pos;
$pos_695 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'Comment'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_746 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_695;
$this->store($result, $subres); $this->pos = $pos_695;
$_746 = true; $_744 = NULL;
break; do {
} $res_697 = $result;
$result = $res_695; $pos_697 = $this->pos;
$this->pos = $pos_695; $matcher = 'match_'.'Translate'; $key = $matcher; $pos = $this->pos;
$_744 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_697 = $result; $this->store( $result, $subres );
$pos_697 = $this->pos; $_744 = TRUE; break;
$matcher = 'match_'.'Translate'; }
$key = $matcher; $result = $res_697;
$pos = $this->pos; $this->pos = $pos_697;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_742 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_699 = $result;
$_744 = true; $pos_699 = $this->pos;
break; $matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_697; if ($subres !== FALSE) {
$this->pos = $pos_697; $this->store( $result, $subres );
$_742 = null; $_742 = TRUE; break;
do { }
$res_699 = $result; $result = $res_699;
$pos_699 = $this->pos; $this->pos = $pos_699;
$matcher = 'match_'.'If'; $_740 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_701 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_701 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_742 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_740 = TRUE; break;
$result = $res_699; }
$this->pos = $pos_699; $result = $res_701;
$_740 = null; $this->pos = $pos_701;
do { $_738 = NULL;
$res_701 = $result; do {
$pos_701 = $this->pos; $res_703 = $result;
$matcher = 'match_'.'Require'; $pos_703 = $this->pos;
$key = $matcher; $matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_738 = TRUE; break;
$_740 = true; }
break; $result = $res_703;
} $this->pos = $pos_703;
$result = $res_701; $_736 = NULL;
$this->pos = $pos_701; do {
$_738 = null; $res_705 = $result;
do { $pos_705 = $this->pos;
$res_703 = $result; $matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$pos_703 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'CacheBlock'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_736 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_705;
$this->store($result, $subres); $this->pos = $pos_705;
$_738 = true; $_734 = NULL;
break; do {
} $res_707 = $result;
$result = $res_703; $pos_707 = $this->pos;
$this->pos = $pos_703; $matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$_736 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_705 = $result; $this->store( $result, $subres );
$pos_705 = $this->pos; $_734 = TRUE; break;
$matcher = 'match_'.'UncachedBlock'; }
$key = $matcher; $result = $res_707;
$pos = $this->pos; $this->pos = $pos_707;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_732 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_709 = $result;
$_736 = true; $pos_709 = $this->pos;
break; $matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_705; if ($subres !== FALSE) {
$this->pos = $pos_705; $this->store( $result, $subres );
$_734 = null; $_732 = TRUE; break;
do { }
$res_707 = $result; $result = $res_709;
$pos_707 = $this->pos; $this->pos = $pos_709;
$matcher = 'match_'.'OldI18NTag'; $_730 = NULL;
$key = $matcher; do {
$pos = $this->pos; $res_711 = $result;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $pos_711 = $this->pos;
if ($subres !== false) { $matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$this->store($result, $subres); $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$_734 = true; if ($subres !== FALSE) {
break; $this->store( $result, $subres );
} $_730 = TRUE; break;
$result = $res_707; }
$this->pos = $pos_707; $result = $res_711;
$_732 = null; $this->pos = $pos_711;
do { $_728 = NULL;
$res_709 = $result; do {
$pos_709 = $this->pos; $res_713 = $result;
$matcher = 'match_'.'Include'; $pos_713 = $this->pos;
$key = $matcher; $matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$pos = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); if ($subres !== FALSE) {
if ($subres !== false) { $this->store( $result, $subres );
$this->store($result, $subres); $_728 = TRUE; break;
$_732 = true; }
break; $result = $res_713;
} $this->pos = $pos_713;
$result = $res_709; $_726 = NULL;
$this->pos = $pos_709; do {
$_730 = null; $res_715 = $result;
do { $pos_715 = $this->pos;
$res_711 = $result; $matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$pos_711 = $this->pos; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$matcher = 'match_'.'ClosedBlock'; if ($subres !== FALSE) {
$key = $matcher; $this->store( $result, $subres );
$pos = $this->pos; $_726 = TRUE; break;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); }
if ($subres !== false) { $result = $res_715;
$this->store($result, $subres); $this->pos = $pos_715;
$_730 = true; $_724 = NULL;
break; do {
} $res_717 = $result;
$result = $res_711; $pos_717 = $this->pos;
$this->pos = $pos_711; $matcher = 'match_'.'MismatchedEndBlock'; $key = $matcher; $pos = $this->pos;
$_728 = null; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
do { if ($subres !== FALSE) {
$res_713 = $result; $this->store( $result, $subres );
$pos_713 = $this->pos; $_724 = TRUE; break;
$matcher = 'match_'.'OpenBlock'; }
$key = $matcher; $result = $res_717;
$pos = $this->pos; $this->pos = $pos_717;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $_722 = NULL;
if ($subres !== false) { do {
$this->store($result, $subres); $res_719 = $result;
$_728 = true; $pos_719 = $this->pos;
break; $matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
} $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$result = $res_713; if ($subres !== FALSE) {
$this->pos = $pos_713; $this->store( $result, $subres );
$_726 = null; $_722 = TRUE; break;
do { }
$res_715 = $result; $result = $res_719;
$pos_715 = $this->pos; $this->pos = $pos_719;
$matcher = 'match_'.'MalformedBlock'; $matcher = 'match_'.'Text'; $key = $matcher; $pos = $this->pos;
$key = $matcher; $subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
$pos = $this->pos; if ($subres !== FALSE) {
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $this->store( $result, $subres );
if ($subres !== false) { $_722 = TRUE; break;
$this->store($result, $subres); }
$_726 = true; $result = $res_719;
break; $this->pos = $pos_719;
} $_722 = FALSE; break;
$result = $res_715; }
$this->pos = $pos_715; while(0);
$_724 = null; if( $_722 === TRUE ) {
do { $_724 = TRUE; break;
$res_717 = $result; }
$pos_717 = $this->pos; $result = $res_717;
$matcher = 'match_'.'MismatchedEndBlock'; $this->pos = $pos_717;
$key = $matcher; $_724 = FALSE; break;
$pos = $this->pos; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); while(0);
if ($subres !== false) { if( $_724 === TRUE ) { $_726 = TRUE; break; }
$this->store($result, $subres); $result = $res_715;
$_724 = true; $this->pos = $pos_715;
break; $_726 = FALSE; break;
} }
$result = $res_717; while(0);
$this->pos = $pos_717; if( $_726 === TRUE ) { $_728 = TRUE; break; }
$_722 = null; $result = $res_713;
do { $this->pos = $pos_713;
$res_719 = $result; $_728 = FALSE; break;
$pos_719 = $this->pos; }
$matcher = 'match_'.'Injection'; while(0);
$key = $matcher; if( $_728 === TRUE ) { $_730 = TRUE; break; }
$pos = $this->pos; $result = $res_711;
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $this->pos = $pos_711;
if ($subres !== false) { $_730 = FALSE; break;
$this->store($result, $subres); }
$_722 = true; while(0);
break; if( $_730 === TRUE ) { $_732 = TRUE; break; }
} $result = $res_709;
$result = $res_719; $this->pos = $pos_709;
$this->pos = $pos_719; $_732 = FALSE; break;
$matcher = 'match_'.'Text'; }
$key = $matcher; while(0);
$pos = $this->pos; if( $_732 === TRUE ) { $_734 = TRUE; break; }
$subres = ( $this->packhas($key, $pos) ? $this->packread($key, $pos) : $this->packwrite($key, $pos, $this->$matcher(array_merge($stack, array($result)))) ); $result = $res_707;
if ($subres !== false) { $this->pos = $pos_707;
$this->store($result, $subres); $_734 = FALSE; break;
$_722 = true; }
break; while(0);
} if( $_734 === TRUE ) { $_736 = TRUE; break; }
$result = $res_719; $result = $res_705;
$this->pos = $pos_719; $this->pos = $pos_705;
$_722 = false; $_736 = FALSE; break;
break; }
} while (0); while(0);
if ($_722 === true) { if( $_736 === TRUE ) { $_738 = TRUE; break; }
$_724 = true; $result = $res_703;
break; $this->pos = $pos_703;
} $_738 = FALSE; break;
$result = $res_717; }
$this->pos = $pos_717; while(0);
$_724 = false; if( $_738 === TRUE ) { $_740 = TRUE; break; }
break; $result = $res_701;
} while (0); $this->pos = $pos_701;
if ($_724 === true) { $_740 = FALSE; break;
$_726 = true; }
break; while(0);
} if( $_740 === TRUE ) { $_742 = TRUE; break; }
$result = $res_715; $result = $res_699;
$this->pos = $pos_715; $this->pos = $pos_699;
$_726 = false; $_742 = FALSE; break;
break; }
} while (0); while(0);
if ($_726 === true) { if( $_742 === TRUE ) { $_744 = TRUE; break; }
$_728 = true; $result = $res_697;
break; $this->pos = $pos_697;
} $_744 = FALSE; break;
$result = $res_713; }
$this->pos = $pos_713; while(0);
$_728 = false; if( $_744 === TRUE ) { $_746 = TRUE; break; }
break; $result = $res_695;
} while (0); $this->pos = $pos_695;
if ($_728 === true) { $_746 = FALSE; break;
$_730 = true; }
break; while(0);
} if( $_746 === FALSE) { $_748 = FALSE; break; }
$result = $res_711; $_748 = TRUE; break;
$this->pos = $pos_711; }
$_730 = false; while(0);
break; if( $_748 === FALSE) {
} while (0); $result = $res_749;
if ($_730 === true) { $this->pos = $pos_749;
$_732 = true; unset( $res_749 );
break; unset( $pos_749 );
} break;
$result = $res_709; }
$this->pos = $pos_709; $count += 1;
$_732 = false; }
break; if ($count > 0) { return $this->finalise($result); }
} while (0); else { return FALSE; }
if ($_732 === true) {
$_734 = true;
break;
}
$result = $res_707;
$this->pos = $pos_707;
$_734 = false;
break;
} while (0);
if ($_734 === true) {
$_736 = true;
break;
}
$result = $res_705;
$this->pos = $pos_705;
$_736 = false;
break;
} while (0);
if ($_736 === true) {
$_738 = true;
break;
}
$result = $res_703;
$this->pos = $pos_703;
$_738 = false;
break;
} while (0);
if ($_738 === true) {
$_740 = true;
break;
}
$result = $res_701;
$this->pos = $pos_701;
$_740 = false;
break;
} while (0);
if ($_740 === true) {
$_742 = true;
break;
}
$result = $res_699;
$this->pos = $pos_699;
$_742 = false;
break;
} while (0);
if ($_742 === true) {
$_744 = true;
break;
}
$result = $res_697;
$this->pos = $pos_697;
$_744 = false;
break;
} while (0);
if ($_744 === true) {
$_746 = true;
break;
}
$result = $res_695;
$this->pos = $pos_695;
$_746 = false;
break;
} while (0);
if ($_746 === false) {
$_748 = false;
break;
}
$_748 = true;
break;
} while (0);
if ($_748 === false) {
$result = $res_749;
$this->pos = $pos_749;
unset($res_749);
unset($pos_749);
break;
}
$count += 1;
}
if ($count > 0) {
return $this->finalise($result);
} else {
return false;
}
} }
@ -6136,261 +4607,213 @@ class SSTemplateParser extends Parser implements TemplateParser
} }
/* Text: ( /* Text: (
/ [^<${\\]+ / | / [^<${\\]+ / |
/ (\\.) / | / (\\.) / |
'<' !'%' | '<' !'%' |
'$' !(/[A-Za-z_]/) | '$' !(/[A-Za-z_]/) |
'{' !'$' | '{' !'$' |
'{$' !(/[A-Za-z_]/) '{$' !(/[A-Za-z_]/)
)+ */ )+ */
protected $match_Text_typestack = array('Text'); protected $match_Text_typestack = array('Text');
function match_Text($stack = array()) function match_Text ($stack = array()) {
{ $matchrule = "Text"; $result = $this->construct($matchrule, $matchrule, null);
$matchrule = "Text"; $count = 0;
$result = $this->construct($matchrule, $matchrule, null); while (true) {
$count = 0; $res_788 = $result;
while (true) { $pos_788 = $this->pos;
$res_788 = $result; $_787 = NULL;
$pos_788 = $this->pos; do {
$_787 = null; $_785 = NULL;
do { do {
$_785 = null; $res_750 = $result;
do { $pos_750 = $this->pos;
$res_750 = $result; if (( $subres = $this->rx( '/ [^<${\\\\]+ /' ) ) !== FALSE) {
$pos_750 = $this->pos; $result["text"] .= $subres;
if (( $subres = $this->rx('/ [^<${\\\\]+ /') ) !== false) { $_785 = TRUE; break;
$result["text"] .= $subres; }
$_785 = true; $result = $res_750;
break; $this->pos = $pos_750;
} $_783 = NULL;
$result = $res_750; do {
$this->pos = $pos_750; $res_752 = $result;
$_783 = null; $pos_752 = $this->pos;
do { if (( $subres = $this->rx( '/ (\\\\.) /' ) ) !== FALSE) {
$res_752 = $result; $result["text"] .= $subres;
$pos_752 = $this->pos; $_783 = TRUE; break;
if (( $subres = $this->rx('/ (\\\\.) /') ) !== false) { }
$result["text"] .= $subres; $result = $res_752;
$_783 = true; $this->pos = $pos_752;
break; $_781 = NULL;
} do {
$result = $res_752; $res_754 = $result;
$this->pos = $pos_752; $pos_754 = $this->pos;
$_781 = null; $_757 = NULL;
do { do {
$res_754 = $result; if (substr($this->string,$this->pos,1) == '<') {
$pos_754 = $this->pos; $this->pos += 1;
$_757 = null; $result["text"] .= '<';
do { }
if (substr($this->string, $this->pos, 1) == '<') { else { $_757 = FALSE; break; }
$this->pos += 1; $res_756 = $result;
$result["text"] .= '<'; $pos_756 = $this->pos;
} else { if (substr($this->string,$this->pos,1) == '%') {
$_757 = false; $this->pos += 1;
break; $result["text"] .= '%';
} $result = $res_756;
$res_756 = $result; $this->pos = $pos_756;
$pos_756 = $this->pos; $_757 = FALSE; break;
if (substr($this->string, $this->pos, 1) == '%') { }
$this->pos += 1; else {
$result["text"] .= '%'; $result = $res_756;
$result = $res_756; $this->pos = $pos_756;
$this->pos = $pos_756; }
$_757 = false; $_757 = TRUE; break;
break; }
} else { while(0);
$result = $res_756; if( $_757 === TRUE ) { $_781 = TRUE; break; }
$this->pos = $pos_756; $result = $res_754;
} $this->pos = $pos_754;
$_757 = true; $_779 = NULL;
break; do {
} while (0); $res_759 = $result;
if ($_757 === true) { $pos_759 = $this->pos;
$_781 = true; $_764 = NULL;
break; do {
} if (substr($this->string,$this->pos,1) == '$') {
$result = $res_754; $this->pos += 1;
$this->pos = $pos_754; $result["text"] .= '$';
$_779 = null; }
do { else { $_764 = FALSE; break; }
$res_759 = $result; $res_763 = $result;
$pos_759 = $this->pos; $pos_763 = $this->pos;
$_764 = null; $_762 = NULL;
do { do {
if (substr($this->string, $this->pos, 1) == '$') { if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) {
$this->pos += 1; $result["text"] .= $subres;
$result["text"] .= '$'; }
} else { else { $_762 = FALSE; break; }
$_764 = false; $_762 = TRUE; break;
break; }
} while(0);
$res_763 = $result; if( $_762 === TRUE ) {
$pos_763 = $this->pos; $result = $res_763;
$_762 = null; $this->pos = $pos_763;
do { $_764 = FALSE; break;
if (( $subres = $this->rx('/[A-Za-z_]/') ) !== false) { }
$result["text"] .= $subres; if( $_762 === FALSE) {
} else { $result = $res_763;
$_762 = false; $this->pos = $pos_763;
break; }
} $_764 = TRUE; break;
$_762 = true; }
break; while(0);
} while (0); if( $_764 === TRUE ) { $_779 = TRUE; break; }
if ($_762 === true) { $result = $res_759;
$result = $res_763; $this->pos = $pos_759;
$this->pos = $pos_763; $_777 = NULL;
$_764 = false; do {
break; $res_766 = $result;
} $pos_766 = $this->pos;
if ($_762 === false) { $_769 = NULL;
$result = $res_763; do {
$this->pos = $pos_763; if (substr($this->string,$this->pos,1) == '{') {
} $this->pos += 1;
$_764 = true; $result["text"] .= '{';
break; }
} while (0); else { $_769 = FALSE; break; }
if ($_764 === true) { $res_768 = $result;
$_779 = true; $pos_768 = $this->pos;
break; if (substr($this->string,$this->pos,1) == '$') {
} $this->pos += 1;
$result = $res_759; $result["text"] .= '$';
$this->pos = $pos_759; $result = $res_768;
$_777 = null; $this->pos = $pos_768;
do { $_769 = FALSE; break;
$res_766 = $result; }
$pos_766 = $this->pos; else {
$_769 = null; $result = $res_768;
do { $this->pos = $pos_768;
if (substr($this->string, $this->pos, 1) == '{') { }
$this->pos += 1; $_769 = TRUE; break;
$result["text"] .= '{'; }
} else { while(0);
$_769 = false; if( $_769 === TRUE ) { $_777 = TRUE; break; }
break; $result = $res_766;
} $this->pos = $pos_766;
$res_768 = $result; $_775 = NULL;
$pos_768 = $this->pos; do {
if (substr($this->string, $this->pos, 1) == '$') { if (( $subres = $this->literal( '{$' ) ) !== FALSE) {
$this->pos += 1; $result["text"] .= $subres;
$result["text"] .= '$'; }
$result = $res_768; else { $_775 = FALSE; break; }
$this->pos = $pos_768; $res_774 = $result;
$_769 = false; $pos_774 = $this->pos;
break; $_773 = NULL;
} else { do {
$result = $res_768; if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) {
$this->pos = $pos_768; $result["text"] .= $subres;
} }
$_769 = true; else { $_773 = FALSE; break; }
break; $_773 = TRUE; break;
} while (0); }
if ($_769 === true) { while(0);
$_777 = true; if( $_773 === TRUE ) {
break; $result = $res_774;
} $this->pos = $pos_774;
$result = $res_766; $_775 = FALSE; break;
$this->pos = $pos_766; }
$_775 = null; if( $_773 === FALSE) {
do { $result = $res_774;
if (( $subres = $this->literal('{$') ) !== false) { $this->pos = $pos_774;
$result["text"] .= $subres; }
} else { $_775 = TRUE; break;
$_775 = false; }
break; while(0);
} if( $_775 === TRUE ) { $_777 = TRUE; break; }
$res_774 = $result; $result = $res_766;
$pos_774 = $this->pos; $this->pos = $pos_766;
$_773 = null; $_777 = FALSE; break;
do { }
if (( $subres = $this->rx('/[A-Za-z_]/') ) !== false) { while(0);
$result["text"] .= $subres; if( $_777 === TRUE ) { $_779 = TRUE; break; }
} else { $result = $res_759;
$_773 = false; $this->pos = $pos_759;
break; $_779 = FALSE; break;
} }
$_773 = true; while(0);
break; if( $_779 === TRUE ) { $_781 = TRUE; break; }
} while (0); $result = $res_754;
if ($_773 === true) { $this->pos = $pos_754;
$result = $res_774; $_781 = FALSE; break;
$this->pos = $pos_774; }
$_775 = false; while(0);
break; if( $_781 === TRUE ) { $_783 = TRUE; break; }
} $result = $res_752;
if ($_773 === false) { $this->pos = $pos_752;
$result = $res_774; $_783 = FALSE; break;
$this->pos = $pos_774; }
} while(0);
$_775 = true; if( $_783 === TRUE ) { $_785 = TRUE; break; }
break; $result = $res_750;
} while (0); $this->pos = $pos_750;
if ($_775 === true) { $_785 = FALSE; break;
$_777 = true; }
break; while(0);
} if( $_785 === FALSE) { $_787 = FALSE; break; }
$result = $res_766; $_787 = TRUE; break;
$this->pos = $pos_766; }
$_777 = false; while(0);
break; if( $_787 === FALSE) {
} while (0); $result = $res_788;
if ($_777 === true) { $this->pos = $pos_788;
$_779 = true; unset( $res_788 );
break; unset( $pos_788 );
} break;
$result = $res_759; }
$this->pos = $pos_759; $count += 1;
$_779 = false; }
break; if ($count > 0) { return $this->finalise($result); }
} while (0); else { return FALSE; }
if ($_779 === true) {
$_781 = true;
break;
}
$result = $res_754;
$this->pos = $pos_754;
$_781 = false;
break;
} while (0);
if ($_781 === true) {
$_783 = true;
break;
}
$result = $res_752;
$this->pos = $pos_752;
$_783 = false;
break;
} while (0);
if ($_783 === true) {
$_785 = true;
break;
}
$result = $res_750;
$this->pos = $pos_750;
$_785 = false;
break;
} while (0);
if ($_785 === false) {
$_787 = false;
break;
}
$_787 = true;
break;
} while (0);
if ($_787 === false) {
$result = $res_788;
$this->pos = $pos_788;
unset($res_788);
unset($pos_788);
break;
}
$count += 1;
}
if ($count > 0) {
return $this->finalise($result);
} else {
return false;
}
} }
@ -6411,8 +4834,8 @@ class SSTemplateParser extends Parser implements TemplateParser
// non-dynamically calculated // non-dynamically calculated
$code = <<<'EOC' $code = <<<'EOC'
(\SilverStripe\View\SSViewer::config()->get('rewrite_hash_links') (\SilverStripe\View\SSViewer::config()->get('rewrite_hash_links')
? \SilverStripe\Core\Convert::raw2att( preg_replace("/^(\\/)+/", "/", $_SERVER['REQUEST_URI'] ) ) ? \SilverStripe\Core\Convert::raw2att( preg_replace("/^(\\/)+/", "/", $_SERVER['REQUEST_URI'] ) )
: "") : "")
EOC; EOC;
// Because preg_replace replacement requires escaped slashes, addcslashes here // Because preg_replace replacement requires escaped slashes, addcslashes here
$text = preg_replace( $text = preg_replace(
@ -6425,8 +4848,8 @@ EOC;
} }
/****************** /******************
* Here ends the parser itself. Below are utility methods to use the parser * Here ends the parser itself. Below are utility methods to use the parser
*/ */
/** /**
* Compiles some passed template source code into the php code that will execute as per the template source. * Compiles some passed template source code into the php code that will execute as per the template source.

View File

@ -86,6 +86,7 @@ PHP;
<%t i18nTestModule.INJECTIONS_3 name="Cat" greeting='meow' goodbye="meow" %> <%t i18nTestModule.INJECTIONS_3 name="Cat" greeting='meow' goodbye="meow" %>
<%t i18nTestModule.INJECTIONS_4 name=\$absoluteBaseURL greeting=\$get_locale goodbye="global calls" %> <%t i18nTestModule.INJECTIONS_4 name=\$absoluteBaseURL greeting=\$get_locale goodbye="global calls" %>
<%t i18nTestModule.INJECTIONS_9 "An item|{count} items" is "Test Pluralisation" count=4 %> <%t i18nTestModule.INJECTIONS_9 "An item|{count} items" is "Test Pluralisation" count=4 %>
<%t SilverStripe\TestModule\i18nTestModule.INJECTIONS_10 "This string is namespaced" %>
SS; SS;
$c->collectFromTemplate($html, null, $mymodule); $c->collectFromTemplate($html, null, $mymodule);
@ -104,6 +105,7 @@ SS;
'other' => '{count} items', 'other' => '{count} items',
'comment' => 'Test Pluralisation' 'comment' => 'Test Pluralisation'
], ],
'SilverStripe\\TestModule\\i18nTestModule.INJECTIONS_10' => 'This string is namespaced'
], ],
$c->collectFromTemplate($html, null, $mymodule) $c->collectFromTemplate($html, null, $mymodule)
); );