removed references on new statements (see issue 1)
This commit is contained in:
parent
03995d3bc6
commit
e092d11e5d
2 changed files with 10 additions and 10 deletions
|
@ -282,7 +282,7 @@ class StringParser {
|
||||||
StringParser_Node::destroyNode ($this->_root);
|
StringParser_Node::destroyNode ($this->_root);
|
||||||
}
|
}
|
||||||
unset ($this->_root);
|
unset ($this->_root);
|
||||||
$this->_root =& new StringParser_Node_Root ();
|
$this->_root = new StringParser_Node_Root ();
|
||||||
$this->_stack[0] =& $this->_root;
|
$this->_stack[0] =& $this->_root;
|
||||||
|
|
||||||
$this->_parserInit ();
|
$this->_parserInit ();
|
||||||
|
@ -979,7 +979,7 @@ class StringParser_Node {
|
||||||
function appendToLastTextChild ($text) {
|
function appendToLastTextChild ($text) {
|
||||||
$ccount = count ($this->_children);
|
$ccount = count ($this->_children);
|
||||||
if ($ccount == 0 || $this->_children[$ccount-1]->_type != STRINGPARSER_NODE_TEXT) {
|
if ($ccount == 0 || $this->_children[$ccount-1]->_type != STRINGPARSER_NODE_TEXT) {
|
||||||
$ntextnode =& new StringParser_Node_Text ($text);
|
$ntextnode = new StringParser_Node_Text ($text);
|
||||||
return $this->appendChild ($ntextnode);
|
return $this->appendChild ($ntextnode);
|
||||||
} else {
|
} else {
|
||||||
$this->_children[$ccount-1]->appendText ($text);
|
$this->_children[$ccount-1]->appendText ($text);
|
||||||
|
|
|
@ -564,7 +564,7 @@ class StringParser_BBCode extends StringParser {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ($needle == '[') {
|
if ($needle == '[') {
|
||||||
$node =& new StringParser_BBCode_Node_Element ($this->_cpos);
|
$node = new StringParser_BBCode_Node_Element ($this->_cpos);
|
||||||
$res = $this->_pushNode ($node);
|
$res = $this->_pushNode ($node);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1207,7 +1207,7 @@ class StringParser_BBCode extends StringParser {
|
||||||
for ($i = 0; $i < count ($sub_nodes); $i++) {
|
for ($i = 0; $i < count ($sub_nodes); $i++) {
|
||||||
if (!$last_node_was_paragraph || ($prevtype == $sub_nodes[$i]->_type && ($i != 0 || $prevtype != STRINGPARSER_BBCODE_NODE_ELEMENT))) {
|
if (!$last_node_was_paragraph || ($prevtype == $sub_nodes[$i]->_type && ($i != 0 || $prevtype != STRINGPARSER_BBCODE_NODE_ELEMENT))) {
|
||||||
unset ($paragraph);
|
unset ($paragraph);
|
||||||
$paragraph =& new StringParser_BBCode_Node_Paragraph ();
|
$paragraph = new StringParser_BBCode_Node_Paragraph ();
|
||||||
}
|
}
|
||||||
$prevtype = $sub_nodes[$i]->_type;
|
$prevtype = $sub_nodes[$i]->_type;
|
||||||
if ($sub_nodes[$i]->_type != STRINGPARSER_BBCODE_NODE_ELEMENT || $sub_nodes[$i]->getFlag ('paragraph_type', 'integer', BBCODE_PARAGRAPH_ALLOW_BREAKUP) != BBCODE_PARAGRAPH_BLOCK_ELEMENT) {
|
if ($sub_nodes[$i]->_type != STRINGPARSER_BBCODE_NODE_ELEMENT || $sub_nodes[$i]->getFlag ('paragraph_type', 'integer', BBCODE_PARAGRAPH_ALLOW_BREAKUP) != BBCODE_PARAGRAPH_BLOCK_ELEMENT) {
|
||||||
|
@ -1218,7 +1218,7 @@ class StringParser_BBCode extends StringParser {
|
||||||
$dest_nodes[] =& $sub_nodes[$i];
|
$dest_nodes[] =& $sub_nodes[$i];
|
||||||
$last_onde_was_paragraph = false;
|
$last_onde_was_paragraph = false;
|
||||||
unset ($paragraph);
|
unset ($paragraph);
|
||||||
$paragraph =& new StringParser_BBCode_Node_Paragraph ();
|
$paragraph = new StringParser_BBCode_Node_Paragraph ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1261,7 +1261,7 @@ class StringParser_BBCode extends StringParser {
|
||||||
if ($node->_type == STRINGPARSER_NODE_TEXT) {
|
if ($node->_type == STRINGPARSER_NODE_TEXT) {
|
||||||
$cpos = 0;
|
$cpos = 0;
|
||||||
while (($npos = strpos ($node->content, $detect_string, $cpos)) !== false) {
|
while (($npos = strpos ($node->content, $detect_string, $cpos)) !== false) {
|
||||||
$subnode =& new StringParser_Node_Text (substr ($node->content, $cpos, $npos - $cpos), $node->occurredAt + $cpos);
|
$subnode = new StringParser_Node_Text (substr ($node->content, $cpos, $npos - $cpos), $node->occurredAt + $cpos);
|
||||||
// copy flags
|
// copy flags
|
||||||
foreach ($node->_flags as $flag => $value) {
|
foreach ($node->_flags as $flag => $value) {
|
||||||
if ($flag == 'newlinemode.begin') {
|
if ($flag == 'newlinemode.begin') {
|
||||||
|
@ -1278,7 +1278,7 @@ class StringParser_BBCode extends StringParser {
|
||||||
unset ($subnode);
|
unset ($subnode);
|
||||||
$cpos = $npos + strlen ($detect_string);
|
$cpos = $npos + strlen ($detect_string);
|
||||||
}
|
}
|
||||||
$subnode =& new StringParser_Node_Text (substr ($node->content, $cpos), $node->occurredAt + $cpos);
|
$subnode = new StringParser_Node_Text (substr ($node->content, $cpos), $node->occurredAt + $cpos);
|
||||||
if ($cpos == 0) {
|
if ($cpos == 0) {
|
||||||
$value = $node->getFlag ('newlinemode.begin', 'integer', null);
|
$value = $node->getFlag ('newlinemode.begin', 'integer', null);
|
||||||
if ($value !== null) {
|
if ($value !== null) {
|
||||||
|
@ -1532,7 +1532,7 @@ class StringParser_BBCode_Node_Element extends StringParser_Node {
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function &duplicate () {
|
function &duplicate () {
|
||||||
$newnode =& new StringParser_BBCode_Node_Element ($this->occurredAt);
|
$newnode = new StringParser_BBCode_Node_Element ($this->occurredAt);
|
||||||
$newnode->_name = $this->_name;
|
$newnode->_name = $this->_name;
|
||||||
$newnode->_flags = $this->_flags;
|
$newnode->_flags = $this->_flags;
|
||||||
$newnode->_attributes = $this->_attributes;
|
$newnode->_attributes = $this->_attributes;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue