Code Duplication    Length = 39-39 lines in 2 locations

view/SSTemplateParser.php 2 locations

@@ 1611-1649 (lines=39) @@
1608
1609
	/* IfPart: '<%' < 'if' [ :IfArgument > '%>' Template:$TemplateMatcher? */
1610
	protected $match_IfPart_typestack = array('IfPart');
1611
	function match_IfPart ($stack = array()) {
1612
		$matchrule = "IfPart"; $result = $this->construct($matchrule, $matchrule, null);
1613
		$_230 = NULL;
1614
		do {
1615
			if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
1616
			else { $_230 = FALSE; break; }
1617
			if (( $subres = $this->whitespace(  ) ) !== FALSE) { $result["text"] .= $subres; }
1618
			if (( $subres = $this->literal( 'if' ) ) !== FALSE) { $result["text"] .= $subres; }
1619
			else { $_230 = FALSE; break; }
1620
			if (( $subres = $this->whitespace(  ) ) !== FALSE) { $result["text"] .= $subres; }
1621
			else { $_230 = FALSE; break; }
1622
			$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
1623
			$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
1624
			if ($subres !== FALSE) {
1625
				$this->store( $result, $subres, "IfArgument" );
1626
			}
1627
			else { $_230 = FALSE; break; }
1628
			if (( $subres = $this->whitespace(  ) ) !== FALSE) { $result["text"] .= $subres; }
1629
			if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
1630
			else { $_230 = FALSE; break; }
1631
			$res_229 = $result;
1632
			$pos_229 = $this->pos;
1633
			$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
1634
			$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
1635
			if ($subres !== FALSE) {
1636
				$this->store( $result, $subres, "Template" );
1637
			}
1638
			else {
1639
				$result = $res_229;
1640
				$this->pos = $pos_229;
1641
				unset( $res_229 );
1642
				unset( $pos_229 );
1643
			}
1644
			$_230 = TRUE; break;
1645
		}
1646
		while(0);
1647
		if( $_230 === TRUE ) { return $this->finalise($result); }
1648
		if( $_230 === FALSE) { return FALSE; }
1649
	}
1650
1651
1652
	/* ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher? */
@@ 1654-1692 (lines=39) @@
1651
1652
	/* ElseIfPart: '<%' < 'else_if' [ :IfArgument > '%>' Template:$TemplateMatcher? */
1653
	protected $match_ElseIfPart_typestack = array('ElseIfPart');
1654
	function match_ElseIfPart ($stack = array()) {
1655
		$matchrule = "ElseIfPart"; $result = $this->construct($matchrule, $matchrule, null);
1656
		$_240 = NULL;
1657
		do {
1658
			if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
1659
			else { $_240 = FALSE; break; }
1660
			if (( $subres = $this->whitespace(  ) ) !== FALSE) { $result["text"] .= $subres; }
1661
			if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) { $result["text"] .= $subres; }
1662
			else { $_240 = FALSE; break; }
1663
			if (( $subres = $this->whitespace(  ) ) !== FALSE) { $result["text"] .= $subres; }
1664
			else { $_240 = FALSE; break; }
1665
			$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
1666
			$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
1667
			if ($subres !== FALSE) {
1668
				$this->store( $result, $subres, "IfArgument" );
1669
			}
1670
			else { $_240 = FALSE; break; }
1671
			if (( $subres = $this->whitespace(  ) ) !== FALSE) { $result["text"] .= $subres; }
1672
			if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
1673
			else { $_240 = FALSE; break; }
1674
			$res_239 = $result;
1675
			$pos_239 = $this->pos;
1676
			$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
1677
			$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
1678
			if ($subres !== FALSE) {
1679
				$this->store( $result, $subres, "Template" );
1680
			}
1681
			else {
1682
				$result = $res_239;
1683
				$this->pos = $pos_239;
1684
				unset( $res_239 );
1685
				unset( $pos_239 );
1686
			}
1687
			$_240 = TRUE; break;
1688
		}
1689
		while(0);
1690
		if( $_240 === TRUE ) { return $this->finalise($result); }
1691
		if( $_240 === FALSE) { return FALSE; }
1692
	}
1693
1694
1695
	/* ElsePart: '<%' < 'else' > '%>' Template:$TemplateMatcher? */