diff --git a/.travis.yml b/.travis.yml index becf14dc9..f85f61c28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,6 +79,9 @@ script: - 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 [[ $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: - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi diff --git a/composer.json b/composer.json index 40b443717..402c5ea9c 100644 --- a/composer.json +++ b/composer.json @@ -72,7 +72,8 @@ "thirdparty/" ], "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", "prefer-stable": true diff --git a/src/View/SSTemplateParser.peg b/src/View/SSTemplateParser.peg index 5d1240758..22294b7cd 100644 --- a/src/View/SSTemplateParser.peg +++ b/src/View/SSTemplateParser.peg @@ -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 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 TODO: - Template comments - <%-- --%> - $Iteration - Partial cache blocks - i18n - we dont support then deprecated _t() or sprintf(_t()) methods; or the new <% t %> block yet - Add with and loop blocks - Add Up and Top - More error detection? + Template comments - <%-- --%> + $Iteration + Partial cache blocks + i18n - we dont support then deprecated _t() or sprintf(_t()) methods; or the new <% t %> block yet + Add with and loop blocks + Add Up and Top + More error detection? This comment will not appear in the output */ @@ -211,13 +211,13 @@ class SSTemplateParser extends Parser implements TemplateParser /*!* SSTemplateParser - # 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. - # Any new template elements need to be included in this list, if they are to work. + # 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. + # 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 | - OpenBlock | MalformedBlock | Injection | Text)+ - */ + Template: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | + OpenBlock | MalformedBlock | Injection | Text)+ + */ function Template_STR(&$res, $sub) { $res['php'] .= $sub['php'] . PHP_EOL ; @@ -225,16 +225,16 @@ class SSTemplateParser extends Parser implements TemplateParser /*!* - Word: / [A-Za-z_] [A-Za-z0-9_]* / - NamespacedWord: / [A-Za-z_\/\\] [A-Za-z0-9_\/\\]* / - Number: / [0-9]+ / - Value: / [A-Za-z0-9_]+ / + Word: / [A-Za-z_] [A-Za-z0-9_]* / + NamespacedWord: / [A-Za-z_\/\\] [A-Za-z0-9_\/\\]* / + Number: / [0-9]+ / + Value: / [A-Za-z0-9_]+ / - # 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 + # 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 - 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 @@ -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 - # arguments are passed + # Call is a php-style function call, e.g. Method(Argument, ...). Unlike PHP, the brackets are optional if no + # 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 "." - # 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 + # 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 + # sorts of values, which require a different final method to be called to get the right return value - LookupStep: :Call &"." - LastLookupStep: :Call + LookupStep: :Call &"." + LastLookupStep: :Call - Lookup: LookupStep ("." LookupStep)* "." LastLookupStep | LastLookupStep - */ + Lookup: LookupStep ("." LookupStep)* "." LastLookupStep | LastLookupStep + */ function Lookup__construct(&$res) { @@ -304,15 +304,15 @@ class SSTemplateParser extends Parser implements TemplateParser /*!* - # New Translatable Syntax - # <%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) + # New Translatable Syntax + # <%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) - Translate: "<%t" < Entity < (Default:QuotedString)? < (!("is" "=") < "is" < Context:QuotedString)? < - (InjectionVariables)? > "%>" - InjectionVariables: (< InjectionName:Word "=" Argument)+ - Entity: / [A-Za-z_] [\w\.]* / - */ + Translate: "<%t" < Entity < (Default:QuotedString)? < (!("is" "=") < "is" < Context:QuotedString)? < + (InjectionVariables)? > "%>" + InjectionVariables: (< InjectionName:Word "=" Argument)+ + Entity: / [A-Za-z_\\] [\w\.\\]* / + */ 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 - # just do $Foo, or {$Foo} if the surrounding text would cause a problem (e.g. {$Foo}Bar) + # 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) - SimpleInjection: '$' :Lookup - BracketInjection: '{$' :Lookup "}" - Injection: BracketInjection | SimpleInjection - */ + SimpleInjection: '$' :Lookup + BracketInjection: '{$' :Lookup "}" + Injection: BracketInjection | SimpleInjection + */ function Injection_STR(&$res, $sub) { $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 - # 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) + # 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, + # but that depends on where it's used, a la 2.4) - DollarMarkedLookup: SimpleInjection - */ + DollarMarkedLookup: SimpleInjection + */ function DollarMarkedLookup_STR(&$res, $sub) { $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, - # 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 + # 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 + # 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 - # 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 - # character which, in some context, would indicate the end of a free string, regardless of if we're actually in - # that context or not + # 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 + # 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 + # that context or not - FreeString: /[^,)%!=><|&]+/ + FreeString: /[^,)%!=><|&]+/ - # 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 + # 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 - Argument: - :DollarMarkedLookup | - :QuotedString | - :Lookup !(< FreeString)| - :FreeString - */ + Argument: + :DollarMarkedLookup | + :QuotedString | + :Lookup !(< FreeString)| + :FreeString + */ /** * 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) { 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', - # 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 + # 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) + # this falls back to simple truthiness check - PresenceCheck: (Not:'not' <)? Argument - */ + PresenceCheck: (Not:'not' <)? Argument + */ function PresenceCheck_Not(&$res, $sub) { $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 - # operators + # if and else_if arguments are a series of presence checks and comparisons, optionally seperated by boolean + # operators - IfArgumentPortion: Comparison | PresenceCheck - */ + IfArgumentPortion: Comparison | PresenceCheck + */ function IfArgumentPortion_STR(&$res, $sub) { $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 - # supported + # if and else_if arguments can be combined via these two boolean operators. No precendence overriding is + # 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) { $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 - # 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 + # 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 + # argument structure to every other block - IfPart: '<%' < 'if' [ :IfArgument > '%>' Template:$TemplateMatcher? - ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher? - ElsePart: '<%' < 'else' > '%>' Template:$TemplateMatcher? + IfPart: '<%' < 'if' [ :IfArgument > '%>' Template:$TemplateMatcher? + ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher? + ElsePart: '<%' < 'else' > '%>' Template:$TemplateMatcher? - If: IfPart ElseIfPart* ElsePart? '<%' < 'end_if' > '%>' - */ + If: IfPart ElseIfPart* ElsePart? '<%' < 'end_if' > '%>' + */ function If_IfPart(&$res, $sub) { $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 - # - must have one call style argument, must pass arguments to that call style argument + # 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 - Require: '<%' < 'require' [ Call:(Method:Word "(" < :CallArguments > ")") > '%>' - */ + Require: '<%' < 'require' [ Call:(Method:Word "(" < :CallArguments > ")") > '%>' + */ function Require_Call(&$res, $sub) { $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: - !( "if " | "unless " ) - ( - :DollarMarkedLookup | - :QuotedString | - :Lookup - ) - */ + CacheBlockArgument: + !( "if " | "unless " ) + ( + :DollarMarkedLookup | + :QuotedString | + :Lookup + ) + */ function CacheBlockArgument_DollarMarkedLookup(&$res, $sub) { $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) { 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: - '<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>' - Template:$TemplateMatcher? - '<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>' - */ + UncachedBlock: + '<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>' + Template:$TemplateMatcher? + '<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>' + */ function UncachedBlock_Template(&$res, $sub) { $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) { 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: - '<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") > - Condition:IfArgument )? > '%>' - (CacheBlock | UncachedBlock | CacheBlockTemplate)* - '<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>' + CacheBlock: + '<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") > + Condition:IfArgument )? > '%>' + (CacheBlock | UncachedBlock | CacheBlockTemplate)* + '<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>' - */ + */ function CacheBlock__construct(&$res) { $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 - # to, but just because it's easier to do so. It's strongly recommended to use the new syntax + # 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 - # 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 - N: / [\s\n]* / - */ + # whitespace with a newline + N: / [\s\n]* / + */ function OldTPart__construct(&$res) { $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) { $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) { $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 - # php, this rule combines all the old i18n stuff into a single match rule to make it easy to not support these - # tags later + # 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 + # tags later - OldI18NTag: OldSprintfTag | OldTTag + OldI18NTag: OldSprintfTag | OldTTag - */ + */ function OldI18NTag_STR(&$res, $sub) { $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) { $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) { $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, - # 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 - # for pulling out the info required + # 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 + # 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 - BlockArguments: :Argument ( < "," < :Argument)* + BlockArguments: :Argument ( < "," < :Argument)* - # 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 + # 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 - 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 - # template + # Match against closed blocks - blocks with an opening and a closing tag that surround some internal portion of + # template - ClosedBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > Zap:'%>' Template:$TemplateMatcher? - '<%' < 'end_' '$BlockName' > '%>' - */ + ClosedBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > Zap:'%>' Template:$TemplateMatcher? + '<%' < 'end_' '$BlockName' > '%>' + */ /** * 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 - # are which - closed is tried first, and if no matching end tag is found, open is tried next + # 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 - OpenBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > '%>' - */ + OpenBlock: '<%' < !NotBlockTag BlockName:Word ( [ :BlockArguments ] )? > '%>' + */ function OpenBlock__construct(&$res) { $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) - # 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 + # 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 + # closing tags are detected as an invalid open tag - MismatchedEndBlock: '<%' < 'end_' :Word > '%>' - */ + MismatchedEndBlock: '<%' < 'end_' :Word > '%>' + */ function MismatchedEndBlock__finalise(&$res) { $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 - # the tag is not structured properly + # 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 - MalformedOpenTag: '<%' < !NotBlockTag Tag:Word !( ( [ :BlockArguments ] )? > '%>' ) - */ + MalformedOpenTag: '<%' < !NotBlockTag Tag:Word !( ( [ :BlockArguments ] )? > '%>' ) + */ function MalformedOpenTag__finalise(&$res) { $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 - # the tag is not structured properly + # 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 - MalformedCloseTag: '<%' < Tag:('end_' :Word ) !( > '%>' ) - */ + MalformedCloseTag: '<%' < Tag:('end_' :Word ) !( > '%>' ) + */ function MalformedCloseTag__finalise(&$res) { $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) { $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 - # MismatchedEndBlock detection, which only works at the top level + # 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 - 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 @@ -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: ( - # Any set of characters that aren't potentially a control mark or an escaped character - / [^<${\\]+ / | - # An escaped character - / (\\.) / | - # A '<' that isn't the start of a block tag - '<' !'%' | - # A '$' that isn't the start of an injection - '$' !(/[A-Za-z_]/) | - # A '{' that isn't the start of an injection - '{' !'$' | - # A '{$' that isn't the start of an injection - '{$' !(/[A-Za-z_]/) - )+ - */ + Text: ( + # Any set of characters that aren't potentially a control mark or an escaped character + / [^<${\\]+ / | + # An escaped character + / (\\.) / | + # A '<' that isn't the start of a block tag + '<' !'%' | + # A '$' that isn't the start of an injection + '$' !(/[A-Za-z_]/) | + # A '{' that isn't the start of an injection + '{' !'$' | + # A '{$' that isn't the start of an injection + '{$' !(/[A-Za-z_]/) + )+ + */ /** * We convert text @@ -1213,8 +1213,8 @@ class SSTemplateParser extends Parser implements TemplateParser // non-dynamically calculated $code = <<<'EOC' (\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; // Because preg_replace replacement requires escaped slashes, addcslashes here $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. diff --git a/src/View/SSTemplateParser.php b/src/View/SSTemplateParser.php index ff96843a4..9859aedbe 100644 --- a/src/View/SSTemplateParser.php +++ b/src/View/SSTemplateParser.php @@ -189,332 +189,252 @@ class SSTemplateParser extends Parser implements TemplateParser } /* Template: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | - OpenBlock | MalformedBlock | Injection | Text)+ */ + OpenBlock | MalformedBlock | Injection | Text)+ */ protected $match_Template_typestack = array('Template'); - function match_Template($stack = array()) - { - $matchrule = "Template"; - $result = $this->construct($matchrule, $matchrule, null); - $count = 0; - while (true) { - $res_50 = $result; - $pos_50 = $this->pos; - $_49 = null; - do { - $_47 = null; - do { - $res_0 = $result; - $pos_0 = $this->pos; - $matcher = 'match_'.'Comment'; - $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); - $_47 = true; - break; - } - $result = $res_0; - $this->pos = $pos_0; - $_45 = null; - do { - $res_2 = $result; - $pos_2 = $this->pos; - $matcher = 'match_'.'Translate'; - $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); - $_45 = true; - break; - } - $result = $res_2; - $this->pos = $pos_2; - $_43 = null; - do { - $res_4 = $result; - $pos_4 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_43 = true; - break; - } - $result = $res_4; - $this->pos = $pos_4; - $_41 = null; - do { - $res_6 = $result; - $pos_6 = $this->pos; - $matcher = 'match_'.'Require'; - $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); - $_41 = true; - break; - } - $result = $res_6; - $this->pos = $pos_6; - $_39 = null; - do { - $res_8 = $result; - $pos_8 = $this->pos; - $matcher = 'match_'.'CacheBlock'; - $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); - $_39 = true; - break; - } - $result = $res_8; - $this->pos = $pos_8; - $_37 = null; - do { - $res_10 = $result; - $pos_10 = $this->pos; - $matcher = 'match_'.'UncachedBlock'; - $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); - $_37 = true; - break; - } - $result = $res_10; - $this->pos = $pos_10; - $_35 = null; - do { - $res_12 = $result; - $pos_12 = $this->pos; - $matcher = 'match_'.'OldI18NTag'; - $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); - $_35 = true; - break; - } - $result = $res_12; - $this->pos = $pos_12; - $_33 = null; - do { - $res_14 = $result; - $pos_14 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_33 = true; - break; - } - $result = $res_14; - $this->pos = $pos_14; - $_31 = null; - do { - $res_16 = $result; - $pos_16 = $this->pos; - $matcher = 'match_'.'ClosedBlock'; - $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); - $_31 = true; - break; - } - $result = $res_16; - $this->pos = $pos_16; - $_29 = null; - do { - $res_18 = $result; - $pos_18 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_29 = true; - break; - } - $result = $res_18; - $this->pos = $pos_18; - $_27 = null; - do { - $res_20 = $result; - $pos_20 = $this->pos; - $matcher = 'match_'.'MalformedBlock'; - $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); - $_27 = true; - break; - } - $result = $res_20; - $this->pos = $pos_20; - $_25 = null; - do { - $res_22 = $result; - $pos_22 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_25 = true; - break; - } - $result = $res_22; - $this->pos = $pos_22; - $matcher = 'match_'.'Text'; - $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); - $_25 = true; - break; - } - $result = $res_22; - $this->pos = $pos_22; - $_25 = false; - break; - } while (0); - if ($_25 === true) { - $_27 = true; - break; - } - $result = $res_20; - $this->pos = $pos_20; - $_27 = false; - break; - } while (0); - if ($_27 === true) { - $_29 = true; - break; - } - $result = $res_18; - $this->pos = $pos_18; - $_29 = false; - break; - } while (0); - if ($_29 === true) { - $_31 = true; - break; - } - $result = $res_16; - $this->pos = $pos_16; - $_31 = false; - break; - } while (0); - if ($_31 === true) { - $_33 = true; - break; - } - $result = $res_14; - $this->pos = $pos_14; - $_33 = false; - break; - } while (0); - if ($_33 === true) { - $_35 = true; - break; - } - $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; - } + function match_Template ($stack = array()) { + $matchrule = "Template"; $result = $this->construct($matchrule, $matchrule, null); + $count = 0; + while (true) { + $res_50 = $result; + $pos_50 = $this->pos; + $_49 = NULL; + do { + $_47 = NULL; + do { + $res_0 = $result; + $pos_0 = $this->pos; + $matcher = 'match_'.'Comment'; $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 ); + $_47 = TRUE; break; + } + $result = $res_0; + $this->pos = $pos_0; + $_45 = NULL; + do { + $res_2 = $result; + $pos_2 = $this->pos; + $matcher = 'match_'.'Translate'; $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 ); + $_45 = TRUE; break; + } + $result = $res_2; + $this->pos = $pos_2; + $_43 = NULL; + do { + $res_4 = $result; + $pos_4 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_43 = TRUE; break; + } + $result = $res_4; + $this->pos = $pos_4; + $_41 = NULL; + do { + $res_6 = $result; + $pos_6 = $this->pos; + $matcher = 'match_'.'Require'; $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 ); + $_41 = TRUE; break; + } + $result = $res_6; + $this->pos = $pos_6; + $_39 = NULL; + do { + $res_8 = $result; + $pos_8 = $this->pos; + $matcher = 'match_'.'CacheBlock'; $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 ); + $_39 = TRUE; break; + } + $result = $res_8; + $this->pos = $pos_8; + $_37 = NULL; + do { + $res_10 = $result; + $pos_10 = $this->pos; + $matcher = 'match_'.'UncachedBlock'; $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 ); + $_37 = TRUE; break; + } + $result = $res_10; + $this->pos = $pos_10; + $_35 = NULL; + do { + $res_12 = $result; + $pos_12 = $this->pos; + $matcher = 'match_'.'OldI18NTag'; $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 ); + $_35 = TRUE; break; + } + $result = $res_12; + $this->pos = $pos_12; + $_33 = NULL; + do { + $res_14 = $result; + $pos_14 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_33 = TRUE; break; + } + $result = $res_14; + $this->pos = $pos_14; + $_31 = NULL; + do { + $res_16 = $result; + $pos_16 = $this->pos; + $matcher = 'match_'.'ClosedBlock'; $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 ); + $_31 = TRUE; break; + } + $result = $res_16; + $this->pos = $pos_16; + $_29 = NULL; + do { + $res_18 = $result; + $pos_18 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_29 = TRUE; break; + } + $result = $res_18; + $this->pos = $pos_18; + $_27 = NULL; + do { + $res_20 = $result; + $pos_20 = $this->pos; + $matcher = 'match_'.'MalformedBlock'; $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 ); + $_27 = TRUE; break; + } + $result = $res_20; + $this->pos = $pos_20; + $_25 = NULL; + do { + $res_22 = $result; + $pos_22 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_25 = TRUE; break; + } + $result = $res_22; + $this->pos = $pos_22; + $matcher = 'match_'.'Text'; $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 ); + $_25 = TRUE; break; + } + $result = $res_22; + $this->pos = $pos_22; + $_25 = FALSE; break; + } + while(0); + if( $_25 === TRUE ) { $_27 = TRUE; break; } + $result = $res_20; + $this->pos = $pos_20; + $_27 = FALSE; break; + } + while(0); + if( $_27 === TRUE ) { $_29 = TRUE; break; } + $result = $res_18; + $this->pos = $pos_18; + $_29 = FALSE; break; + } + while(0); + if( $_29 === TRUE ) { $_31 = TRUE; break; } + $result = $res_16; + $this->pos = $pos_16; + $_31 = FALSE; break; + } + while(0); + if( $_31 === TRUE ) { $_33 = TRUE; break; } + $result = $res_14; + $this->pos = $pos_14; + $_33 = FALSE; break; + } + while(0); + if( $_33 === TRUE ) { $_35 = TRUE; break; } + $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_]* / */ protected $match_Word_typestack = array('Word'); - function match_Word($stack = array()) - { - $matchrule = "Word"; - $result = $this->construct($matchrule, $matchrule, null); - if (( $subres = $this->rx('/ [A-Za-z_] [A-Za-z0-9_]* /') ) !== false) { - $result["text"] .= $subres; - return $this->finalise($result); - } else { - return false; - } + function match_Word ($stack = array()) { + $matchrule = "Word"; $result = $this->construct($matchrule, $matchrule, null); + if (( $subres = $this->rx( '/ [A-Za-z_] [A-Za-z0-9_]* /' ) ) !== FALSE) { + $result["text"] .= $subres; + return $this->finalise($result); + } + else { return FALSE; } } /* NamespacedWord: / [A-Za-z_\/\\] [A-Za-z0-9_\/\\]* / */ protected $match_NamespacedWord_typestack = array('NamespacedWord'); - function match_NamespacedWord($stack = array()) - { - $matchrule = "NamespacedWord"; - $result = $this->construct($matchrule, $matchrule, null); - if (( $subres = $this->rx('/ [A-Za-z_\/\\\\] [A-Za-z0-9_\/\\\\]* /') ) !== false) { - $result["text"] .= $subres; - return $this->finalise($result); - } else { - return false; - } + function match_NamespacedWord ($stack = array()) { + $matchrule = "NamespacedWord"; $result = $this->construct($matchrule, $matchrule, null); + if (( $subres = $this->rx( '/ [A-Za-z_\/\\\\] [A-Za-z0-9_\/\\\\]* /' ) ) !== FALSE) { + $result["text"] .= $subres; + return $this->finalise($result); + } + else { return FALSE; } } /* Number: / [0-9]+ / */ protected $match_Number_typestack = array('Number'); - function match_Number($stack = array()) - { - $matchrule = "Number"; - $result = $this->construct($matchrule, $matchrule, null); - if (( $subres = $this->rx('/ [0-9]+ /') ) !== false) { - $result["text"] .= $subres; - return $this->finalise($result); - } else { - return false; - } + function match_Number ($stack = array()) { + $matchrule = "Number"; $result = $this->construct($matchrule, $matchrule, null); + if (( $subres = $this->rx( '/ [0-9]+ /' ) ) !== FALSE) { + $result["text"] .= $subres; + return $this->finalise($result); + } + else { return FALSE; } } /* Value: / [A-Za-z0-9_]+ / */ protected $match_Value_typestack = array('Value'); - function match_Value($stack = array()) - { - $matchrule = "Value"; - $result = $this->construct($matchrule, $matchrule, null); - if (( $subres = $this->rx('/ [A-Za-z0-9_]+ /') ) !== false) { - $result["text"] .= $subres; - return $this->finalise($result); - } else { - return false; - } + function match_Value ($stack = array()) { + $matchrule = "Value"; $result = $this->construct($matchrule, $matchrule, null); + if (( $subres = $this->rx( '/ [A-Za-z0-9_]+ /' ) ) !== FALSE) { + $result["text"] .= $subres; + return $this->finalise($result); + } + else { return FALSE; } } /* CallArguments: :Argument ( < "," < :Argument )* */ protected $match_CallArguments_typestack = array('CallArguments'); - function match_CallArguments($stack = array()) - { - $matchrule = "CallArguments"; - $result = $this->construct($matchrule, $matchrule, null); - $_62 = null; - do { - $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, "Argument"); - } else { - $_62 = false; - break; - } - while (true) { - $res_61 = $result; - $pos_61 = $this->pos; - $_60 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (substr($this->string, $this->pos, 1) == ',') { - $this->pos += 1; - $result["text"] .= ','; - } else { - $_60 = false; - break; - } - 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, "Argument"); - } else { - $_60 = false; - break; - } - $_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; - } + function match_CallArguments ($stack = array()) { + $matchrule = "CallArguments"; $result = $this->construct($matchrule, $matchrule, null); + $_62 = NULL; + do { + $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, "Argument" ); + } + else { $_62 = FALSE; break; } + while (true) { + $res_61 = $result; + $pos_61 = $this->pos; + $_60 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (substr($this->string,$this->pos,1) == ',') { + $this->pos += 1; + $result["text"] .= ','; + } + else { $_60 = FALSE; break; } + 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, "Argument" ); + } + else { $_60 = FALSE; break; } + $_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? > ")" )? */ protected $match_Call_typestack = array('Call'); - function match_Call($stack = array()) - { - $matchrule = "Call"; - $result = $this->construct($matchrule, $matchrule, null); - $_72 = null; - do { - $matcher = 'match_'.'Word'; - $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, "Method"); - } else { - $_72 = false; - break; - } - $res_71 = $result; - $pos_71 = $this->pos; - $_70 = null; - do { - if (substr($this->string, $this->pos, 1) == '(') { - $this->pos += 1; - $result["text"] .= '('; - } else { - $_70 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_67 = $result; - $pos_67 = $this->pos; - $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, "CallArguments"); - } else { - $result = $res_67; - $this->pos = $pos_67; - unset($res_67); - unset($pos_67); - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (substr($this->string, $this->pos, 1) == ')') { - $this->pos += 1; - $result["text"] .= ')'; - } else { - $_70 = false; - break; - } - $_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; - } + function match_Call ($stack = array()) { + $matchrule = "Call"; $result = $this->construct($matchrule, $matchrule, null); + $_72 = NULL; + do { + $matcher = 'match_'.'Word'; $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, "Method" ); + } + else { $_72 = FALSE; break; } + $res_71 = $result; + $pos_71 = $this->pos; + $_70 = NULL; + do { + if (substr($this->string,$this->pos,1) == '(') { + $this->pos += 1; + $result["text"] .= '('; + } + else { $_70 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_67 = $result; + $pos_67 = $this->pos; + $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, "CallArguments" ); + } + else { + $result = $res_67; + $this->pos = $pos_67; + unset( $res_67 ); + unset( $pos_67 ); + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (substr($this->string,$this->pos,1) == ')') { + $this->pos += 1; + $result["text"] .= ')'; + } + else { $_70 = FALSE; break; } + $_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 &"." */ protected $match_LookupStep_typestack = array('LookupStep'); - function match_LookupStep($stack = array()) - { - $matchrule = "LookupStep"; - $result = $this->construct($matchrule, $matchrule, null); - $_76 = null; - do { - $matcher = 'match_'.'Call'; - $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, "Call"); - } else { - $_76 = false; - break; - } - $res_75 = $result; - $pos_75 = $this->pos; - if (substr($this->string, $this->pos, 1) == '.') { - $this->pos += 1; - $result["text"] .= '.'; - $result = $res_75; - $this->pos = $pos_75; - } else { - $result = $res_75; - $this->pos = $pos_75; - $_76 = false; - break; - } - $_76 = true; - break; - } while (0); - if ($_76 === true) { - return $this->finalise($result); - } - if ($_76 === false) { - return false; - } + function match_LookupStep ($stack = array()) { + $matchrule = "LookupStep"; $result = $this->construct($matchrule, $matchrule, null); + $_76 = NULL; + do { + $matcher = 'match_'.'Call'; $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, "Call" ); + } + else { $_76 = FALSE; break; } + $res_75 = $result; + $pos_75 = $this->pos; + if (substr($this->string,$this->pos,1) == '.') { + $this->pos += 1; + $result["text"] .= '.'; + $result = $res_75; + $this->pos = $pos_75; + } + else { + $result = $res_75; + $this->pos = $pos_75; + $_76 = FALSE; break; + } + $_76 = TRUE; break; + } + while(0); + if( $_76 === TRUE ) { return $this->finalise($result); } + if( $_76 === FALSE) { return FALSE; } } /* LastLookupStep: :Call */ protected $match_LastLookupStep_typestack = array('LastLookupStep'); - function match_LastLookupStep($stack = array()) - { - $matchrule = "LastLookupStep"; - $result = $this->construct($matchrule, $matchrule, null); - $matcher = 'match_'.'Call'; - $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, "Call"); - return $this->finalise($result); - } else { - return false; - } + function match_LastLookupStep ($stack = array()) { + $matchrule = "LastLookupStep"; $result = $this->construct($matchrule, $matchrule, null); + $matcher = 'match_'.'Call'; $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, "Call" ); + return $this->finalise($result); + } + else { return FALSE; } } /* Lookup: LookupStep ("." LookupStep)* "." LastLookupStep | LastLookupStep */ protected $match_Lookup_typestack = array('Lookup'); - function match_Lookup($stack = array()) - { - $matchrule = "Lookup"; - $result = $this->construct($matchrule, $matchrule, null); - $_90 = null; - do { - $res_79 = $result; - $pos_79 = $this->pos; - $_87 = null; - do { - $matcher = 'match_'.'LookupStep'; - $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 { - $_87 = false; - break; - } - while (true) { - $res_84 = $result; - $pos_84 = $this->pos; - $_83 = null; - do { - if (substr($this->string, $this->pos, 1) == '.') { - $this->pos += 1; - $result["text"] .= '.'; - } else { - $_83 = false; - break; - } - $matcher = 'match_'.'LookupStep'; - $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 { - $_83 = false; - break; - } - $_83 = true; - break; - } while (0); - if ($_83 === false) { - $result = $res_84; - $this->pos = $pos_84; - unset($res_84); - unset($pos_84); - break; - } - } - if (substr($this->string, $this->pos, 1) == '.') { - $this->pos += 1; - $result["text"] .= '.'; - } else { - $_87 = false; - 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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - } else { - $_87 = false; - break; - } - $_87 = true; - 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; - } + function match_Lookup ($stack = array()) { + $matchrule = "Lookup"; $result = $this->construct($matchrule, $matchrule, null); + $_90 = NULL; + do { + $res_79 = $result; + $pos_79 = $this->pos; + $_87 = NULL; + do { + $matcher = 'match_'.'LookupStep'; $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 { $_87 = FALSE; break; } + while (true) { + $res_84 = $result; + $pos_84 = $this->pos; + $_83 = NULL; + do { + if (substr($this->string,$this->pos,1) == '.') { + $this->pos += 1; + $result["text"] .= '.'; + } + else { $_83 = FALSE; break; } + $matcher = 'match_'.'LookupStep'; $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 { $_83 = FALSE; break; } + $_83 = TRUE; break; + } + while(0); + if( $_83 === FALSE) { + $result = $res_84; + $this->pos = $pos_84; + unset( $res_84 ); + unset( $pos_84 ); + break; + } + } + if (substr($this->string,$this->pos,1) == '.') { + $this->pos += 1; + $result["text"] .= '.'; + } + else { $_87 = FALSE; 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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + } + else { $_87 = FALSE; break; } + $_87 = TRUE; 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)? < - (InjectionVariables)? > "%>" */ + (InjectionVariables)? > "%>" */ protected $match_Translate_typestack = array('Translate'); - function match_Translate($stack = array()) - { - $matchrule = "Translate"; - $result = $this->construct($matchrule, $matchrule, null); - $_116 = null; - do { - if (( $subres = $this->literal('<%t') ) !== false) { - $result["text"] .= $subres; - } else { - $_116 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'Entity'; - $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 { - $_116 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_98 = $result; - $pos_98 = $this->pos; - $_97 = null; - do { - $matcher = 'match_'.'QuotedString'; - $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, "Default"); - } else { - $_97 = false; - break; - } - $_97 = true; - break; - } while (0); - if ($_97 === false) { - $result = $res_98; - $this->pos = $pos_98; - unset($res_98); - unset($pos_98); - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_109 = $result; - $pos_109 = $this->pos; - $_108 = null; - do { - $res_103 = $result; - $pos_103 = $this->pos; - $_102 = null; - do { - if (( $subres = $this->literal('is') ) !== false) { - $result["text"] .= $subres; - } else { - $_102 = false; - break; - } - if (substr($this->string, $this->pos, 1) == '=') { - $this->pos += 1; - $result["text"] .= '='; - } else { - $_102 = false; - break; - } - $_102 = true; - break; - } while (0); - if ($_102 === true) { - $result = $res_103; - $this->pos = $pos_103; - $_108 = false; - break; - } - if ($_102 === false) { - $result = $res_103; - $this->pos = $pos_103; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('is') ) !== false) { - $result["text"] .= $subres; - } else { - $_108 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'QuotedString'; - $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, "Context"); - } else { - $_108 = 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; - } + function match_Translate ($stack = array()) { + $matchrule = "Translate"; $result = $this->construct($matchrule, $matchrule, null); + $_116 = NULL; + do { + if (( $subres = $this->literal( '<%t' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_116 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'Entity'; $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 { $_116 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_98 = $result; + $pos_98 = $this->pos; + $_97 = NULL; + do { + $matcher = 'match_'.'QuotedString'; $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, "Default" ); + } + else { $_97 = FALSE; break; } + $_97 = TRUE; break; + } + while(0); + if( $_97 === FALSE) { + $result = $res_98; + $this->pos = $pos_98; + unset( $res_98 ); + unset( $pos_98 ); + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_109 = $result; + $pos_109 = $this->pos; + $_108 = NULL; + do { + $res_103 = $result; + $pos_103 = $this->pos; + $_102 = NULL; + do { + if (( $subres = $this->literal( 'is' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_102 = FALSE; break; } + if (substr($this->string,$this->pos,1) == '=') { + $this->pos += 1; + $result["text"] .= '='; + } + else { $_102 = FALSE; break; } + $_102 = TRUE; break; + } + while(0); + if( $_102 === TRUE ) { + $result = $res_103; + $this->pos = $pos_103; + $_108 = FALSE; break; + } + if( $_102 === FALSE) { + $result = $res_103; + $this->pos = $pos_103; + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'is' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_108 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'QuotedString'; $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, "Context" ); + } + else { $_108 = 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)+ */ protected $match_InjectionVariables_typestack = array('InjectionVariables'); - function match_InjectionVariables($stack = array()) - { - $matchrule = "InjectionVariables"; - $result = $this->construct($matchrule, $matchrule, null); - $count = 0; - while (true) { - $res_123 = $result; - $pos_123 = $this->pos; - $_122 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'Word'; - $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, "InjectionName"); - } else { - $_122 = false; - break; - } - if (substr($this->string, $this->pos, 1) == '=') { - $this->pos += 1; - $result["text"] .= '='; - } else { - $_122 = false; - break; - } - $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 { - $_122 = false; - break; - } - $_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; - } + function match_InjectionVariables ($stack = array()) { + $matchrule = "InjectionVariables"; $result = $this->construct($matchrule, $matchrule, null); + $count = 0; + while (true) { + $res_123 = $result; + $pos_123 = $this->pos; + $_122 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'Word'; $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, "InjectionName" ); + } + else { $_122 = FALSE; break; } + if (substr($this->string,$this->pos,1) == '=') { + $this->pos += 1; + $result["text"] .= '='; + } + else { $_122 = FALSE; break; } + $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 { $_122 = FALSE; break; } + $_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'); - function match_Entity($stack = array()) - { - $matchrule = "Entity"; - $result = $this->construct($matchrule, $matchrule, null); - if (( $subres = $this->rx('/ [A-Za-z_] [\w\.]* /') ) !== false) { - $result["text"] .= $subres; - return $this->finalise($result); - } else { - return false; - } + function match_Entity ($stack = array()) { + $matchrule = "Entity"; $result = $this->construct($matchrule, $matchrule, null); + if (( $subres = $this->rx( '/ [A-Za-z_\\\\] [\w\.\\\\]* /' ) ) !== FALSE) { + $result["text"] .= $subres; + return $this->finalise($result); + } + else { return FALSE; } } @@ -1253,125 +1004,85 @@ class SSTemplateParser extends Parser implements TemplateParser /* SimpleInjection: '$' :Lookup */ protected $match_SimpleInjection_typestack = array('SimpleInjection'); - function match_SimpleInjection($stack = array()) - { - $matchrule = "SimpleInjection"; - $result = $this->construct($matchrule, $matchrule, null); - $_127 = null; - do { - if (substr($this->string, $this->pos, 1) == '$') { - $this->pos += 1; - $result["text"] .= '$'; - } else { - $_127 = false; - break; - } - $matcher = 'match_'.'Lookup'; - $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, "Lookup"); - } else { - $_127 = false; - break; - } - $_127 = true; - break; - } while (0); - if ($_127 === true) { - return $this->finalise($result); - } - if ($_127 === false) { - return false; - } + function match_SimpleInjection ($stack = array()) { + $matchrule = "SimpleInjection"; $result = $this->construct($matchrule, $matchrule, null); + $_127 = NULL; + do { + if (substr($this->string,$this->pos,1) == '$') { + $this->pos += 1; + $result["text"] .= '$'; + } + else { $_127 = FALSE; break; } + $matcher = 'match_'.'Lookup'; $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, "Lookup" ); + } + else { $_127 = FALSE; break; } + $_127 = TRUE; break; + } + while(0); + if( $_127 === TRUE ) { return $this->finalise($result); } + if( $_127 === FALSE) { return FALSE; } } /* BracketInjection: '{$' :Lookup "}" */ protected $match_BracketInjection_typestack = array('BracketInjection'); - function match_BracketInjection($stack = array()) - { - $matchrule = "BracketInjection"; - $result = $this->construct($matchrule, $matchrule, null); - $_132 = null; - do { - if (( $subres = $this->literal('{$') ) !== false) { - $result["text"] .= $subres; - } else { - $_132 = false; - break; - } - $matcher = 'match_'.'Lookup'; - $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, "Lookup"); - } else { - $_132 = false; - break; - } - 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; - } + function match_BracketInjection ($stack = array()) { + $matchrule = "BracketInjection"; $result = $this->construct($matchrule, $matchrule, null); + $_132 = NULL; + do { + if (( $subres = $this->literal( '{$' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_132 = FALSE; break; } + $matcher = 'match_'.'Lookup'; $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, "Lookup" ); + } + else { $_132 = FALSE; break; } + 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 */ protected $match_Injection_typestack = array('Injection'); - function match_Injection($stack = array()) - { - $matchrule = "Injection"; - $result = $this->construct($matchrule, $matchrule, null); - $_137 = null; - do { - $res_134 = $result; - $pos_134 = $this->pos; - $matcher = 'match_'.'BracketInjection'; - $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); - $_137 = true; - break; - } - $result = $res_134; - $this->pos = $pos_134; - $matcher = 'match_'.'SimpleInjection'; - $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); - $_137 = true; - break; - } - $result = $res_134; - $this->pos = $pos_134; - $_137 = false; - break; - } while (0); - if ($_137 === true) { - return $this->finalise($result); - } - if ($_137 === false) { - return false; - } + function match_Injection ($stack = array()) { + $matchrule = "Injection"; $result = $this->construct($matchrule, $matchrule, null); + $_137 = NULL; + do { + $res_134 = $result; + $pos_134 = $this->pos; + $matcher = 'match_'.'BracketInjection'; $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 ); + $_137 = TRUE; break; + } + $result = $res_134; + $this->pos = $pos_134; + $matcher = 'match_'.'SimpleInjection'; $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 ); + $_137 = TRUE; break; + } + $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 */ protected $match_DollarMarkedLookup_typestack = array('DollarMarkedLookup'); - function match_DollarMarkedLookup($stack = array()) - { - $matchrule = "DollarMarkedLookup"; - $result = $this->construct($matchrule, $matchrule, null); - $matcher = 'match_'.'SimpleInjection'; - $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); - return $this->finalise($result); - } else { - return false; - } + function match_DollarMarkedLookup ($stack = array()) { + $matchrule = "DollarMarkedLookup"; $result = $this->construct($matchrule, $matchrule, null); + $matcher = 'match_'.'SimpleInjection'; $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 ); + return $this->finalise($result); + } + else { return FALSE; } } @@ -1408,202 +1114,150 @@ class SSTemplateParser extends Parser implements TemplateParser /* QuotedString: q:/['"]/ String:/ (\\\\ | \\. | [^$q\\])* / '$q' */ protected $match_QuotedString_typestack = array('QuotedString'); - function match_QuotedString($stack = array()) - { - $matchrule = "QuotedString"; - $result = $this->construct($matchrule, $matchrule, null); - $_143 = null; - do { - $stack[] = $result; - $result = $this->construct($matchrule, "q"); - if (( $subres = $this->rx('/[\'"]/') ) !== false) { - $result["text"] .= $subres; - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'q'); - } else { - $result = array_pop($stack); - $_143 = false; - break; - } - $stack[] = $result; - $result = $this->construct($matchrule, "String"); - if (( $subres = $this->rx('/ (\\\\\\\\ | \\\\. | [^'.$this->expression($result, $stack, 'q').'\\\\])* /') ) !== false) { - $result["text"] .= $subres; - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'String'); - } else { - $result = array_pop($stack); - $_143 = false; - break; - } - if (( $subres = $this->literal(''.$this->expression($result, $stack, 'q').'') ) !== 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; - } + function match_QuotedString ($stack = array()) { + $matchrule = "QuotedString"; $result = $this->construct($matchrule, $matchrule, null); + $_143 = NULL; + do { + $stack[] = $result; $result = $this->construct( $matchrule, "q" ); + if (( $subres = $this->rx( '/[\'"]/' ) ) !== FALSE) { + $result["text"] .= $subres; + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'q' ); + } + else { + $result = array_pop($stack); + $_143 = FALSE; break; + } + $stack[] = $result; $result = $this->construct( $matchrule, "String" ); + if (( $subres = $this->rx( '/ (\\\\\\\\ | \\\\. | [^'.$this->expression($result, $stack, 'q').'\\\\])* /' ) ) !== FALSE) { + $result["text"] .= $subres; + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'String' ); + } + else { + $result = array_pop($stack); + $_143 = FALSE; break; + } + if (( $subres = $this->literal( ''.$this->expression($result, $stack, 'q').'' ) ) !== 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: /[^,)%!=><|&]+/ */ protected $match_FreeString_typestack = array('FreeString'); - function match_FreeString($stack = array()) - { - $matchrule = "FreeString"; - $result = $this->construct($matchrule, $matchrule, null); - if (( $subres = $this->rx('/[^,)%!=><|&]+/') ) !== false) { - $result["text"] .= $subres; - return $this->finalise($result); - } else { - return false; - } + function match_FreeString ($stack = array()) { + $matchrule = "FreeString"; $result = $this->construct($matchrule, $matchrule, null); + if (( $subres = $this->rx( '/[^,)%!=><|&]+/' ) ) !== FALSE) { + $result["text"] .= $subres; + return $this->finalise($result); + } + else { return FALSE; } } /* Argument: - :DollarMarkedLookup | - :QuotedString | - :Lookup !(< FreeString)| - :FreeString */ + :DollarMarkedLookup | + :QuotedString | + :Lookup !(< FreeString)| + :FreeString */ protected $match_Argument_typestack = array('Argument'); - function match_Argument($stack = array()) - { - $matchrule = "Argument"; - $result = $this->construct($matchrule, $matchrule, null); - $_163 = null; - do { - $res_146 = $result; - $pos_146 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "DollarMarkedLookup"); - $_163 = true; - break; - } - $result = $res_146; - $this->pos = $pos_146; - $_161 = null; - do { - $res_148 = $result; - $pos_148 = $this->pos; - $matcher = 'match_'.'QuotedString'; - $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, "QuotedString"); - $_161 = true; - break; - } - $result = $res_148; - $this->pos = $pos_148; - $_159 = null; - do { - $res_150 = $result; - $pos_150 = $this->pos; - $_156 = null; - do { - $matcher = 'match_'.'Lookup'; - $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, "Lookup"); - } else { - $_156 = false; - break; - } - $res_155 = $result; - $pos_155 = $this->pos; - $_154 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'FreeString'; - $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 { - $_154 = false; - break; - } - $_154 = true; - break; - } while (0); - if ($_154 === true) { - $result = $res_155; - $this->pos = $pos_155; - $_156 = false; - break; - } - if ($_154 === false) { - $result = $res_155; - $this->pos = $pos_155; - } - $_156 = true; - break; - } while (0); - if ($_156 === true) { - $_159 = true; - break; - } - $result = $res_150; - $this->pos = $pos_150; - $matcher = 'match_'.'FreeString'; - $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, "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; - } + function match_Argument ($stack = array()) { + $matchrule = "Argument"; $result = $this->construct($matchrule, $matchrule, null); + $_163 = NULL; + do { + $res_146 = $result; + $pos_146 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "DollarMarkedLookup" ); + $_163 = TRUE; break; + } + $result = $res_146; + $this->pos = $pos_146; + $_161 = NULL; + do { + $res_148 = $result; + $pos_148 = $this->pos; + $matcher = 'match_'.'QuotedString'; $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, "QuotedString" ); + $_161 = TRUE; break; + } + $result = $res_148; + $this->pos = $pos_148; + $_159 = NULL; + do { + $res_150 = $result; + $pos_150 = $this->pos; + $_156 = NULL; + do { + $matcher = 'match_'.'Lookup'; $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, "Lookup" ); + } + else { $_156 = FALSE; break; } + $res_155 = $result; + $pos_155 = $this->pos; + $_154 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'FreeString'; $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 { $_154 = FALSE; break; } + $_154 = TRUE; break; + } + while(0); + if( $_154 === TRUE ) { + $result = $res_155; + $this->pos = $pos_155; + $_156 = FALSE; break; + } + if( $_154 === FALSE) { + $result = $res_155; + $this->pos = $pos_155; + } + $_156 = TRUE; break; + } + while(0); + if( $_156 === TRUE ) { $_159 = TRUE; break; } + $result = $res_150; + $this->pos = $pos_150; + $matcher = 'match_'.'FreeString'; $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, "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: "!=" | "==" | ">=" | ">" | "<=" | "<" | "=" */ protected $match_ComparisonOperator_typestack = array('ComparisonOperator'); - function match_ComparisonOperator($stack = array()) - { - $matchrule = "ComparisonOperator"; - $result = $this->construct($matchrule, $matchrule, null); - $_188 = null; - do { - $res_165 = $result; - $pos_165 = $this->pos; - if (( $subres = $this->literal('!=') ) !== false) { - $result["text"] .= $subres; - $_188 = true; - break; - } - $result = $res_165; - $this->pos = $pos_165; - $_186 = null; - do { - $res_167 = $result; - $pos_167 = $this->pos; - if (( $subres = $this->literal('==') ) !== false) { - $result["text"] .= $subres; - $_186 = true; - break; - } - $result = $res_167; - $this->pos = $pos_167; - $_184 = null; - do { - $res_169 = $result; - $pos_169 = $this->pos; - if (( $subres = $this->literal('>=') ) !== false) { - $result["text"] .= $subres; - $_184 = true; - break; - } - $result = $res_169; - $this->pos = $pos_169; - $_182 = null; - do { - $res_171 = $result; - $pos_171 = $this->pos; - if (substr($this->string, $this->pos, 1) == '>') { - $this->pos += 1; - $result["text"] .= '>'; - $_182 = true; - break; - } - $result = $res_171; - $this->pos = $pos_171; - $_180 = null; - do { - $res_173 = $result; - $pos_173 = $this->pos; - if (( $subres = $this->literal('<=') ) !== false) { - $result["text"] .= $subres; - $_180 = true; - break; - } - $result = $res_173; - $this->pos = $pos_173; - $_178 = null; - do { - $res_175 = $result; - $pos_175 = $this->pos; - if (substr($this->string, $this->pos, 1) == '<') { - $this->pos += 1; - $result["text"] .= '<'; - $_178 = true; - break; - } - $result = $res_175; - $this->pos = $pos_175; - if (substr($this->string, $this->pos, 1) == '=') { - $this->pos += 1; - $result["text"] .= '='; - $_178 = true; - break; - } - $result = $res_175; - $this->pos = $pos_175; - $_178 = false; - break; - } while (0); - if ($_178 === true) { - $_180 = true; - break; - } - $result = $res_173; - $this->pos = $pos_173; - $_180 = false; - break; - } while (0); - if ($_180 === true) { - $_182 = true; - break; - } - $result = $res_171; - $this->pos = $pos_171; - $_182 = false; - break; - } while (0); - if ($_182 === true) { - $_184 = true; - break; - } - $result = $res_169; - $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; - } + function match_ComparisonOperator ($stack = array()) { + $matchrule = "ComparisonOperator"; $result = $this->construct($matchrule, $matchrule, null); + $_188 = NULL; + do { + $res_165 = $result; + $pos_165 = $this->pos; + if (( $subres = $this->literal( '!=' ) ) !== FALSE) { + $result["text"] .= $subres; + $_188 = TRUE; break; + } + $result = $res_165; + $this->pos = $pos_165; + $_186 = NULL; + do { + $res_167 = $result; + $pos_167 = $this->pos; + if (( $subres = $this->literal( '==' ) ) !== FALSE) { + $result["text"] .= $subres; + $_186 = TRUE; break; + } + $result = $res_167; + $this->pos = $pos_167; + $_184 = NULL; + do { + $res_169 = $result; + $pos_169 = $this->pos; + if (( $subres = $this->literal( '>=' ) ) !== FALSE) { + $result["text"] .= $subres; + $_184 = TRUE; break; + } + $result = $res_169; + $this->pos = $pos_169; + $_182 = NULL; + do { + $res_171 = $result; + $pos_171 = $this->pos; + if (substr($this->string,$this->pos,1) == '>') { + $this->pos += 1; + $result["text"] .= '>'; + $_182 = TRUE; break; + } + $result = $res_171; + $this->pos = $pos_171; + $_180 = NULL; + do { + $res_173 = $result; + $pos_173 = $this->pos; + if (( $subres = $this->literal( '<=' ) ) !== FALSE) { + $result["text"] .= $subres; + $_180 = TRUE; break; + } + $result = $res_173; + $this->pos = $pos_173; + $_178 = NULL; + do { + $res_175 = $result; + $pos_175 = $this->pos; + if (substr($this->string,$this->pos,1) == '<') { + $this->pos += 1; + $result["text"] .= '<'; + $_178 = TRUE; break; + } + $result = $res_175; + $this->pos = $pos_175; + if (substr($this->string,$this->pos,1) == '=') { + $this->pos += 1; + $result["text"] .= '='; + $_178 = TRUE; break; + } + $result = $res_175; + $this->pos = $pos_175; + $_178 = FALSE; break; + } + while(0); + if( $_178 === TRUE ) { $_180 = TRUE; break; } + $result = $res_173; + $this->pos = $pos_173; + $_180 = FALSE; break; + } + while(0); + if( $_180 === TRUE ) { $_182 = TRUE; break; } + $result = $res_171; + $this->pos = $pos_171; + $_182 = FALSE; break; + } + while(0); + if( $_182 === TRUE ) { $_184 = TRUE; break; } + $result = $res_169; + $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 */ protected $match_Comparison_typestack = array('Comparison'); - function match_Comparison($stack = array()) - { - $matchrule = "Comparison"; - $result = $this->construct($matchrule, $matchrule, null); - $_195 = null; - do { - $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; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'ComparisonOperator'; - $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; - } - 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; - } + function match_Comparison ($stack = array()) { + $matchrule = "Comparison"; $result = $this->construct($matchrule, $matchrule, null); + $_195 = NULL; + do { + $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; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'ComparisonOperator'; $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; } + 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 */ protected $match_PresenceCheck_typestack = array('PresenceCheck'); - function match_PresenceCheck($stack = array()) - { - $matchrule = "PresenceCheck"; - $result = $this->construct($matchrule, $matchrule, null); - $_202 = null; - do { - $res_200 = $result; - $pos_200 = $this->pos; - $_199 = null; - do { - $stack[] = $result; - $result = $this->construct($matchrule, "Not"); - if (( $subres = $this->literal('not') ) !== false) { - $result["text"] .= $subres; - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'Not'); - } else { - $result = array_pop($stack); - $_199 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $_199 = true; - break; - } while (0); - if ($_199 === false) { - $result = $res_200; - $this->pos = $pos_200; - unset($res_200); - unset($pos_200); - } - $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 { - $_202 = false; - break; - } - $_202 = true; - break; - } while (0); - if ($_202 === true) { - return $this->finalise($result); - } - if ($_202 === false) { - return false; - } + function match_PresenceCheck ($stack = array()) { + $matchrule = "PresenceCheck"; $result = $this->construct($matchrule, $matchrule, null); + $_202 = NULL; + do { + $res_200 = $result; + $pos_200 = $this->pos; + $_199 = NULL; + do { + $stack[] = $result; $result = $this->construct( $matchrule, "Not" ); + if (( $subres = $this->literal( 'not' ) ) !== FALSE) { + $result["text"] .= $subres; + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'Not' ); + } + else { + $result = array_pop($stack); + $_199 = FALSE; break; + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $_199 = TRUE; break; + } + while(0); + if( $_199 === FALSE) { + $result = $res_200; + $this->pos = $pos_200; + unset( $res_200 ); + unset( $pos_200 ); + } + $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 { $_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 */ protected $match_IfArgumentPortion_typestack = array('IfArgumentPortion'); - function match_IfArgumentPortion($stack = array()) - { - $matchrule = "IfArgumentPortion"; - $result = $this->construct($matchrule, $matchrule, null); - $_207 = null; - do { - $res_204 = $result; - $pos_204 = $this->pos; - $matcher = 'match_'.'Comparison'; - $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); - $_207 = true; - break; - } - $result = $res_204; - $this->pos = $pos_204; - $matcher = 'match_'.'PresenceCheck'; - $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); - $_207 = true; - break; - } - $result = $res_204; - $this->pos = $pos_204; - $_207 = false; - break; - } while (0); - if ($_207 === true) { - return $this->finalise($result); - } - if ($_207 === false) { - return false; - } + function match_IfArgumentPortion ($stack = array()) { + $matchrule = "IfArgumentPortion"; $result = $this->construct($matchrule, $matchrule, null); + $_207 = NULL; + do { + $res_204 = $result; + $pos_204 = $this->pos; + $matcher = 'match_'.'Comparison'; $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 ); + $_207 = TRUE; break; + } + $result = $res_204; + $this->pos = $pos_204; + $matcher = 'match_'.'PresenceCheck'; $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 ); + $_207 = TRUE; break; + } + $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: "||" | "&&" */ protected $match_BooleanOperator_typestack = array('BooleanOperator'); - function match_BooleanOperator($stack = array()) - { - $matchrule = "BooleanOperator"; - $result = $this->construct($matchrule, $matchrule, null); - $_212 = null; - do { - $res_209 = $result; - $pos_209 = $this->pos; - if (( $subres = $this->literal('||') ) !== false) { - $result["text"] .= $subres; - $_212 = true; - break; - } - $result = $res_209; - $this->pos = $pos_209; - if (( $subres = $this->literal('&&') ) !== false) { - $result["text"] .= $subres; - $_212 = true; - break; - } - $result = $res_209; - $this->pos = $pos_209; - $_212 = false; - break; - } while (0); - if ($_212 === true) { - return $this->finalise($result); - } - if ($_212 === false) { - return false; - } + function match_BooleanOperator ($stack = array()) { + $matchrule = "BooleanOperator"; $result = $this->construct($matchrule, $matchrule, null); + $_212 = NULL; + do { + $res_209 = $result; + $pos_209 = $this->pos; + if (( $subres = $this->literal( '||' ) ) !== FALSE) { + $result["text"] .= $subres; + $_212 = TRUE; break; + } + $result = $res_209; + $this->pos = $pos_209; + if (( $subres = $this->literal( '&&' ) ) !== FALSE) { + $result["text"] .= $subres; + $_212 = TRUE; break; + } + $result = $res_209; + $this->pos = $pos_209; + $_212 = FALSE; break; + } + while(0); + if( $_212 === TRUE ) { return $this->finalise($result); } + if( $_212 === FALSE) { return FALSE; } } /* IfArgument: :IfArgumentPortion ( < :BooleanOperator < :IfArgumentPortion )* */ protected $match_IfArgument_typestack = array('IfArgument'); - function match_IfArgument($stack = array()) - { - $matchrule = "IfArgument"; - $result = $this->construct($matchrule, $matchrule, null); - $_221 = null; - do { - $matcher = 'match_'.'IfArgumentPortion'; - $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, "IfArgumentPortion"); - } else { - $_221 = false; - break; - } - while (true) { - $res_220 = $result; - $pos_220 = $this->pos; - $_219 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'BooleanOperator'; - $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, "BooleanOperator"); - } else { - $_219 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'IfArgumentPortion'; - $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, "IfArgumentPortion"); - } else { - $_219 = 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; - } + function match_IfArgument ($stack = array()) { + $matchrule = "IfArgument"; $result = $this->construct($matchrule, $matchrule, null); + $_221 = NULL; + do { + $matcher = 'match_'.'IfArgumentPortion'; $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, "IfArgumentPortion" ); + } + else { $_221 = FALSE; break; } + while (true) { + $res_220 = $result; + $pos_220 = $this->pos; + $_219 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'BooleanOperator'; $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, "BooleanOperator" ); + } + else { $_219 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'IfArgumentPortion'; $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, "IfArgumentPortion" ); + } + else { $_219 = 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? */ protected $match_IfPart_typestack = array('IfPart'); - function match_IfPart($stack = array()) - { - $matchrule = "IfPart"; - $result = $this->construct($matchrule, $matchrule, null); - $_231 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_231 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('if') ) !== false) { - $result["text"] .= $subres; - } else { - $_231 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_231 = false; - 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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "IfArgument"); - } else { - $_231 = false; - break; - } - if (( $subres = $this->whitespace() ) !== 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; - } + function match_IfPart ($stack = array()) { + $matchrule = "IfPart"; $result = $this->construct($matchrule, $matchrule, null); + $_231 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_231 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'if' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_231 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_231 = FALSE; 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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "IfArgument" ); + } + else { $_231 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== 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? */ protected $match_ElseIfPart_typestack = array('ElseIfPart'); - function match_ElseIfPart($stack = array()) - { - $matchrule = "ElseIfPart"; - $result = $this->construct($matchrule, $matchrule, null); - $_241 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_241 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('else_if') ) !== false) { - $result["text"] .= $subres; - } else { - $_241 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_241 = false; - 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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "IfArgument"); - } else { - $_241 = false; - break; - } - if (( $subres = $this->whitespace() ) !== 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; - } + function match_ElseIfPart ($stack = array()) { + $matchrule = "ElseIfPart"; $result = $this->construct($matchrule, $matchrule, null); + $_241 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_241 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_241 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_241 = FALSE; 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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "IfArgument" ); + } + else { $_241 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== 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? */ protected $match_ElsePart_typestack = array('ElsePart'); - function match_ElsePart($stack = array()) - { - $matchrule = "ElsePart"; - $result = $this->construct($matchrule, $matchrule, null); - $_249 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_249 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('else') ) !== false) { - $result["text"] .= $subres; - } else { - $_249 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('%>') ) !== false) { - $result["text"] .= $subres; - } else { - $_249 = false; - break; - } - $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; - } + function match_ElsePart ($stack = array()) { + $matchrule = "ElsePart"; $result = $this->construct($matchrule, $matchrule, null); + $_249 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_249 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'else' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_249 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_249 = FALSE; break; } + $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' > '%>' */ protected $match_If_typestack = array('If'); - function match_If($stack = array()) - { - $matchrule = "If"; - $result = $this->construct($matchrule, $matchrule, null); - $_259 = null; - do { - $matcher = 'match_'.'IfPart'; - $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 { - $_259 = false; - break; - } - while (true) { - $res_252 = $result; - $pos_252 = $this->pos; - $matcher = 'match_'.'ElseIfPart'; - $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 { - $result = $res_252; - $this->pos = $pos_252; - unset($res_252); - unset($pos_252); - break; - } - } - $res_253 = $result; - $pos_253 = $this->pos; - $matcher = 'match_'.'ElsePart'; - $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 { - $result = $res_253; - $this->pos = $pos_253; - unset($res_253); - unset($pos_253); - } - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_259 = false; - break; - } - 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; - } + function match_If ($stack = array()) { + $matchrule = "If"; $result = $this->construct($matchrule, $matchrule, null); + $_259 = NULL; + do { + $matcher = 'match_'.'IfPart'; $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 { $_259 = FALSE; break; } + while (true) { + $res_252 = $result; + $pos_252 = $this->pos; + $matcher = 'match_'.'ElseIfPart'; $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 { + $result = $res_252; + $this->pos = $pos_252; + unset( $res_252 ); + unset( $pos_252 ); + break; + } + } + $res_253 = $result; + $pos_253 = $this->pos; + $matcher = 'match_'.'ElsePart'; $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 { + $result = $res_253; + $this->pos = $pos_253; + unset( $res_253 ); + unset( $pos_253 ); + } + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_259 = FALSE; break; } + 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 > ")") > '%>' */ protected $match_Require_typestack = array('Require'); - function match_Require($stack = array()) - { - $matchrule = "Require"; - $result = $this->construct($matchrule, $matchrule, null); - $_275 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_275 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('require') ) !== false) { - $result["text"] .= $subres; - } else { - $_275 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_275 = false; - break; - } - $stack[] = $result; - $result = $this->construct($matchrule, "Call"); - $_271 = null; - do { - $matcher = 'match_'.'Word'; - $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, "Method"); - } else { - $_271 = false; - break; - } - if (substr($this->string, $this->pos, 1) == '(') { - $this->pos += 1; - $result["text"] .= '('; - } else { - $_271 = 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, "CallArguments"); - } 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; - } + function match_Require ($stack = array()) { + $matchrule = "Require"; $result = $this->construct($matchrule, $matchrule, null); + $_275 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_275 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'require' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_275 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_275 = FALSE; break; } + $stack[] = $result; $result = $this->construct( $matchrule, "Call" ); + $_271 = NULL; + do { + $matcher = 'match_'.'Word'; $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, "Method" ); + } + else { $_271 = FALSE; break; } + if (substr($this->string,$this->pos,1) == '(') { + $this->pos += 1; + $result["text"] .= '('; + } + else { $_271 = 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, "CallArguments" ); + } + 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: !( "if " | "unless " ) - ( - :DollarMarkedLookup | - :QuotedString | - :Lookup - ) */ + ( + :DollarMarkedLookup | + :QuotedString | + :Lookup + ) */ protected $match_CacheBlockArgument_typestack = array('CacheBlockArgument'); - function match_CacheBlockArgument($stack = array()) - { - $matchrule = "CacheBlockArgument"; - $result = $this->construct($matchrule, $matchrule, null); - $_295 = null; - do { - $res_283 = $result; - $pos_283 = $this->pos; - $_282 = null; - do { - $_280 = null; - do { - $res_277 = $result; - $pos_277 = $this->pos; - if (( $subres = $this->literal('if ') ) !== false) { - $result["text"] .= $subres; - $_280 = true; - break; - } - $result = $res_277; - $this->pos = $pos_277; - if (( $subres = $this->literal('unless ') ) !== false) { - $result["text"] .= $subres; - $_280 = true; - break; - } - $result = $res_277; - $this->pos = $pos_277; - $_280 = false; - break; - } while (0); - if ($_280 === false) { - $_282 = false; - break; - } - $_282 = true; - break; - } while (0); - if ($_282 === true) { - $result = $res_283; - $this->pos = $pos_283; - $_295 = false; - break; - } - if ($_282 === false) { - $result = $res_283; - $this->pos = $pos_283; - } - $_293 = null; - do { - $_291 = null; - do { - $res_284 = $result; - $pos_284 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "DollarMarkedLookup"); - $_291 = true; - break; - } - $result = $res_284; - $this->pos = $pos_284; - $_289 = null; - do { - $res_286 = $result; - $pos_286 = $this->pos; - $matcher = 'match_'.'QuotedString'; - $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, "QuotedString"); - $_289 = true; - break; - } - $result = $res_286; - $this->pos = $pos_286; - $matcher = 'match_'.'Lookup'; - $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, "Lookup"); - $_289 = true; - break; - } - $result = $res_286; - $this->pos = $pos_286; - $_289 = false; - break; - } 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; - } + function match_CacheBlockArgument ($stack = array()) { + $matchrule = "CacheBlockArgument"; $result = $this->construct($matchrule, $matchrule, null); + $_295 = NULL; + do { + $res_283 = $result; + $pos_283 = $this->pos; + $_282 = NULL; + do { + $_280 = NULL; + do { + $res_277 = $result; + $pos_277 = $this->pos; + if (( $subres = $this->literal( 'if ' ) ) !== FALSE) { + $result["text"] .= $subres; + $_280 = TRUE; break; + } + $result = $res_277; + $this->pos = $pos_277; + if (( $subres = $this->literal( 'unless ' ) ) !== FALSE) { + $result["text"] .= $subres; + $_280 = TRUE; break; + } + $result = $res_277; + $this->pos = $pos_277; + $_280 = FALSE; break; + } + while(0); + if( $_280 === FALSE) { $_282 = FALSE; break; } + $_282 = TRUE; break; + } + while(0); + if( $_282 === TRUE ) { + $result = $res_283; + $this->pos = $pos_283; + $_295 = FALSE; break; + } + if( $_282 === FALSE) { + $result = $res_283; + $this->pos = $pos_283; + } + $_293 = NULL; + do { + $_291 = NULL; + do { + $res_284 = $result; + $pos_284 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "DollarMarkedLookup" ); + $_291 = TRUE; break; + } + $result = $res_284; + $this->pos = $pos_284; + $_289 = NULL; + do { + $res_286 = $result; + $pos_286 = $this->pos; + $matcher = 'match_'.'QuotedString'; $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, "QuotedString" ); + $_289 = TRUE; break; + } + $result = $res_286; + $this->pos = $pos_286; + $matcher = 'match_'.'Lookup'; $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, "Lookup" ); + $_289 = TRUE; break; + } + $result = $res_286; + $this->pos = $pos_286; + $_289 = FALSE; break; + } + 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 )* */ protected $match_CacheBlockArguments_typestack = array('CacheBlockArguments'); - function match_CacheBlockArguments($stack = array()) - { - $matchrule = "CacheBlockArguments"; - $result = $this->construct($matchrule, $matchrule, null); - $_304 = null; - do { - $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 ($subres !== false) { - $this->store($result, $subres); - } else { - $_304 = false; - break; - } - while (true) { - $res_303 = $result; - $pos_303 = $this->pos; - $_302 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (substr($this->string, $this->pos, 1) == ',') { - $this->pos += 1; - $result["text"] .= ','; - } else { - $_302 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $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 ($subres !== false) { - $this->store($result, $subres); - } else { - $_302 = false; - break; - } - $_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; - } + function match_CacheBlockArguments ($stack = array()) { + $matchrule = "CacheBlockArguments"; $result = $this->construct($matchrule, $matchrule, null); + $_304 = NULL; + do { + $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 ($subres !== FALSE) { + $this->store( $result, $subres ); + } + else { $_304 = FALSE; break; } + while (true) { + $res_303 = $result; + $pos_303 = $this->pos; + $_302 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (substr($this->string,$this->pos,1) == ',') { + $this->pos += 1; + $result["text"] .= ','; + } + else { $_302 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $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 ($subres !== FALSE) { + $this->store( $result, $subres ); + } + else { $_302 = FALSE; break; } + $_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 | - OpenBlock | MalformedBlock | Injection | Text)+ */ + OpenBlock | MalformedBlock | Injection | Text)+ */ protected $match_CacheBlockTemplate_typestack = array('CacheBlockTemplate','Template'); - function match_CacheBlockTemplate($stack = array()) - { - $matchrule = "CacheBlockTemplate"; - $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'CacheRestrictedTemplate')); - $count = 0; - while (true) { - $res_348 = $result; - $pos_348 = $this->pos; - $_347 = null; - do { - $_345 = null; - do { - $res_306 = $result; - $pos_306 = $this->pos; - $matcher = 'match_'.'Comment'; - $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); - $_345 = true; - break; - } - $result = $res_306; - $this->pos = $pos_306; - $_343 = null; - do { - $res_308 = $result; - $pos_308 = $this->pos; - $matcher = 'match_'.'Translate'; - $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); - $_343 = true; - break; - } - $result = $res_308; - $this->pos = $pos_308; - $_341 = null; - do { - $res_310 = $result; - $pos_310 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_341 = true; - break; - } - $result = $res_310; - $this->pos = $pos_310; - $_339 = null; - do { - $res_312 = $result; - $pos_312 = $this->pos; - $matcher = 'match_'.'Require'; - $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); - $_339 = true; - break; - } - $result = $res_312; - $this->pos = $pos_312; - $_337 = null; - do { - $res_314 = $result; - $pos_314 = $this->pos; - $matcher = 'match_'.'OldI18NTag'; - $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); - $_337 = true; - break; - } - $result = $res_314; - $this->pos = $pos_314; - $_335 = null; - do { - $res_316 = $result; - $pos_316 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_335 = true; - break; - } - $result = $res_316; - $this->pos = $pos_316; - $_333 = null; - do { - $res_318 = $result; - $pos_318 = $this->pos; - $matcher = 'match_'.'ClosedBlock'; - $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); - $_333 = true; - break; - } - $result = $res_318; - $this->pos = $pos_318; - $_331 = null; - do { - $res_320 = $result; - $pos_320 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_331 = true; - break; - } - $result = $res_320; - $this->pos = $pos_320; - $_329 = null; - do { - $res_322 = $result; - $pos_322 = $this->pos; - $matcher = 'match_'.'MalformedBlock'; - $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); - $_329 = true; - break; - } - $result = $res_322; - $this->pos = $pos_322; - $_327 = null; - do { - $res_324 = $result; - $pos_324 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_327 = true; - break; - } - $result = $res_324; - $this->pos = $pos_324; - $matcher = 'match_'.'Text'; - $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); - $_327 = true; - break; - } - $result = $res_324; - $this->pos = $pos_324; - $_327 = false; - break; - } while (0); - if ($_327 === true) { - $_329 = true; - break; - } - $result = $res_322; - $this->pos = $pos_322; - $_329 = false; - break; - } while (0); - if ($_329 === true) { - $_331 = true; - break; - } - $result = $res_320; - $this->pos = $pos_320; - $_331 = false; - break; - } while (0); - if ($_331 === true) { - $_333 = true; - break; - } - $result = $res_318; - $this->pos = $pos_318; - $_333 = false; - break; - } while (0); - if ($_333 === true) { - $_335 = true; - break; - } - $result = $res_316; - $this->pos = $pos_316; - $_335 = 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; - } + function match_CacheBlockTemplate ($stack = array()) { + $matchrule = "CacheBlockTemplate"; $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'CacheRestrictedTemplate')); + $count = 0; + while (true) { + $res_348 = $result; + $pos_348 = $this->pos; + $_347 = NULL; + do { + $_345 = NULL; + do { + $res_306 = $result; + $pos_306 = $this->pos; + $matcher = 'match_'.'Comment'; $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 ); + $_345 = TRUE; break; + } + $result = $res_306; + $this->pos = $pos_306; + $_343 = NULL; + do { + $res_308 = $result; + $pos_308 = $this->pos; + $matcher = 'match_'.'Translate'; $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 ); + $_343 = TRUE; break; + } + $result = $res_308; + $this->pos = $pos_308; + $_341 = NULL; + do { + $res_310 = $result; + $pos_310 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_341 = TRUE; break; + } + $result = $res_310; + $this->pos = $pos_310; + $_339 = NULL; + do { + $res_312 = $result; + $pos_312 = $this->pos; + $matcher = 'match_'.'Require'; $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 ); + $_339 = TRUE; break; + } + $result = $res_312; + $this->pos = $pos_312; + $_337 = NULL; + do { + $res_314 = $result; + $pos_314 = $this->pos; + $matcher = 'match_'.'OldI18NTag'; $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 ); + $_337 = TRUE; break; + } + $result = $res_314; + $this->pos = $pos_314; + $_335 = NULL; + do { + $res_316 = $result; + $pos_316 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_335 = TRUE; break; + } + $result = $res_316; + $this->pos = $pos_316; + $_333 = NULL; + do { + $res_318 = $result; + $pos_318 = $this->pos; + $matcher = 'match_'.'ClosedBlock'; $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 ); + $_333 = TRUE; break; + } + $result = $res_318; + $this->pos = $pos_318; + $_331 = NULL; + do { + $res_320 = $result; + $pos_320 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_331 = TRUE; break; + } + $result = $res_320; + $this->pos = $pos_320; + $_329 = NULL; + do { + $res_322 = $result; + $pos_322 = $this->pos; + $matcher = 'match_'.'MalformedBlock'; $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 ); + $_329 = TRUE; break; + } + $result = $res_322; + $this->pos = $pos_322; + $_327 = NULL; + do { + $res_324 = $result; + $pos_324 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_327 = TRUE; break; + } + $result = $res_324; + $this->pos = $pos_324; + $matcher = 'match_'.'Text'; $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 ); + $_327 = TRUE; break; + } + $result = $res_324; + $this->pos = $pos_324; + $_327 = FALSE; break; + } + while(0); + if( $_327 === TRUE ) { $_329 = TRUE; break; } + $result = $res_322; + $this->pos = $pos_322; + $_329 = FALSE; break; + } + while(0); + if( $_329 === TRUE ) { $_331 = TRUE; break; } + $result = $res_320; + $this->pos = $pos_320; + $_331 = FALSE; break; + } + while(0); + if( $_331 === TRUE ) { $_333 = TRUE; break; } + $result = $res_318; + $this->pos = $pos_318; + $_333 = FALSE; break; + } + while(0); + if( $_333 === TRUE ) { $_335 = TRUE; break; } + $result = $res_316; + $this->pos = $pos_316; + $_335 = 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: - '<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>' - Template:$TemplateMatcher? - '<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>' */ + '<%' < "uncached" < CacheBlockArguments? ( < Conditional:("if"|"unless") > Condition:IfArgument )? > '%>' + Template:$TemplateMatcher? + '<%' < 'end_' ("uncached"|"cached"|"cacheblock") > '%>' */ protected $match_UncachedBlock_typestack = array('UncachedBlock'); - function match_UncachedBlock($stack = array()) - { - $matchrule = "UncachedBlock"; - $result = $this->construct($matchrule, $matchrule, null); - $_385 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_385 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('uncached') ) !== false) { - $result["text"] .= $subres; - } else { - $_385 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_353 = $result; - $pos_353 = $this->pos; - $matcher = 'match_'.'CacheBlockArguments'; - $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 { - $result = $res_353; - $this->pos = $pos_353; - unset($res_353); - unset($pos_353); - } - $res_365 = $result; - $pos_365 = $this->pos; - $_364 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $stack[] = $result; - $result = $this->construct($matchrule, "Conditional"); - $_360 = null; - do { - $_358 = null; - do { - $res_355 = $result; - $pos_355 = $this->pos; - if (( $subres = $this->literal('if') ) !== false) { - $result["text"] .= $subres; - $_358 = true; - break; - } - $result = $res_355; - $this->pos = $pos_355; - if (( $subres = $this->literal('unless') ) !== false) { - $result["text"] .= $subres; - $_358 = true; - break; - } - $result = $res_355; - $this->pos = $pos_355; - $_358 = false; - break; - } while (0); - if ($_358 === false) { - $_360 = false; - break; - } - $_360 = true; - break; - } while (0); - if ($_360 === true) { - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'Conditional'); - } - if ($_360 === false) { - $result = array_pop($stack); - $_364 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "Condition"); - } else { - $_364 = false; - break; - } - $_364 = true; - break; - } while (0); - if ($_364 === false) { - $result = $res_365; - $this->pos = $pos_365; - unset($res_365); - unset($pos_365); - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('%>') ) !== false) { - $result["text"] .= $subres; - } else { - $_385 = false; - break; - } - $res_368 = $result; - $pos_368 = $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_368; - $this->pos = $pos_368; - unset($res_368); - unset($pos_368); - } - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_385 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('end_') ) !== false) { - $result["text"] .= $subres; - } else { - $_385 = false; - break; - } - $_381 = null; - do { - $_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; - } + function match_UncachedBlock ($stack = array()) { + $matchrule = "UncachedBlock"; $result = $this->construct($matchrule, $matchrule, null); + $_385 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_385 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_385 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_353 = $result; + $pos_353 = $this->pos; + $matcher = 'match_'.'CacheBlockArguments'; $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 { + $result = $res_353; + $this->pos = $pos_353; + unset( $res_353 ); + unset( $pos_353 ); + } + $res_365 = $result; + $pos_365 = $this->pos; + $_364 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $stack[] = $result; $result = $this->construct( $matchrule, "Conditional" ); + $_360 = NULL; + do { + $_358 = NULL; + do { + $res_355 = $result; + $pos_355 = $this->pos; + if (( $subres = $this->literal( 'if' ) ) !== FALSE) { + $result["text"] .= $subres; + $_358 = TRUE; break; + } + $result = $res_355; + $this->pos = $pos_355; + if (( $subres = $this->literal( 'unless' ) ) !== FALSE) { + $result["text"] .= $subres; + $_358 = TRUE; break; + } + $result = $res_355; + $this->pos = $pos_355; + $_358 = FALSE; break; + } + while(0); + if( $_358 === FALSE) { $_360 = FALSE; break; } + $_360 = TRUE; break; + } + while(0); + if( $_360 === TRUE ) { + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'Conditional' ); + } + if( $_360 === FALSE) { + $result = array_pop($stack); + $_364 = FALSE; break; + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "Condition" ); + } + else { $_364 = FALSE; break; } + $_364 = TRUE; break; + } + while(0); + if( $_364 === FALSE) { + $result = $res_365; + $this->pos = $pos_365; + unset( $res_365 ); + unset( $pos_365 ); + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_385 = FALSE; break; } + $res_368 = $result; + $pos_368 = $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_368; + $this->pos = $pos_368; + unset( $res_368 ); + unset( $pos_368 ); + } + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_385 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_385 = FALSE; break; } + $_381 = NULL; + do { + $_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 | - OpenBlock | MalformedBlock | Injection | Text)+ */ + OpenBlock | MalformedBlock | Injection | Text)+ */ protected $match_CacheRestrictedTemplate_typestack = array('CacheRestrictedTemplate','Template'); - function match_CacheRestrictedTemplate($stack = array()) - { - $matchrule = "CacheRestrictedTemplate"; - $result = $this->construct($matchrule, $matchrule, null); - $count = 0; - while (true) { - $res_437 = $result; - $pos_437 = $this->pos; - $_436 = null; - do { - $_434 = null; - do { - $res_387 = $result; - $pos_387 = $this->pos; - $matcher = 'match_'.'Comment'; - $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); - $_434 = true; - break; - } - $result = $res_387; - $this->pos = $pos_387; - $_432 = null; - do { - $res_389 = $result; - $pos_389 = $this->pos; - $matcher = 'match_'.'Translate'; - $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); - $_432 = true; - break; - } - $result = $res_389; - $this->pos = $pos_389; - $_430 = null; - do { - $res_391 = $result; - $pos_391 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_430 = true; - break; - } - $result = $res_391; - $this->pos = $pos_391; - $_428 = null; - do { - $res_393 = $result; - $pos_393 = $this->pos; - $matcher = 'match_'.'Require'; - $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); - $_428 = true; - break; - } - $result = $res_393; - $this->pos = $pos_393; - $_426 = null; - do { - $res_395 = $result; - $pos_395 = $this->pos; - $matcher = 'match_'.'CacheBlock'; - $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); - $_426 = true; - break; - } - $result = $res_395; - $this->pos = $pos_395; - $_424 = null; - do { - $res_397 = $result; - $pos_397 = $this->pos; - $matcher = 'match_'.'UncachedBlock'; - $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); - $_424 = true; - break; - } - $result = $res_397; - $this->pos = $pos_397; - $_422 = null; - do { - $res_399 = $result; - $pos_399 = $this->pos; - $matcher = 'match_'.'OldI18NTag'; - $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); - $_422 = true; - break; - } - $result = $res_399; - $this->pos = $pos_399; - $_420 = null; - do { - $res_401 = $result; - $pos_401 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_420 = true; - break; - } - $result = $res_401; - $this->pos = $pos_401; - $_418 = null; - do { - $res_403 = $result; - $pos_403 = $this->pos; - $matcher = 'match_'.'ClosedBlock'; - $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); - $_418 = true; - break; - } - $result = $res_403; - $this->pos = $pos_403; - $_416 = null; - do { - $res_405 = $result; - $pos_405 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_416 = true; - break; - } - $result = $res_405; - $this->pos = $pos_405; - $_414 = null; - do { - $res_407 = $result; - $pos_407 = $this->pos; - $matcher = 'match_'.'MalformedBlock'; - $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); - $_414 = true; - break; - } - $result = $res_407; - $this->pos = $pos_407; - $_412 = null; - do { - $res_409 = $result; - $pos_409 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_412 = true; - break; - } - $result = $res_409; - $this->pos = $pos_409; - $matcher = 'match_'.'Text'; - $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); - $_412 = true; - break; - } - $result = $res_409; - $this->pos = $pos_409; - $_412 = false; - break; - } while (0); - if ($_412 === true) { - $_414 = true; - break; - } - $result = $res_407; - $this->pos = $pos_407; - $_414 = false; - break; - } while (0); - if ($_414 === true) { - $_416 = true; - break; - } - $result = $res_405; - $this->pos = $pos_405; - $_416 = false; - break; - } while (0); - if ($_416 === true) { - $_418 = true; - break; - } - $result = $res_403; - $this->pos = $pos_403; - $_418 = false; - break; - } while (0); - if ($_418 === true) { - $_420 = true; - break; - } - $result = $res_401; - $this->pos = $pos_401; - $_420 = false; - break; - } while (0); - if ($_420 === true) { - $_422 = true; - break; - } - $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; - } + function match_CacheRestrictedTemplate ($stack = array()) { + $matchrule = "CacheRestrictedTemplate"; $result = $this->construct($matchrule, $matchrule, null); + $count = 0; + while (true) { + $res_437 = $result; + $pos_437 = $this->pos; + $_436 = NULL; + do { + $_434 = NULL; + do { + $res_387 = $result; + $pos_387 = $this->pos; + $matcher = 'match_'.'Comment'; $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 ); + $_434 = TRUE; break; + } + $result = $res_387; + $this->pos = $pos_387; + $_432 = NULL; + do { + $res_389 = $result; + $pos_389 = $this->pos; + $matcher = 'match_'.'Translate'; $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 ); + $_432 = TRUE; break; + } + $result = $res_389; + $this->pos = $pos_389; + $_430 = NULL; + do { + $res_391 = $result; + $pos_391 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_430 = TRUE; break; + } + $result = $res_391; + $this->pos = $pos_391; + $_428 = NULL; + do { + $res_393 = $result; + $pos_393 = $this->pos; + $matcher = 'match_'.'Require'; $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 ); + $_428 = TRUE; break; + } + $result = $res_393; + $this->pos = $pos_393; + $_426 = NULL; + do { + $res_395 = $result; + $pos_395 = $this->pos; + $matcher = 'match_'.'CacheBlock'; $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 ); + $_426 = TRUE; break; + } + $result = $res_395; + $this->pos = $pos_395; + $_424 = NULL; + do { + $res_397 = $result; + $pos_397 = $this->pos; + $matcher = 'match_'.'UncachedBlock'; $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 ); + $_424 = TRUE; break; + } + $result = $res_397; + $this->pos = $pos_397; + $_422 = NULL; + do { + $res_399 = $result; + $pos_399 = $this->pos; + $matcher = 'match_'.'OldI18NTag'; $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 ); + $_422 = TRUE; break; + } + $result = $res_399; + $this->pos = $pos_399; + $_420 = NULL; + do { + $res_401 = $result; + $pos_401 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_420 = TRUE; break; + } + $result = $res_401; + $this->pos = $pos_401; + $_418 = NULL; + do { + $res_403 = $result; + $pos_403 = $this->pos; + $matcher = 'match_'.'ClosedBlock'; $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 ); + $_418 = TRUE; break; + } + $result = $res_403; + $this->pos = $pos_403; + $_416 = NULL; + do { + $res_405 = $result; + $pos_405 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_416 = TRUE; break; + } + $result = $res_405; + $this->pos = $pos_405; + $_414 = NULL; + do { + $res_407 = $result; + $pos_407 = $this->pos; + $matcher = 'match_'.'MalformedBlock'; $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 ); + $_414 = TRUE; break; + } + $result = $res_407; + $this->pos = $pos_407; + $_412 = NULL; + do { + $res_409 = $result; + $pos_409 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_412 = TRUE; break; + } + $result = $res_409; + $this->pos = $pos_409; + $matcher = 'match_'.'Text'; $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 ); + $_412 = TRUE; break; + } + $result = $res_409; + $this->pos = $pos_409; + $_412 = FALSE; break; + } + while(0); + if( $_412 === TRUE ) { $_414 = TRUE; break; } + $result = $res_407; + $this->pos = $pos_407; + $_414 = FALSE; break; + } + while(0); + if( $_414 === TRUE ) { $_416 = TRUE; break; } + $result = $res_405; + $this->pos = $pos_405; + $_416 = FALSE; break; + } + while(0); + if( $_416 === TRUE ) { $_418 = TRUE; break; } + $result = $res_403; + $this->pos = $pos_403; + $_418 = FALSE; break; + } + while(0); + if( $_418 === TRUE ) { $_420 = TRUE; break; } + $result = $res_401; + $this->pos = $pos_401; + $_420 = FALSE; break; + } + while(0); + if( $_420 === TRUE ) { $_422 = TRUE; break; } + $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: - '<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") > - Condition:IfArgument )? > '%>' - (CacheBlock | UncachedBlock | CacheBlockTemplate)* - '<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>' */ + '<%' < CacheTag:("cached"|"cacheblock") < (CacheBlockArguments)? ( < Conditional:("if"|"unless") > + Condition:IfArgument )? > '%>' + (CacheBlock | UncachedBlock | CacheBlockTemplate)* + '<%' < 'end_' ("cached"|"uncached"|"cacheblock") > '%>' */ protected $match_CacheBlock_typestack = array('CacheBlock'); - function match_CacheBlock($stack = array()) - { - $matchrule = "CacheBlock"; - $result = $this->construct($matchrule, $matchrule, null); - $_492 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_492 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $stack[] = $result; - $result = $this->construct($matchrule, "CacheTag"); - $_445 = null; - do { - $_443 = null; - do { - $res_440 = $result; - $pos_440 = $this->pos; - if (( $subres = $this->literal('cached') ) !== false) { - $result["text"] .= $subres; - $_443 = true; - break; - } - $result = $res_440; - $this->pos = $pos_440; - if (( $subres = $this->literal('cacheblock') ) !== false) { - $result["text"] .= $subres; - $_443 = true; - break; - } - $result = $res_440; - $this->pos = $pos_440; - $_443 = false; - break; - } while (0); - if ($_443 === false) { - $_445 = false; - break; - } - $_445 = true; - break; - } while (0); - if ($_445 === true) { - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'CacheTag'); - } - if ($_445 === false) { - $result = array_pop($stack); - $_492 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_450 = $result; - $pos_450 = $this->pos; - $_449 = null; - do { - $matcher = 'match_'.'CacheBlockArguments'; - $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 { - $_449 = false; - break; - } - $_449 = true; - break; - } while (0); - if ($_449 === false) { - $result = $res_450; - $this->pos = $pos_450; - unset($res_450); - unset($pos_450); - } - $res_462 = $result; - $pos_462 = $this->pos; - $_461 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $stack[] = $result; - $result = $this->construct($matchrule, "Conditional"); - $_457 = null; - do { - $_455 = null; - do { - $res_452 = $result; - $pos_452 = $this->pos; - if (( $subres = $this->literal('if') ) !== false) { - $result["text"] .= $subres; - $_455 = true; - break; - } - $result = $res_452; - $this->pos = $pos_452; - if (( $subres = $this->literal('unless') ) !== false) { - $result["text"] .= $subres; - $_455 = true; - break; - } - $result = $res_452; - $this->pos = $pos_452; - $_455 = false; - break; - } while (0); - if ($_455 === false) { - $_457 = false; - break; - } - $_457 = true; - break; - } while (0); - if ($_457 === true) { - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'Conditional'); - } - if ($_457 === false) { - $result = array_pop($stack); - $_461 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "Condition"); - } else { - $_461 = false; - break; - } - $_461 = true; - break; - } while (0); - if ($_461 === false) { - $result = $res_462; - $this->pos = $pos_462; - unset($res_462); - unset($pos_462); - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('%>') ) !== false) { - $result["text"] .= $subres; - } else { - $_492 = false; - break; - } - while (true) { - $res_475 = $result; - $pos_475 = $this->pos; - $_474 = null; - do { - $_472 = null; - do { - $res_465 = $result; - $pos_465 = $this->pos; - $matcher = 'match_'.'CacheBlock'; - $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); - $_472 = true; - break; - } - $result = $res_465; - $this->pos = $pos_465; - $_470 = null; - do { - $res_467 = $result; - $pos_467 = $this->pos; - $matcher = 'match_'.'UncachedBlock'; - $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); - $_470 = true; - break; - } - $result = $res_467; - $this->pos = $pos_467; - $matcher = 'match_'.'CacheBlockTemplate'; - $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); - $_470 = true; - break; - } - $result = $res_467; - $this->pos = $pos_467; - $_470 = false; - break; - } while (0); - if ($_470 === true) { - $_472 = true; - break; - } - $result = $res_465; - $this->pos = $pos_465; - $_472 = false; - break; - } while (0); - if ($_472 === false) { - $_474 = false; - break; - } - $_474 = true; - break; - } while (0); - if ($_474 === false) { - $result = $res_475; - $this->pos = $pos_475; - unset($res_475); - 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; - } + function match_CacheBlock ($stack = array()) { + $matchrule = "CacheBlock"; $result = $this->construct($matchrule, $matchrule, null); + $_492 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_492 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $stack[] = $result; $result = $this->construct( $matchrule, "CacheTag" ); + $_445 = NULL; + do { + $_443 = NULL; + do { + $res_440 = $result; + $pos_440 = $this->pos; + if (( $subres = $this->literal( 'cached' ) ) !== FALSE) { + $result["text"] .= $subres; + $_443 = TRUE; break; + } + $result = $res_440; + $this->pos = $pos_440; + if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) { + $result["text"] .= $subres; + $_443 = TRUE; break; + } + $result = $res_440; + $this->pos = $pos_440; + $_443 = FALSE; break; + } + while(0); + if( $_443 === FALSE) { $_445 = FALSE; break; } + $_445 = TRUE; break; + } + while(0); + if( $_445 === TRUE ) { + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'CacheTag' ); + } + if( $_445 === FALSE) { + $result = array_pop($stack); + $_492 = FALSE; break; + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_450 = $result; + $pos_450 = $this->pos; + $_449 = NULL; + do { + $matcher = 'match_'.'CacheBlockArguments'; $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 { $_449 = FALSE; break; } + $_449 = TRUE; break; + } + while(0); + if( $_449 === FALSE) { + $result = $res_450; + $this->pos = $pos_450; + unset( $res_450 ); + unset( $pos_450 ); + } + $res_462 = $result; + $pos_462 = $this->pos; + $_461 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $stack[] = $result; $result = $this->construct( $matchrule, "Conditional" ); + $_457 = NULL; + do { + $_455 = NULL; + do { + $res_452 = $result; + $pos_452 = $this->pos; + if (( $subres = $this->literal( 'if' ) ) !== FALSE) { + $result["text"] .= $subres; + $_455 = TRUE; break; + } + $result = $res_452; + $this->pos = $pos_452; + if (( $subres = $this->literal( 'unless' ) ) !== FALSE) { + $result["text"] .= $subres; + $_455 = TRUE; break; + } + $result = $res_452; + $this->pos = $pos_452; + $_455 = FALSE; break; + } + while(0); + if( $_455 === FALSE) { $_457 = FALSE; break; } + $_457 = TRUE; break; + } + while(0); + if( $_457 === TRUE ) { + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'Conditional' ); + } + if( $_457 === FALSE) { + $result = array_pop($stack); + $_461 = FALSE; break; + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "Condition" ); + } + else { $_461 = FALSE; break; } + $_461 = TRUE; break; + } + while(0); + if( $_461 === FALSE) { + $result = $res_462; + $this->pos = $pos_462; + unset( $res_462 ); + unset( $pos_462 ); + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_492 = FALSE; break; } + while (true) { + $res_475 = $result; + $pos_475 = $this->pos; + $_474 = NULL; + do { + $_472 = NULL; + do { + $res_465 = $result; + $pos_465 = $this->pos; + $matcher = 'match_'.'CacheBlock'; $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 ); + $_472 = TRUE; break; + } + $result = $res_465; + $this->pos = $pos_465; + $_470 = NULL; + do { + $res_467 = $result; + $pos_467 = $this->pos; + $matcher = 'match_'.'UncachedBlock'; $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 ); + $_470 = TRUE; break; + } + $result = $res_467; + $this->pos = $pos_467; + $matcher = 'match_'.'CacheBlockTemplate'; $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 ); + $_470 = TRUE; break; + } + $result = $res_467; + $this->pos = $pos_467; + $_470 = FALSE; break; + } + while(0); + if( $_470 === TRUE ) { $_472 = TRUE; break; } + $result = $res_465; + $this->pos = $pos_465; + $_472 = FALSE; break; + } + while(0); + if( $_472 === FALSE) { $_474 = FALSE; break; } + $_474 = TRUE; break; + } + while(0); + if( $_474 === FALSE) { + $result = $res_475; + $this->pos = $pos_475; + unset( $res_475 ); + 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. $res['php'] .= '$keyExpression = function() use ($scope, $cache) {' . 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, // 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. @@ -4029,176 +3060,123 @@ class SSTemplateParser extends Parser implements TemplateParser /* OldTPart: "_t" N "(" N QuotedString (N "," N CallArguments)? N ")" N (";")? */ protected $match_OldTPart_typestack = array('OldTPart'); - function match_OldTPart($stack = array()) - { - $matchrule = "OldTPart"; - $result = $this->construct($matchrule, $matchrule, null); - $_511 = null; - do { - if (( $subres = $this->literal('_t') ) !== false) { - $result["text"] .= $subres; - } 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; - } - 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; - } - $matcher = 'match_'.'QuotedString'; - $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_504 = $result; - $pos_504 = $this->pos; - $_503 = null; - do { - $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 { - $_503 = false; - break; - } - if (substr($this->string, $this->pos, 1) == ',') { - $this->pos += 1; - $result["text"] .= ','; - } else { - $_503 = 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 { - $_503 = false; - 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 !== false) { - $this->store($result, $subres); - } else { - $_503 = false; - break; - } - $_503 = true; - break; - } while (0); - if ($_503 === false) { - $result = $res_504; - $this->pos = $pos_504; - unset($res_504); - unset($pos_504); - } - $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; - } - 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; - } + function match_OldTPart ($stack = array()) { + $matchrule = "OldTPart"; $result = $this->construct($matchrule, $matchrule, null); + $_511 = NULL; + do { + if (( $subres = $this->literal( '_t' ) ) !== FALSE) { $result["text"] .= $subres; } + 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; } + 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; } + $matcher = 'match_'.'QuotedString'; $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_504 = $result; + $pos_504 = $this->pos; + $_503 = NULL; + do { + $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 { $_503 = FALSE; break; } + if (substr($this->string,$this->pos,1) == ',') { + $this->pos += 1; + $result["text"] .= ','; + } + else { $_503 = 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 { $_503 = FALSE; 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 !== FALSE) { + $this->store( $result, $subres ); + } + else { $_503 = FALSE; break; } + $_503 = TRUE; break; + } + while(0); + if( $_503 === FALSE) { + $result = $res_504; + $this->pos = $pos_504; + unset( $res_504 ); + unset( $pos_504 ); + } + $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; } + 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]* / */ protected $match_N_typestack = array('N'); - function match_N($stack = array()) - { - $matchrule = "N"; - $result = $this->construct($matchrule, $matchrule, null); - if (( $subres = $this->rx('/ [\s\n]* /') ) !== false) { - $result["text"] .= $subres; - return $this->finalise($result); - } else { - return false; - } + function match_N ($stack = array()) { + $matchrule = "N"; $result = $this->construct($matchrule, $matchrule, null); + if (( $subres = $this->rx( '/ [\s\n]* /' ) ) !== FALSE) { + $result["text"] .= $subres; + return $this->finalise($result); + } + else { return FALSE; } } @@ -4230,49 +3208,27 @@ class SSTemplateParser extends Parser implements TemplateParser /* OldTTag: "<%" < OldTPart > "%>" */ protected $match_OldTTag_typestack = array('OldTTag'); - function match_OldTTag($stack = array()) - { - $matchrule = "OldTTag"; - $result = $this->construct($matchrule, $matchrule, null); - $_519 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_519 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'OldTPart'; - $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 { - $_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; - } + function match_OldTTag ($stack = array()) { + $matchrule = "OldTTag"; $result = $this->construct($matchrule, $matchrule, null); + $_519 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_519 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'OldTPart'; $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 { $_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 > ")" > "%>" */ protected $match_OldSprintfTag_typestack = array('OldSprintfTag'); - function match_OldSprintfTag($stack = array()) - { - $matchrule = "OldSprintfTag"; - $result = $this->construct($matchrule, $matchrule, null); - $_536 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_536 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('sprintf') ) !== false) { - $result["text"] .= $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; - } - $matcher = 'match_'.'OldTPart'; - $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; - } - $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; - } + function match_OldSprintfTag ($stack = array()) { + $matchrule = "OldSprintfTag"; $result = $this->construct($matchrule, $matchrule, null); + $_536 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_536 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'sprintf' ) ) !== FALSE) { $result["text"] .= $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; } + $matcher = 'match_'.'OldTPart'; $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; } + $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 */ protected $match_OldI18NTag_typestack = array('OldI18NTag'); - function match_OldI18NTag($stack = array()) - { - $matchrule = "OldI18NTag"; - $result = $this->construct($matchrule, $matchrule, null); - $_541 = null; - do { - $res_538 = $result; - $pos_538 = $this->pos; - $matcher = 'match_'.'OldSprintfTag'; - $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); - $_541 = true; - break; - } - $result = $res_538; - $this->pos = $pos_538; - $matcher = 'match_'.'OldTTag'; - $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); - $_541 = true; - break; - } - $result = $res_538; - $this->pos = $pos_538; - $_541 = false; - break; - } while (0); - if ($_541 === true) { - return $this->finalise($result); - } - if ($_541 === false) { - return false; - } + function match_OldI18NTag ($stack = array()) { + $matchrule = "OldI18NTag"; $result = $this->construct($matchrule, $matchrule, null); + $_541 = NULL; + do { + $res_538 = $result; + $pos_538 = $this->pos; + $matcher = 'match_'.'OldSprintfTag'; $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 ); + $_541 = TRUE; break; + } + $result = $res_538; + $this->pos = $pos_538; + $matcher = 'match_'.'OldTTag'; $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 ); + $_541 = TRUE; break; + } + $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 */ protected $match_NamedArgument_typestack = array('NamedArgument'); - function match_NamedArgument($stack = array()) - { - $matchrule = "NamedArgument"; - $result = $this->construct($matchrule, $matchrule, null); - $_546 = null; - do { - $matcher = 'match_'.'Word'; - $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, "Name"); - } else { - $_546 = false; - break; - } - if (substr($this->string, $this->pos, 1) == '=') { - $this->pos += 1; - $result["text"] .= '='; - } else { - $_546 = false; - break; - } - $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, "Value"); - } else { - $_546 = false; - break; - } - $_546 = true; - break; - } while (0); - if ($_546 === true) { - return $this->finalise($result); - } - if ($_546 === false) { - return false; - } + function match_NamedArgument ($stack = array()) { + $matchrule = "NamedArgument"; $result = $this->construct($matchrule, $matchrule, null); + $_546 = NULL; + do { + $matcher = 'match_'.'Word'; $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, "Name" ); + } + else { $_546 = FALSE; break; } + if (substr($this->string,$this->pos,1) == '=') { + $this->pos += 1; + $result["text"] .= '='; + } + else { $_546 = FALSE; break; } + $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, "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 )*)? > "%>" */ protected $match_Include_typestack = array('Include'); - function match_Include($stack = array()) - { - $matchrule = "Include"; - $result = $this->construct($matchrule, $matchrule, null); - $_565 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_565 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('include') ) !== false) { - $result["text"] .= $subres; - } else { - $_565 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $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 !== false) { - $this->store($result, $subres, "Template"); - } else { - $_565 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_562 = $result; - $pos_562 = $this->pos; - $_561 = null; - do { - $matcher = 'match_'.'NamedArgument'; - $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 { - $_561 = false; - break; - } - while (true) { - $res_560 = $result; - $pos_560 = $this->pos; - $_559 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (substr($this->string, $this->pos, 1) == ',') { - $this->pos += 1; - $result["text"] .= ','; - } else { - $_559 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $matcher = 'match_'.'NamedArgument'; - $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 { - $_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; - } + function match_Include ($stack = array()) { + $matchrule = "Include"; $result = $this->construct($matchrule, $matchrule, null); + $_565 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_565 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'include' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_565 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $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 !== FALSE) { + $this->store( $result, $subres, "Template" ); + } + else { $_565 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_562 = $result; + $pos_562 = $this->pos; + $_561 = NULL; + do { + $matcher = 'match_'.'NamedArgument'; $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 { $_561 = FALSE; break; } + while (true) { + $res_560 = $result; + $pos_560 = $this->pos; + $_559 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (substr($this->string,$this->pos,1) == ',') { + $this->pos += 1; + $result["text"] .= ','; + } + else { $_559 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $matcher = 'match_'.'NamedArgument'; $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 { $_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)* */ protected $match_BlockArguments_typestack = array('BlockArguments'); - function match_BlockArguments($stack = array()) - { - $matchrule = "BlockArguments"; - $result = $this->construct($matchrule, $matchrule, null); - $_574 = null; - do { - $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, "Argument"); - } else { - $_574 = false; - break; - } - while (true) { - $res_573 = $result; - $pos_573 = $this->pos; - $_572 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (substr($this->string, $this->pos, 1) == ',') { - $this->pos += 1; - $result["text"] .= ','; - } else { - $_572 = false; - break; - } - 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, "Argument"); - } else { - $_572 = false; - break; - } - $_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; - } + function match_BlockArguments ($stack = array()) { + $matchrule = "BlockArguments"; $result = $this->construct($matchrule, $matchrule, null); + $_574 = NULL; + do { + $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, "Argument" ); + } + else { $_574 = FALSE; break; } + while (true) { + $res_573 = $result; + $pos_573 = $this->pos; + $_572 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (substr($this->string,$this->pos,1) == ',') { + $this->pos += 1; + $result["text"] .= ','; + } + else { $_572 = FALSE; break; } + 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, "Argument" ); + } + else { $_572 = FALSE; break; } + $_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")]) */ protected $match_NotBlockTag_typestack = array('NotBlockTag'); - function match_NotBlockTag($stack = array()) - { - $matchrule = "NotBlockTag"; - $result = $this->construct($matchrule, $matchrule, null); - $_612 = null; - do { - $res_576 = $result; - $pos_576 = $this->pos; - if (( $subres = $this->literal('end_') ) !== false) { - $result["text"] .= $subres; - $_612 = true; - break; - } - $result = $res_576; - $this->pos = $pos_576; - $_610 = null; - do { - $_607 = null; - do { - $_605 = null; - do { - $res_578 = $result; - $pos_578 = $this->pos; - if (( $subres = $this->literal('if') ) !== false) { - $result["text"] .= $subres; - $_605 = true; - break; - } - $result = $res_578; - $this->pos = $pos_578; - $_603 = null; - do { - $res_580 = $result; - $pos_580 = $this->pos; - if (( $subres = $this->literal('else_if') ) !== false) { - $result["text"] .= $subres; - $_603 = true; - break; - } - $result = $res_580; - $this->pos = $pos_580; - $_601 = null; - do { - $res_582 = $result; - $pos_582 = $this->pos; - if (( $subres = $this->literal('else') ) !== false) { - $result["text"] .= $subres; - $_601 = true; - break; - } - $result = $res_582; - $this->pos = $pos_582; - $_599 = null; - do { - $res_584 = $result; - $pos_584 = $this->pos; - if (( $subres = $this->literal('require') ) !== false) { - $result["text"] .= $subres; - $_599 = true; - break; - } - $result = $res_584; - $this->pos = $pos_584; - $_597 = null; - do { - $res_586 = $result; - $pos_586 = $this->pos; - if (( $subres = $this->literal('cached') ) !== false) { - $result["text"] .= $subres; - $_597 = true; - break; - } - $result = $res_586; - $this->pos = $pos_586; - $_595 = null; - do { - $res_588 = $result; - $pos_588 = $this->pos; - if (( $subres = $this->literal('uncached') ) !== false) { - $result["text"] .= $subres; - $_595 = true; - break; - } - $result = $res_588; - $this->pos = $pos_588; - $_593 = null; - do { - $res_590 = $result; - $pos_590 = $this->pos; - if (( $subres = $this->literal('cacheblock') ) !== false) { - $result["text"] .= $subres; - $_593 = true; - break; - } - $result = $res_590; - $this->pos = $pos_590; - if (( $subres = $this->literal('include') ) !== false) { - $result["text"] .= $subres; - $_593 = true; - break; - } - $result = $res_590; - $this->pos = $pos_590; - $_593 = false; - break; - } while (0); - if ($_593 === true) { - $_595 = true; - break; - } - $result = $res_588; - $this->pos = $pos_588; - $_595 = false; - break; - } while (0); - if ($_595 === true) { - $_597 = true; - break; - } - $result = $res_586; - $this->pos = $pos_586; - $_597 = false; - break; - } while (0); - if ($_597 === true) { - $_599 = true; - break; - } - $result = $res_584; - $this->pos = $pos_584; - $_599 = false; - break; - } while (0); - if ($_599 === true) { - $_601 = true; - break; - } - $result = $res_582; - $this->pos = $pos_582; - $_601 = false; - break; - } while (0); - if ($_601 === true) { - $_603 = true; - break; - } - $result = $res_580; - $this->pos = $pos_580; - $_603 = 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; - } + function match_NotBlockTag ($stack = array()) { + $matchrule = "NotBlockTag"; $result = $this->construct($matchrule, $matchrule, null); + $_612 = NULL; + do { + $res_576 = $result; + $pos_576 = $this->pos; + if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { + $result["text"] .= $subres; + $_612 = TRUE; break; + } + $result = $res_576; + $this->pos = $pos_576; + $_610 = NULL; + do { + $_607 = NULL; + do { + $_605 = NULL; + do { + $res_578 = $result; + $pos_578 = $this->pos; + if (( $subres = $this->literal( 'if' ) ) !== FALSE) { + $result["text"] .= $subres; + $_605 = TRUE; break; + } + $result = $res_578; + $this->pos = $pos_578; + $_603 = NULL; + do { + $res_580 = $result; + $pos_580 = $this->pos; + if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) { + $result["text"] .= $subres; + $_603 = TRUE; break; + } + $result = $res_580; + $this->pos = $pos_580; + $_601 = NULL; + do { + $res_582 = $result; + $pos_582 = $this->pos; + if (( $subres = $this->literal( 'else' ) ) !== FALSE) { + $result["text"] .= $subres; + $_601 = TRUE; break; + } + $result = $res_582; + $this->pos = $pos_582; + $_599 = NULL; + do { + $res_584 = $result; + $pos_584 = $this->pos; + if (( $subres = $this->literal( 'require' ) ) !== FALSE) { + $result["text"] .= $subres; + $_599 = TRUE; break; + } + $result = $res_584; + $this->pos = $pos_584; + $_597 = NULL; + do { + $res_586 = $result; + $pos_586 = $this->pos; + if (( $subres = $this->literal( 'cached' ) ) !== FALSE) { + $result["text"] .= $subres; + $_597 = TRUE; break; + } + $result = $res_586; + $this->pos = $pos_586; + $_595 = NULL; + do { + $res_588 = $result; + $pos_588 = $this->pos; + if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) { + $result["text"] .= $subres; + $_595 = TRUE; break; + } + $result = $res_588; + $this->pos = $pos_588; + $_593 = NULL; + do { + $res_590 = $result; + $pos_590 = $this->pos; + if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) { + $result["text"] .= $subres; + $_593 = TRUE; break; + } + $result = $res_590; + $this->pos = $pos_590; + if (( $subres = $this->literal( 'include' ) ) !== FALSE) { + $result["text"] .= $subres; + $_593 = TRUE; break; + } + $result = $res_590; + $this->pos = $pos_590; + $_593 = FALSE; break; + } + while(0); + if( $_593 === TRUE ) { $_595 = TRUE; break; } + $result = $res_588; + $this->pos = $pos_588; + $_595 = FALSE; break; + } + while(0); + if( $_595 === TRUE ) { $_597 = TRUE; break; } + $result = $res_586; + $this->pos = $pos_586; + $_597 = FALSE; break; + } + while(0); + if( $_597 === TRUE ) { $_599 = TRUE; break; } + $result = $res_584; + $this->pos = $pos_584; + $_599 = FALSE; break; + } + while(0); + if( $_599 === TRUE ) { $_601 = TRUE; break; } + $result = $res_582; + $this->pos = $pos_582; + $_601 = FALSE; break; + } + while(0); + if( $_601 === TRUE ) { $_603 = TRUE; break; } + $result = $res_580; + $this->pos = $pos_580; + $_603 = 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? - '<%' < 'end_' '$BlockName' > '%>' */ + '<%' < 'end_' '$BlockName' > '%>' */ protected $match_ClosedBlock_typestack = array('ClosedBlock'); - function match_ClosedBlock($stack = array()) - { - $matchrule = "ClosedBlock"; - $result = $this->construct($matchrule, $matchrule, null); - $_632 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_632 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_616 = $result; - $pos_616 = $this->pos; - $matcher = 'match_'.'NotBlockTag'; - $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); - $result = $res_616; - $this->pos = $pos_616; - $_632 = false; - break; - } else { - $result = $res_616; - $this->pos = $pos_616; - } - $matcher = 'match_'.'Word'; - $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, "BlockName"); - } else { - $_632 = false; - break; - } - $res_622 = $result; - $pos_622 = $this->pos; - $_621 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_621 = false; - break; - } - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "BlockArguments"); - } else { - $_621 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_621 = false; - break; - } - $_621 = true; - break; - } while (0); - if ($_621 === false) { - $result = $res_622; - $this->pos = $pos_622; - unset($res_622); - unset($pos_622); - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $stack[] = $result; - $result = $this->construct($matchrule, "Zap"); - if (( $subres = $this->literal('%>') ) !== false) { - $result["text"] .= $subres; - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'Zap'); - } else { - $result = array_pop($stack); - $_632 = 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; - } + function match_ClosedBlock ($stack = array()) { + $matchrule = "ClosedBlock"; $result = $this->construct($matchrule, $matchrule, null); + $_632 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_632 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_616 = $result; + $pos_616 = $this->pos; + $matcher = 'match_'.'NotBlockTag'; $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 ); + $result = $res_616; + $this->pos = $pos_616; + $_632 = FALSE; break; + } + else { + $result = $res_616; + $this->pos = $pos_616; + } + $matcher = 'match_'.'Word'; $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, "BlockName" ); + } + else { $_632 = FALSE; break; } + $res_622 = $result; + $pos_622 = $this->pos; + $_621 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_621 = FALSE; break; } + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "BlockArguments" ); + } + else { $_621 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_621 = FALSE; break; } + $_621 = TRUE; break; + } + while(0); + if( $_621 === FALSE) { + $result = $res_622; + $this->pos = $pos_622; + unset( $res_622 ); + unset( $pos_622 ); + } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $stack[] = $result; $result = $this->construct( $matchrule, "Zap" ); + if (( $subres = $this->literal( '%>' ) ) !== FALSE) { + $result["text"] .= $subres; + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'Zap' ); + } + else { + $result = array_pop($stack); + $_632 = 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 ] )? > '%>' */ protected $match_OpenBlock_typestack = array('OpenBlock'); - function match_OpenBlock($stack = array()) - { - $matchrule = "OpenBlock"; - $result = $this->construct($matchrule, $matchrule, null); - $_645 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_645 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_636 = $result; - $pos_636 = $this->pos; - $matcher = 'match_'.'NotBlockTag'; - $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); - $result = $res_636; - $this->pos = $pos_636; - $_645 = false; - break; - } else { - $result = $res_636; - $this->pos = $pos_636; - } - $matcher = 'match_'.'Word'; - $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, "BlockName"); - } else { - $_645 = false; - break; - } - $res_642 = $result; - $pos_642 = $this->pos; - $_641 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_641 = false; - break; - } - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "BlockArguments"); - } else { - $_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; - } + function match_OpenBlock ($stack = array()) { + $matchrule = "OpenBlock"; $result = $this->construct($matchrule, $matchrule, null); + $_645 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_645 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_636 = $result; + $pos_636 = $this->pos; + $matcher = 'match_'.'NotBlockTag'; $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 ); + $result = $res_636; + $this->pos = $pos_636; + $_645 = FALSE; break; + } + else { + $result = $res_636; + $this->pos = $pos_636; + } + $matcher = 'match_'.'Word'; $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, "BlockName" ); + } + else { $_645 = FALSE; break; } + $res_642 = $result; + $pos_642 = $this->pos; + $_641 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_641 = FALSE; break; } + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "BlockArguments" ); + } + else { $_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 > '%>' */ protected $match_MismatchedEndBlock_typestack = array('MismatchedEndBlock'); - function match_MismatchedEndBlock($stack = array()) - { - $matchrule = "MismatchedEndBlock"; - $result = $this->construct($matchrule, $matchrule, null); - $_653 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_653 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - if (( $subres = $this->literal('end_') ) !== false) { - $result["text"] .= $subres; - } else { - $_653 = false; - break; - } - $matcher = 'match_'.'Word'; - $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, "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; - } + function match_MismatchedEndBlock ($stack = array()) { + $matchrule = "MismatchedEndBlock"; $result = $this->construct($matchrule, $matchrule, null); + $_653 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_653 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_653 = FALSE; break; } + $matcher = 'match_'.'Word'; $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, "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 ] )? > '%>' ) */ protected $match_MalformedOpenTag_typestack = array('MalformedOpenTag'); - function match_MalformedOpenTag($stack = array()) - { - $matchrule = "MalformedOpenTag"; - $result = $this->construct($matchrule, $matchrule, null); - $_668 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_668 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $res_657 = $result; - $pos_657 = $this->pos; - $matcher = 'match_'.'NotBlockTag'; - $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); - $result = $res_657; - $this->pos = $pos_657; - $_668 = false; - break; - } else { - $result = $res_657; - $this->pos = $pos_657; - } - $matcher = 'match_'.'Word'; - $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, "Tag"); - } else { - $_668 = false; - break; - } - $res_667 = $result; - $pos_667 = $this->pos; - $_666 = null; - do { - $res_663 = $result; - $pos_663 = $this->pos; - $_662 = null; - do { - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_662 = false; - break; - } - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres, "BlockArguments"); - } else { - $_662 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } else { - $_662 = false; - break; - } - $_662 = true; - break; - } while (0); - 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; - } + function match_MalformedOpenTag ($stack = array()) { + $matchrule = "MalformedOpenTag"; $result = $this->construct($matchrule, $matchrule, null); + $_668 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_668 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $res_657 = $result; + $pos_657 = $this->pos; + $matcher = 'match_'.'NotBlockTag'; $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 ); + $result = $res_657; + $this->pos = $pos_657; + $_668 = FALSE; break; + } + else { + $result = $res_657; + $this->pos = $pos_657; + } + $matcher = 'match_'.'Word'; $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, "Tag" ); + } + else { $_668 = FALSE; break; } + $res_667 = $result; + $pos_667 = $this->pos; + $_666 = NULL; + do { + $res_663 = $result; + $pos_663 = $this->pos; + $_662 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_662 = FALSE; break; } + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres, "BlockArguments" ); + } + else { $_662 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_662 = FALSE; break; } + $_662 = TRUE; break; + } + while(0); + 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 ) !( > '%>' ) */ protected $match_MalformedCloseTag_typestack = array('MalformedCloseTag'); - function match_MalformedCloseTag($stack = array()) - { - $matchrule = "MalformedCloseTag"; - $result = $this->construct($matchrule, $matchrule, null); - $_680 = null; - do { - if (( $subres = $this->literal('<%') ) !== false) { - $result["text"] .= $subres; - } else { - $_680 = false; - break; - } - if (( $subres = $this->whitespace() ) !== false) { - $result["text"] .= $subres; - } - $stack[] = $result; - $result = $this->construct($matchrule, "Tag"); - $_674 = null; - do { - if (( $subres = $this->literal('end_') ) !== false) { - $result["text"] .= $subres; - } else { - $_674 = false; - break; - } - $matcher = 'match_'.'Word'; - $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, "Word"); - } else { - $_674 = false; - break; - } - $_674 = true; - break; - } while (0); - if ($_674 === true) { - $subres = $result; - $result = array_pop($stack); - $this->store($result, $subres, 'Tag'); - } - if ($_674 === false) { - $result = array_pop($stack); - $_680 = false; - break; - } - $res_679 = $result; - $pos_679 = $this->pos; - $_678 = null; - do { - if (( $subres = $this->whitespace() ) !== 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; - } + function match_MalformedCloseTag ($stack = array()) { + $matchrule = "MalformedCloseTag"; $result = $this->construct($matchrule, $matchrule, null); + $_680 = NULL; + do { + if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_680 = FALSE; break; } + if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; } + $stack[] = $result; $result = $this->construct( $matchrule, "Tag" ); + $_674 = NULL; + do { + if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_674 = FALSE; break; } + $matcher = 'match_'.'Word'; $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, "Word" ); + } + else { $_674 = FALSE; break; } + $_674 = TRUE; break; + } + while(0); + if( $_674 === TRUE ) { + $subres = $result; $result = array_pop($stack); + $this->store( $result, $subres, 'Tag' ); + } + if( $_674 === FALSE) { + $result = array_pop($stack); + $_680 = FALSE; break; + } + $res_679 = $result; + $pos_679 = $this->pos; + $_678 = NULL; + do { + if (( $subres = $this->whitespace( ) ) !== 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 */ protected $match_MalformedBlock_typestack = array('MalformedBlock'); - function match_MalformedBlock($stack = array()) - { - $matchrule = "MalformedBlock"; - $result = $this->construct($matchrule, $matchrule, null); - $_685 = null; - do { - $res_682 = $result; - $pos_682 = $this->pos; - $matcher = 'match_'.'MalformedOpenTag'; - $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); - $_685 = true; - break; - } - $result = $res_682; - $this->pos = $pos_682; - $matcher = 'match_'.'MalformedCloseTag'; - $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); - $_685 = true; - break; - } - $result = $res_682; - $this->pos = $pos_682; - $_685 = false; - break; - } while (0); - if ($_685 === true) { - return $this->finalise($result); - } - if ($_685 === false) { - return false; - } + function match_MalformedBlock ($stack = array()) { + $matchrule = "MalformedBlock"; $result = $this->construct($matchrule, $matchrule, null); + $_685 = NULL; + do { + $res_682 = $result; + $pos_682 = $this->pos; + $matcher = 'match_'.'MalformedOpenTag'; $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 ); + $_685 = TRUE; break; + } + $result = $res_682; + $this->pos = $pos_682; + $matcher = 'match_'.'MalformedCloseTag'; $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 ); + $_685 = TRUE; break; + } + $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)./)+ "--%>" */ protected $match_Comment_typestack = array('Comment'); - function match_Comment($stack = array()) - { - $matchrule = "Comment"; - $result = $this->construct($matchrule, $matchrule, null); - $_693 = null; - do { - if (( $subres = $this->literal('<%--') ) !== false) { - $result["text"] .= $subres; - } else { - $_693 = false; - break; - } - $count = 0; - while (true) { - $res_691 = $result; - $pos_691 = $this->pos; - $_690 = null; - do { - $res_688 = $result; - $pos_688 = $this->pos; - if (( $subres = $this->literal('--%>') ) !== false) { - $result["text"] .= $subres; - $result = $res_688; - $this->pos = $pos_688; - $_690 = false; - break; - } else { - $result = $res_688; - $this->pos = $pos_688; - } - if (( $subres = $this->rx('/(?s)./') ) !== false) { - $result["text"] .= $subres; - } else { - $_690 = false; - break; - } - $_690 = true; - break; - } while (0); - if ($_690 === false) { - $result = $res_691; - $this->pos = $pos_691; - unset($res_691); - unset($pos_691); - break; - } - $count += 1; - } - 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; - } + function match_Comment ($stack = array()) { + $matchrule = "Comment"; $result = $this->construct($matchrule, $matchrule, null); + $_693 = NULL; + do { + if (( $subres = $this->literal( '<%--' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_693 = FALSE; break; } + $count = 0; + while (true) { + $res_691 = $result; + $pos_691 = $this->pos; + $_690 = NULL; + do { + $res_688 = $result; + $pos_688 = $this->pos; + if (( $subres = $this->literal( '--%>' ) ) !== FALSE) { + $result["text"] .= $subres; + $result = $res_688; + $this->pos = $pos_688; + $_690 = FALSE; break; + } + else { + $result = $res_688; + $this->pos = $pos_688; + } + if (( $subres = $this->rx( '/(?s)./' ) ) !== FALSE) { $result["text"] .= $subres; } + else { $_690 = FALSE; break; } + $_690 = TRUE; break; + } + while(0); + if( $_690 === FALSE) { + $result = $res_691; + $this->pos = $pos_691; + unset( $res_691 ); + unset( $pos_691 ); + break; + } + $count += 1; + } + 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 | - OpenBlock | MalformedBlock | MismatchedEndBlock | Injection | Text)+ */ + OpenBlock | MalformedBlock | MismatchedEndBlock | Injection | Text)+ */ protected $match_TopTemplate_typestack = array('TopTemplate','Template'); - function match_TopTemplate($stack = array()) - { - $matchrule = "TopTemplate"; - $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'Template')); - $count = 0; - while (true) { - $res_749 = $result; - $pos_749 = $this->pos; - $_748 = null; - do { - $_746 = null; - do { - $res_695 = $result; - $pos_695 = $this->pos; - $matcher = 'match_'.'Comment'; - $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); - $_746 = true; - break; - } - $result = $res_695; - $this->pos = $pos_695; - $_744 = null; - do { - $res_697 = $result; - $pos_697 = $this->pos; - $matcher = 'match_'.'Translate'; - $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); - $_744 = true; - break; - } - $result = $res_697; - $this->pos = $pos_697; - $_742 = null; - do { - $res_699 = $result; - $pos_699 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_742 = true; - break; - } - $result = $res_699; - $this->pos = $pos_699; - $_740 = null; - do { - $res_701 = $result; - $pos_701 = $this->pos; - $matcher = 'match_'.'Require'; - $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); - $_740 = true; - break; - } - $result = $res_701; - $this->pos = $pos_701; - $_738 = null; - do { - $res_703 = $result; - $pos_703 = $this->pos; - $matcher = 'match_'.'CacheBlock'; - $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); - $_738 = true; - break; - } - $result = $res_703; - $this->pos = $pos_703; - $_736 = null; - do { - $res_705 = $result; - $pos_705 = $this->pos; - $matcher = 'match_'.'UncachedBlock'; - $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); - $_736 = true; - break; - } - $result = $res_705; - $this->pos = $pos_705; - $_734 = null; - do { - $res_707 = $result; - $pos_707 = $this->pos; - $matcher = 'match_'.'OldI18NTag'; - $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); - $_734 = true; - break; - } - $result = $res_707; - $this->pos = $pos_707; - $_732 = null; - do { - $res_709 = $result; - $pos_709 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_732 = true; - break; - } - $result = $res_709; - $this->pos = $pos_709; - $_730 = null; - do { - $res_711 = $result; - $pos_711 = $this->pos; - $matcher = 'match_'.'ClosedBlock'; - $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); - $_730 = true; - break; - } - $result = $res_711; - $this->pos = $pos_711; - $_728 = null; - do { - $res_713 = $result; - $pos_713 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_728 = true; - break; - } - $result = $res_713; - $this->pos = $pos_713; - $_726 = null; - do { - $res_715 = $result; - $pos_715 = $this->pos; - $matcher = 'match_'.'MalformedBlock'; - $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); - $_726 = true; - break; - } - $result = $res_715; - $this->pos = $pos_715; - $_724 = null; - do { - $res_717 = $result; - $pos_717 = $this->pos; - $matcher = 'match_'.'MismatchedEndBlock'; - $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); - $_724 = true; - break; - } - $result = $res_717; - $this->pos = $pos_717; - $_722 = null; - do { - $res_719 = $result; - $pos_719 = $this->pos; - $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)))) ); - if ($subres !== false) { - $this->store($result, $subres); - $_722 = true; - break; - } - $result = $res_719; - $this->pos = $pos_719; - $matcher = 'match_'.'Text'; - $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); - $_722 = true; - break; - } - $result = $res_719; - $this->pos = $pos_719; - $_722 = false; - break; - } while (0); - if ($_722 === true) { - $_724 = true; - break; - } - $result = $res_717; - $this->pos = $pos_717; - $_724 = false; - break; - } while (0); - if ($_724 === true) { - $_726 = true; - break; - } - $result = $res_715; - $this->pos = $pos_715; - $_726 = false; - break; - } while (0); - if ($_726 === true) { - $_728 = true; - break; - } - $result = $res_713; - $this->pos = $pos_713; - $_728 = false; - break; - } while (0); - if ($_728 === true) { - $_730 = true; - break; - } - $result = $res_711; - $this->pos = $pos_711; - $_730 = false; - break; - } while (0); - if ($_730 === true) { - $_732 = true; - break; - } - $result = $res_709; - $this->pos = $pos_709; - $_732 = false; - break; - } while (0); - 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; - } + function match_TopTemplate ($stack = array()) { + $matchrule = "TopTemplate"; $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'Template')); + $count = 0; + while (true) { + $res_749 = $result; + $pos_749 = $this->pos; + $_748 = NULL; + do { + $_746 = NULL; + do { + $res_695 = $result; + $pos_695 = $this->pos; + $matcher = 'match_'.'Comment'; $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 ); + $_746 = TRUE; break; + } + $result = $res_695; + $this->pos = $pos_695; + $_744 = NULL; + do { + $res_697 = $result; + $pos_697 = $this->pos; + $matcher = 'match_'.'Translate'; $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 ); + $_744 = TRUE; break; + } + $result = $res_697; + $this->pos = $pos_697; + $_742 = NULL; + do { + $res_699 = $result; + $pos_699 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_742 = TRUE; break; + } + $result = $res_699; + $this->pos = $pos_699; + $_740 = NULL; + do { + $res_701 = $result; + $pos_701 = $this->pos; + $matcher = 'match_'.'Require'; $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 ); + $_740 = TRUE; break; + } + $result = $res_701; + $this->pos = $pos_701; + $_738 = NULL; + do { + $res_703 = $result; + $pos_703 = $this->pos; + $matcher = 'match_'.'CacheBlock'; $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 ); + $_738 = TRUE; break; + } + $result = $res_703; + $this->pos = $pos_703; + $_736 = NULL; + do { + $res_705 = $result; + $pos_705 = $this->pos; + $matcher = 'match_'.'UncachedBlock'; $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 ); + $_736 = TRUE; break; + } + $result = $res_705; + $this->pos = $pos_705; + $_734 = NULL; + do { + $res_707 = $result; + $pos_707 = $this->pos; + $matcher = 'match_'.'OldI18NTag'; $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 ); + $_734 = TRUE; break; + } + $result = $res_707; + $this->pos = $pos_707; + $_732 = NULL; + do { + $res_709 = $result; + $pos_709 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_732 = TRUE; break; + } + $result = $res_709; + $this->pos = $pos_709; + $_730 = NULL; + do { + $res_711 = $result; + $pos_711 = $this->pos; + $matcher = 'match_'.'ClosedBlock'; $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 ); + $_730 = TRUE; break; + } + $result = $res_711; + $this->pos = $pos_711; + $_728 = NULL; + do { + $res_713 = $result; + $pos_713 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_728 = TRUE; break; + } + $result = $res_713; + $this->pos = $pos_713; + $_726 = NULL; + do { + $res_715 = $result; + $pos_715 = $this->pos; + $matcher = 'match_'.'MalformedBlock'; $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 ); + $_726 = TRUE; break; + } + $result = $res_715; + $this->pos = $pos_715; + $_724 = NULL; + do { + $res_717 = $result; + $pos_717 = $this->pos; + $matcher = 'match_'.'MismatchedEndBlock'; $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 ); + $_724 = TRUE; break; + } + $result = $res_717; + $this->pos = $pos_717; + $_722 = NULL; + do { + $res_719 = $result; + $pos_719 = $this->pos; + $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))) ) ); + if ($subres !== FALSE) { + $this->store( $result, $subres ); + $_722 = TRUE; break; + } + $result = $res_719; + $this->pos = $pos_719; + $matcher = 'match_'.'Text'; $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 ); + $_722 = TRUE; break; + } + $result = $res_719; + $this->pos = $pos_719; + $_722 = FALSE; break; + } + while(0); + if( $_722 === TRUE ) { + $_724 = TRUE; break; + } + $result = $res_717; + $this->pos = $pos_717; + $_724 = FALSE; break; + } + while(0); + if( $_724 === TRUE ) { $_726 = TRUE; break; } + $result = $res_715; + $this->pos = $pos_715; + $_726 = FALSE; break; + } + while(0); + if( $_726 === TRUE ) { $_728 = TRUE; break; } + $result = $res_713; + $this->pos = $pos_713; + $_728 = FALSE; break; + } + while(0); + if( $_728 === TRUE ) { $_730 = TRUE; break; } + $result = $res_711; + $this->pos = $pos_711; + $_730 = FALSE; break; + } + while(0); + if( $_730 === TRUE ) { $_732 = TRUE; break; } + $result = $res_709; + $this->pos = $pos_709; + $_732 = FALSE; break; + } + while(0); + 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: ( - / [^<${\\]+ / | - / (\\.) / | - '<' !'%' | - '$' !(/[A-Za-z_]/) | - '{' !'$' | - '{$' !(/[A-Za-z_]/) - )+ */ + / [^<${\\]+ / | + / (\\.) / | + '<' !'%' | + '$' !(/[A-Za-z_]/) | + '{' !'$' | + '{$' !(/[A-Za-z_]/) + )+ */ protected $match_Text_typestack = array('Text'); - function match_Text($stack = array()) - { - $matchrule = "Text"; - $result = $this->construct($matchrule, $matchrule, null); - $count = 0; - while (true) { - $res_788 = $result; - $pos_788 = $this->pos; - $_787 = null; - do { - $_785 = null; - do { - $res_750 = $result; - $pos_750 = $this->pos; - if (( $subres = $this->rx('/ [^<${\\\\]+ /') ) !== false) { - $result["text"] .= $subres; - $_785 = true; - break; - } - $result = $res_750; - $this->pos = $pos_750; - $_783 = null; - do { - $res_752 = $result; - $pos_752 = $this->pos; - if (( $subres = $this->rx('/ (\\\\.) /') ) !== false) { - $result["text"] .= $subres; - $_783 = true; - break; - } - $result = $res_752; - $this->pos = $pos_752; - $_781 = null; - do { - $res_754 = $result; - $pos_754 = $this->pos; - $_757 = null; - do { - if (substr($this->string, $this->pos, 1) == '<') { - $this->pos += 1; - $result["text"] .= '<'; - } else { - $_757 = false; - break; - } - $res_756 = $result; - $pos_756 = $this->pos; - if (substr($this->string, $this->pos, 1) == '%') { - $this->pos += 1; - $result["text"] .= '%'; - $result = $res_756; - $this->pos = $pos_756; - $_757 = false; - break; - } else { - $result = $res_756; - $this->pos = $pos_756; - } - $_757 = true; - break; - } while (0); - if ($_757 === true) { - $_781 = true; - break; - } - $result = $res_754; - $this->pos = $pos_754; - $_779 = null; - do { - $res_759 = $result; - $pos_759 = $this->pos; - $_764 = null; - do { - if (substr($this->string, $this->pos, 1) == '$') { - $this->pos += 1; - $result["text"] .= '$'; - } else { - $_764 = false; - break; - } - $res_763 = $result; - $pos_763 = $this->pos; - $_762 = null; - do { - if (( $subres = $this->rx('/[A-Za-z_]/') ) !== false) { - $result["text"] .= $subres; - } else { - $_762 = false; - break; - } - $_762 = true; - break; - } while (0); - if ($_762 === true) { - $result = $res_763; - $this->pos = $pos_763; - $_764 = false; - break; - } - if ($_762 === false) { - $result = $res_763; - $this->pos = $pos_763; - } - $_764 = true; - break; - } while (0); - if ($_764 === true) { - $_779 = true; - break; - } - $result = $res_759; - $this->pos = $pos_759; - $_777 = null; - do { - $res_766 = $result; - $pos_766 = $this->pos; - $_769 = null; - do { - if (substr($this->string, $this->pos, 1) == '{') { - $this->pos += 1; - $result["text"] .= '{'; - } else { - $_769 = false; - break; - } - $res_768 = $result; - $pos_768 = $this->pos; - if (substr($this->string, $this->pos, 1) == '$') { - $this->pos += 1; - $result["text"] .= '$'; - $result = $res_768; - $this->pos = $pos_768; - $_769 = false; - break; - } else { - $result = $res_768; - $this->pos = $pos_768; - } - $_769 = true; - break; - } while (0); - if ($_769 === true) { - $_777 = true; - break; - } - $result = $res_766; - $this->pos = $pos_766; - $_775 = null; - do { - if (( $subres = $this->literal('{$') ) !== false) { - $result["text"] .= $subres; - } else { - $_775 = false; - break; - } - $res_774 = $result; - $pos_774 = $this->pos; - $_773 = null; - do { - if (( $subres = $this->rx('/[A-Za-z_]/') ) !== false) { - $result["text"] .= $subres; - } else { - $_773 = false; - break; - } - $_773 = true; - break; - } while (0); - if ($_773 === true) { - $result = $res_774; - $this->pos = $pos_774; - $_775 = false; - break; - } - if ($_773 === false) { - $result = $res_774; - $this->pos = $pos_774; - } - $_775 = true; - break; - } while (0); - if ($_775 === true) { - $_777 = true; - break; - } - $result = $res_766; - $this->pos = $pos_766; - $_777 = false; - break; - } while (0); - if ($_777 === true) { - $_779 = true; - break; - } - $result = $res_759; - $this->pos = $pos_759; - $_779 = false; - break; - } while (0); - 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; - } + function match_Text ($stack = array()) { + $matchrule = "Text"; $result = $this->construct($matchrule, $matchrule, null); + $count = 0; + while (true) { + $res_788 = $result; + $pos_788 = $this->pos; + $_787 = NULL; + do { + $_785 = NULL; + do { + $res_750 = $result; + $pos_750 = $this->pos; + if (( $subres = $this->rx( '/ [^<${\\\\]+ /' ) ) !== FALSE) { + $result["text"] .= $subres; + $_785 = TRUE; break; + } + $result = $res_750; + $this->pos = $pos_750; + $_783 = NULL; + do { + $res_752 = $result; + $pos_752 = $this->pos; + if (( $subres = $this->rx( '/ (\\\\.) /' ) ) !== FALSE) { + $result["text"] .= $subres; + $_783 = TRUE; break; + } + $result = $res_752; + $this->pos = $pos_752; + $_781 = NULL; + do { + $res_754 = $result; + $pos_754 = $this->pos; + $_757 = NULL; + do { + if (substr($this->string,$this->pos,1) == '<') { + $this->pos += 1; + $result["text"] .= '<'; + } + else { $_757 = FALSE; break; } + $res_756 = $result; + $pos_756 = $this->pos; + if (substr($this->string,$this->pos,1) == '%') { + $this->pos += 1; + $result["text"] .= '%'; + $result = $res_756; + $this->pos = $pos_756; + $_757 = FALSE; break; + } + else { + $result = $res_756; + $this->pos = $pos_756; + } + $_757 = TRUE; break; + } + while(0); + if( $_757 === TRUE ) { $_781 = TRUE; break; } + $result = $res_754; + $this->pos = $pos_754; + $_779 = NULL; + do { + $res_759 = $result; + $pos_759 = $this->pos; + $_764 = NULL; + do { + if (substr($this->string,$this->pos,1) == '$') { + $this->pos += 1; + $result["text"] .= '$'; + } + else { $_764 = FALSE; break; } + $res_763 = $result; + $pos_763 = $this->pos; + $_762 = NULL; + do { + if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) { + $result["text"] .= $subres; + } + else { $_762 = FALSE; break; } + $_762 = TRUE; break; + } + while(0); + if( $_762 === TRUE ) { + $result = $res_763; + $this->pos = $pos_763; + $_764 = FALSE; break; + } + if( $_762 === FALSE) { + $result = $res_763; + $this->pos = $pos_763; + } + $_764 = TRUE; break; + } + while(0); + if( $_764 === TRUE ) { $_779 = TRUE; break; } + $result = $res_759; + $this->pos = $pos_759; + $_777 = NULL; + do { + $res_766 = $result; + $pos_766 = $this->pos; + $_769 = NULL; + do { + if (substr($this->string,$this->pos,1) == '{') { + $this->pos += 1; + $result["text"] .= '{'; + } + else { $_769 = FALSE; break; } + $res_768 = $result; + $pos_768 = $this->pos; + if (substr($this->string,$this->pos,1) == '$') { + $this->pos += 1; + $result["text"] .= '$'; + $result = $res_768; + $this->pos = $pos_768; + $_769 = FALSE; break; + } + else { + $result = $res_768; + $this->pos = $pos_768; + } + $_769 = TRUE; break; + } + while(0); + if( $_769 === TRUE ) { $_777 = TRUE; break; } + $result = $res_766; + $this->pos = $pos_766; + $_775 = NULL; + do { + if (( $subres = $this->literal( '{$' ) ) !== FALSE) { + $result["text"] .= $subres; + } + else { $_775 = FALSE; break; } + $res_774 = $result; + $pos_774 = $this->pos; + $_773 = NULL; + do { + if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) { + $result["text"] .= $subres; + } + else { $_773 = FALSE; break; } + $_773 = TRUE; break; + } + while(0); + if( $_773 === TRUE ) { + $result = $res_774; + $this->pos = $pos_774; + $_775 = FALSE; break; + } + if( $_773 === FALSE) { + $result = $res_774; + $this->pos = $pos_774; + } + $_775 = TRUE; break; + } + while(0); + if( $_775 === TRUE ) { $_777 = TRUE; break; } + $result = $res_766; + $this->pos = $pos_766; + $_777 = FALSE; break; + } + while(0); + if( $_777 === TRUE ) { $_779 = TRUE; break; } + $result = $res_759; + $this->pos = $pos_759; + $_779 = FALSE; break; + } + while(0); + 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 $code = <<<'EOC' (\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; // Because preg_replace replacement requires escaped slashes, addcslashes here $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. diff --git a/tests/php/i18n/i18nTextCollectorTest.php b/tests/php/i18n/i18nTextCollectorTest.php index 5478260d1..f6292f889 100644 --- a/tests/php/i18n/i18nTextCollectorTest.php +++ b/tests/php/i18n/i18nTextCollectorTest.php @@ -86,6 +86,7 @@ PHP; <%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_9 "An item|{count} items" is "Test Pluralisation" count=4 %> +<%t SilverStripe\TestModule\i18nTestModule.INJECTIONS_10 "This string is namespaced" %> SS; $c->collectFromTemplate($html, null, $mymodule); @@ -104,6 +105,7 @@ SS; 'other' => '{count} items', 'comment' => 'Test Pluralisation' ], + 'SilverStripe\\TestModule\\i18nTestModule.INJECTIONS_10' => 'This string is namespaced' ], $c->collectFromTemplate($html, null, $mymodule) );