[phpwebapp-commits] CVS: web_app/parser class.VarStack.php,1.6,1.7 class.Parser.php,1.15,1.16
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-07-22 09:41:48
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10685/parser Modified Files: class.VarStack.php class.Parser.php Log Message: Index: class.VarStack.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.VarStack.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** class.VarStack.php 25 Aug 2003 13:18:32 -0000 1.6 --- class.VarStack.php 22 Jul 2004 09:41:24 -0000 1.7 *************** *** 28,36 **** { /** array of associative arrays (stack of scopes) */ ! var $Vars; function VarStack() { ! $this->Vars = array(); $this->pushScope(); } --- 28,36 ---- { /** array of associative arrays (stack of scopes) */ ! var $vars; function VarStack() { ! $this->vars = array(); $this->pushScope(); } *************** *** 38,47 **** function pushScope() { ! array_push($this->Vars, array()); } function popScope() { ! array_pop($this->Vars); } --- 38,47 ---- function pushScope() { ! array_push($this->vars, array()); } function popScope() { ! array_pop($this->vars); } *************** *** 49,53 **** function getCurrentScope() { ! $len = count($this->Vars); $curr_scope = $len - 1; return $curr_scope; --- 49,53 ---- function getCurrentScope() { ! $len = count($this->vars); $curr_scope = $len - 1; return $curr_scope; *************** *** 63,79 **** { $scope_nr = $this->getCurrentScope(); ! $current_scope = &$this->Vars[$scope_nr]; $current_scope[$var_name] = $var_value; } else { ! $len = count($this->Vars); ! if ($scope_nr >= $len) ! { ! $msg = "Out of scope: VarStack::addVar('$var_name','$var_value', $scope_nr): scope nr too big."; ! print WebApp::error_msg($msg); ! return; ! } ! $scope = &$this->Vars[$scope_nr]; $scope[$var_name] = $var_value; } --- 63,74 ---- { $scope_nr = $this->getCurrentScope(); ! $current_scope = &$this->vars[$scope_nr]; $current_scope[$var_name] = $var_value; } else { ! $len = count($this->vars); ! if ($scope_nr >= $len) return; ! $scope = &$this->vars[$scope_nr]; $scope[$var_name] = $var_value; } *************** *** 83,87 **** function addGlobalVar($var_name, $var_value) { ! $first_scope = &$this->Vars[0]; $first_scope[$var_name] = $var_value; } --- 78,82 ---- function addGlobalVar($var_name, $var_value) { ! $first_scope = &$this->vars[0]; $first_scope[$var_name] = $var_value; } *************** *** 90,95 **** function addVars($arrVars) { ! $len = count($this->Vars); ! $current_scope = &$this->Vars[$len-1]; $current_scope = array_merge($current_scope, $arrVars); } --- 85,90 ---- function addVars($arrVars) { ! $len = count($this->vars); ! $current_scope = &$this->vars[$len-1]; $current_scope = array_merge($current_scope, $arrVars); } *************** *** 98,102 **** function addGlobalVars($arrVars) { ! $first_scope = &$this->Vars[0]; $first_scope = array_merge($first_scope, $arrVars); } --- 93,97 ---- function addGlobalVars($arrVars) { ! $first_scope = &$this->vars[0]; $first_scope = array_merge($first_scope, $arrVars); } *************** *** 110,117 **** { $found = false; ! $len = count($this->Vars); for ($i = $len-1; $i>=0; $i--) { ! $scope = &$this->Vars[$i]; if (isset($scope[$var_name])) { --- 105,112 ---- { $found = false; ! $len = count($this->vars); for ($i = $len-1; $i>=0; $i--) { ! $scope = &$this->vars[$i]; if (isset($scope[$var_name])) { *************** *** 132,136 **** $html = "<strong>VarStack</strong>\n"; $html .= "<table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'>"; ! $len = count($this->Vars); for ($i = $len-1; $i>=0; $i--) { --- 127,131 ---- $html = "<strong>VarStack</strong>\n"; $html .= "<table bgcolor='#aaaaaa' border='0' cellspacing='1' cellpadding='2'>"; ! $len = count($this->vars); for ($i = $len-1; $i>=0; $i--) { *************** *** 139,143 **** <td bgcolor='#eeeeff' colspan='2' align='center'>Scope $i</td> </tr>"; ! $scope = &$this->Vars[$i]; while (list($var_name,$var_value) = each($scope)) { --- 134,138 ---- <td bgcolor='#eeeeff' colspan='2' align='center'>Scope $i</td> </tr>"; ! $scope = &$this->vars[$i]; while (list($var_name,$var_value) = each($scope)) { Index: class.Parser.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Parser.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** class.Parser.php 21 Jul 2004 17:09:10 -0000 1.15 --- class.Parser.php 22 Jul 2004 09:41:24 -0000 1.16 *************** *** 258,265 **** //ignore framework comments, do nothing } ! else if (substr($data, 0, 9)=='<![CDATA[') { ! $data = substr($data, 9, -3); ! $this->append($data); } else --- 258,274 ---- //ignore framework comments, do nothing } ! else if ( (substr($data, 0, 9)=='<![CDATA[') ! or (substr($data, 0, 3)==']]>') ) { ! $type = $this->current_tpl->type; ! if ($type=='QueryTpl') ! { ! //ommit them ! } ! else ! { ! //keep them ! $this->append($data); ! } } else *************** *** 295,298 **** --- 304,308 ---- case 'RECORDSET': case 'DBCOMMAND': + case 'QUERY': case 'VAR': case 'PRE': *************** *** 343,346 **** --- 353,357 ---- case 'RECORDSET': case 'DBCOMMAND': + case 'QUERY': case 'VAR': case 'PRE': *************** *** 897,901 **** function end_RECORDSET() { ! $tpl = pop_current_tpl(); $id = $tpl->vars['ID']; --- 908,912 ---- function end_RECORDSET() { ! $tpl = $this->pop_current_tpl(); $id = $tpl->vars['ID']; |