- The ::capture_first method now returns a pointer to the new branch.
This commit is contained in:
Paul Beckingham
2014-04-19 11:56:31 -04:00
parent 24d7411aa8
commit e8e25bb7c6
7 changed files with 12 additions and 4 deletions

View File

@@ -503,12 +503,13 @@ void A3t::inject_defaults ()
}
////////////////////////////////////////////////////////////////////////////////
void A3t::capture_first (const std::string& arg)
Tree* A3t::capture_first (const std::string& arg)
{
//std::cout << "# capture_first (" << arg << ")\n";
// Insert the arg as the new first branch.
Tree* t = new Tree ("argIns");
if (!t)
throw std::string (STRING_ERROR_MEMORY);
t->attribute ("raw", arg);
t->tag ("?");
t->_trunk = _tree;
@@ -518,6 +519,8 @@ void A3t::capture_first (const std::string& arg)
_tree->_branches.insert (i, t);
findCommand ();
return t;
}
////////////////////////////////////////////////////////////////////////////////