-
-/*
- * This version handles the case in which we have to
- * create a delimited argument
-
-void
-TPushParser::advance(const TNode& node)
-{
- assert(node);
- TNode parent = node.parent();
- if (!parent)
- ; // nothing to do, the cursor is not in the document any more
- else if (parent.isG())
- {
- TNode next = node.next();
- if (next) next.insert(cursor);
- else parent.append(cursor);
- }
- else if (parent.isC())
- {
- if (node.next())
- ; // cursor removed
- else
- {
- Frame& frame = frames.top();
- if (frame.pos == frame.entry.pattern.size())
- {
- frames.pop();
- advance(parent);
- }
- else if (frame.entry.paramDelimited(frame.pos))
- {
- // the next argument is delimited, so we have to create a phantom group
- // with the cursor inside. We have to remember that, since we are here,
- // the cursor has been removed
- TNode g = doc.createG();
- g.append(cursor);
- parent.append(g);
- }
- else
- {
- // otherwise, the next MACRO's argument is not delimited, so we just
- // append the cursor to the MACRO
- parent.append(cursor);
- }
- }
- }
- else if (parent.is("math"))
- ; // we are done
- else
- advance(parent);
-}
-*/
-
-/*
- * original advance
-void
-TPushParser::advance(const TNode& node)
-{
- assert(node);
- TNode parent = node.parent();
- if (!parent)
- ; // nothing to do, the cursor is not in the document any more
- else if (parent.isG())
- {
- TNode next = node.next();
- if (next) next.insert(cursor);
- else parent.append(cursor);
- }
- else if (parent.isC())
- {
- if (node.next())
- ; // cursor removed
- else
- {
- Frame& frame = frames.top();
- if (frame.pos == frame.entry.pattern.size())
- {
- frames.pop();
- advance(parent);
- }
- else
- parent.append(cursor);
- }
- }
- else if (parent.is("math"))
- ; // we are done
- else
- advance(parent);
-}
-*/
-
-