Code Duplication    Length = 39-39 lines in 2 locations

view/SSTemplateParser.php 2 locations

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