Merge pull request #342 from silverstripe-big-o/sapphire

---

This is the new _t syntax. All i18n unit tests pass.
This commit is contained in:
Ingo Schommer 2012-04-18 10:16:23 +02:00
commit c2797f3ffa
10 changed files with 2190 additions and 1562 deletions

View File

@ -365,7 +365,17 @@ placeholder and the `PageComment` class. See the ['comments' module](https://git
The setting determines difference homepages at arbitrary locations in the page tree,
and was rarely used in practice - so we moved it to a "[homepagefordomain](https://github.com/silverstripe-labs/silverstripe-homepagefordomain)" module.
### New syntax for translatable _t functions ###
You can now call the _t() function in both templates and code with a namespace and string to translate, as well as a
comment and injection array. Note that the proxity arguement to _t is no longer supported.
The new syntax supports injecting variables into the translation. For example:
:::php
_t('i18nTestModule.INJECTIONS2', "Hello {name} {greeting}", array("name"=>"Paul", "greeting"=>"good you are here"));
### Default translation source in YML instead of PHP $lang array, using Zend_Translate ###
This allows for a more flexible handling of translation sources in various formats.

View File

@ -139,20 +139,18 @@ The `_t()` function is the main gateway to localized text, and takes four parame
* **$entity:** Unique identifier, composed by a namespace and an entity name, with a dot separating them. Both are arbitrary names, although by convention we use the name of the containing class or template. Use this identifier to reference the same translation elsewhere in your code.
* **$string:** (optional) The original language string to be translated. Only needs to be declared once, and gets picked up the [text collector](#collecting-text).
* **$string:** (optional) Natural language (particularly short phrases and individual words)
* **$string:** (optional) Natural language comment (particularly short phrases and individual words)
are very context dependent. This parameter allows the developer to convey this information
to the translator. Can also be used to explain `sprintf()` placeholders.
to the translator.
* **$array::** (optional) An array of injecting variables into the second parameter
:::php
//Example 4: Using context to hint information about a parameter
sprintf(
_t('CMSMain.RESTORED',
"Restored '%s' successfully",
'Param %s is a title'
),
$title
)
_t('CMSMain.RESTORED',
"Restored {value} successfully",
'This is a message when restoring a broken part of the CMS',
array('value' => $itemRestored)
);
### Usage
@ -182,25 +180,21 @@ Therefore, the following would be a valid use in templates:
Using SS templating variables in the translatable string (e.g. $Author, $Date..) is not currently supported.
### sprintf()-support
### Injection-support
Sprintf enables us to dynamically replace parts of a translated string, e.g. by a username or a page-title.
Variable injection in _t allows us to dynamically replace parts of a translated string, e.g. by a username or a page-title.
:::php
// in PHP-file
sprintf(
_t('CMSMain.RESTORED',"Restored '%s' successfully"),
$title
)
<div class="warning" markdown='1'>
**Caution**: In templates (*.ss)-files you can only use ONE argument for your sprintf-support, and can't use spaces
between parameters.
</div>
_t(
'CMSMain.RESTORED',
"Restored {title} successfully"),
array('title' => $title)
);
:::php
// in SS-template ($title must be available in the current template-scope)
<% sprintf(_t('CMSMain.RESTORED',"Restored '%s' successfully"),$title) %>
// in SS-template ($Name must be available in the current template-scope)
<%t MYPROJECT.INJECTIONS "Hello {name} {greeting}" name="$Name" greeting="good to see you" %>
## Collecting text
@ -339,14 +333,12 @@ Example Translation Table (mymodule/javascript/lang/de_DE.js)
alert(ss.i18n._t('MYMODULE.MYENTITY'));
### Advanced Usage with sprintf()
### Advanced Usage with injection
:::js
// MYMODULE.MYENTITY contains "Really delete %s articles by %s authors?"
alert(ss.i18n.sprintf(
ss.i18n._t('MYMODULE.MYENTITY'),
42,
'Douglas Adams'
// MYMODULE.MYENTITY contains "Really delete {answer} articles by {author} authors?"
alert(ss.i18n._t('MYMODULE.MYENTITY'),
array('answer' => 42, 'author' => 'Douglas Adams')
));
// Displays: "Really delete 42 articles by Douglas Adams?"

View File

@ -1456,25 +1456,40 @@ class i18n extends Object implements TemplateGlobalProvider {
* the class name where this string is used and Entity identifies the string inside the namespace.
* @param string $string The original string itself. In a usual call this is a mandatory parameter, but if you are reusing a string which
* has already been "declared" (using another call to this function, with the same class and entity), you can omit it.
* @param string $context If the string can be difficult to translate by any reason, you can help translators with some more info using this param
* @param string $context (optional) If the string can be difficult to translate by any reason, you can help translators with some more info using this param
* @param string injectionArray (optional) array of key value pairs that are used to replace corresponding expressions in {curly brackets} in the $string.
* The injection array can also be used as the their argument to the _t() function
* @return string The translated string, according to the currently set locale {@link i18n::set_locale()}
*/
static function _t($entity, $string = "", $context = "") {
static function _t($entity, $string = "", $context = "", $injection = "") {
if(is_numeric($context) && in_array($context, array(PR_LOW, PR_MEDIUM, PR_HIGH))) {
$context = func_get_arg(4);
Deprecation::notice(
'3.0',
'3.0',
'The $priority argument to _t() is deprecated, please use module inclusion priorities instead'
);
}
//fetch the injection array out of the parameters (if it is present)
$argList = func_get_args();
$argNum = func_num_args();
//_t($entity, $string = "", $context (optional), $injectionArray (optional))
$injectionArray = null;
for($i = 0; $i < $argNum; $i++) {
if (is_array($argList[$i])) { //we have reached the injectionArray
$injectionArray = $argList[$i]; //any array in the args will be the injection array
}
}
// get current locale (either default or user preference)
$locale = i18n::get_locale();
$lang = i18n::get_lang_from_locale($locale);
// Only call getter if static isn't already defined (for performance reasons)
$translatorsByPrio = self::$translators;
if(!$translatorsByPrio) $translatorsByPrio = self::get_translators();
$returnValue = $string; // Fall back to default string argument
foreach($translatorsByPrio as $priority => $translators) {
foreach($translators as $name => $translator) {
$adapter = $translator->getAdapter();
@ -1489,14 +1504,24 @@ class i18n extends Object implements TemplateGlobalProvider {
$translation = $adapter->translate($entity, $locale);
// Return translation only if we found a match thats not the entity itself (Zend fallback)
if($translation && $translation != $entity) return $translation;
if($translation && $translation != $entity) {
$returnValue = $translation;
break 2;
}
}
}
// Fall back to default string argument
return $string;
// inject the variables from injectionArray (if present)
if ($injectionArray && count($injectionArray) > 0) {
foreach($injectionArray as $variable => $injection) {
$returnValue = str_replace('{'.$variable.'}', $injection, $returnValue);
}
}
return $returnValue;
}
/**
* @return array Array of priority keys to instances of Zend_Translate, mapped by name.
*/

View File

@ -193,17 +193,24 @@ class i18nTextCollector extends Object {
return $entities;
}
public function collectFromCode($content, $module) {
$entities = array();
$tokens = token_get_all("<?php\n" . $content);
$inTransFn = false;
$inConcat = false;
$finalTokenDueToArray = false;
$currentEntity = array();
foreach($tokens as $token) {
if(is_array($token)) {
list($id, $text) = $token;
if($inTransFn && $id == T_ARRAY) {
//raw 'array' token found in _t function, stop processing the tokens for this _t now
$finalTokenDueToArray = true;
}
if($id == T_STRING && $text == '_t') {
// start definition
$inTransFn = true;
@ -223,39 +230,40 @@ class i18nTextCollector extends Object {
$text = preg_replace('/^"/', '', $text);
$text = preg_replace('/"$/', '', $text);
}
if($inConcat) {
$currentEntity[count($currentEntity)-1] .= $text;
} else {
$currentEntity[] = $text;
}
}
}
}
} elseif($inTransFn && $token == '.') {
$inConcat = true;
$inConcat = true;
} elseif($inTransFn && $token == ',') {
$inConcat = false;
} elseif($inTransFn && $token == ')') {
$inConcat = false;
} elseif($inTransFn && ($token == ')' || $finalTokenDueToArray)) {
// finalize definition
$inTransFn = false;
$inConcat = false;
$entity = array_shift($currentEntity);
$entities[$entity] = $currentEntity;
$currentEntity = array();
$finalTokenDueToArray = false;
}
}
foreach($entities as $entity => $spec) {
// call without master language definition
if(!$spec) {
unset($entities[$entity]);
continue;
continue;
}
unset($entities[$entity]);
$entities[$this->normalizeEntity($entity, $module)] = $spec;
}
ksort($entities);
return $entities;
}
@ -276,6 +284,11 @@ class i18nTextCollector extends Object {
// @todo Will get massively confused if you include the includer -> infinite loop
}
// use parser to extract <%t style translatable entities
$translatables = i18nTextCollector_Parser::GetTranslatables($content);
$entities = array_merge($entities,(array)$translatables);
// use the old method of getting _t() style translatable entities
// Collect in actual template
if(preg_match_all('/<%\s*(_t\(.*)%>/ms', $content, $matches)) {
foreach($matches as $match) {
@ -516,4 +529,49 @@ class i18nTextCollector_Writer_RailsYaml implements i18nTextCollector_Writer {
// TODO Dumper can't handle YAML comments, so the context information is currently discarded
return $yamlHandler->dump(array($locale => $entitiesNested), 99);
}
}
/**
* Parser that scans through a template and extracts the parameters to the _t and <%t calls
*/
class i18nTextCollector_Parser extends SSTemplateParser {
static $entities = array();
static $currentEntity = array();
function Translate__construct(&$res) {
self::$currentEntity = array(null,null,null); //start with empty array
}
function Translate_Entity(&$res, $sub) {
self::$currentEntity[0] = $sub['text']; //entity
}
function Translate_Default(&$res, $sub) {
self::$currentEntity[1] = $sub['String']['text']; //value
}
function Translate_Context(&$res, $sub) {
self::$currentEntity[2] = $sub['String']['text']; //comment
}
function Translate__finalise(&$res) {
// set the entity name and the value (default), as well as the context (comment)
// priority is no longer used, so that is blank
self::$entities[self::$currentEntity[0]] = array(self::$currentEntity[1],null,self::$currentEntity[2]);
}
/**
* Parses a template and returns any translatable entities
*/
static function GetTranslatables($template) {
self::$entities = array();
// Run the parser and throw away the result
$parser = new i18nTextCollector_Parser($template);
if(substr($template, 0,3) == pack("CCC", 0xef, 0xbb, 0xbf)) $parser->pos = 3;
$parser->match_TopTemplate();
return self::$entities;
}
}

View File

@ -2,4 +2,11 @@
<% _t('LAYOUTTEMPLATENONAMESPACE',"Layout Template no namespace") %>
<% sprintf(_t('i18nTestModule.SPRINTFNAMESPACE','My replacement: %s'),$TestProperty) %>
<% sprintf(_t('SPRINTFNONAMESPACE','My replacement no namespace: %s'),$TestProperty) %>
<% include i18nTestModuleInclude %>
<% include i18nTestModuleInclude %>
<%t i18nTestModule.NEWMETHODSIG "New _t method signature test" %>
<%t i18nTestModule.INJECTIONS_DOES_NOT_EXIST "Hello {name} {greeting}. But it is late, {goodbye}" name="Mark" greeting="welcome" goodbye="bye" %>
<%t i18nTestModule.INJECTIONS "Hello {name} {greeting}. But it is late, {goodbye}" name="Paul" greeting="good you are here" goodbye="see you" %>
<%t i18nTestModule.INJECTIONS "Hello {name} {greeting}. But it is late, {goodbye}" is "New context (this should be ignored)" name="Steffen" greeting="willkommen" goodbye="wiedersehen" %>
<%t i18nTestModule.INJECTIONS name="Cat" greeting='meow' goodbye="meow" %>
<%t i18nTestModule.INJECTIONS name=$absoluteBaseURL greeting=$get_locale goodbye="global calls" %>

View File

@ -167,7 +167,7 @@ class i18nTest extends SapphireTest {
function testTemplateTranslation() {
$oldLocale = i18n::get_locale();
i18n::set_locale('en_US');
i18n::get_translator('core')->getAdapter()->addTranslation(array(
'i18nTestModule.MAINTEMPLATE' => 'Main Template',
@ -242,6 +242,92 @@ class i18nTest extends SapphireTest {
i18n::set_locale($oldLocale);
}
function testNewTMethodSignature() {
global $lang;
$oldLocale = i18n::get_locale();
i18n::set_locale('en_US');
i18n::get_translator('core')->getAdapter()->addTranslation(array(
'i18nTestModule.NEWMETHODSIG' => 'TRANS New _t method signature test',
'i18nTestModule.INJECTIONS' => 'TRANS Hello {name} {greeting}. But it is late, {goodbye}'
), 'en_US');
$entity = "i18nTestModule.INJECTIONS";
$default = "Hello {name} {greeting}. But it is late, {goodbye}";
$translated = i18n::_t('i18nTestModule.NEWMETHODSIG',"New _t method signature test");
$this->assertContains(
"TRANS New _t method signature test",
$translated
);
$translated = i18n::_t($entity.'_DOES_NOT_EXIST', $default, array("name"=>"Mark", "greeting"=>"welcome", "goodbye"=>"bye"));
$this->assertContains(
"Hello Mark welcome. But it is late, bye",
$translated, "Testing fallback to the translation default (but using the injection array)"
);
$translated = i18n::_t($entity, $default, array("name"=>"Paul", "greeting"=>"good you are here", "goodbye"=>"see you"));
$this->assertContains(
"TRANS Hello Paul good you are here. But it is late, see you",
$translated, "Testing entity, default string and injection array"
);
$translated = i18n::_t($entity, $default, "New context (this should be ignored)", array("name"=>"Steffen", "greeting"=>"willkommen", "goodbye"=>"wiedersehen"));
$this->assertContains(
"TRANS Hello Steffen willkommen. But it is late, wiedersehen",
$translated, "Full test of translation, using default, context and injection array"
);
$translated = i18n::_t($entity, array("name"=>"Cat", "greeting"=>"meow", "goodbye"=>"meow"));
$this->assertContains(
"TRANS Hello Cat meow. But it is late, meow",
$translated, "Testing a translation with just entity and injection array"
);
i18n::set_locale($oldLocale);
}
/**
* See @i18nTestModule.ss for the template that is being used for this test
* */
function testNewTemplateTranslation() {
global $lang;
$oldLocale = i18n::get_locale();
i18n::set_locale('en_US');
i18n::get_translator('core')->getAdapter()->addTranslation(array(
'i18nTestModule.NEWMETHODSIG' => 'TRANS New _t method signature test',
'i18nTestModule.INJECTIONS' => 'TRANS Hello {name} {greeting}. But it is late, {goodbye}'
),'en_US');
$viewer = new SSViewer('i18nTestModule');
$parsedHtml = $viewer->process(new ArrayData(array('TestProperty' => 'TestPropertyValue')));
$this->assertContains(
"Hello Mark welcome. But it is late, bye\n",
$parsedHtml, "Testing fallback to the translation default (but using the injection array)"
);
$this->assertContains(
"TRANS Hello Paul good you are here. But it is late, see you\n",
$parsedHtml, "Testing entity, default string and injection array"
);
$this->assertContains(
"TRANS Hello Cat meow. But it is late, meow\n",
$parsedHtml, "Testing a translation with just entity and injection array"
);
//test injected calls
$this->assertContains(
"TRANS Hello ".Director::absoluteBaseURL()." ".i18n::get_locale().". But it is late, global calls\n",
$parsedHtml, "Testing a translation with just entity and injection array, but with global variables injected in"
);
i18n::set_locale($oldLocale);
}
function testGetLocaleFromLang() {
$this->assertEquals('en_US', i18n::get_locale_from_lang('en'));

View File

@ -68,7 +68,36 @@ PHP;
'Test.CONCATENATED2' => array("Line \"4\" and Line 5")
)
);
}
}
function testCollectFromNewTemplateSyntaxUsingParserSubclass() {
$c = new i18nTextCollector();
$html = <<<SS
<% _t('Test.SINGLEQUOTE','Single Quote'); %>
<%t i18nTestModule.NEWMETHODSIG "New _t method signature test" %>
<%t i18nTestModule.INJECTIONS_0 "Hello {name} {greeting}. But it is late, {goodbye}" name="Mark" greeting="welcome" goodbye="bye" %>
<%t i18nTestModule.INJECTIONS_1 "Hello {name} {greeting}. But it is late, {goodbye}" name="Paul" greeting="good you are here" goodbye="see you" %>
<%t i18nTestModule.INJECTIONS_2 "Hello {name} {greeting}. But it is late, {goodbye}" is "New context (this should be ignored)" name="Steffen" greeting="willkommen" goodbye="wiedersehen" %>
<%t i18nTestModule.INJECTIONS_3 name="Cat" greeting='meow' goodbye="meow" %>
<%t i18nTestModule.INJECTIONS_4 name=\$absoluteBaseURL greeting=\$get_locale goodbye="global calls" %>
SS;
$c->collectFromTemplate($html, 'mymodule', 'Test');
$this->assertEquals(
$c->collectFromTemplate($html, 'mymodule', 'Test'),
array(
'Test.SINGLEQUOTE' => array('Single Quote'),
'i18nTestModule.NEWMETHODSIG' => array("New _t method signature test",null,null),
'i18nTestModule.INJECTIONS_0' => array("Hello {name} {greeting}. But it is late, {goodbye}", null, null),
'i18nTestModule.INJECTIONS_1' => array("Hello {name} {greeting}. But it is late, {goodbye}", null, null),
'i18nTestModule.INJECTIONS_2' => array("Hello {name} {greeting}. But it is late, {goodbye}", null, "New context (this should be ignored)"),
'i18nTestModule.INJECTIONS_3' => array(null, null, null),
'i18nTestModule.INJECTIONS_4' => array(null, null, null),
)
);
}
function testCollectFromTemplateSimple() {
$c = new i18nTextCollector();
@ -282,6 +311,34 @@ PHP;
);
}
/**
* Test extracting entities from the new _t method signature
*/
function testCollectFromCodeNewSignature() {
$c = new i18nTextCollector();
$php = <<<PHP
_t('i18nTestModule.NEWMETHODSIG',"New _t method signature test");
_t('i18nTestModule.INJECTIONS1','_DOES_NOT_EXIST', "Hello {name} {greeting}. But it is late, {goodbye}", array("name"=>"Mark", "greeting"=>"welcome", "goodbye"=>"bye"));
_t('i18nTestModule.INJECTIONS2', "Hello {name} {greeting}. But it is late, {goodbye}", array("name"=>"Paul", "greeting"=>"good you are here", "goodbye"=>"see you"));
_t("i18nTestModule.INJECTIONS3", "Hello {name} {greeting}. But it is late, {goodbye}", "New context (this should be ignored)", array("name"=>"Steffen", "greeting"=>"willkommen", "goodbye"=>"wiedersehen"));
_t('i18nTestModule.INJECTIONS4', array("name"=>"Cat", "greeting"=>"meow", "goodbye"=>"meow"));
PHP;
$collectedTranslatables = $c->collectFromCode($php, 'mymodule');
$expectedArray = (array(
'i18nTestModule.NEWMETHODSIG' => array("New _t method signature test"),
'i18nTestModule.INJECTIONS1' => array("_DOES_NOT_EXIST", "Hello {name} {greeting}. But it is late, {goodbye}"),
'i18nTestModule.INJECTIONS2' => array("Hello {name} {greeting}. But it is late, {goodbye}"),
'i18nTestModule.INJECTIONS3' => array("Hello {name} {greeting}. But it is late, {goodbye}", "New context (this should be ignored)"),
));
ksort($expectedArray);
$this->assertEquals($collectedTranslatables, $expectedArray);
}
/**
* Input for langArrayCodeForEntitySpec() should be suitable for insertion
* into single-quoted strings, so needs to be escaped already.

View File

@ -461,7 +461,7 @@ after')
$this->assertEquals(
$this->render('<% include SSViewerTestIncludeWithArguments Arg1=A Bare String, Arg2=B Bare String %>'),
'<p>A Bare String</p><p>B Bare String</p>'
'<p>A Bare String</p><p>B Bare String </p>'
);
$this->assertEquals(

View File

@ -58,6 +58,9 @@ forbidden)
Closed Block: An SS template block that wraps content, and requires a counterpart <% end_blockname %> tag
Angle Bracket: angle brackets "<" and ">" are used to eat whitespace between template elements
N: eats white space including newlines (using in legacy _t support)
*/
class SSTemplateParser extends Parser {
@ -76,17 +79,17 @@ class SSTemplateParser extends Parser {
return $res;
}
/* Template: (Comment | 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)+ */
protected $match_Template_typestack = array('Template');
function match_Template ($stack = array()) {
$matchrule = "Template"; $result = $this->construct($matchrule, $matchrule, null);
$count = 0;
while (true) {
$res_46 = $result;
$pos_46 = $this->pos;
$_45 = NULL;
$res_50 = $result;
$pos_50 = $this->pos;
$_49 = NULL;
do {
$_43 = NULL;
$_47 = NULL;
do {
$res_0 = $result;
$pos_0 = $this->pos;
@ -94,210 +97,228 @@ class SSTemplateParser extends Parser {
$subres = ( $this->packhas( $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;
$_47 = TRUE; break;
}
$result = $res_0;
$this->pos = $pos_0;
$_41 = NULL;
$_45 = NULL;
do {
$res_2 = $result;
$pos_2 = $this->pos;
$matcher = 'match_'.'If'; $key = $matcher; $pos = $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 );
$_41 = TRUE; break;
$_45 = TRUE; break;
}
$result = $res_2;
$this->pos = $pos_2;
$_39 = NULL;
$_43 = NULL;
do {
$res_4 = $result;
$pos_4 = $this->pos;
$matcher = 'match_'.'Require'; $key = $matcher; $pos = $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 );
$_39 = TRUE; break;
$_43 = TRUE; break;
}
$result = $res_4;
$this->pos = $pos_4;
$_37 = NULL;
$_41 = NULL;
do {
$res_6 = $result;
$pos_6 = $this->pos;
$matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $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 );
$_37 = TRUE; break;
$_41 = TRUE; break;
}
$result = $res_6;
$this->pos = $pos_6;
$_35 = NULL;
$_39 = NULL;
do {
$res_8 = $result;
$pos_8 = $this->pos;
$matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $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 );
$_35 = TRUE; break;
$_39 = TRUE; break;
}
$result = $res_8;
$this->pos = $pos_8;
$_33 = NULL;
$_37 = NULL;
do {
$res_10 = $result;
$pos_10 = $this->pos;
$matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $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 );
$_33 = TRUE; break;
$_37 = TRUE; break;
}
$result = $res_10;
$this->pos = $pos_10;
$_31 = NULL;
$_35 = NULL;
do {
$res_12 = $result;
$pos_12 = $this->pos;
$matcher = 'match_'.'Include'; $key = $matcher; $pos = $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 );
$_31 = TRUE; break;
$_35 = TRUE; break;
}
$result = $res_12;
$this->pos = $pos_12;
$_29 = NULL;
$_33 = NULL;
do {
$res_14 = $result;
$pos_14 = $this->pos;
$matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $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 );
$_29 = TRUE; break;
$_33 = TRUE; break;
}
$result = $res_14;
$this->pos = $pos_14;
$_27 = NULL;
$_31 = NULL;
do {
$res_16 = $result;
$pos_16 = $this->pos;
$matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $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 );
$_27 = TRUE; break;
$_31 = TRUE; break;
}
$result = $res_16;
$this->pos = $pos_16;
$_25 = NULL;
$_29 = NULL;
do {
$res_18 = $result;
$pos_18 = $this->pos;
$matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $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 );
$_25 = TRUE; break;
$_29 = TRUE; break;
}
$result = $res_18;
$this->pos = $pos_18;
$_23 = NULL;
$_27 = NULL;
do {
$res_20 = $result;
$pos_20 = $this->pos;
$matcher = 'match_'.'Injection'; $key = $matcher; $pos = $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 );
$_23 = TRUE; break;
$_27 = TRUE; break;
}
$result = $res_20;
$this->pos = $pos_20;
$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 );
$_23 = TRUE; break;
$_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;
$_23 = FALSE; break;
$_27 = FALSE; break;
}
while(0);
if( $_23 === TRUE ) { $_25 = TRUE; break; }
if( $_27 === TRUE ) { $_29 = TRUE; break; }
$result = $res_18;
$this->pos = $pos_18;
$_25 = FALSE; break;
$_29 = FALSE; break;
}
while(0);
if( $_25 === TRUE ) { $_27 = TRUE; break; }
if( $_29 === TRUE ) { $_31 = TRUE; break; }
$result = $res_16;
$this->pos = $pos_16;
$_27 = FALSE; break;
$_31 = FALSE; break;
}
while(0);
if( $_27 === TRUE ) { $_29 = TRUE; break; }
if( $_31 === TRUE ) { $_33 = TRUE; break; }
$result = $res_14;
$this->pos = $pos_14;
$_29 = FALSE; break;
$_33 = FALSE; break;
}
while(0);
if( $_29 === TRUE ) { $_31 = TRUE; break; }
if( $_33 === TRUE ) { $_35 = TRUE; break; }
$result = $res_12;
$this->pos = $pos_12;
$_31 = FALSE; break;
$_35 = FALSE; break;
}
while(0);
if( $_31 === TRUE ) { $_33 = TRUE; break; }
if( $_35 === TRUE ) { $_37 = TRUE; break; }
$result = $res_10;
$this->pos = $pos_10;
$_33 = FALSE; break;
$_37 = FALSE; break;
}
while(0);
if( $_33 === TRUE ) { $_35 = TRUE; break; }
if( $_37 === TRUE ) { $_39 = TRUE; break; }
$result = $res_8;
$this->pos = $pos_8;
$_35 = FALSE; break;
$_39 = FALSE; break;
}
while(0);
if( $_35 === TRUE ) { $_37 = TRUE; break; }
if( $_39 === TRUE ) { $_41 = TRUE; break; }
$result = $res_6;
$this->pos = $pos_6;
$_37 = FALSE; break;
$_41 = FALSE; break;
}
while(0);
if( $_37 === TRUE ) { $_39 = TRUE; break; }
if( $_41 === TRUE ) { $_43 = TRUE; break; }
$result = $res_4;
$this->pos = $pos_4;
$_39 = FALSE; break;
$_43 = FALSE; break;
}
while(0);
if( $_39 === TRUE ) { $_41 = TRUE; break; }
if( $_43 === TRUE ) { $_45 = TRUE; break; }
$result = $res_2;
$this->pos = $pos_2;
$_41 = FALSE; break;
$_45 = FALSE; break;
}
while(0);
if( $_41 === TRUE ) { $_43 = TRUE; break; }
if( $_45 === TRUE ) { $_47 = TRUE; break; }
$result = $res_0;
$this->pos = $pos_0;
$_43 = FALSE; break;
$_47 = FALSE; break;
}
while(0);
if( $_43 === FALSE) { $_45 = FALSE; break; }
$_45 = TRUE; break;
if( $_47 === FALSE) { $_49 = FALSE; break; }
$_49 = TRUE; break;
}
while(0);
if( $_45 === FALSE) {
$result = $res_46;
$this->pos = $pos_46;
unset( $res_46 );
unset( $pos_46 );
if( $_49 === FALSE) {
$result = $res_50;
$this->pos = $pos_50;
unset( $res_50 );
unset( $pos_50 );
break;
}
$count += 1;
@ -352,48 +373,48 @@ class SSTemplateParser extends Parser {
protected $match_CallArguments_typestack = array('CallArguments');
function match_CallArguments ($stack = array()) {
$matchrule = "CallArguments"; $result = $this->construct($matchrule, $matchrule, null);
$_57 = NULL;
$_61 = 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 { $_57 = FALSE; break; }
else { $_61 = FALSE; break; }
while (true) {
$res_56 = $result;
$pos_56 = $this->pos;
$_55 = NULL;
$res_60 = $result;
$pos_60 = $this->pos;
$_59 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_55 = FALSE; break; }
else { $_59 = 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 { $_55 = FALSE; break; }
$_55 = TRUE; break;
else { $_59 = FALSE; break; }
$_59 = TRUE; break;
}
while(0);
if( $_55 === FALSE) {
$result = $res_56;
$this->pos = $pos_56;
unset( $res_56 );
unset( $pos_56 );
if( $_59 === FALSE) {
$result = $res_60;
$this->pos = $pos_60;
unset( $res_60 );
unset( $pos_60 );
break;
}
}
$_57 = TRUE; break;
$_61 = TRUE; break;
}
while(0);
if( $_57 === TRUE ) { return $this->finalise($result); }
if( $_57 === FALSE) { return FALSE; }
if( $_61 === TRUE ) { return $this->finalise($result); }
if( $_61 === FALSE) { return FALSE; }
}
@ -413,57 +434,57 @@ class SSTemplateParser extends Parser {
protected $match_Call_typestack = array('Call');
function match_Call ($stack = array()) {
$matchrule = "Call"; $result = $this->construct($matchrule, $matchrule, null);
$_67 = NULL;
$_71 = 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 { $_67 = FALSE; break; }
$res_66 = $result;
$pos_66 = $this->pos;
$_65 = NULL;
else { $_71 = FALSE; break; }
$res_70 = $result;
$pos_70 = $this->pos;
$_69 = NULL;
do {
if (substr($this->string,$this->pos,1) == '(') {
$this->pos += 1;
$result["text"] .= '(';
}
else { $_65 = FALSE; break; }
else { $_69 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_62 = $result;
$pos_62 = $this->pos;
$res_66 = $result;
$pos_66 = $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_62;
$this->pos = $pos_62;
unset( $res_62 );
unset( $pos_62 );
$result = $res_66;
$this->pos = $pos_66;
unset( $res_66 );
unset( $pos_66 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
}
else { $_65 = FALSE; break; }
$_65 = TRUE; break;
else { $_69 = FALSE; break; }
$_69 = TRUE; break;
}
while(0);
if( $_65 === FALSE) {
$result = $res_66;
$this->pos = $pos_66;
unset( $res_66 );
unset( $pos_66 );
if( $_69 === FALSE) {
$result = $res_70;
$this->pos = $pos_70;
unset( $res_70 );
unset( $pos_70 );
}
$_67 = TRUE; break;
$_71 = TRUE; break;
}
while(0);
if( $_67 === TRUE ) { return $this->finalise($result); }
if( $_67 === FALSE) { return FALSE; }
if( $_71 === TRUE ) { return $this->finalise($result); }
if( $_71 === FALSE) { return FALSE; }
}
@ -471,32 +492,32 @@ class SSTemplateParser extends Parser {
protected $match_LookupStep_typestack = array('LookupStep');
function match_LookupStep ($stack = array()) {
$matchrule = "LookupStep"; $result = $this->construct($matchrule, $matchrule, null);
$_71 = NULL;
$_75 = 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 { $_71 = FALSE; break; }
$res_70 = $result;
$pos_70 = $this->pos;
else { $_75 = FALSE; break; }
$res_74 = $result;
$pos_74 = $this->pos;
if (substr($this->string,$this->pos,1) == '.') {
$this->pos += 1;
$result["text"] .= '.';
$result = $res_70;
$this->pos = $pos_70;
$result = $res_74;
$this->pos = $pos_74;
}
else {
$result = $res_70;
$this->pos = $pos_70;
$_71 = FALSE; break;
$result = $res_74;
$this->pos = $pos_74;
$_75 = FALSE; break;
}
$_71 = TRUE; break;
$_75 = TRUE; break;
}
while(0);
if( $_71 === TRUE ) { return $this->finalise($result); }
if( $_71 === FALSE) { return FALSE; }
if( $_75 === TRUE ) { return $this->finalise($result); }
if( $_75 === FALSE) { return FALSE; }
}
@ -518,40 +539,40 @@ class SSTemplateParser extends Parser {
protected $match_Lookup_typestack = array('Lookup');
function match_Lookup ($stack = array()) {
$matchrule = "Lookup"; $result = $this->construct($matchrule, $matchrule, null);
$_85 = NULL;
$_89 = NULL;
do {
$res_74 = $result;
$pos_74 = $this->pos;
$_82 = NULL;
$res_78 = $result;
$pos_78 = $this->pos;
$_86 = 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 { $_82 = FALSE; break; }
else { $_86 = FALSE; break; }
while (true) {
$res_79 = $result;
$pos_79 = $this->pos;
$_78 = NULL;
$res_83 = $result;
$pos_83 = $this->pos;
$_82 = NULL;
do {
if (substr($this->string,$this->pos,1) == '.') {
$this->pos += 1;
$result["text"] .= '.';
}
else { $_78 = FALSE; break; }
else { $_82 = 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 { $_78 = FALSE; break; }
$_78 = TRUE; break;
else { $_82 = FALSE; break; }
$_82 = TRUE; break;
}
while(0);
if( $_78 === FALSE) {
$result = $res_79;
$this->pos = $pos_79;
unset( $res_79 );
unset( $pos_79 );
if( $_82 === FALSE) {
$result = $res_83;
$this->pos = $pos_83;
unset( $res_83 );
unset( $pos_83 );
break;
}
}
@ -559,30 +580,30 @@ class SSTemplateParser extends Parser {
$this->pos += 1;
$result["text"] .= '.';
}
else { $_82 = FALSE; break; }
else { $_86 = 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 { $_82 = FALSE; break; }
$_82 = TRUE; break;
else { $_86 = FALSE; break; }
$_86 = TRUE; break;
}
while(0);
if( $_82 === TRUE ) { $_85 = TRUE; break; }
$result = $res_74;
$this->pos = $pos_74;
if( $_86 === TRUE ) { $_89 = TRUE; break; }
$result = $res_78;
$this->pos = $pos_78;
$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 );
$_85 = TRUE; break;
$_89 = TRUE; break;
}
$result = $res_74;
$this->pos = $pos_74;
$_85 = FALSE; break;
$result = $res_78;
$this->pos = $pos_78;
$_89 = FALSE; break;
}
while(0);
if( $_85 === TRUE ) { return $this->finalise($result); }
if( $_85 === FALSE) { return FALSE; }
if( $_89 === TRUE ) { return $this->finalise($result); }
if( $_89 === FALSE) { return FALSE; }
}
@ -619,28 +640,237 @@ class SSTemplateParser extends Parser {
$this->Lookup_AddLookupStep($res, $sub, '$$FINAL');
}
/* Translate: "<%t" < Entity < (Default:QuotedString)? < (!("is" "=") < "is" < Context:QuotedString)? < (InjectionVariables)? > "%>" */
protected $match_Translate_typestack = array('Translate');
function match_Translate ($stack = array()) {
$matchrule = "Translate"; $result = $this->construct($matchrule, $matchrule, null);
$_115 = NULL;
do {
if (( $subres = $this->literal( '<%t' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_115 = 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 { $_115 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_97 = $result;
$pos_97 = $this->pos;
$_96 = 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 { $_96 = FALSE; break; }
$_96 = TRUE; break;
}
while(0);
if( $_96 === FALSE) {
$result = $res_97;
$this->pos = $pos_97;
unset( $res_97 );
unset( $pos_97 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_108 = $result;
$pos_108 = $this->pos;
$_107 = NULL;
do {
$res_102 = $result;
$pos_102 = $this->pos;
$_101 = NULL;
do {
if (( $subres = $this->literal( 'is' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_101 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1;
$result["text"] .= '=';
}
else { $_101 = FALSE; break; }
$_101 = TRUE; break;
}
while(0);
if( $_101 === TRUE ) {
$result = $res_102;
$this->pos = $pos_102;
$_107 = FALSE; break;
}
if( $_101 === FALSE) {
$result = $res_102;
$this->pos = $pos_102;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'is' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_107 = 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 { $_107 = FALSE; break; }
$_107 = TRUE; break;
}
while(0);
if( $_107 === FALSE) {
$result = $res_108;
$this->pos = $pos_108;
unset( $res_108 );
unset( $pos_108 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_112 = $result;
$pos_112 = $this->pos;
$_111 = 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 { $_111 = FALSE; break; }
$_111 = TRUE; break;
}
while(0);
if( $_111 === FALSE) {
$result = $res_112;
$this->pos = $pos_112;
unset( $res_112 );
unset( $pos_112 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_115 = FALSE; break; }
$_115 = TRUE; break;
}
while(0);
if( $_115 === TRUE ) { return $this->finalise($result); }
if( $_115 === 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_122 = $result;
$pos_122 = $this->pos;
$_121 = 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 { $_121 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1;
$result["text"] .= '=';
}
else { $_121 = 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 { $_121 = FALSE; break; }
$_121 = TRUE; break;
}
while(0);
if( $_121 === FALSE) {
$result = $res_122;
$this->pos = $pos_122;
unset( $res_122 );
unset( $pos_122 );
break;
}
$count += 1;
}
if ($count > 0) { return $this->finalise($result); }
else { return FALSE; }
}
/* 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 Translate__construct(&$res) {
$res['php'] = '$val .= _t(';
}
function Translate_Entity(&$res, $sub) {
$res['php'] .= "'$sub[text]'";
}
function Translate_Default(&$res, $sub) {
$res['php'] .= ",$sub[text]";
}
function Translate_Context(&$res, $sub) {
$res['php'] .= ",$sub[text]";
}
function Translate_InjectionVariables(&$res, $sub) {
$res['php'] .= ",$sub[php]";
}
function Translate__finalise(&$res) {
$res['php'] .= ');';
}
function InjectionVariables__construct(&$res) {
$res['php'] = "array(";
}
function InjectionVariables_InjectionName(&$res, $sub) {
$res['php'] .= "'$sub[text]'=>";
}
function InjectionVariables_Argument(&$res, $sub) {
$res['php'] .= str_replace('$$FINAL', 'XML_val', $sub['php']) . ',';
}
function InjectionVariables__finalise(&$res) {
if (substr($res['php'], -1) == ',') $res['php'] = substr($res['php'], 0, -1); //remove last comma in the array
$res['php'] .= ')';
}
/* SimpleInjection: '$' :Lookup */
protected $match_SimpleInjection_typestack = array('SimpleInjection');
function match_SimpleInjection ($stack = array()) {
$matchrule = "SimpleInjection"; $result = $this->construct($matchrule, $matchrule, null);
$_89 = NULL;
$_126 = NULL;
do {
if (substr($this->string,$this->pos,1) == '$') {
$this->pos += 1;
$result["text"] .= '$';
}
else { $_89 = FALSE; break; }
else { $_126 = 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 { $_89 = FALSE; break; }
$_89 = TRUE; break;
else { $_126 = FALSE; break; }
$_126 = TRUE; break;
}
while(0);
if( $_89 === TRUE ) { return $this->finalise($result); }
if( $_89 === FALSE) { return FALSE; }
if( $_126 === TRUE ) { return $this->finalise($result); }
if( $_126 === FALSE) { return FALSE; }
}
@ -648,26 +878,26 @@ class SSTemplateParser extends Parser {
protected $match_BracketInjection_typestack = array('BracketInjection');
function match_BracketInjection ($stack = array()) {
$matchrule = "BracketInjection"; $result = $this->construct($matchrule, $matchrule, null);
$_94 = NULL;
$_131 = NULL;
do {
if (( $subres = $this->literal( '{$' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_94 = FALSE; break; }
else { $_131 = 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 { $_94 = FALSE; break; }
else { $_131 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '}') {
$this->pos += 1;
$result["text"] .= '}';
}
else { $_94 = FALSE; break; }
$_94 = TRUE; break;
else { $_131 = FALSE; break; }
$_131 = TRUE; break;
}
while(0);
if( $_94 === TRUE ) { return $this->finalise($result); }
if( $_94 === FALSE) { return FALSE; }
if( $_131 === TRUE ) { return $this->finalise($result); }
if( $_131 === FALSE) { return FALSE; }
}
@ -675,31 +905,31 @@ class SSTemplateParser extends Parser {
protected $match_Injection_typestack = array('Injection');
function match_Injection ($stack = array()) {
$matchrule = "Injection"; $result = $this->construct($matchrule, $matchrule, null);
$_99 = NULL;
$_136 = NULL;
do {
$res_96 = $result;
$pos_96 = $this->pos;
$res_133 = $result;
$pos_133 = $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 );
$_99 = TRUE; break;
$_136 = TRUE; break;
}
$result = $res_96;
$this->pos = $pos_96;
$result = $res_133;
$this->pos = $pos_133;
$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 );
$_99 = TRUE; break;
$_136 = TRUE; break;
}
$result = $res_96;
$this->pos = $pos_96;
$_99 = FALSE; break;
$result = $res_133;
$this->pos = $pos_133;
$_136 = FALSE; break;
}
while(0);
if( $_99 === TRUE ) { return $this->finalise($result); }
if( $_99 === FALSE) { return FALSE; }
if( $_136 === TRUE ) { return $this->finalise($result); }
if( $_136 === FALSE) { return FALSE; }
}
@ -731,7 +961,7 @@ class SSTemplateParser extends Parser {
protected $match_QuotedString_typestack = array('QuotedString');
function match_QuotedString ($stack = array()) {
$matchrule = "QuotedString"; $result = $this->construct($matchrule, $matchrule, null);
$_105 = NULL;
$_142 = NULL;
do {
$stack[] = $result; $result = $this->construct( $matchrule, "q" );
if (( $subres = $this->rx( '/[\'"]/' ) ) !== FALSE) {
@ -741,7 +971,7 @@ class SSTemplateParser extends Parser {
}
else {
$result = array_pop($stack);
$_105 = FALSE; break;
$_142 = FALSE; break;
}
$stack[] = $result; $result = $this->construct( $matchrule, "String" );
if (( $subres = $this->rx( '/ (\\\\\\\\ | \\\\. | [^'.$this->expression($result, $stack, 'q').'\\\\])* /' ) ) !== FALSE) {
@ -751,15 +981,15 @@ class SSTemplateParser extends Parser {
}
else {
$result = array_pop($stack);
$_105 = FALSE; break;
$_142 = FALSE; break;
}
if (( $subres = $this->literal( ''.$this->expression($result, $stack, 'q').'' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_105 = FALSE; break; }
$_105 = TRUE; break;
else { $_142 = FALSE; break; }
$_142 = TRUE; break;
}
while(0);
if( $_105 === TRUE ) { return $this->finalise($result); }
if( $_105 === FALSE) { return FALSE; }
if( $_142 === TRUE ) { return $this->finalise($result); }
if( $_142 === FALSE) { return FALSE; }
}
@ -783,45 +1013,45 @@ class SSTemplateParser extends Parser {
protected $match_Argument_typestack = array('Argument');
function match_Argument ($stack = array()) {
$matchrule = "Argument"; $result = $this->construct($matchrule, $matchrule, null);
$_125 = NULL;
$_162 = NULL;
do {
$res_108 = $result;
$pos_108 = $this->pos;
$res_145 = $result;
$pos_145 = $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" );
$_125 = TRUE; break;
$_162 = TRUE; break;
}
$result = $res_108;
$this->pos = $pos_108;
$_123 = NULL;
$result = $res_145;
$this->pos = $pos_145;
$_160 = NULL;
do {
$res_110 = $result;
$pos_110 = $this->pos;
$res_147 = $result;
$pos_147 = $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" );
$_123 = TRUE; break;
$_160 = TRUE; break;
}
$result = $res_110;
$this->pos = $pos_110;
$_121 = NULL;
$result = $res_147;
$this->pos = $pos_147;
$_158 = NULL;
do {
$res_112 = $result;
$pos_112 = $this->pos;
$_118 = NULL;
$res_149 = $result;
$pos_149 = $this->pos;
$_155 = 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 { $_118 = FALSE; break; }
$res_117 = $result;
$pos_117 = $this->pos;
$_116 = NULL;
else { $_155 = FALSE; break; }
$res_154 = $result;
$pos_154 = $this->pos;
$_153 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'FreeString'; $key = $matcher; $pos = $this->pos;
@ -829,50 +1059,50 @@ class SSTemplateParser extends Parser {
if ($subres !== FALSE) {
$this->store( $result, $subres );
}
else { $_116 = FALSE; break; }
$_116 = TRUE; break;
else { $_153 = FALSE; break; }
$_153 = TRUE; break;
}
while(0);
if( $_116 === TRUE ) {
$result = $res_117;
$this->pos = $pos_117;
$_118 = FALSE; break;
if( $_153 === TRUE ) {
$result = $res_154;
$this->pos = $pos_154;
$_155 = FALSE; break;
}
if( $_116 === FALSE) {
$result = $res_117;
$this->pos = $pos_117;
if( $_153 === FALSE) {
$result = $res_154;
$this->pos = $pos_154;
}
$_118 = TRUE; break;
$_155 = TRUE; break;
}
while(0);
if( $_118 === TRUE ) { $_121 = TRUE; break; }
$result = $res_112;
$this->pos = $pos_112;
if( $_155 === TRUE ) { $_158 = TRUE; break; }
$result = $res_149;
$this->pos = $pos_149;
$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" );
$_121 = TRUE; break;
$_158 = TRUE; break;
}
$result = $res_112;
$this->pos = $pos_112;
$_121 = FALSE; break;
$result = $res_149;
$this->pos = $pos_149;
$_158 = FALSE; break;
}
while(0);
if( $_121 === TRUE ) { $_123 = TRUE; break; }
$result = $res_110;
$this->pos = $pos_110;
$_123 = FALSE; break;
if( $_158 === TRUE ) { $_160 = TRUE; break; }
$result = $res_147;
$this->pos = $pos_147;
$_160 = FALSE; break;
}
while(0);
if( $_123 === TRUE ) { $_125 = TRUE; break; }
$result = $res_108;
$this->pos = $pos_108;
$_125 = FALSE; break;
if( $_160 === TRUE ) { $_162 = TRUE; break; }
$result = $res_145;
$this->pos = $pos_145;
$_162 = FALSE; break;
}
while(0);
if( $_125 === TRUE ) { return $this->finalise($result); }
if( $_125 === FALSE) { return FALSE; }
if( $_162 === TRUE ) { return $this->finalise($result); }
if( $_162 === FALSE) { return FALSE; }
}
@ -916,51 +1146,51 @@ class SSTemplateParser extends Parser {
function Argument_FreeString(&$res, $sub) {
$res['ArgumentMode'] = 'string';
$res['php'] = "'" . str_replace("'", "\\'", rtrim($sub['text'])) . "'";
$res['php'] = "'" . str_replace("'", "\\'", $sub['text']) . "'";
}
/* ComparisonOperator: "==" | "!=" | "=" */
protected $match_ComparisonOperator_typestack = array('ComparisonOperator');
function match_ComparisonOperator ($stack = array()) {
$matchrule = "ComparisonOperator"; $result = $this->construct($matchrule, $matchrule, null);
$_134 = NULL;
$_171 = NULL;
do {
$res_127 = $result;
$pos_127 = $this->pos;
$res_164 = $result;
$pos_164 = $this->pos;
if (( $subres = $this->literal( '==' ) ) !== FALSE) {
$result["text"] .= $subres;
$_134 = TRUE; break;
$_171 = TRUE; break;
}
$result = $res_127;
$this->pos = $pos_127;
$_132 = NULL;
$result = $res_164;
$this->pos = $pos_164;
$_169 = NULL;
do {
$res_129 = $result;
$pos_129 = $this->pos;
$res_166 = $result;
$pos_166 = $this->pos;
if (( $subres = $this->literal( '!=' ) ) !== FALSE) {
$result["text"] .= $subres;
$_132 = TRUE; break;
$_169 = TRUE; break;
}
$result = $res_129;
$this->pos = $pos_129;
$result = $res_166;
$this->pos = $pos_166;
if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1;
$result["text"] .= '=';
$_132 = TRUE; break;
$_169 = TRUE; break;
}
$result = $res_129;
$this->pos = $pos_129;
$_132 = FALSE; break;
$result = $res_166;
$this->pos = $pos_166;
$_169 = FALSE; break;
}
while(0);
if( $_132 === TRUE ) { $_134 = TRUE; break; }
$result = $res_127;
$this->pos = $pos_127;
$_134 = FALSE; break;
if( $_169 === TRUE ) { $_171 = TRUE; break; }
$result = $res_164;
$this->pos = $pos_164;
$_171 = FALSE; break;
}
while(0);
if( $_134 === TRUE ) { return $this->finalise($result); }
if( $_134 === FALSE) { return FALSE; }
if( $_171 === TRUE ) { return $this->finalise($result); }
if( $_171 === FALSE) { return FALSE; }
}
@ -968,27 +1198,27 @@ class SSTemplateParser extends Parser {
protected $match_Comparison_typestack = array('Comparison');
function match_Comparison ($stack = array()) {
$matchrule = "Comparison"; $result = $this->construct($matchrule, $matchrule, null);
$_141 = NULL;
$_178 = 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 { $_141 = FALSE; break; }
else { $_178 = 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 { $_141 = FALSE; break; }
else { $_178 = 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 { $_141 = FALSE; break; }
$_141 = TRUE; break;
else { $_178 = FALSE; break; }
$_178 = TRUE; break;
}
while(0);
if( $_141 === TRUE ) { return $this->finalise($result); }
if( $_141 === FALSE) { return FALSE; }
if( $_178 === TRUE ) { return $this->finalise($result); }
if( $_178 === FALSE) { return FALSE; }
}
@ -1011,11 +1241,11 @@ class SSTemplateParser extends Parser {
protected $match_PresenceCheck_typestack = array('PresenceCheck');
function match_PresenceCheck ($stack = array()) {
$matchrule = "PresenceCheck"; $result = $this->construct($matchrule, $matchrule, null);
$_148 = NULL;
$_185 = NULL;
do {
$res_146 = $result;
$pos_146 = $this->pos;
$_145 = NULL;
$res_183 = $result;
$pos_183 = $this->pos;
$_182 = NULL;
do {
$stack[] = $result; $result = $this->construct( $matchrule, "Not" );
if (( $subres = $this->literal( 'not' ) ) !== FALSE) {
@ -1025,27 +1255,27 @@ class SSTemplateParser extends Parser {
}
else {
$result = array_pop($stack);
$_145 = FALSE; break;
$_182 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_145 = TRUE; break;
$_182 = TRUE; break;
}
while(0);
if( $_145 === FALSE) {
$result = $res_146;
$this->pos = $pos_146;
unset( $res_146 );
unset( $pos_146 );
if( $_182 === FALSE) {
$result = $res_183;
$this->pos = $pos_183;
unset( $res_183 );
unset( $pos_183 );
}
$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 { $_148 = FALSE; break; }
$_148 = TRUE; break;
else { $_185 = FALSE; break; }
$_185 = TRUE; break;
}
while(0);
if( $_148 === TRUE ) { return $this->finalise($result); }
if( $_148 === FALSE) { return FALSE; }
if( $_185 === TRUE ) { return $this->finalise($result); }
if( $_185 === FALSE) { return FALSE; }
}
@ -1070,31 +1300,31 @@ class SSTemplateParser extends Parser {
protected $match_IfArgumentPortion_typestack = array('IfArgumentPortion');
function match_IfArgumentPortion ($stack = array()) {
$matchrule = "IfArgumentPortion"; $result = $this->construct($matchrule, $matchrule, null);
$_153 = NULL;
$_190 = NULL;
do {
$res_150 = $result;
$pos_150 = $this->pos;
$res_187 = $result;
$pos_187 = $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 );
$_153 = TRUE; break;
$_190 = TRUE; break;
}
$result = $res_150;
$this->pos = $pos_150;
$result = $res_187;
$this->pos = $pos_187;
$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 );
$_153 = TRUE; break;
$_190 = TRUE; break;
}
$result = $res_150;
$this->pos = $pos_150;
$_153 = FALSE; break;
$result = $res_187;
$this->pos = $pos_187;
$_190 = FALSE; break;
}
while(0);
if( $_153 === TRUE ) { return $this->finalise($result); }
if( $_153 === FALSE) { return FALSE; }
if( $_190 === TRUE ) { return $this->finalise($result); }
if( $_190 === FALSE) { return FALSE; }
}
@ -1107,27 +1337,27 @@ class SSTemplateParser extends Parser {
protected $match_BooleanOperator_typestack = array('BooleanOperator');
function match_BooleanOperator ($stack = array()) {
$matchrule = "BooleanOperator"; $result = $this->construct($matchrule, $matchrule, null);
$_158 = NULL;
$_195 = NULL;
do {
$res_155 = $result;
$pos_155 = $this->pos;
$res_192 = $result;
$pos_192 = $this->pos;
if (( $subres = $this->literal( '||' ) ) !== FALSE) {
$result["text"] .= $subres;
$_158 = TRUE; break;
$_195 = TRUE; break;
}
$result = $res_155;
$this->pos = $pos_155;
$result = $res_192;
$this->pos = $pos_192;
if (( $subres = $this->literal( '&&' ) ) !== FALSE) {
$result["text"] .= $subres;
$_158 = TRUE; break;
$_195 = TRUE; break;
}
$result = $res_155;
$this->pos = $pos_155;
$_158 = FALSE; break;
$result = $res_192;
$this->pos = $pos_192;
$_195 = FALSE; break;
}
while(0);
if( $_158 === TRUE ) { return $this->finalise($result); }
if( $_158 === FALSE) { return FALSE; }
if( $_195 === TRUE ) { return $this->finalise($result); }
if( $_195 === FALSE) { return FALSE; }
}
@ -1135,18 +1365,18 @@ class SSTemplateParser extends Parser {
protected $match_IfArgument_typestack = array('IfArgument');
function match_IfArgument ($stack = array()) {
$matchrule = "IfArgument"; $result = $this->construct($matchrule, $matchrule, null);
$_167 = NULL;
$_204 = 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 { $_167 = FALSE; break; }
else { $_204 = FALSE; break; }
while (true) {
$res_166 = $result;
$pos_166 = $this->pos;
$_165 = NULL;
$res_203 = $result;
$pos_203 = $this->pos;
$_202 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'BooleanOperator'; $key = $matcher; $pos = $this->pos;
@ -1154,30 +1384,30 @@ class SSTemplateParser extends Parser {
if ($subres !== FALSE) {
$this->store( $result, $subres, "BooleanOperator" );
}
else { $_165 = FALSE; break; }
else { $_202 = 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 { $_165 = FALSE; break; }
$_165 = TRUE; break;
else { $_202 = FALSE; break; }
$_202 = TRUE; break;
}
while(0);
if( $_165 === FALSE) {
$result = $res_166;
$this->pos = $pos_166;
unset( $res_166 );
unset( $pos_166 );
if( $_202 === FALSE) {
$result = $res_203;
$this->pos = $pos_203;
unset( $res_203 );
unset( $pos_203 );
break;
}
}
$_167 = TRUE; break;
$_204 = TRUE; break;
}
while(0);
if( $_167 === TRUE ) { return $this->finalise($result); }
if( $_167 === FALSE) { return FALSE; }
if( $_204 === TRUE ) { return $this->finalise($result); }
if( $_204 === FALSE) { return FALSE; }
}
@ -1194,42 +1424,42 @@ class SSTemplateParser extends Parser {
protected $match_IfPart_typestack = array('IfPart');
function match_IfPart ($stack = array()) {
$matchrule = "IfPart"; $result = $this->construct($matchrule, $matchrule, null);
$_177 = NULL;
$_214 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_177 = FALSE; break; }
else { $_214 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'if' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_177 = FALSE; break; }
else { $_214 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_177 = FALSE; break; }
else { $_214 = 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 { $_177 = FALSE; break; }
else { $_214 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_177 = FALSE; break; }
$res_176 = $result;
$pos_176 = $this->pos;
else { $_214 = FALSE; break; }
$res_213 = $result;
$pos_213 = $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_176;
$this->pos = $pos_176;
unset( $res_176 );
unset( $pos_176 );
$result = $res_213;
$this->pos = $pos_213;
unset( $res_213 );
unset( $pos_213 );
}
$_177 = TRUE; break;
$_214 = TRUE; break;
}
while(0);
if( $_177 === TRUE ) { return $this->finalise($result); }
if( $_177 === FALSE) { return FALSE; }
if( $_214 === TRUE ) { return $this->finalise($result); }
if( $_214 === FALSE) { return FALSE; }
}
@ -1237,35 +1467,35 @@ class SSTemplateParser extends Parser {
protected $match_ElseIfPart_typestack = array('ElseIfPart');
function match_ElseIfPart ($stack = array()) {
$matchrule = "ElseIfPart"; $result = $this->construct($matchrule, $matchrule, null);
$_187 = NULL;
$_224 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_187 = FALSE; break; }
else { $_224 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_187 = FALSE; break; }
else { $_224 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_187 = FALSE; break; }
else { $_224 = 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 { $_187 = FALSE; break; }
else { $_224 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_187 = FALSE; break; }
else { $_224 = FALSE; break; }
$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 { $_187 = FALSE; break; }
$_187 = TRUE; break;
else { $_224 = FALSE; break; }
$_224 = TRUE; break;
}
while(0);
if( $_187 === TRUE ) { return $this->finalise($result); }
if( $_187 === FALSE) { return FALSE; }
if( $_224 === TRUE ) { return $this->finalise($result); }
if( $_224 === FALSE) { return FALSE; }
}
@ -1273,27 +1503,27 @@ class SSTemplateParser extends Parser {
protected $match_ElsePart_typestack = array('ElsePart');
function match_ElsePart ($stack = array()) {
$matchrule = "ElsePart"; $result = $this->construct($matchrule, $matchrule, null);
$_195 = NULL;
$_232 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_195 = FALSE; break; }
else { $_232 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'else' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_195 = FALSE; break; }
else { $_232 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_195 = FALSE; break; }
else { $_232 = FALSE; break; }
$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 { $_195 = FALSE; break; }
$_195 = TRUE; break;
else { $_232 = FALSE; break; }
$_232 = TRUE; break;
}
while(0);
if( $_195 === TRUE ) { return $this->finalise($result); }
if( $_195 === FALSE) { return FALSE; }
if( $_232 === TRUE ) { return $this->finalise($result); }
if( $_232 === FALSE) { return FALSE; }
}
@ -1301,50 +1531,50 @@ class SSTemplateParser extends Parser {
protected $match_If_typestack = array('If');
function match_If ($stack = array()) {
$matchrule = "If"; $result = $this->construct($matchrule, $matchrule, null);
$_205 = NULL;
$_242 = 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 { $_205 = FALSE; break; }
else { $_242 = FALSE; break; }
while (true) {
$res_198 = $result;
$pos_198 = $this->pos;
$res_235 = $result;
$pos_235 = $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_198;
$this->pos = $pos_198;
unset( $res_198 );
unset( $pos_198 );
$result = $res_235;
$this->pos = $pos_235;
unset( $res_235 );
unset( $pos_235 );
break;
}
}
$res_199 = $result;
$pos_199 = $this->pos;
$res_236 = $result;
$pos_236 = $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_199;
$this->pos = $pos_199;
unset( $res_199 );
unset( $pos_199 );
$result = $res_236;
$this->pos = $pos_236;
unset( $res_236 );
unset( $pos_236 );
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_205 = FALSE; break; }
else { $_242 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_if' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_205 = FALSE; break; }
else { $_242 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_205 = FALSE; break; }
$_205 = TRUE; break;
else { $_242 = FALSE; break; }
$_242 = TRUE; break;
}
while(0);
if( $_205 === TRUE ) { return $this->finalise($result); }
if( $_205 === FALSE) { return FALSE; }
if( $_242 === TRUE ) { return $this->finalise($result); }
if( $_242 === FALSE) { return FALSE; }
}
@ -1374,61 +1604,61 @@ class SSTemplateParser extends Parser {
protected $match_Require_typestack = array('Require');
function match_Require ($stack = array()) {
$matchrule = "Require"; $result = $this->construct($matchrule, $matchrule, null);
$_221 = NULL;
$_258 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_221 = FALSE; break; }
else { $_258 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'require' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_221 = FALSE; break; }
else { $_258 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_221 = FALSE; break; }
else { $_258 = FALSE; break; }
$stack[] = $result; $result = $this->construct( $matchrule, "Call" );
$_217 = NULL;
$_254 = 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 { $_217 = FALSE; break; }
else { $_254 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '(') {
$this->pos += 1;
$result["text"] .= '(';
}
else { $_217 = FALSE; break; }
else { $_254 = 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 { $_217 = FALSE; break; }
else { $_254 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
}
else { $_217 = FALSE; break; }
$_217 = TRUE; break;
else { $_254 = FALSE; break; }
$_254 = TRUE; break;
}
while(0);
if( $_217 === TRUE ) {
if( $_254 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Call' );
}
if( $_217 === FALSE) {
if( $_254 === FALSE) {
$result = array_pop($stack);
$_221 = FALSE; break;
$_258 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_221 = FALSE; break; }
$_221 = TRUE; break;
else { $_258 = FALSE; break; }
$_258 = TRUE; break;
}
while(0);
if( $_221 === TRUE ) { return $this->finalise($result); }
if( $_221 === FALSE) { return FALSE; }
if( $_258 === TRUE ) { return $this->finalise($result); }
if( $_258 === FALSE) { return FALSE; }
}
@ -1448,97 +1678,97 @@ class SSTemplateParser extends Parser {
protected $match_CacheBlockArgument_typestack = array('CacheBlockArgument');
function match_CacheBlockArgument ($stack = array()) {
$matchrule = "CacheBlockArgument"; $result = $this->construct($matchrule, $matchrule, null);
$_241 = NULL;
$_278 = NULL;
do {
$res_229 = $result;
$pos_229 = $this->pos;
$_228 = NULL;
$res_266 = $result;
$pos_266 = $this->pos;
$_265 = NULL;
do {
$_226 = NULL;
$_263 = NULL;
do {
$res_223 = $result;
$pos_223 = $this->pos;
$res_260 = $result;
$pos_260 = $this->pos;
if (( $subres = $this->literal( 'if ' ) ) !== FALSE) {
$result["text"] .= $subres;
$_226 = TRUE; break;
$_263 = TRUE; break;
}
$result = $res_223;
$this->pos = $pos_223;
$result = $res_260;
$this->pos = $pos_260;
if (( $subres = $this->literal( 'unless ' ) ) !== FALSE) {
$result["text"] .= $subres;
$_226 = TRUE; break;
$_263 = TRUE; break;
}
$result = $res_223;
$this->pos = $pos_223;
$_226 = FALSE; break;
$result = $res_260;
$this->pos = $pos_260;
$_263 = FALSE; break;
}
while(0);
if( $_226 === FALSE) { $_228 = FALSE; break; }
$_228 = TRUE; break;
if( $_263 === FALSE) { $_265 = FALSE; break; }
$_265 = TRUE; break;
}
while(0);
if( $_228 === TRUE ) {
$result = $res_229;
$this->pos = $pos_229;
$_241 = FALSE; break;
if( $_265 === TRUE ) {
$result = $res_266;
$this->pos = $pos_266;
$_278 = FALSE; break;
}
if( $_228 === FALSE) {
$result = $res_229;
$this->pos = $pos_229;
if( $_265 === FALSE) {
$result = $res_266;
$this->pos = $pos_266;
}
$_239 = NULL;
$_276 = NULL;
do {
$_237 = NULL;
$_274 = NULL;
do {
$res_230 = $result;
$pos_230 = $this->pos;
$res_267 = $result;
$pos_267 = $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" );
$_237 = TRUE; break;
$_274 = TRUE; break;
}
$result = $res_230;
$this->pos = $pos_230;
$_235 = NULL;
$result = $res_267;
$this->pos = $pos_267;
$_272 = NULL;
do {
$res_232 = $result;
$pos_232 = $this->pos;
$res_269 = $result;
$pos_269 = $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" );
$_235 = TRUE; break;
$_272 = TRUE; break;
}
$result = $res_232;
$this->pos = $pos_232;
$result = $res_269;
$this->pos = $pos_269;
$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" );
$_235 = TRUE; break;
$_272 = TRUE; break;
}
$result = $res_232;
$this->pos = $pos_232;
$_235 = FALSE; break;
$result = $res_269;
$this->pos = $pos_269;
$_272 = FALSE; break;
}
while(0);
if( $_235 === TRUE ) { $_237 = TRUE; break; }
$result = $res_230;
$this->pos = $pos_230;
$_237 = FALSE; break;
if( $_272 === TRUE ) { $_274 = TRUE; break; }
$result = $res_267;
$this->pos = $pos_267;
$_274 = FALSE; break;
}
while(0);
if( $_237 === FALSE) { $_239 = FALSE; break; }
$_239 = TRUE; break;
if( $_274 === FALSE) { $_276 = FALSE; break; }
$_276 = TRUE; break;
}
while(0);
if( $_239 === FALSE) { $_241 = FALSE; break; }
$_241 = TRUE; break;
if( $_276 === FALSE) { $_278 = FALSE; break; }
$_278 = TRUE; break;
}
while(0);
if( $_241 === TRUE ) { return $this->finalise($result); }
if( $_241 === FALSE) { return FALSE; }
if( $_278 === TRUE ) { return $this->finalise($result); }
if( $_278 === FALSE) { return FALSE; }
}
@ -1559,44 +1789,44 @@ class SSTemplateParser extends Parser {
protected $match_CacheBlockArguments_typestack = array('CacheBlockArguments');
function match_CacheBlockArguments ($stack = array()) {
$matchrule = "CacheBlockArguments"; $result = $this->construct($matchrule, $matchrule, null);
$_250 = NULL;
$_287 = 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 { $_250 = FALSE; break; }
else { $_287 = FALSE; break; }
while (true) {
$res_249 = $result;
$pos_249 = $this->pos;
$_248 = NULL;
$res_286 = $result;
$pos_286 = $this->pos;
$_285 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_248 = FALSE; break; }
else { $_285 = 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 { $_248 = FALSE; break; }
$_248 = TRUE; break;
else { $_285 = FALSE; break; }
$_285 = TRUE; break;
}
while(0);
if( $_248 === FALSE) {
$result = $res_249;
$this->pos = $pos_249;
unset( $res_249 );
unset( $pos_249 );
if( $_285 === FALSE) {
$result = $res_286;
$this->pos = $pos_286;
unset( $res_286 );
unset( $pos_286 );
break;
}
}
$_250 = TRUE; break;
$_287 = TRUE; break;
}
while(0);
if( $_250 === TRUE ) { return $this->finalise($result); }
if( $_250 === FALSE) { return FALSE; }
if( $_287 === TRUE ) { return $this->finalise($result); }
if( $_287 === FALSE) { return FALSE; }
}
@ -1608,192 +1838,210 @@ class SSTemplateParser extends Parser {
$res['php'] .= str_replace('$$FINAL', 'XML_val', $sub['php']);
}
/* CacheBlockTemplate: (Comment | If | Require | OldI18NTag | Include | ClosedBlock | OpenBlock | MalformedBlock | Injection | Text)+ */
/* CacheBlockTemplate: (Comment | Translate | If | Require | OldI18NTag | Include | ClosedBlock | 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_290 = $result;
$pos_290 = $this->pos;
$_289 = NULL;
$res_331 = $result;
$pos_331 = $this->pos;
$_330 = NULL;
do {
$_287 = NULL;
$_328 = NULL;
do {
$res_252 = $result;
$pos_252 = $this->pos;
$res_289 = $result;
$pos_289 = $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 );
$_287 = TRUE; break;
$_328 = TRUE; break;
}
$result = $res_252;
$this->pos = $pos_252;
$_285 = NULL;
$result = $res_289;
$this->pos = $pos_289;
$_326 = NULL;
do {
$res_254 = $result;
$pos_254 = $this->pos;
$matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
$res_291 = $result;
$pos_291 = $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 );
$_285 = TRUE; break;
$_326 = TRUE; break;
}
$result = $res_254;
$this->pos = $pos_254;
$_283 = NULL;
$result = $res_291;
$this->pos = $pos_291;
$_324 = NULL;
do {
$res_256 = $result;
$pos_256 = $this->pos;
$matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$res_293 = $result;
$pos_293 = $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 );
$_283 = TRUE; break;
$_324 = TRUE; break;
}
$result = $res_256;
$this->pos = $pos_256;
$_281 = NULL;
$result = $res_293;
$this->pos = $pos_293;
$_322 = NULL;
do {
$res_258 = $result;
$pos_258 = $this->pos;
$matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$res_295 = $result;
$pos_295 = $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 );
$_281 = TRUE; break;
$_322 = TRUE; break;
}
$result = $res_258;
$this->pos = $pos_258;
$_279 = NULL;
$result = $res_295;
$this->pos = $pos_295;
$_320 = NULL;
do {
$res_260 = $result;
$pos_260 = $this->pos;
$matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
$res_297 = $result;
$pos_297 = $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 );
$_279 = TRUE; break;
$_320 = TRUE; break;
}
$result = $res_260;
$this->pos = $pos_260;
$_277 = NULL;
$result = $res_297;
$this->pos = $pos_297;
$_318 = NULL;
do {
$res_262 = $result;
$pos_262 = $this->pos;
$matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$res_299 = $result;
$pos_299 = $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 );
$_277 = TRUE; break;
$_318 = TRUE; break;
}
$result = $res_262;
$this->pos = $pos_262;
$_275 = NULL;
$result = $res_299;
$this->pos = $pos_299;
$_316 = NULL;
do {
$res_264 = $result;
$pos_264 = $this->pos;
$matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$res_301 = $result;
$pos_301 = $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 );
$_275 = TRUE; break;
$_316 = TRUE; break;
}
$result = $res_264;
$this->pos = $pos_264;
$_273 = NULL;
$result = $res_301;
$this->pos = $pos_301;
$_314 = NULL;
do {
$res_266 = $result;
$pos_266 = $this->pos;
$matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$res_303 = $result;
$pos_303 = $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 );
$_273 = TRUE; break;
$_314 = TRUE; break;
}
$result = $res_266;
$this->pos = $pos_266;
$_271 = NULL;
$result = $res_303;
$this->pos = $pos_303;
$_312 = NULL;
do {
$res_268 = $result;
$pos_268 = $this->pos;
$matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$res_305 = $result;
$pos_305 = $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 );
$_271 = TRUE; break;
$_312 = TRUE; break;
}
$result = $res_268;
$this->pos = $pos_268;
$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 );
$_271 = TRUE; break;
$result = $res_305;
$this->pos = $pos_305;
$_310 = NULL;
do {
$res_307 = $result;
$pos_307 = $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 );
$_310 = TRUE; break;
}
$result = $res_307;
$this->pos = $pos_307;
$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 );
$_310 = TRUE; break;
}
$result = $res_307;
$this->pos = $pos_307;
$_310 = FALSE; break;
}
$result = $res_268;
$this->pos = $pos_268;
$_271 = FALSE; break;
while(0);
if( $_310 === TRUE ) { $_312 = TRUE; break; }
$result = $res_305;
$this->pos = $pos_305;
$_312 = FALSE; break;
}
while(0);
if( $_271 === TRUE ) { $_273 = TRUE; break; }
$result = $res_266;
$this->pos = $pos_266;
$_273 = FALSE; break;
if( $_312 === TRUE ) { $_314 = TRUE; break; }
$result = $res_303;
$this->pos = $pos_303;
$_314 = FALSE; break;
}
while(0);
if( $_273 === TRUE ) { $_275 = TRUE; break; }
$result = $res_264;
$this->pos = $pos_264;
$_275 = FALSE; break;
if( $_314 === TRUE ) { $_316 = TRUE; break; }
$result = $res_301;
$this->pos = $pos_301;
$_316 = FALSE; break;
}
while(0);
if( $_275 === TRUE ) { $_277 = TRUE; break; }
$result = $res_262;
$this->pos = $pos_262;
$_277 = FALSE; break;
if( $_316 === TRUE ) { $_318 = TRUE; break; }
$result = $res_299;
$this->pos = $pos_299;
$_318 = FALSE; break;
}
while(0);
if( $_277 === TRUE ) { $_279 = TRUE; break; }
$result = $res_260;
$this->pos = $pos_260;
$_279 = FALSE; break;
if( $_318 === TRUE ) { $_320 = TRUE; break; }
$result = $res_297;
$this->pos = $pos_297;
$_320 = FALSE; break;
}
while(0);
if( $_279 === TRUE ) { $_281 = TRUE; break; }
$result = $res_258;
$this->pos = $pos_258;
$_281 = FALSE; break;
if( $_320 === TRUE ) { $_322 = TRUE; break; }
$result = $res_295;
$this->pos = $pos_295;
$_322 = FALSE; break;
}
while(0);
if( $_281 === TRUE ) { $_283 = TRUE; break; }
$result = $res_256;
$this->pos = $pos_256;
$_283 = FALSE; break;
if( $_322 === TRUE ) { $_324 = TRUE; break; }
$result = $res_293;
$this->pos = $pos_293;
$_324 = FALSE; break;
}
while(0);
if( $_283 === TRUE ) { $_285 = TRUE; break; }
$result = $res_254;
$this->pos = $pos_254;
$_285 = FALSE; break;
if( $_324 === TRUE ) { $_326 = TRUE; break; }
$result = $res_291;
$this->pos = $pos_291;
$_326 = FALSE; break;
}
while(0);
if( $_285 === TRUE ) { $_287 = TRUE; break; }
$result = $res_252;
$this->pos = $pos_252;
$_287 = FALSE; break;
if( $_326 === TRUE ) { $_328 = TRUE; break; }
$result = $res_289;
$this->pos = $pos_289;
$_328 = FALSE; break;
}
while(0);
if( $_287 === FALSE) { $_289 = FALSE; break; }
$_289 = TRUE; break;
if( $_328 === FALSE) { $_330 = FALSE; break; }
$_330 = TRUE; break;
}
while(0);
if( $_289 === FALSE) {
$result = $res_290;
$this->pos = $pos_290;
unset( $res_290 );
unset( $pos_290 );
if( $_330 === FALSE) {
$result = $res_331;
$this->pos = $pos_331;
unset( $res_331 );
unset( $pos_331 );
break;
}
$count += 1;
@ -1812,63 +2060,63 @@ class SSTemplateParser extends Parser {
protected $match_UncachedBlock_typestack = array('UncachedBlock');
function match_UncachedBlock ($stack = array()) {
$matchrule = "UncachedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_327 = NULL;
$_368 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_327 = FALSE; break; }
else { $_368 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_327 = FALSE; break; }
else { $_368 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_295 = $result;
$pos_295 = $this->pos;
$res_336 = $result;
$pos_336 = $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_295;
$this->pos = $pos_295;
unset( $res_295 );
unset( $pos_295 );
$result = $res_336;
$this->pos = $pos_336;
unset( $res_336 );
unset( $pos_336 );
}
$res_307 = $result;
$pos_307 = $this->pos;
$_306 = NULL;
$res_348 = $result;
$pos_348 = $this->pos;
$_347 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Conditional" );
$_302 = NULL;
$_343 = NULL;
do {
$_300 = NULL;
$_341 = NULL;
do {
$res_297 = $result;
$pos_297 = $this->pos;
$res_338 = $result;
$pos_338 = $this->pos;
if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_300 = TRUE; break;
$_341 = TRUE; break;
}
$result = $res_297;
$this->pos = $pos_297;
$result = $res_338;
$this->pos = $pos_338;
if (( $subres = $this->literal( 'unless' ) ) !== FALSE) {
$result["text"] .= $subres;
$_300 = TRUE; break;
$_341 = TRUE; break;
}
$result = $res_297;
$this->pos = $pos_297;
$_300 = FALSE; break;
$result = $res_338;
$this->pos = $pos_338;
$_341 = FALSE; break;
}
while(0);
if( $_300 === FALSE) { $_302 = FALSE; break; }
$_302 = TRUE; break;
if( $_341 === FALSE) { $_343 = FALSE; break; }
$_343 = TRUE; break;
}
while(0);
if( $_302 === TRUE ) {
if( $_343 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Conditional' );
}
if( $_302 === FALSE) {
if( $_343 === FALSE) {
$result = array_pop($stack);
$_306 = FALSE; break;
$_347 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
@ -1876,87 +2124,87 @@ class SSTemplateParser extends Parser {
if ($subres !== FALSE) {
$this->store( $result, $subres, "Condition" );
}
else { $_306 = FALSE; break; }
$_306 = TRUE; break;
else { $_347 = FALSE; break; }
$_347 = TRUE; break;
}
while(0);
if( $_306 === FALSE) {
$result = $res_307;
$this->pos = $pos_307;
unset( $res_307 );
unset( $pos_307 );
if( $_347 === FALSE) {
$result = $res_348;
$this->pos = $pos_348;
unset( $res_348 );
unset( $pos_348 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_327 = FALSE; break; }
$res_310 = $result;
$pos_310 = $this->pos;
else { $_368 = FALSE; break; }
$res_351 = $result;
$pos_351 = $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_310;
$this->pos = $pos_310;
unset( $res_310 );
unset( $pos_310 );
$result = $res_351;
$this->pos = $pos_351;
unset( $res_351 );
unset( $pos_351 );
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_327 = FALSE; break; }
else { $_368 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_327 = FALSE; break; }
$_323 = NULL;
else { $_368 = FALSE; break; }
$_364 = NULL;
do {
$_321 = NULL;
$_362 = NULL;
do {
$res_314 = $result;
$pos_314 = $this->pos;
$res_355 = $result;
$pos_355 = $this->pos;
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_321 = TRUE; break;
$_362 = TRUE; break;
}
$result = $res_314;
$this->pos = $pos_314;
$_319 = NULL;
$result = $res_355;
$this->pos = $pos_355;
$_360 = NULL;
do {
$res_316 = $result;
$pos_316 = $this->pos;
$res_357 = $result;
$pos_357 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_319 = TRUE; break;
$_360 = TRUE; break;
}
$result = $res_316;
$this->pos = $pos_316;
$result = $res_357;
$this->pos = $pos_357;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_319 = TRUE; break;
$_360 = TRUE; break;
}
$result = $res_316;
$this->pos = $pos_316;
$_319 = FALSE; break;
$result = $res_357;
$this->pos = $pos_357;
$_360 = FALSE; break;
}
while(0);
if( $_319 === TRUE ) { $_321 = TRUE; break; }
$result = $res_314;
$this->pos = $pos_314;
$_321 = FALSE; break;
if( $_360 === TRUE ) { $_362 = TRUE; break; }
$result = $res_355;
$this->pos = $pos_355;
$_362 = FALSE; break;
}
while(0);
if( $_321 === FALSE) { $_323 = FALSE; break; }
$_323 = TRUE; break;
if( $_362 === FALSE) { $_364 = FALSE; break; }
$_364 = TRUE; break;
}
while(0);
if( $_323 === FALSE) { $_327 = FALSE; break; }
if( $_364 === FALSE) { $_368 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_327 = FALSE; break; }
$_327 = TRUE; break;
else { $_368 = FALSE; break; }
$_368 = TRUE; break;
}
while(0);
if( $_327 === TRUE ) { return $this->finalise($result); }
if( $_327 === FALSE) { return FALSE; }
if( $_368 === TRUE ) { return $this->finalise($result); }
if( $_368 === FALSE) { return FALSE; }
}
@ -1965,228 +2213,246 @@ class SSTemplateParser extends Parser {
$res['php'] = $sub['php'];
}
/* CacheRestrictedTemplate: (Comment | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | OpenBlock | MalformedBlock | Injection | Text)+ */
/* CacheRestrictedTemplate: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | 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_375 = $result;
$pos_375 = $this->pos;
$_374 = NULL;
$res_420 = $result;
$pos_420 = $this->pos;
$_419 = NULL;
do {
$_372 = NULL;
$_417 = NULL;
do {
$res_329 = $result;
$pos_329 = $this->pos;
$res_370 = $result;
$pos_370 = $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 );
$_372 = TRUE; break;
$_417 = TRUE; break;
}
$result = $res_329;
$this->pos = $pos_329;
$_370 = NULL;
$result = $res_370;
$this->pos = $pos_370;
$_415 = NULL;
do {
$res_331 = $result;
$pos_331 = $this->pos;
$matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
$res_372 = $result;
$pos_372 = $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 );
$_370 = TRUE; break;
$_415 = TRUE; break;
}
$result = $res_331;
$this->pos = $pos_331;
$_368 = NULL;
$result = $res_372;
$this->pos = $pos_372;
$_413 = NULL;
do {
$res_333 = $result;
$pos_333 = $this->pos;
$matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$res_374 = $result;
$pos_374 = $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 );
$_368 = TRUE; break;
$_413 = TRUE; break;
}
$result = $res_333;
$this->pos = $pos_333;
$_366 = NULL;
$result = $res_374;
$this->pos = $pos_374;
$_411 = NULL;
do {
$res_335 = $result;
$pos_335 = $this->pos;
$matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$res_376 = $result;
$pos_376 = $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 );
$_366 = TRUE; break;
$_411 = TRUE; break;
}
$result = $res_335;
$this->pos = $pos_335;
$_364 = NULL;
$result = $res_376;
$this->pos = $pos_376;
$_409 = NULL;
do {
$res_337 = $result;
$pos_337 = $this->pos;
$matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$res_378 = $result;
$pos_378 = $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 );
$_364 = TRUE; break;
$_409 = TRUE; break;
}
$result = $res_337;
$this->pos = $pos_337;
$_362 = NULL;
$result = $res_378;
$this->pos = $pos_378;
$_407 = NULL;
do {
$res_339 = $result;
$pos_339 = $this->pos;
$matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$res_380 = $result;
$pos_380 = $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 );
$_362 = TRUE; break;
$_407 = TRUE; break;
}
$result = $res_339;
$this->pos = $pos_339;
$_360 = NULL;
$result = $res_380;
$this->pos = $pos_380;
$_405 = NULL;
do {
$res_341 = $result;
$pos_341 = $this->pos;
$matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
$res_382 = $result;
$pos_382 = $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 );
$_360 = TRUE; break;
$_405 = TRUE; break;
}
$result = $res_341;
$this->pos = $pos_341;
$_358 = NULL;
$result = $res_382;
$this->pos = $pos_382;
$_403 = NULL;
do {
$res_343 = $result;
$pos_343 = $this->pos;
$matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$res_384 = $result;
$pos_384 = $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 );
$_358 = TRUE; break;
$_403 = TRUE; break;
}
$result = $res_343;
$this->pos = $pos_343;
$_356 = NULL;
$result = $res_384;
$this->pos = $pos_384;
$_401 = NULL;
do {
$res_345 = $result;
$pos_345 = $this->pos;
$matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$res_386 = $result;
$pos_386 = $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 );
$_356 = TRUE; break;
$_401 = TRUE; break;
}
$result = $res_345;
$this->pos = $pos_345;
$_354 = NULL;
$result = $res_386;
$this->pos = $pos_386;
$_399 = NULL;
do {
$res_347 = $result;
$pos_347 = $this->pos;
$matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$res_388 = $result;
$pos_388 = $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 );
$_354 = TRUE; break;
$_399 = TRUE; break;
}
$result = $res_347;
$this->pos = $pos_347;
$_352 = NULL;
$result = $res_388;
$this->pos = $pos_388;
$_397 = NULL;
do {
$res_349 = $result;
$pos_349 = $this->pos;
$matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$res_390 = $result;
$pos_390 = $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 );
$_352 = TRUE; break;
$_397 = TRUE; break;
}
$result = $res_349;
$this->pos = $pos_349;
$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 );
$_352 = TRUE; break;
$result = $res_390;
$this->pos = $pos_390;
$_395 = NULL;
do {
$res_392 = $result;
$pos_392 = $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 );
$_395 = TRUE; break;
}
$result = $res_392;
$this->pos = $pos_392;
$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 );
$_395 = TRUE; break;
}
$result = $res_392;
$this->pos = $pos_392;
$_395 = FALSE; break;
}
$result = $res_349;
$this->pos = $pos_349;
$_352 = FALSE; break;
while(0);
if( $_395 === TRUE ) { $_397 = TRUE; break; }
$result = $res_390;
$this->pos = $pos_390;
$_397 = FALSE; break;
}
while(0);
if( $_352 === TRUE ) { $_354 = TRUE; break; }
$result = $res_347;
$this->pos = $pos_347;
$_354 = FALSE; break;
if( $_397 === TRUE ) { $_399 = TRUE; break; }
$result = $res_388;
$this->pos = $pos_388;
$_399 = FALSE; break;
}
while(0);
if( $_354 === TRUE ) { $_356 = TRUE; break; }
$result = $res_345;
$this->pos = $pos_345;
$_356 = FALSE; break;
if( $_399 === TRUE ) { $_401 = TRUE; break; }
$result = $res_386;
$this->pos = $pos_386;
$_401 = FALSE; break;
}
while(0);
if( $_356 === TRUE ) { $_358 = TRUE; break; }
$result = $res_343;
$this->pos = $pos_343;
$_358 = FALSE; break;
if( $_401 === TRUE ) { $_403 = TRUE; break; }
$result = $res_384;
$this->pos = $pos_384;
$_403 = FALSE; break;
}
while(0);
if( $_358 === TRUE ) { $_360 = TRUE; break; }
$result = $res_341;
$this->pos = $pos_341;
$_360 = FALSE; break;
if( $_403 === TRUE ) { $_405 = TRUE; break; }
$result = $res_382;
$this->pos = $pos_382;
$_405 = FALSE; break;
}
while(0);
if( $_360 === TRUE ) { $_362 = TRUE; break; }
$result = $res_339;
$this->pos = $pos_339;
$_362 = FALSE; break;
if( $_405 === TRUE ) { $_407 = TRUE; break; }
$result = $res_380;
$this->pos = $pos_380;
$_407 = FALSE; break;
}
while(0);
if( $_362 === TRUE ) { $_364 = TRUE; break; }
$result = $res_337;
$this->pos = $pos_337;
$_364 = FALSE; break;
if( $_407 === TRUE ) { $_409 = TRUE; break; }
$result = $res_378;
$this->pos = $pos_378;
$_409 = FALSE; break;
}
while(0);
if( $_364 === TRUE ) { $_366 = TRUE; break; }
$result = $res_335;
$this->pos = $pos_335;
$_366 = FALSE; break;
if( $_409 === TRUE ) { $_411 = TRUE; break; }
$result = $res_376;
$this->pos = $pos_376;
$_411 = FALSE; break;
}
while(0);
if( $_366 === TRUE ) { $_368 = TRUE; break; }
$result = $res_333;
$this->pos = $pos_333;
$_368 = FALSE; break;
if( $_411 === TRUE ) { $_413 = TRUE; break; }
$result = $res_374;
$this->pos = $pos_374;
$_413 = FALSE; break;
}
while(0);
if( $_368 === TRUE ) { $_370 = TRUE; break; }
$result = $res_331;
$this->pos = $pos_331;
$_370 = FALSE; break;
if( $_413 === TRUE ) { $_415 = TRUE; break; }
$result = $res_372;
$this->pos = $pos_372;
$_415 = FALSE; break;
}
while(0);
if( $_370 === TRUE ) { $_372 = TRUE; break; }
$result = $res_329;
$this->pos = $pos_329;
$_372 = FALSE; break;
if( $_415 === TRUE ) { $_417 = TRUE; break; }
$result = $res_370;
$this->pos = $pos_370;
$_417 = FALSE; break;
}
while(0);
if( $_372 === FALSE) { $_374 = FALSE; break; }
$_374 = TRUE; break;
if( $_417 === FALSE) { $_419 = FALSE; break; }
$_419 = TRUE; break;
}
while(0);
if( $_374 === FALSE) {
$result = $res_375;
$this->pos = $pos_375;
unset( $res_375 );
unset( $pos_375 );
if( $_419 === FALSE) {
$result = $res_420;
$this->pos = $pos_420;
unset( $res_420 );
unset( $pos_420 );
break;
}
$count += 1;
@ -2212,101 +2478,101 @@ class SSTemplateParser extends Parser {
protected $match_CacheBlock_typestack = array('CacheBlock');
function match_CacheBlock ($stack = array()) {
$matchrule = "CacheBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_430 = NULL;
$_475 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_430 = FALSE; break; }
else { $_475 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "CacheTag" );
$_383 = NULL;
$_428 = NULL;
do {
$_381 = NULL;
$_426 = NULL;
do {
$res_378 = $result;
$pos_378 = $this->pos;
$res_423 = $result;
$pos_423 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_381 = TRUE; break;
$_426 = TRUE; break;
}
$result = $res_378;
$this->pos = $pos_378;
$result = $res_423;
$this->pos = $pos_423;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_381 = TRUE; break;
$_426 = TRUE; break;
}
$result = $res_378;
$this->pos = $pos_378;
$_381 = FALSE; break;
$result = $res_423;
$this->pos = $pos_423;
$_426 = FALSE; break;
}
while(0);
if( $_381 === FALSE) { $_383 = FALSE; break; }
$_383 = TRUE; break;
if( $_426 === FALSE) { $_428 = FALSE; break; }
$_428 = TRUE; break;
}
while(0);
if( $_383 === TRUE ) {
if( $_428 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'CacheTag' );
}
if( $_383 === FALSE) {
if( $_428 === FALSE) {
$result = array_pop($stack);
$_430 = FALSE; break;
$_475 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_388 = $result;
$pos_388 = $this->pos;
$_387 = NULL;
$res_433 = $result;
$pos_433 = $this->pos;
$_432 = 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 { $_387 = FALSE; break; }
$_387 = TRUE; break;
else { $_432 = FALSE; break; }
$_432 = TRUE; break;
}
while(0);
if( $_387 === FALSE) {
$result = $res_388;
$this->pos = $pos_388;
unset( $res_388 );
unset( $pos_388 );
if( $_432 === FALSE) {
$result = $res_433;
$this->pos = $pos_433;
unset( $res_433 );
unset( $pos_433 );
}
$res_400 = $result;
$pos_400 = $this->pos;
$_399 = NULL;
$res_445 = $result;
$pos_445 = $this->pos;
$_444 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Conditional" );
$_395 = NULL;
$_440 = NULL;
do {
$_393 = NULL;
$_438 = NULL;
do {
$res_390 = $result;
$pos_390 = $this->pos;
$res_435 = $result;
$pos_435 = $this->pos;
if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_393 = TRUE; break;
$_438 = TRUE; break;
}
$result = $res_390;
$this->pos = $pos_390;
$result = $res_435;
$this->pos = $pos_435;
if (( $subres = $this->literal( 'unless' ) ) !== FALSE) {
$result["text"] .= $subres;
$_393 = TRUE; break;
$_438 = TRUE; break;
}
$result = $res_390;
$this->pos = $pos_390;
$_393 = FALSE; break;
$result = $res_435;
$this->pos = $pos_435;
$_438 = FALSE; break;
}
while(0);
if( $_393 === FALSE) { $_395 = FALSE; break; }
$_395 = TRUE; break;
if( $_438 === FALSE) { $_440 = FALSE; break; }
$_440 = TRUE; break;
}
while(0);
if( $_395 === TRUE ) {
if( $_440 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Conditional' );
}
if( $_395 === FALSE) {
if( $_440 === FALSE) {
$result = array_pop($stack);
$_399 = FALSE; break;
$_444 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
@ -2314,132 +2580,132 @@ class SSTemplateParser extends Parser {
if ($subres !== FALSE) {
$this->store( $result, $subres, "Condition" );
}
else { $_399 = FALSE; break; }
$_399 = TRUE; break;
else { $_444 = FALSE; break; }
$_444 = TRUE; break;
}
while(0);
if( $_399 === FALSE) {
$result = $res_400;
$this->pos = $pos_400;
unset( $res_400 );
unset( $pos_400 );
if( $_444 === FALSE) {
$result = $res_445;
$this->pos = $pos_445;
unset( $res_445 );
unset( $pos_445 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_430 = FALSE; break; }
else { $_475 = FALSE; break; }
while (true) {
$res_413 = $result;
$pos_413 = $this->pos;
$_412 = NULL;
$res_458 = $result;
$pos_458 = $this->pos;
$_457 = NULL;
do {
$_410 = NULL;
$_455 = NULL;
do {
$res_403 = $result;
$pos_403 = $this->pos;
$res_448 = $result;
$pos_448 = $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 );
$_410 = TRUE; break;
$_455 = TRUE; break;
}
$result = $res_403;
$this->pos = $pos_403;
$_408 = NULL;
$result = $res_448;
$this->pos = $pos_448;
$_453 = NULL;
do {
$res_405 = $result;
$pos_405 = $this->pos;
$res_450 = $result;
$pos_450 = $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 );
$_408 = TRUE; break;
$_453 = TRUE; break;
}
$result = $res_405;
$this->pos = $pos_405;
$result = $res_450;
$this->pos = $pos_450;
$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 );
$_408 = TRUE; break;
$_453 = TRUE; break;
}
$result = $res_405;
$this->pos = $pos_405;
$_408 = FALSE; break;
$result = $res_450;
$this->pos = $pos_450;
$_453 = FALSE; break;
}
while(0);
if( $_408 === TRUE ) { $_410 = TRUE; break; }
$result = $res_403;
$this->pos = $pos_403;
$_410 = FALSE; break;
if( $_453 === TRUE ) { $_455 = TRUE; break; }
$result = $res_448;
$this->pos = $pos_448;
$_455 = FALSE; break;
}
while(0);
if( $_410 === FALSE) { $_412 = FALSE; break; }
$_412 = TRUE; break;
if( $_455 === FALSE) { $_457 = FALSE; break; }
$_457 = TRUE; break;
}
while(0);
if( $_412 === FALSE) {
$result = $res_413;
$this->pos = $pos_413;
unset( $res_413 );
unset( $pos_413 );
if( $_457 === FALSE) {
$result = $res_458;
$this->pos = $pos_458;
unset( $res_458 );
unset( $pos_458 );
break;
}
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_430 = FALSE; break; }
else { $_475 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_430 = FALSE; break; }
$_426 = NULL;
else { $_475 = FALSE; break; }
$_471 = NULL;
do {
$_424 = NULL;
$_469 = NULL;
do {
$res_417 = $result;
$pos_417 = $this->pos;
$res_462 = $result;
$pos_462 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_424 = TRUE; break;
$_469 = TRUE; break;
}
$result = $res_417;
$this->pos = $pos_417;
$_422 = NULL;
$result = $res_462;
$this->pos = $pos_462;
$_467 = NULL;
do {
$res_419 = $result;
$pos_419 = $this->pos;
$res_464 = $result;
$pos_464 = $this->pos;
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_422 = TRUE; break;
$_467 = TRUE; break;
}
$result = $res_419;
$this->pos = $pos_419;
$result = $res_464;
$this->pos = $pos_464;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_422 = TRUE; break;
$_467 = TRUE; break;
}
$result = $res_419;
$this->pos = $pos_419;
$_422 = FALSE; break;
$result = $res_464;
$this->pos = $pos_464;
$_467 = FALSE; break;
}
while(0);
if( $_422 === TRUE ) { $_424 = TRUE; break; }
$result = $res_417;
$this->pos = $pos_417;
$_424 = FALSE; break;
if( $_467 === TRUE ) { $_469 = TRUE; break; }
$result = $res_462;
$this->pos = $pos_462;
$_469 = FALSE; break;
}
while(0);
if( $_424 === FALSE) { $_426 = FALSE; break; }
$_426 = TRUE; break;
if( $_469 === FALSE) { $_471 = FALSE; break; }
$_471 = TRUE; break;
}
while(0);
if( $_426 === FALSE) { $_430 = FALSE; break; }
if( $_471 === FALSE) { $_475 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_430 = FALSE; break; }
$_430 = TRUE; break;
else { $_475 = FALSE; break; }
$_475 = TRUE; break;
}
while(0);
if( $_430 === TRUE ) { return $this->finalise($result); }
if( $_430 === FALSE) { return FALSE; }
if( $_475 === TRUE ) { return $this->finalise($result); }
if( $_475 === FALSE) { return FALSE; }
}
@ -2479,60 +2745,109 @@ class SSTemplateParser extends Parser {
$res['php'] .= '}';
}
/* OldTPart: "_t" < "(" < QuotedString (< "," < CallArguments)? > ")" */
/* 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);
$_445 = NULL;
$_494 = NULL;
do {
if (( $subres = $this->literal( '_t' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_445 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_494 = 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 { $_494 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '(') {
$this->pos += 1;
$result["text"] .= '(';
}
else { $_445 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_494 = 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 { $_494 = 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 { $_445 = FALSE; break; }
$res_442 = $result;
$pos_442 = $this->pos;
$_441 = NULL;
else { $_494 = FALSE; break; }
$res_487 = $result;
$pos_487 = $this->pos;
$_486 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$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 { $_486 = FALSE; break; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_441 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_486 = 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 { $_486 = 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 { $_441 = FALSE; break; }
$_441 = TRUE; break;
else { $_486 = FALSE; break; }
$_486 = TRUE; break;
}
while(0);
if( $_441 === FALSE) {
$result = $res_442;
$this->pos = $pos_442;
unset( $res_442 );
unset( $pos_442 );
if( $_486 === FALSE) {
$result = $res_487;
$this->pos = $pos_487;
unset( $res_487 );
unset( $pos_487 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$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 { $_494 = FALSE; break; }
if (substr($this->string,$this->pos,1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
}
else { $_445 = FALSE; break; }
$_445 = TRUE; break;
else { $_494 = 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 { $_494 = FALSE; break; }
$res_493 = $result;
$pos_493 = $this->pos;
$_492 = NULL;
do {
if (substr($this->string,$this->pos,1) == ';') {
$this->pos += 1;
$result["text"] .= ';';
}
else { $_492 = FALSE; break; }
$_492 = TRUE; break;
}
while(0);
if( $_492 === FALSE) {
$result = $res_493;
$this->pos = $pos_493;
unset( $res_493 );
unset( $pos_493 );
}
$_494 = TRUE; break;
}
while(0);
if( $_445 === TRUE ) { return $this->finalise($result); }
if( $_445 === FALSE) { return FALSE; }
if( $_494 === TRUE ) { return $this->finalise($result); }
if( $_494 === 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; }
}
@ -2563,23 +2878,23 @@ class SSTemplateParser extends Parser {
protected $match_OldTTag_typestack = array('OldTTag');
function match_OldTTag ($stack = array()) {
$matchrule = "OldTTag"; $result = $this->construct($matchrule, $matchrule, null);
$_452 = NULL;
$_502 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_452 = FALSE; break; }
else { $_502 = 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 { $_452 = FALSE; break; }
else { $_502 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_452 = FALSE; break; }
$_452 = TRUE; break;
else { $_502 = FALSE; break; }
$_502 = TRUE; break;
}
while(0);
if( $_452 === TRUE ) { return $this->finalise($result); }
if( $_452 === FALSE) { return FALSE; }
if( $_502 === TRUE ) { return $this->finalise($result); }
if( $_502 === FALSE) { return FALSE; }
}
@ -2592,49 +2907,49 @@ class SSTemplateParser extends Parser {
protected $match_OldSprintfTag_typestack = array('OldSprintfTag');
function match_OldSprintfTag ($stack = array()) {
$matchrule = "OldSprintfTag"; $result = $this->construct($matchrule, $matchrule, null);
$_469 = NULL;
$_519 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_469 = FALSE; break; }
else { $_519 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'sprintf' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_469 = FALSE; break; }
else { $_519 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == '(') {
$this->pos += 1;
$result["text"] .= '(';
}
else { $_469 = FALSE; break; }
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 { $_469 = FALSE; break; }
else { $_519 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_469 = FALSE; break; }
else { $_519 = 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 { $_469 = FALSE; break; }
else { $_519 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
}
else { $_469 = FALSE; break; }
else { $_519 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_469 = FALSE; break; }
$_469 = TRUE; break;
else { $_519 = FALSE; break; }
$_519 = TRUE; break;
}
while(0);
if( $_469 === TRUE ) { return $this->finalise($result); }
if( $_469 === FALSE) { return FALSE; }
if( $_519 === TRUE ) { return $this->finalise($result); }
if( $_519 === FALSE) { return FALSE; }
}
@ -2655,31 +2970,31 @@ class SSTemplateParser extends Parser {
protected $match_OldI18NTag_typestack = array('OldI18NTag');
function match_OldI18NTag ($stack = array()) {
$matchrule = "OldI18NTag"; $result = $this->construct($matchrule, $matchrule, null);
$_474 = NULL;
$_524 = NULL;
do {
$res_471 = $result;
$pos_471 = $this->pos;
$res_521 = $result;
$pos_521 = $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 );
$_474 = TRUE; break;
$_524 = TRUE; break;
}
$result = $res_471;
$this->pos = $pos_471;
$result = $res_521;
$this->pos = $pos_521;
$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 );
$_474 = TRUE; break;
$_524 = TRUE; break;
}
$result = $res_471;
$this->pos = $pos_471;
$_474 = FALSE; break;
$result = $res_521;
$this->pos = $pos_521;
$_524 = FALSE; break;
}
while(0);
if( $_474 === TRUE ) { return $this->finalise($result); }
if( $_474 === FALSE) { return FALSE; }
if( $_524 === TRUE ) { return $this->finalise($result); }
if( $_524 === FALSE) { return FALSE; }
}
@ -2692,30 +3007,30 @@ class SSTemplateParser extends Parser {
protected $match_NamedArgument_typestack = array('NamedArgument');
function match_NamedArgument ($stack = array()) {
$matchrule = "NamedArgument"; $result = $this->construct($matchrule, $matchrule, null);
$_479 = NULL;
$_529 = 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 { $_479 = FALSE; break; }
else { $_529 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1;
$result["text"] .= '=';
}
else { $_479 = FALSE; break; }
else { $_529 = 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 { $_479 = FALSE; break; }
$_479 = TRUE; break;
else { $_529 = FALSE; break; }
$_529 = TRUE; break;
}
while(0);
if( $_479 === TRUE ) { return $this->finalise($result); }
if( $_479 === FALSE) { return FALSE; }
if( $_529 === TRUE ) { return $this->finalise($result); }
if( $_529 === FALSE) { return FALSE; }
}
@ -2732,75 +3047,75 @@ class SSTemplateParser extends Parser {
protected $match_Include_typestack = array('Include');
function match_Include ($stack = array()) {
$matchrule = "Include"; $result = $this->construct($matchrule, $matchrule, null);
$_498 = NULL;
$_548 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_498 = FALSE; break; }
else { $_548 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'include' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_498 = FALSE; break; }
else { $_548 = FALSE; break; }
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, "Template" );
}
else { $_498 = FALSE; break; }
else { $_548 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_495 = $result;
$pos_495 = $this->pos;
$_494 = NULL;
$res_545 = $result;
$pos_545 = $this->pos;
$_544 = 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 { $_494 = FALSE; break; }
else { $_544 = FALSE; break; }
while (true) {
$res_493 = $result;
$pos_493 = $this->pos;
$_492 = NULL;
$res_543 = $result;
$pos_543 = $this->pos;
$_542 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_492 = FALSE; break; }
else { $_542 = 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 { $_492 = FALSE; break; }
$_492 = TRUE; break;
else { $_542 = FALSE; break; }
$_542 = TRUE; break;
}
while(0);
if( $_492 === FALSE) {
$result = $res_493;
$this->pos = $pos_493;
unset( $res_493 );
unset( $pos_493 );
if( $_542 === FALSE) {
$result = $res_543;
$this->pos = $pos_543;
unset( $res_543 );
unset( $pos_543 );
break;
}
}
$_494 = TRUE; break;
$_544 = TRUE; break;
}
while(0);
if( $_494 === FALSE) {
$result = $res_495;
$this->pos = $pos_495;
unset( $res_495 );
unset( $pos_495 );
if( $_544 === FALSE) {
$result = $res_545;
$this->pos = $pos_545;
unset( $res_545 );
unset( $pos_545 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_498 = FALSE; break; }
$_498 = TRUE; break;
else { $_548 = FALSE; break; }
$_548 = TRUE; break;
}
while(0);
if( $_498 === TRUE ) { return $this->finalise($result); }
if( $_498 === FALSE) { return FALSE; }
if( $_548 === TRUE ) { return $this->finalise($result); }
if( $_548 === FALSE) { return FALSE; }
}
@ -2835,48 +3150,48 @@ class SSTemplateParser extends Parser {
protected $match_BlockArguments_typestack = array('BlockArguments');
function match_BlockArguments ($stack = array()) {
$matchrule = "BlockArguments"; $result = $this->construct($matchrule, $matchrule, null);
$_507 = NULL;
$_557 = 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 { $_507 = FALSE; break; }
else { $_557 = FALSE; break; }
while (true) {
$res_506 = $result;
$pos_506 = $this->pos;
$_505 = NULL;
$res_556 = $result;
$pos_556 = $this->pos;
$_555 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_505 = FALSE; break; }
else { $_555 = 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 { $_505 = FALSE; break; }
$_505 = TRUE; break;
else { $_555 = FALSE; break; }
$_555 = TRUE; break;
}
while(0);
if( $_505 === FALSE) {
$result = $res_506;
$this->pos = $pos_506;
unset( $res_506 );
unset( $pos_506 );
if( $_555 === FALSE) {
$result = $res_556;
$this->pos = $pos_556;
unset( $res_556 );
unset( $pos_556 );
break;
}
}
$_507 = TRUE; break;
$_557 = TRUE; break;
}
while(0);
if( $_507 === TRUE ) { return $this->finalise($result); }
if( $_507 === FALSE) { return FALSE; }
if( $_557 === TRUE ) { return $this->finalise($result); }
if( $_557 === FALSE) { return FALSE; }
}
@ -2884,153 +3199,153 @@ class SSTemplateParser extends Parser {
protected $match_NotBlockTag_typestack = array('NotBlockTag');
function match_NotBlockTag ($stack = array()) {
$matchrule = "NotBlockTag"; $result = $this->construct($matchrule, $matchrule, null);
$_545 = NULL;
$_595 = NULL;
do {
$res_509 = $result;
$pos_509 = $this->pos;
$res_559 = $result;
$pos_559 = $this->pos;
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) {
$result["text"] .= $subres;
$_545 = TRUE; break;
$_595 = TRUE; break;
}
$result = $res_509;
$this->pos = $pos_509;
$_543 = NULL;
$result = $res_559;
$this->pos = $pos_559;
$_593 = NULL;
do {
$_540 = NULL;
$_590 = NULL;
do {
$_538 = NULL;
$_588 = NULL;
do {
$res_511 = $result;
$pos_511 = $this->pos;
$res_561 = $result;
$pos_561 = $this->pos;
if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_538 = TRUE; break;
$_588 = TRUE; break;
}
$result = $res_511;
$this->pos = $pos_511;
$_536 = NULL;
$result = $res_561;
$this->pos = $pos_561;
$_586 = NULL;
do {
$res_513 = $result;
$pos_513 = $this->pos;
$res_563 = $result;
$pos_563 = $this->pos;
if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_536 = TRUE; break;
$_586 = TRUE; break;
}
$result = $res_513;
$this->pos = $pos_513;
$_534 = NULL;
$result = $res_563;
$this->pos = $pos_563;
$_584 = NULL;
do {
$res_515 = $result;
$pos_515 = $this->pos;
$res_565 = $result;
$pos_565 = $this->pos;
if (( $subres = $this->literal( 'else' ) ) !== FALSE) {
$result["text"] .= $subres;
$_534 = TRUE; break;
$_584 = TRUE; break;
}
$result = $res_515;
$this->pos = $pos_515;
$_532 = NULL;
$result = $res_565;
$this->pos = $pos_565;
$_582 = NULL;
do {
$res_517 = $result;
$pos_517 = $this->pos;
$res_567 = $result;
$pos_567 = $this->pos;
if (( $subres = $this->literal( 'require' ) ) !== FALSE) {
$result["text"] .= $subres;
$_532 = TRUE; break;
$_582 = TRUE; break;
}
$result = $res_517;
$this->pos = $pos_517;
$_530 = NULL;
$result = $res_567;
$this->pos = $pos_567;
$_580 = NULL;
do {
$res_519 = $result;
$pos_519 = $this->pos;
$res_569 = $result;
$pos_569 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_530 = TRUE; break;
$_580 = TRUE; break;
}
$result = $res_519;
$this->pos = $pos_519;
$_528 = NULL;
$result = $res_569;
$this->pos = $pos_569;
$_578 = NULL;
do {
$res_521 = $result;
$pos_521 = $this->pos;
$res_571 = $result;
$pos_571 = $this->pos;
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_528 = TRUE; break;
$_578 = TRUE; break;
}
$result = $res_521;
$this->pos = $pos_521;
$_526 = NULL;
$result = $res_571;
$this->pos = $pos_571;
$_576 = NULL;
do {
$res_523 = $result;
$pos_523 = $this->pos;
$res_573 = $result;
$pos_573 = $this->pos;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_526 = TRUE; break;
$_576 = TRUE; break;
}
$result = $res_523;
$this->pos = $pos_523;
$result = $res_573;
$this->pos = $pos_573;
if (( $subres = $this->literal( 'include' ) ) !== FALSE) {
$result["text"] .= $subres;
$_526 = TRUE; break;
$_576 = TRUE; break;
}
$result = $res_523;
$this->pos = $pos_523;
$_526 = FALSE; break;
$result = $res_573;
$this->pos = $pos_573;
$_576 = FALSE; break;
}
while(0);
if( $_526 === TRUE ) { $_528 = TRUE; break; }
$result = $res_521;
$this->pos = $pos_521;
$_528 = FALSE; break;
if( $_576 === TRUE ) { $_578 = TRUE; break; }
$result = $res_571;
$this->pos = $pos_571;
$_578 = FALSE; break;
}
while(0);
if( $_528 === TRUE ) { $_530 = TRUE; break; }
$result = $res_519;
$this->pos = $pos_519;
$_530 = FALSE; break;
if( $_578 === TRUE ) { $_580 = TRUE; break; }
$result = $res_569;
$this->pos = $pos_569;
$_580 = FALSE; break;
}
while(0);
if( $_530 === TRUE ) { $_532 = TRUE; break; }
$result = $res_517;
$this->pos = $pos_517;
$_532 = FALSE; break;
if( $_580 === TRUE ) { $_582 = TRUE; break; }
$result = $res_567;
$this->pos = $pos_567;
$_582 = FALSE; break;
}
while(0);
if( $_532 === TRUE ) { $_534 = TRUE; break; }
$result = $res_515;
$this->pos = $pos_515;
$_534 = FALSE; break;
if( $_582 === TRUE ) { $_584 = TRUE; break; }
$result = $res_565;
$this->pos = $pos_565;
$_584 = FALSE; break;
}
while(0);
if( $_534 === TRUE ) { $_536 = TRUE; break; }
$result = $res_513;
$this->pos = $pos_513;
$_536 = FALSE; break;
if( $_584 === TRUE ) { $_586 = TRUE; break; }
$result = $res_563;
$this->pos = $pos_563;
$_586 = FALSE; break;
}
while(0);
if( $_536 === TRUE ) { $_538 = TRUE; break; }
$result = $res_511;
$this->pos = $pos_511;
$_538 = FALSE; break;
if( $_586 === TRUE ) { $_588 = TRUE; break; }
$result = $res_561;
$this->pos = $pos_561;
$_588 = FALSE; break;
}
while(0);
if( $_538 === FALSE) { $_540 = FALSE; break; }
$_540 = TRUE; break;
if( $_588 === FALSE) { $_590 = FALSE; break; }
$_590 = TRUE; break;
}
while(0);
if( $_540 === FALSE) { $_543 = FALSE; break; }
if( $_590 === FALSE) { $_593 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_543 = FALSE; break; }
$_543 = TRUE; break;
else { $_593 = FALSE; break; }
$_593 = TRUE; break;
}
while(0);
if( $_543 === TRUE ) { $_545 = TRUE; break; }
$result = $res_509;
$this->pos = $pos_509;
$_545 = FALSE; break;
if( $_593 === TRUE ) { $_595 = TRUE; break; }
$result = $res_559;
$this->pos = $pos_559;
$_595 = FALSE; break;
}
while(0);
if( $_545 === TRUE ) { return $this->finalise($result); }
if( $_545 === FALSE) { return FALSE; }
if( $_595 === TRUE ) { return $this->finalise($result); }
if( $_595 === FALSE) { return FALSE; }
}
@ -3038,53 +3353,53 @@ class SSTemplateParser extends Parser {
protected $match_ClosedBlock_typestack = array('ClosedBlock');
function match_ClosedBlock ($stack = array()) {
$matchrule = "ClosedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_565 = NULL;
$_615 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_565 = FALSE; break; }
else { $_615 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_549 = $result;
$pos_549 = $this->pos;
$res_599 = $result;
$pos_599 = $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_549;
$this->pos = $pos_549;
$_565 = FALSE; break;
$result = $res_599;
$this->pos = $pos_599;
$_615 = FALSE; break;
}
else {
$result = $res_549;
$this->pos = $pos_549;
$result = $res_599;
$this->pos = $pos_599;
}
$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 { $_565 = FALSE; break; }
$res_555 = $result;
$pos_555 = $this->pos;
$_554 = NULL;
else { $_615 = FALSE; break; }
$res_605 = $result;
$pos_605 = $this->pos;
$_604 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_554 = FALSE; break; }
else { $_604 = 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 { $_554 = FALSE; break; }
else { $_604 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_554 = FALSE; break; }
$_554 = TRUE; break;
else { $_604 = FALSE; break; }
$_604 = TRUE; break;
}
while(0);
if( $_554 === FALSE) {
$result = $res_555;
$this->pos = $pos_555;
unset( $res_555 );
unset( $pos_555 );
if( $_604 === FALSE) {
$result = $res_605;
$this->pos = $pos_605;
unset( $res_605 );
unset( $pos_605 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Zap" );
@ -3095,36 +3410,36 @@ class SSTemplateParser extends Parser {
}
else {
$result = array_pop($stack);
$_565 = FALSE; break;
$_615 = FALSE; break;
}
$res_558 = $result;
$pos_558 = $this->pos;
$res_608 = $result;
$pos_608 = $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_558;
$this->pos = $pos_558;
unset( $res_558 );
unset( $pos_558 );
$result = $res_608;
$this->pos = $pos_608;
unset( $res_608 );
unset( $pos_608 );
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_565 = FALSE; break; }
else { $_615 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_565 = FALSE; break; }
else { $_615 = FALSE; break; }
if (( $subres = $this->literal( ''.$this->expression($result, $stack, 'BlockName').'' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_565 = FALSE; break; }
else { $_615 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_565 = FALSE; break; }
$_565 = TRUE; break;
else { $_615 = FALSE; break; }
$_615 = TRUE; break;
}
while(0);
if( $_565 === TRUE ) { return $this->finalise($result); }
if( $_565 === FALSE) { return FALSE; }
if( $_615 === TRUE ) { return $this->finalise($result); }
if( $_615 === FALSE) { return FALSE; }
}
@ -3227,62 +3542,62 @@ class SSTemplateParser extends Parser {
protected $match_OpenBlock_typestack = array('OpenBlock');
function match_OpenBlock ($stack = array()) {
$matchrule = "OpenBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_578 = NULL;
$_628 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_578 = FALSE; break; }
else { $_628 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_569 = $result;
$pos_569 = $this->pos;
$res_619 = $result;
$pos_619 = $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_569;
$this->pos = $pos_569;
$_578 = FALSE; break;
$result = $res_619;
$this->pos = $pos_619;
$_628 = FALSE; break;
}
else {
$result = $res_569;
$this->pos = $pos_569;
$result = $res_619;
$this->pos = $pos_619;
}
$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 { $_578 = FALSE; break; }
$res_575 = $result;
$pos_575 = $this->pos;
$_574 = NULL;
else { $_628 = FALSE; break; }
$res_625 = $result;
$pos_625 = $this->pos;
$_624 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_574 = FALSE; break; }
else { $_624 = 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 { $_574 = FALSE; break; }
else { $_624 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_574 = FALSE; break; }
$_574 = TRUE; break;
else { $_624 = FALSE; break; }
$_624 = TRUE; break;
}
while(0);
if( $_574 === FALSE) {
$result = $res_575;
$this->pos = $pos_575;
unset( $res_575 );
unset( $pos_575 );
if( $_624 === FALSE) {
$result = $res_625;
$this->pos = $pos_625;
unset( $res_625 );
unset( $pos_625 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_578 = FALSE; break; }
$_578 = TRUE; break;
else { $_628 = FALSE; break; }
$_628 = TRUE; break;
}
while(0);
if( $_578 === TRUE ) { return $this->finalise($result); }
if( $_578 === FALSE) { return FALSE; }
if( $_628 === TRUE ) { return $this->finalise($result); }
if( $_628 === FALSE) { return FALSE; }
}
@ -3350,27 +3665,27 @@ class SSTemplateParser extends Parser {
protected $match_MismatchedEndBlock_typestack = array('MismatchedEndBlock');
function match_MismatchedEndBlock ($stack = array()) {
$matchrule = "MismatchedEndBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_586 = NULL;
$_636 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_586 = FALSE; break; }
else { $_636 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_586 = FALSE; break; }
else { $_636 = 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 { $_586 = FALSE; break; }
else { $_636 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_586 = FALSE; break; }
$_586 = TRUE; break;
else { $_636 = FALSE; break; }
$_636 = TRUE; break;
}
while(0);
if( $_586 === TRUE ) { return $this->finalise($result); }
if( $_586 === FALSE) { return FALSE; }
if( $_636 === TRUE ) { return $this->finalise($result); }
if( $_636 === FALSE) { return FALSE; }
}
@ -3384,78 +3699,78 @@ class SSTemplateParser extends Parser {
protected $match_MalformedOpenTag_typestack = array('MalformedOpenTag');
function match_MalformedOpenTag ($stack = array()) {
$matchrule = "MalformedOpenTag"; $result = $this->construct($matchrule, $matchrule, null);
$_601 = NULL;
$_651 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_601 = FALSE; break; }
else { $_651 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_590 = $result;
$pos_590 = $this->pos;
$res_640 = $result;
$pos_640 = $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_590;
$this->pos = $pos_590;
$_601 = FALSE; break;
$result = $res_640;
$this->pos = $pos_640;
$_651 = FALSE; break;
}
else {
$result = $res_590;
$this->pos = $pos_590;
$result = $res_640;
$this->pos = $pos_640;
}
$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 { $_601 = FALSE; break; }
$res_600 = $result;
$pos_600 = $this->pos;
$_599 = NULL;
else { $_651 = FALSE; break; }
$res_650 = $result;
$pos_650 = $this->pos;
$_649 = NULL;
do {
$res_596 = $result;
$pos_596 = $this->pos;
$_595 = NULL;
$res_646 = $result;
$pos_646 = $this->pos;
$_645 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_595 = FALSE; break; }
else { $_645 = 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 { $_595 = FALSE; break; }
else { $_645 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_595 = FALSE; break; }
$_595 = TRUE; break;
else { $_645 = FALSE; break; }
$_645 = TRUE; break;
}
while(0);
if( $_595 === FALSE) {
$result = $res_596;
$this->pos = $pos_596;
unset( $res_596 );
unset( $pos_596 );
if( $_645 === FALSE) {
$result = $res_646;
$this->pos = $pos_646;
unset( $res_646 );
unset( $pos_646 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_599 = FALSE; break; }
$_599 = TRUE; break;
else { $_649 = FALSE; break; }
$_649 = TRUE; break;
}
while(0);
if( $_599 === TRUE ) {
$result = $res_600;
$this->pos = $pos_600;
$_601 = FALSE; break;
if( $_649 === TRUE ) {
$result = $res_650;
$this->pos = $pos_650;
$_651 = FALSE; break;
}
if( $_599 === FALSE) {
$result = $res_600;
$this->pos = $pos_600;
if( $_649 === FALSE) {
$result = $res_650;
$this->pos = $pos_650;
}
$_601 = TRUE; break;
$_651 = TRUE; break;
}
while(0);
if( $_601 === TRUE ) { return $this->finalise($result); }
if( $_601 === FALSE) { return FALSE; }
if( $_651 === TRUE ) { return $this->finalise($result); }
if( $_651 === FALSE) { return FALSE; }
}
@ -3469,57 +3784,57 @@ class SSTemplateParser extends Parser {
protected $match_MalformedCloseTag_typestack = array('MalformedCloseTag');
function match_MalformedCloseTag ($stack = array()) {
$matchrule = "MalformedCloseTag"; $result = $this->construct($matchrule, $matchrule, null);
$_613 = NULL;
$_663 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_613 = FALSE; break; }
else { $_663 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Tag" );
$_607 = NULL;
$_657 = NULL;
do {
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_607 = FALSE; break; }
else { $_657 = 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 { $_607 = FALSE; break; }
$_607 = TRUE; break;
else { $_657 = FALSE; break; }
$_657 = TRUE; break;
}
while(0);
if( $_607 === TRUE ) {
if( $_657 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Tag' );
}
if( $_607 === FALSE) {
if( $_657 === FALSE) {
$result = array_pop($stack);
$_613 = FALSE; break;
$_663 = FALSE; break;
}
$res_612 = $result;
$pos_612 = $this->pos;
$_611 = NULL;
$res_662 = $result;
$pos_662 = $this->pos;
$_661 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_611 = FALSE; break; }
$_611 = TRUE; break;
else { $_661 = FALSE; break; }
$_661 = TRUE; break;
}
while(0);
if( $_611 === TRUE ) {
$result = $res_612;
$this->pos = $pos_612;
$_613 = FALSE; break;
if( $_661 === TRUE ) {
$result = $res_662;
$this->pos = $pos_662;
$_663 = FALSE; break;
}
if( $_611 === FALSE) {
$result = $res_612;
$this->pos = $pos_612;
if( $_661 === FALSE) {
$result = $res_662;
$this->pos = $pos_662;
}
$_613 = TRUE; break;
$_663 = TRUE; break;
}
while(0);
if( $_613 === TRUE ) { return $this->finalise($result); }
if( $_613 === FALSE) { return FALSE; }
if( $_663 === TRUE ) { return $this->finalise($result); }
if( $_663 === FALSE) { return FALSE; }
}
@ -3533,31 +3848,31 @@ class SSTemplateParser extends Parser {
protected $match_MalformedBlock_typestack = array('MalformedBlock');
function match_MalformedBlock ($stack = array()) {
$matchrule = "MalformedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_618 = NULL;
$_668 = NULL;
do {
$res_615 = $result;
$pos_615 = $this->pos;
$res_665 = $result;
$pos_665 = $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 );
$_618 = TRUE; break;
$_668 = TRUE; break;
}
$result = $res_615;
$this->pos = $pos_615;
$result = $res_665;
$this->pos = $pos_665;
$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 );
$_618 = TRUE; break;
$_668 = TRUE; break;
}
$result = $res_615;
$this->pos = $pos_615;
$_618 = FALSE; break;
$result = $res_665;
$this->pos = $pos_665;
$_668 = FALSE; break;
}
while(0);
if( $_618 === TRUE ) { return $this->finalise($result); }
if( $_618 === FALSE) { return FALSE; }
if( $_668 === TRUE ) { return $this->finalise($result); }
if( $_668 === FALSE) { return FALSE; }
}
@ -3567,51 +3882,51 @@ class SSTemplateParser extends Parser {
protected $match_Comment_typestack = array('Comment');
function match_Comment ($stack = array()) {
$matchrule = "Comment"; $result = $this->construct($matchrule, $matchrule, null);
$_626 = NULL;
$_676 = NULL;
do {
if (( $subres = $this->literal( '<%--' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_626 = FALSE; break; }
else { $_676 = FALSE; break; }
$count = 0;
while (true) {
$res_624 = $result;
$pos_624 = $this->pos;
$_623 = NULL;
$res_674 = $result;
$pos_674 = $this->pos;
$_673 = NULL;
do {
$res_621 = $result;
$pos_621 = $this->pos;
$res_671 = $result;
$pos_671 = $this->pos;
if (( $subres = $this->literal( '--%>' ) ) !== FALSE) {
$result["text"] .= $subres;
$result = $res_621;
$this->pos = $pos_621;
$_623 = FALSE; break;
$result = $res_671;
$this->pos = $pos_671;
$_673 = FALSE; break;
}
else {
$result = $res_621;
$this->pos = $pos_621;
$result = $res_671;
$this->pos = $pos_671;
}
if (( $subres = $this->rx( '/./' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_623 = FALSE; break; }
$_623 = TRUE; break;
else { $_673 = FALSE; break; }
$_673 = TRUE; break;
}
while(0);
if( $_623 === FALSE) {
$result = $res_624;
$this->pos = $pos_624;
unset( $res_624 );
unset( $pos_624 );
if( $_673 === FALSE) {
$result = $res_674;
$this->pos = $pos_674;
unset( $res_674 );
unset( $pos_674 );
break;
}
$count += 1;
}
if ($count > 0) { }
else { $_626 = FALSE; break; }
else { $_676 = FALSE; break; }
if (( $subres = $this->literal( '--%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_626 = FALSE; break; }
$_626 = TRUE; break;
else { $_676 = FALSE; break; }
$_676 = TRUE; break;
}
while(0);
if( $_626 === TRUE ) { return $this->finalise($result); }
if( $_626 === FALSE) { return FALSE; }
if( $_676 === TRUE ) { return $this->finalise($result); }
if( $_676 === FALSE) { return FALSE; }
}
@ -3620,246 +3935,264 @@ class SSTemplateParser extends Parser {
$res['php'] = '';
}
/* TopTemplate: (Comment | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | OpenBlock | MalformedBlock | MismatchedEndBlock | Injection | Text)+ */
/* TopTemplate: (Comment | Translate | If | Require | CacheBlock | UncachedBlock | OldI18NTag | Include | ClosedBlock | 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_678 = $result;
$pos_678 = $this->pos;
$_677 = NULL;
$res_732 = $result;
$pos_732 = $this->pos;
$_731 = NULL;
do {
$_675 = NULL;
$_729 = NULL;
do {
$res_628 = $result;
$pos_628 = $this->pos;
$res_678 = $result;
$pos_678 = $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 );
$_675 = TRUE; break;
$_729 = TRUE; break;
}
$result = $res_628;
$this->pos = $pos_628;
$_673 = NULL;
$result = $res_678;
$this->pos = $pos_678;
$_727 = NULL;
do {
$res_630 = $result;
$pos_630 = $this->pos;
$matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
$res_680 = $result;
$pos_680 = $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 );
$_673 = TRUE; break;
$_727 = TRUE; break;
}
$result = $res_630;
$this->pos = $pos_630;
$_671 = NULL;
$result = $res_680;
$this->pos = $pos_680;
$_725 = NULL;
do {
$res_632 = $result;
$pos_632 = $this->pos;
$matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$res_682 = $result;
$pos_682 = $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 );
$_671 = TRUE; break;
$_725 = TRUE; break;
}
$result = $res_632;
$this->pos = $pos_632;
$_669 = NULL;
$result = $res_682;
$this->pos = $pos_682;
$_723 = NULL;
do {
$res_634 = $result;
$pos_634 = $this->pos;
$matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$res_684 = $result;
$pos_684 = $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 );
$_669 = TRUE; break;
$_723 = TRUE; break;
}
$result = $res_634;
$this->pos = $pos_634;
$_667 = NULL;
$result = $res_684;
$this->pos = $pos_684;
$_721 = NULL;
do {
$res_636 = $result;
$pos_636 = $this->pos;
$matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$res_686 = $result;
$pos_686 = $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 );
$_667 = TRUE; break;
$_721 = TRUE; break;
}
$result = $res_636;
$this->pos = $pos_636;
$_665 = NULL;
$result = $res_686;
$this->pos = $pos_686;
$_719 = NULL;
do {
$res_638 = $result;
$pos_638 = $this->pos;
$matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$res_688 = $result;
$pos_688 = $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 );
$_665 = TRUE; break;
$_719 = TRUE; break;
}
$result = $res_638;
$this->pos = $pos_638;
$_663 = NULL;
$result = $res_688;
$this->pos = $pos_688;
$_717 = NULL;
do {
$res_640 = $result;
$pos_640 = $this->pos;
$matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
$res_690 = $result;
$pos_690 = $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 );
$_663 = TRUE; break;
$_717 = TRUE; break;
}
$result = $res_640;
$this->pos = $pos_640;
$_661 = NULL;
$result = $res_690;
$this->pos = $pos_690;
$_715 = NULL;
do {
$res_642 = $result;
$pos_642 = $this->pos;
$matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$res_692 = $result;
$pos_692 = $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 );
$_661 = TRUE; break;
$_715 = TRUE; break;
}
$result = $res_642;
$this->pos = $pos_642;
$_659 = NULL;
$result = $res_692;
$this->pos = $pos_692;
$_713 = NULL;
do {
$res_644 = $result;
$pos_644 = $this->pos;
$matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$res_694 = $result;
$pos_694 = $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 );
$_659 = TRUE; break;
$_713 = TRUE; break;
}
$result = $res_644;
$this->pos = $pos_644;
$_657 = NULL;
$result = $res_694;
$this->pos = $pos_694;
$_711 = NULL;
do {
$res_646 = $result;
$pos_646 = $this->pos;
$matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$res_696 = $result;
$pos_696 = $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 );
$_657 = TRUE; break;
$_711 = TRUE; break;
}
$result = $res_646;
$this->pos = $pos_646;
$_655 = NULL;
$result = $res_696;
$this->pos = $pos_696;
$_709 = NULL;
do {
$res_648 = $result;
$pos_648 = $this->pos;
$matcher = 'match_'.'MismatchedEndBlock'; $key = $matcher; $pos = $this->pos;
$res_698 = $result;
$pos_698 = $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 );
$_655 = TRUE; break;
$_709 = TRUE; break;
}
$result = $res_648;
$this->pos = $pos_648;
$_653 = NULL;
$result = $res_698;
$this->pos = $pos_698;
$_707 = NULL;
do {
$res_650 = $result;
$pos_650 = $this->pos;
$matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$res_700 = $result;
$pos_700 = $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 );
$_653 = TRUE; break;
$_707 = TRUE; break;
}
$result = $res_650;
$this->pos = $pos_650;
$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 );
$_653 = TRUE; break;
$result = $res_700;
$this->pos = $pos_700;
$_705 = NULL;
do {
$res_702 = $result;
$pos_702 = $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 );
$_705 = TRUE; break;
}
$result = $res_702;
$this->pos = $pos_702;
$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 );
$_705 = TRUE; break;
}
$result = $res_702;
$this->pos = $pos_702;
$_705 = FALSE; break;
}
$result = $res_650;
$this->pos = $pos_650;
$_653 = FALSE; break;
while(0);
if( $_705 === TRUE ) { $_707 = TRUE; break; }
$result = $res_700;
$this->pos = $pos_700;
$_707 = FALSE; break;
}
while(0);
if( $_653 === TRUE ) { $_655 = TRUE; break; }
$result = $res_648;
$this->pos = $pos_648;
$_655 = FALSE; break;
if( $_707 === TRUE ) { $_709 = TRUE; break; }
$result = $res_698;
$this->pos = $pos_698;
$_709 = FALSE; break;
}
while(0);
if( $_655 === TRUE ) { $_657 = TRUE; break; }
$result = $res_646;
$this->pos = $pos_646;
$_657 = FALSE; break;
if( $_709 === TRUE ) { $_711 = TRUE; break; }
$result = $res_696;
$this->pos = $pos_696;
$_711 = FALSE; break;
}
while(0);
if( $_657 === TRUE ) { $_659 = TRUE; break; }
$result = $res_644;
$this->pos = $pos_644;
$_659 = FALSE; break;
if( $_711 === TRUE ) { $_713 = TRUE; break; }
$result = $res_694;
$this->pos = $pos_694;
$_713 = FALSE; break;
}
while(0);
if( $_659 === TRUE ) { $_661 = TRUE; break; }
$result = $res_642;
$this->pos = $pos_642;
$_661 = FALSE; break;
if( $_713 === TRUE ) { $_715 = TRUE; break; }
$result = $res_692;
$this->pos = $pos_692;
$_715 = FALSE; break;
}
while(0);
if( $_661 === TRUE ) { $_663 = TRUE; break; }
$result = $res_640;
$this->pos = $pos_640;
$_663 = FALSE; break;
if( $_715 === TRUE ) { $_717 = TRUE; break; }
$result = $res_690;
$this->pos = $pos_690;
$_717 = FALSE; break;
}
while(0);
if( $_663 === TRUE ) { $_665 = TRUE; break; }
$result = $res_638;
$this->pos = $pos_638;
$_665 = FALSE; break;
if( $_717 === TRUE ) { $_719 = TRUE; break; }
$result = $res_688;
$this->pos = $pos_688;
$_719 = FALSE; break;
}
while(0);
if( $_665 === TRUE ) { $_667 = TRUE; break; }
$result = $res_636;
$this->pos = $pos_636;
$_667 = FALSE; break;
if( $_719 === TRUE ) { $_721 = TRUE; break; }
$result = $res_686;
$this->pos = $pos_686;
$_721 = FALSE; break;
}
while(0);
if( $_667 === TRUE ) { $_669 = TRUE; break; }
$result = $res_634;
$this->pos = $pos_634;
$_669 = FALSE; break;
if( $_721 === TRUE ) { $_723 = TRUE; break; }
$result = $res_684;
$this->pos = $pos_684;
$_723 = FALSE; break;
}
while(0);
if( $_669 === TRUE ) { $_671 = TRUE; break; }
$result = $res_632;
$this->pos = $pos_632;
$_671 = FALSE; break;
if( $_723 === TRUE ) { $_725 = TRUE; break; }
$result = $res_682;
$this->pos = $pos_682;
$_725 = FALSE; break;
}
while(0);
if( $_671 === TRUE ) { $_673 = TRUE; break; }
$result = $res_630;
$this->pos = $pos_630;
$_673 = FALSE; break;
if( $_725 === TRUE ) { $_727 = TRUE; break; }
$result = $res_680;
$this->pos = $pos_680;
$_727 = FALSE; break;
}
while(0);
if( $_673 === TRUE ) { $_675 = TRUE; break; }
$result = $res_628;
$this->pos = $pos_628;
$_675 = FALSE; break;
if( $_727 === TRUE ) { $_729 = TRUE; break; }
$result = $res_678;
$this->pos = $pos_678;
$_729 = FALSE; break;
}
while(0);
if( $_675 === FALSE) { $_677 = FALSE; break; }
$_677 = TRUE; break;
if( $_729 === FALSE) { $_731 = FALSE; break; }
$_731 = TRUE; break;
}
while(0);
if( $_677 === FALSE) {
$result = $res_678;
$this->pos = $pos_678;
unset( $res_678 );
unset( $pos_678 );
if( $_731 === FALSE) {
$result = $res_732;
$this->pos = $pos_732;
unset( $res_732 );
unset( $pos_732 );
break;
}
$count += 1;
@ -3891,189 +4224,189 @@ class SSTemplateParser extends Parser {
$matchrule = "Text"; $result = $this->construct($matchrule, $matchrule, null);
$count = 0;
while (true) {
$res_717 = $result;
$pos_717 = $this->pos;
$_716 = NULL;
$res_771 = $result;
$pos_771 = $this->pos;
$_770 = NULL;
do {
$_714 = NULL;
$_768 = NULL;
do {
$res_679 = $result;
$pos_679 = $this->pos;
$res_733 = $result;
$pos_733 = $this->pos;
if (( $subres = $this->rx( '/ [^<${\\\\]+ /' ) ) !== FALSE) {
$result["text"] .= $subres;
$_714 = TRUE; break;
$_768 = TRUE; break;
}
$result = $res_679;
$this->pos = $pos_679;
$_712 = NULL;
$result = $res_733;
$this->pos = $pos_733;
$_766 = NULL;
do {
$res_681 = $result;
$pos_681 = $this->pos;
$res_735 = $result;
$pos_735 = $this->pos;
if (( $subres = $this->rx( '/ (\\\\.) /' ) ) !== FALSE) {
$result["text"] .= $subres;
$_712 = TRUE; break;
$_766 = TRUE; break;
}
$result = $res_681;
$this->pos = $pos_681;
$_710 = NULL;
$result = $res_735;
$this->pos = $pos_735;
$_764 = NULL;
do {
$res_683 = $result;
$pos_683 = $this->pos;
$_686 = NULL;
$res_737 = $result;
$pos_737 = $this->pos;
$_740 = NULL;
do {
if (substr($this->string,$this->pos,1) == '<') {
$this->pos += 1;
$result["text"] .= '<';
}
else { $_686 = FALSE; break; }
$res_685 = $result;
$pos_685 = $this->pos;
else { $_740 = FALSE; break; }
$res_739 = $result;
$pos_739 = $this->pos;
if (substr($this->string,$this->pos,1) == '%') {
$this->pos += 1;
$result["text"] .= '%';
$result = $res_685;
$this->pos = $pos_685;
$_686 = FALSE; break;
$result = $res_739;
$this->pos = $pos_739;
$_740 = FALSE; break;
}
else {
$result = $res_685;
$this->pos = $pos_685;
$result = $res_739;
$this->pos = $pos_739;
}
$_686 = TRUE; break;
$_740 = TRUE; break;
}
while(0);
if( $_686 === TRUE ) { $_710 = TRUE; break; }
$result = $res_683;
$this->pos = $pos_683;
$_708 = NULL;
if( $_740 === TRUE ) { $_764 = TRUE; break; }
$result = $res_737;
$this->pos = $pos_737;
$_762 = NULL;
do {
$res_688 = $result;
$pos_688 = $this->pos;
$_693 = NULL;
$res_742 = $result;
$pos_742 = $this->pos;
$_747 = NULL;
do {
if (substr($this->string,$this->pos,1) == '$') {
$this->pos += 1;
$result["text"] .= '$';
}
else { $_693 = FALSE; break; }
$res_692 = $result;
$pos_692 = $this->pos;
$_691 = NULL;
else { $_747 = FALSE; break; }
$res_746 = $result;
$pos_746 = $this->pos;
$_745 = NULL;
do {
if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_691 = FALSE; break; }
$_691 = TRUE; break;
else { $_745 = FALSE; break; }
$_745 = TRUE; break;
}
while(0);
if( $_691 === TRUE ) {
$result = $res_692;
$this->pos = $pos_692;
$_693 = FALSE; break;
if( $_745 === TRUE ) {
$result = $res_746;
$this->pos = $pos_746;
$_747 = FALSE; break;
}
if( $_691 === FALSE) {
$result = $res_692;
$this->pos = $pos_692;
if( $_745 === FALSE) {
$result = $res_746;
$this->pos = $pos_746;
}
$_693 = TRUE; break;
$_747 = TRUE; break;
}
while(0);
if( $_693 === TRUE ) { $_708 = TRUE; break; }
$result = $res_688;
$this->pos = $pos_688;
$_706 = NULL;
if( $_747 === TRUE ) { $_762 = TRUE; break; }
$result = $res_742;
$this->pos = $pos_742;
$_760 = NULL;
do {
$res_695 = $result;
$pos_695 = $this->pos;
$_698 = NULL;
$res_749 = $result;
$pos_749 = $this->pos;
$_752 = NULL;
do {
if (substr($this->string,$this->pos,1) == '{') {
$this->pos += 1;
$result["text"] .= '{';
}
else { $_698 = FALSE; break; }
$res_697 = $result;
$pos_697 = $this->pos;
else { $_752 = FALSE; break; }
$res_751 = $result;
$pos_751 = $this->pos;
if (substr($this->string,$this->pos,1) == '$') {
$this->pos += 1;
$result["text"] .= '$';
$result = $res_697;
$this->pos = $pos_697;
$_698 = FALSE; break;
$result = $res_751;
$this->pos = $pos_751;
$_752 = FALSE; break;
}
else {
$result = $res_697;
$this->pos = $pos_697;
$result = $res_751;
$this->pos = $pos_751;
}
$_698 = TRUE; break;
$_752 = TRUE; break;
}
while(0);
if( $_698 === TRUE ) { $_706 = TRUE; break; }
$result = $res_695;
$this->pos = $pos_695;
$_704 = NULL;
if( $_752 === TRUE ) { $_760 = TRUE; break; }
$result = $res_749;
$this->pos = $pos_749;
$_758 = NULL;
do {
if (( $subres = $this->literal( '{$' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_704 = FALSE; break; }
$res_703 = $result;
$pos_703 = $this->pos;
$_702 = NULL;
else { $_758 = FALSE; break; }
$res_757 = $result;
$pos_757 = $this->pos;
$_756 = NULL;
do {
if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_702 = FALSE; break; }
$_702 = TRUE; break;
else { $_756 = FALSE; break; }
$_756 = TRUE; break;
}
while(0);
if( $_702 === TRUE ) {
$result = $res_703;
$this->pos = $pos_703;
$_704 = FALSE; break;
if( $_756 === TRUE ) {
$result = $res_757;
$this->pos = $pos_757;
$_758 = FALSE; break;
}
if( $_702 === FALSE) {
$result = $res_703;
$this->pos = $pos_703;
if( $_756 === FALSE) {
$result = $res_757;
$this->pos = $pos_757;
}
$_704 = TRUE; break;
$_758 = TRUE; break;
}
while(0);
if( $_704 === TRUE ) { $_706 = TRUE; break; }
$result = $res_695;
$this->pos = $pos_695;
$_706 = FALSE; break;
if( $_758 === TRUE ) { $_760 = TRUE; break; }
$result = $res_749;
$this->pos = $pos_749;
$_760 = FALSE; break;
}
while(0);
if( $_706 === TRUE ) { $_708 = TRUE; break; }
$result = $res_688;
$this->pos = $pos_688;
$_708 = FALSE; break;
if( $_760 === TRUE ) { $_762 = TRUE; break; }
$result = $res_742;
$this->pos = $pos_742;
$_762 = FALSE; break;
}
while(0);
if( $_708 === TRUE ) { $_710 = TRUE; break; }
$result = $res_683;
$this->pos = $pos_683;
$_710 = FALSE; break;
if( $_762 === TRUE ) { $_764 = TRUE; break; }
$result = $res_737;
$this->pos = $pos_737;
$_764 = FALSE; break;
}
while(0);
if( $_710 === TRUE ) { $_712 = TRUE; break; }
$result = $res_681;
$this->pos = $pos_681;
$_712 = FALSE; break;
if( $_764 === TRUE ) { $_766 = TRUE; break; }
$result = $res_735;
$this->pos = $pos_735;
$_766 = FALSE; break;
}
while(0);
if( $_712 === TRUE ) { $_714 = TRUE; break; }
$result = $res_679;
$this->pos = $pos_679;
$_714 = FALSE; break;
if( $_766 === TRUE ) { $_768 = TRUE; break; }
$result = $res_733;
$this->pos = $pos_733;
$_768 = FALSE; break;
}
while(0);
if( $_714 === FALSE) { $_716 = FALSE; break; }
$_716 = TRUE; break;
if( $_768 === FALSE) { $_770 = FALSE; break; }
$_770 = TRUE; break;
}
while(0);
if( $_716 === FALSE) {
$result = $res_717;
$this->pos = $pos_717;
unset( $res_717 );
unset( $pos_717 );
if( $_770 === FALSE) {
$result = $res_771;
$this->pos = $pos_771;
unset( $res_771 );
unset( $pos_771 );
break;
}
$count += 1;

View File

@ -7,7 +7,7 @@ This is the uncompiled parser for the SilverStripe template language, PHP with s
It gets run through the php-peg parser compiler to have those comments turned into code that match parts of the template language,
producing the executable version SSTemplateParser.php
To recompile after changing this file, run this from the 'framework/core' directory via command line:
To recompile after changing this file, run this from the 'framework/view' directory via command line (in most cases this is: sapphire/view):
php ../thirdparty/php-peg/cli.php SSTemplateParser.php.inc > SSTemplateParser.php
@ -76,6 +76,9 @@ forbidden)
Closed Block: An SS template block that wraps content, and requires a counterpart <% end_blockname %> tag
Angle Bracket: angle brackets "<" and ">" are used to eat whitespace between template elements
N: eats white space including newlines (using in legacy _t support)
*/
class SSTemplateParser extends Parser {
@ -97,9 +100,10 @@ class SSTemplateParser extends Parser {
/*!* 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
# 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 | 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 ;
@ -175,6 +179,60 @@ class SSTemplateParser extends Parser {
$this->Lookup_AddLookupStep($res, $sub, '$$FINAL');
}
/*!*
# 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\.]* /
*/
function Translate__construct(&$res) {
$res['php'] = '$val .= _t(';
}
function Translate_Entity(&$res, $sub) {
$res['php'] .= "'$sub[text]'";
}
function Translate_Default(&$res, $sub) {
$res['php'] .= ",$sub[text]";
}
function Translate_Context(&$res, $sub) {
$res['php'] .= ",$sub[text]";
}
function Translate_InjectionVariables(&$res, $sub) {
$res['php'] .= ",$sub[php]";
}
function Translate__finalise(&$res) {
$res['php'] .= ');';
}
function InjectionVariables__construct(&$res) {
$res['php'] = "array(";
}
function InjectionVariables_InjectionName(&$res, $sub) {
$res['php'] .= "'$sub[text]'=>";
}
function InjectionVariables_Argument(&$res, $sub) {
$res['php'] .= str_replace('$$FINAL', 'XML_val', $sub['php']) . ',';
}
function InjectionVariables__finalise(&$res) {
if (substr($res['php'], -1) == ',') $res['php'] = substr($res['php'], 0, -1); //remove last comma in the array
$res['php'] .= ')';
}
/*!*
# Injections are where, outside of a block, a value needs to be inserted into the output. You can either
@ -264,7 +322,7 @@ class SSTemplateParser extends Parser {
function Argument_FreeString(&$res, $sub) {
$res['ArgumentMode'] = 'string';
$res['php'] = "'" . str_replace("'", "\\'", rtrim($sub['text'])) . "'";
$res['php'] = "'" . str_replace("'", "\\'", $sub['text']) . "'";
}
/*!*
@ -507,8 +565,10 @@ class SSTemplateParser extends Parser {
# This is the core used by both syntaxes, without the block start & end tags
OldTPart: "_t" < "(" < QuotedString (< "," < CallArguments)? > ")"
OldTPart: "_t" N "(" N QuotedString (N "," N CallArguments)? N ")" N (";")?
# whitespace with a newline
N: / [\s\n]* /
*/
function OldTPart__construct(&$res) {
$res['php'] = "_t(";