3286
This commit is contained in:
parent
ce2e604ec9
commit
376b333a39
22
010vm.cc
22
010vm.cc
|
@ -340,7 +340,7 @@ type_tree::type_tree(const type_tree& old) {
|
|||
right = old.right ? new type_tree(*old.right) : NULL;
|
||||
}
|
||||
|
||||
string_tree::string_tree(const string_tree& old) { // :value(old.value) {
|
||||
string_tree::string_tree(const string_tree& old) {
|
||||
value = old.value;
|
||||
left = old.left ? new string_tree(*old.left) : NULL;
|
||||
right = old.right ? new string_tree(*old.right) : NULL;
|
||||
|
@ -385,6 +385,26 @@ string_tree::~string_tree() {
|
|||
delete right;
|
||||
}
|
||||
|
||||
void append(type_tree*& base, type_tree* extra) {
|
||||
if (!base) {
|
||||
base = extra;
|
||||
return;
|
||||
}
|
||||
type_tree* curr = base;
|
||||
while (curr->right) curr = curr->right;
|
||||
curr->right = extra;
|
||||
}
|
||||
|
||||
void append(string_tree*& base, string_tree* extra) {
|
||||
if (!base) {
|
||||
base = extra;
|
||||
return;
|
||||
}
|
||||
string_tree* curr = base;
|
||||
while (curr->right) curr = curr->right;
|
||||
curr->right = extra;
|
||||
}
|
||||
|
||||
string slurp_until(istream& in, char delim) {
|
||||
ostringstream out;
|
||||
char c;
|
||||
|
|
|
@ -364,26 +364,6 @@ bool final_type_ingredient(int type_ingredient_index, const type_info& container
|
|||
return true;
|
||||
}
|
||||
|
||||
void append(type_tree*& base, type_tree* extra) {
|
||||
if (!base) {
|
||||
base = extra;
|
||||
return;
|
||||
}
|
||||
type_tree* curr = base;
|
||||
while (curr->right) curr = curr->right;
|
||||
curr->right = extra;
|
||||
}
|
||||
|
||||
void append(string_tree*& base, string_tree* extra) {
|
||||
if (!base) {
|
||||
base = extra;
|
||||
return;
|
||||
}
|
||||
string_tree* curr = base;
|
||||
while (curr->right) curr = curr->right;
|
||||
curr->right = extra;
|
||||
}
|
||||
|
||||
void test_replace_type_ingredients_entire() {
|
||||
run("container foo:_elem [\n"
|
||||
" x:_elem\n"
|
||||
|
|
Loading…
Reference in New Issue
Block a user