From 78c5020531a09a242f1d21b94ab128001c04bcdf Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 16 Sep 2016 23:52:15 -0700 Subject: 3374 --- 014literal_string.cc | 4 ++-- 027call_ingredient.cc | 8 ++++---- 029tools.cc | 6 +++--- 038new_text.cc | 18 +++++++++--------- 050scenario.cc | 4 ++-- 058to_text.cc | 2 +- 060rewrite_literal_string.cc | 2 +- 062convert_ingredients_to_text.cc | 8 ++++---- 069hash.cc | 8 ++++---- 072scheduler.cc | 2 +- 082scenario_screen.cc | 4 ++-- 087file.cc | 8 ++++---- 089scenario_filesystem.cc | 4 ++-- 101run_sandboxed.cc | 20 ++++++++++---------- 102persist.cc | 26 +++++++++++++------------- 15 files changed, 62 insertions(+), 62 deletions(-) diff --git a/014literal_string.cc b/014literal_string.cc index f5576a31..316bd4aa 100644 --- a/014literal_string.cc +++ b/014literal_string.cc @@ -119,11 +119,11 @@ if (starts_with(s, "[")) { //: more friendly to trace(). :(after "string to_string(const reagent& r)") - if (is_literal_string(r)) + if (is_literal_text(r)) return emit_literal_string(r.name); :(code) -bool is_literal_string(const reagent& x) { +bool is_literal_text(const reagent& x) { return x.type && x.type->name == "literal-string"; } diff --git a/027call_ingredient.cc b/027call_ingredient.cc index c9917614..d2f8a000 100644 --- a/027call_ingredient.cc +++ b/027call_ingredient.cc @@ -57,7 +57,7 @@ case NEXT_INGREDIENT: { if (current_recipe_name() == "main") { // no ingredient types since the call might be implicit; assume ingredients are always strings // todo: how to test this? - if (!is_mu_string(product)) + if (!is_mu_text(product)) raise << "main: wrong type for ingredient '" << product.original_string << "'\n" << end(); } else if (!types_coercible(product, @@ -171,10 +171,10 @@ case INGREDIENT: { break; } -//: a particularly common array type is the string, or address:array:character +//: a particularly common array type is the text, or address:array:character :(code) -bool is_mu_string(reagent/*copy*/ x) { - // End Preprocess is_mu_string(reagent x) +bool is_mu_text(reagent/*copy*/ x) { + // End Preprocess is_mu_text(reagent x) return x.type && !x.type->atom && x.type->left->atom diff --git a/029tools.cc b/029tools.cc index 706416a4..c481e583 100644 --- a/029tools.cc +++ b/029tools.cc @@ -20,7 +20,7 @@ case TRACE: { raise << maybe(get(Recipe, r).name) << "first ingredient of 'trace' should be a number (depth), but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } - if (!is_literal_string(inst.ingredients.at(1))) { + if (!is_literal_text(inst.ingredients.at(1))) { raise << maybe(get(Recipe, r).name) << "second ingredient of 'trace' should be a literal string (label), but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); break; } @@ -210,7 +210,7 @@ case ASSERT: { raise << maybe(get(Recipe, r).name) << "'assert' requires a boolean for its first ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } - if (!is_literal_string(inst.ingredients.at(1))) { + if (!is_literal_text(inst.ingredients.at(1))) { raise << maybe(get(Recipe, r).name) << "'assert' requires a literal string for its second ingredient, but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); break; } @@ -284,7 +284,7 @@ case _SYSTEM: { raise << maybe(get(Recipe, r).name) << "'$system' requires exactly one ingredient, but got '" << to_string(inst) << "'\n" << end(); break; } - if (!is_literal_string(inst.ingredients.at(0))) { + if (!is_literal_text(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "ingredient to '$system' must be a literal text, but got '" << to_string(inst) << "'\n" << end(); } break; diff --git a/038new_text.cc b/038new_text.cc index 46e4db7c..043e0498 100644 --- a/038new_text.cc +++ b/038new_text.cc @@ -19,19 +19,19 @@ def main [ +mem: storing 171 in location 3 :(before "End NEW Check Special-cases") -if (is_literal_string(inst.ingredients.at(0))) break; +if (is_literal_text(inst.ingredients.at(0))) break; :(before "Convert 'new' To 'allocate'") -if (inst.name == "new" && is_literal_string(inst.ingredients.at(0))) continue; +if (inst.name == "new" && is_literal_text(inst.ingredients.at(0))) continue; :(after "case NEW" following "Primitive Recipe Implementations") - if (is_literal_string(current_instruction().ingredients.at(0))) { + if (is_literal_text(current_instruction().ingredients.at(0))) { products.resize(1); - products.at(0).push_back(new_mu_string(current_instruction().ingredients.at(0).name)); + products.at(0).push_back(new_mu_text(current_instruction().ingredients.at(0).name)); trace(9999, "mem") << "new string alloc: " << products.at(0).at(0) << end(); break; } :(code) -int new_mu_string(const string& contents) { +int new_mu_text(const string& contents) { // allocate an array just large enough for it int string_length = unicode_length(contents); //? Total_alloc += string_length+1; @@ -68,9 +68,9 @@ def main [ +app: foo: abc :(before "End print Special-cases(r, data)") -if (is_mu_string(r)) { +if (is_mu_text(r)) { assert(scalar(data)); - return read_mu_string(data.at(0)); + return read_mu_text(data.at(0)); } :(scenario unicode_string) @@ -95,7 +95,7 @@ def main [ +app: 3 97 98 99 //: fixes way more than just stash -:(before "End Preprocess is_mu_string(reagent x)") +:(before "End Preprocess is_mu_text(reagent x)") if (!canonize_type(x)) return false; //: Allocate more to routine when initializing a literal string @@ -122,7 +122,7 @@ int unicode_length(const string& s) { return result; } -string read_mu_string(int address) { +string read_mu_text(int address) { if (address == 0) return ""; ++address; // skip refcount int size = get_or_insert(Memory, address); diff --git a/050scenario.cc b/050scenario.cc index 918aaf0c..351d978b 100644 --- a/050scenario.cc +++ b/050scenario.cc @@ -410,7 +410,7 @@ void check_string(int address, const string& literal) { trace(9999, "run") << "checking string length at " << address << end(); if (get_or_insert(Memory, address) != SIZE(literal)) { if (Current_scenario && !Scenario_testing_scenario) - raise << "\nF - " << Current_scenario->name << ": expected location '" << address << "' to contain length " << SIZE(literal) << " of string [" << literal << "] but saw " << no_scientific(get_or_insert(Memory, address)) << " (" << read_mu_string(address-/*fake refcount*/1) << ")\n" << end(); + raise << "\nF - " << Current_scenario->name << ": expected location '" << address << "' to contain length " << SIZE(literal) << " of string [" << literal << "] but saw " << no_scientific(get_or_insert(Memory, address)) << " (" << read_mu_text(address-/*fake refcount*/1) << ")\n" << end(); else raise << "expected location '" << address << "' to contain length " << SIZE(literal) << " of string [" << literal << "] but saw " << no_scientific(get_or_insert(Memory, address)) << '\n' << end(); if (!Scenario_testing_scenario) Passed = false; @@ -687,7 +687,7 @@ case CHECK_TRACE_COUNT_FOR_LABEL: { raise << maybe(get(Recipe, r).name) << "first ingredient of 'check-trace-count-for-label' should be a number (count), but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } - if (!is_literal_string(inst.ingredients.at(1))) { + if (!is_literal_text(inst.ingredients.at(1))) { raise << maybe(get(Recipe, r).name) << "second ingredient of 'check-trace-count-for-label' should be a literal string (label), but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); break; } diff --git a/058to_text.cc b/058to_text.cc index 502199a2..924846df 100644 --- a/058to_text.cc +++ b/058to_text.cc @@ -21,6 +21,6 @@ case TO_TEXT: { :(before "End Primitive Recipe Implementations") case TO_TEXT: { products.resize(1); - products.at(0).push_back(new_mu_string(print_mu(current_instruction().ingredients.at(0), ingredients.at(0)))); + products.at(0).push_back(new_mu_text(print_mu(current_instruction().ingredients.at(0), ingredients.at(0)))); break; } diff --git a/060rewrite_literal_string.cc b/060rewrite_literal_string.cc index cf0ec24b..92abeca3 100644 --- a/060rewrite_literal_string.cc +++ b/060rewrite_literal_string.cc @@ -43,7 +43,7 @@ void rewrite_literal_string_to_text(recipe_ordinal r) { instruction& inst = caller.steps.at(i); if (recipes_taking_literal_strings.find(inst.name) == recipes_taking_literal_strings.end()) { for (int j = 0; j < SIZE(inst.ingredients); ++j) { - if (!is_literal_string(inst.ingredients.at(j))) continue; + if (!is_literal_text(inst.ingredients.at(j))) continue; instruction def; ostringstream ingredient_name; ingredient_name << inst.name << '_' << i << '_' << j << ":address:array:character"; diff --git a/062convert_ingredients_to_text.cc b/062convert_ingredients_to_text.cc index 0a4e7a94..300645de 100644 --- a/062convert_ingredients_to_text.cc +++ b/062convert_ingredients_to_text.cc @@ -73,7 +73,7 @@ void convert_ingredients_to_text(recipe& caller) { // all these cases are getting hairy. how can we make this extensible? if (inst.name == "stash") { for (int j = 0; j < SIZE(inst.ingredients); ++j) { - if (is_literal_string(inst.ingredients.at(j))) continue; + if (is_literal_text(inst.ingredients.at(j))) continue; ostringstream ingredient_name; ingredient_name << "stash_" << i << '_' << j << ":address:array:character"; convert_ingredient_to_text(inst.ingredients.at(j), new_instructions, ingredient_name.str()); @@ -81,7 +81,7 @@ void convert_ingredients_to_text(recipe& caller) { } else if (inst.name == "trace") { for (int j = /*skip*/2; j < SIZE(inst.ingredients); ++j) { - if (is_literal_string(inst.ingredients.at(j))) continue; + if (is_literal_text(inst.ingredients.at(j))) continue; ostringstream ingredient_name; ingredient_name << "trace_" << i << '_' << j << ":address:array:character"; convert_ingredient_to_text(inst.ingredients.at(j), new_instructions, ingredient_name.str()); @@ -93,7 +93,7 @@ void convert_ingredients_to_text(recipe& caller) { // new variants that match: // append _:text, ___ // will never ever get used. - if (is_literal_string(inst.ingredients.at(0)) || is_mu_string(inst.ingredients.at(0))) { + if (is_literal_text(inst.ingredients.at(0)) || is_mu_text(inst.ingredients.at(0))) { for (int j = 0; j < SIZE(inst.ingredients); ++j) { ostringstream ingredient_name; ingredient_name << "append_" << i << '_' << j << ":address:array:character"; @@ -111,7 +111,7 @@ void convert_ingredients_to_text(recipe& caller) { // replace r with converted text void convert_ingredient_to_text(reagent& r, vector& out, const string& tmp_var) { if (!r.type) return; // error; will be handled elsewhere - if (is_mu_string(r)) return; + if (is_mu_text(r)) return; // don't try to extend static arrays if (is_static_array(r)) return; instruction def; diff --git a/069hash.cc b/069hash.cc index 9133fa6d..80fb8455 100644 --- a/069hash.cc +++ b/069hash.cc @@ -33,7 +33,7 @@ case HASH: { :(code) size_t hash(size_t h, reagent/*copy*/ r) { canonize(r); - if (is_mu_string(r)) // optimization + if (is_mu_text(r)) // optimization return hash_mu_string(h, r); else if (is_mu_address(r)) return hash_mu_address(h, r); @@ -66,7 +66,7 @@ size_t hash_mu_address(size_t h, reagent& r) { } size_t hash_mu_string(size_t h, const reagent& r) { - string input = read_mu_string(get_or_insert(Memory, r.value)); + string input = read_mu_text(get_or_insert(Memory, r.value)); for (int i = 0; i < SIZE(input); ++i) { h = hash_iter(h, static_cast(input.at(i))); //? cerr << i << ": " << h << '\n'; @@ -354,7 +354,7 @@ case HASH_OLD: { raise << maybe(get(Recipe, r).name) << "'hash_old' takes exactly one ingredient rather than '" << inst.original_string << "'\n" << end(); break; } - if (!is_mu_string(inst.ingredients.at(0))) { + if (!is_mu_text(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "'hash_old' currently only supports strings (address:array:character), but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } @@ -362,7 +362,7 @@ case HASH_OLD: { } :(before "End Primitive Recipe Implementations") case HASH_OLD: { - string input = read_mu_string(ingredients.at(0).at(0)); + string input = read_mu_text(ingredients.at(0).at(0)); size_t h = 0 ; for (int i = 0; i < SIZE(input); ++i) { diff --git a/072scheduler.cc b/072scheduler.cc index 5e2ae4fb..91fd110a 100644 --- a/072scheduler.cc +++ b/072scheduler.cc @@ -132,7 +132,7 @@ void run_main(int argc, char* argv[]) { Current_routine = main_routine; for (int i = 1; i < argc; ++i) { vector arg; - arg.push_back(new_mu_string(argv[i])); + arg.push_back(new_mu_text(argv[i])); current_call().ingredient_atoms.push_back(arg); } run(main_routine); diff --git a/082scenario_screen.cc b/082scenario_screen.cc index 3321a7fc..509043cc 100644 --- a/082scenario_screen.cc +++ b/082scenario_screen.cc @@ -191,7 +191,7 @@ case SCREEN_SHOULD_CONTAIN: { raise << maybe(get(Recipe, r).name) << "'screen-should-contain' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); break; } - if (!is_literal_string(inst.ingredients.at(0))) { + if (!is_literal_text(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of 'screen-should-contain' should be a literal string, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } @@ -219,7 +219,7 @@ case SCREEN_SHOULD_CONTAIN_IN_COLOR: { raise << maybe(get(Recipe, r).name) << "first ingredient of 'screen-should-contain-in-color' should be a number (color code), but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } - if (!is_literal_string(inst.ingredients.at(1))) { + if (!is_literal_text(inst.ingredients.at(1))) { raise << maybe(get(Recipe, r).name) << "second ingredient of 'screen-should-contain-in-color' should be a literal string, but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); break; } diff --git a/087file.cc b/087file.cc index 804fee86..ffa6417c 100644 --- a/087file.cc +++ b/087file.cc @@ -19,7 +19,7 @@ case _OPEN_FILE_FOR_READING: { raise << maybe(get(Recipe, r).name) << "'$open-file-for-reading' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); break; } - if (!is_mu_string(inst.ingredients.at(0))) { + if (!is_mu_text(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of '$open-file-for-reading' should be a string, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } @@ -35,7 +35,7 @@ case _OPEN_FILE_FOR_READING: { } :(before "End Primitive Recipe Implementations") case _OPEN_FILE_FOR_READING: { - string filename = read_mu_string(ingredients.at(0).at(0)); + string filename = read_mu_text(ingredients.at(0).at(0)); assert(sizeof(long long int) >= sizeof(FILE*)); FILE* f = fopen(filename.c_str(), "r"); long long int result = reinterpret_cast(f); @@ -54,7 +54,7 @@ case _OPEN_FILE_FOR_WRITING: { raise << maybe(get(Recipe, r).name) << "'$open-file-for-writing' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); break; } - if (!is_mu_string(inst.ingredients.at(0))) { + if (!is_mu_text(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of '$open-file-for-writing' should be a string, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } @@ -70,7 +70,7 @@ case _OPEN_FILE_FOR_WRITING: { } :(before "End Primitive Recipe Implementations") case _OPEN_FILE_FOR_WRITING: { - string filename = read_mu_string(ingredients.at(0).at(0)); + string filename = read_mu_text(ingredients.at(0).at(0)); assert(sizeof(long long int) >= sizeof(FILE*)); long long int result = reinterpret_cast(fopen(filename.c_str(), "w")); products.resize(1); diff --git a/089scenario_filesystem.cc b/089scenario_filesystem.cc index 4c7fce54..f96b9f42 100644 --- a/089scenario_filesystem.cc +++ b/089scenario_filesystem.cc @@ -191,12 +191,12 @@ void construct_filesystem_object(const map& contents) { int filesystem_data_address = allocate(SIZE(contents)*2 + /*array length*/1); int curr = filesystem_data_address + /*skip refcount and length*/2; for (map::const_iterator p = contents.begin(); p != contents.end(); ++p) { - put(Memory, curr, new_mu_string(p->first)); + put(Memory, curr, new_mu_text(p->first)); trace(9999, "mem") << "storing file name " << get(Memory, curr) << " in location " << curr << end(); put(Memory, get(Memory, curr), 1); trace(9999, "mem") << "storing refcount 1 in location " << get(Memory, curr) << end(); ++curr; - put(Memory, curr, new_mu_string(p->second)); + put(Memory, curr, new_mu_text(p->second)); trace(9999, "mem") << "storing file contents " << get(Memory, curr) << " in location " << curr << end(); put(Memory, get(Memory, curr), 1); trace(9999, "mem") << "storing refcount 1 in location " << get(Memory, curr) << end(); diff --git a/101run_sandboxed.cc b/101run_sandboxed.cc index f65f7898..b1be48e0 100644 --- a/101run_sandboxed.cc +++ b/101run_sandboxed.cc @@ -44,7 +44,7 @@ case RUN_SANDBOXED: { raise << maybe(get(Recipe, r).name) << "'run-sandboxed' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); break; } - if (!is_mu_string(inst.ingredients.at(0))) { + if (!is_mu_text(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of 'run-sandboxed' should be a string, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } @@ -95,7 +95,7 @@ bool run_interactive(int address) { for (int i = 1; i < Reserved_for_tests; ++i) Memory.erase(i); } - string command = trim(strip_comments(read_mu_string(address))); + string command = trim(strip_comments(read_mu_text(address))); Name[get(Recipe_ordinal, "interactive")].clear(); run_code_begin(/*should_stash_snapshots*/true); if (command.empty()) return false; @@ -261,7 +261,7 @@ case _MOST_RECENT_PRODUCTS: { :(before "End Primitive Recipe Implementations") case _MOST_RECENT_PRODUCTS: { products.resize(1); - products.at(0).push_back(new_mu_string(Most_recent_products)); + products.at(0).push_back(new_mu_text(Most_recent_products)); break; } @@ -379,9 +379,9 @@ void track_most_recent_products(const instruction& instruction, const vector abc if (i < SIZE(instruction.products)) { - if (is_mu_string(instruction.products.at(i))) { + if (is_mu_text(instruction.products.at(i))) { if (!scalar(products.at(i))) continue; // error handled elsewhere - out << read_mu_string(products.at(i).at(0)) << '\n'; + out << read_mu_text(products.at(i).at(0)) << '\n'; continue; } } @@ -411,7 +411,7 @@ int stringified_value_of_location(int address) { // convert to string ostringstream out; out << no_scientific(get_or_insert(Memory, address)); - return new_mu_string(out.str()); + return new_mu_text(out.str()); } int trace_error_contents() { @@ -425,7 +425,7 @@ int trace_error_contents() { string result = out.str(); if (result.empty()) return 0; truncate(result); - return new_mu_string(result); + return new_mu_text(result); } int trace_app_contents() { @@ -439,7 +439,7 @@ int trace_app_contents() { string result = out.str(); if (result.empty()) return 0; truncate(result); - return new_mu_string(result); + return new_mu_text(result); } void truncate(string& x) { @@ -464,7 +464,7 @@ case RELOAD: { raise << maybe(get(Recipe, r).name) << "'reload' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end(); break; } - if (!is_mu_string(inst.ingredients.at(0))) { + if (!is_mu_text(inst.ingredients.at(0))) { raise << maybe(get(Recipe, r).name) << "first ingredient of 'reload' should be a string, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } @@ -483,7 +483,7 @@ case RELOAD: { Recipe_variants = Recipe_variants_snapshot; Name = Name_snapshot; // } - string code = read_mu_string(ingredients.at(0).at(0)); + string code = read_mu_text(ingredients.at(0).at(0)); run_code_begin(/*should_stash_snapshots*/false); routine* save_current_routine = Current_routine; Current_routine = NULL; diff --git a/102persist.cc b/102persist.cc index 44a10bf1..09bbc482 100644 --- a/102persist.cc +++ b/102persist.cc @@ -13,10 +13,10 @@ case RESTORE: { break; } string filename; - if (is_literal_string(inst.ingredients.at(0))) { + if (is_literal_text(inst.ingredients.at(0))) { ; } - else if (is_mu_string(inst.ingredients.at(0))) { + else if (is_mu_text(inst.ingredients.at(0))) { ; } else { @@ -28,11 +28,11 @@ case RESTORE: { :(before "End Primitive Recipe Implementations") case RESTORE: { string filename; - if (is_literal_string(current_instruction().ingredients.at(0))) { + if (is_literal_text(current_instruction().ingredients.at(0))) { filename = current_instruction().ingredients.at(0).name; } - else if (is_mu_string(current_instruction().ingredients.at(0))) { - filename = read_mu_string(ingredients.at(0).at(0)); + else if (is_mu_text(current_instruction().ingredients.at(0))) { + filename = read_mu_text(ingredients.at(0).at(0)); } if (Current_scenario) { // do nothing in tests @@ -45,7 +45,7 @@ case RESTORE: { if (contents.empty()) products.at(0).push_back(0); else - products.at(0).push_back(new_mu_string(contents)); + products.at(0).push_back(new_mu_text(contents)); break; } @@ -71,17 +71,17 @@ case SAVE: { raise << maybe(get(Recipe, r).name) << "'save' requires exactly two ingredients, but got '" << inst.original_string << "'\n" << end(); break; } - if (is_literal_string(inst.ingredients.at(0))) { + if (is_literal_text(inst.ingredients.at(0))) { ; } - else if (is_mu_string(inst.ingredients.at(0))) { + else if (is_mu_text(inst.ingredients.at(0))) { ; } else { raise << maybe(get(Recipe, r).name) << "first ingredient of 'save' should be a string, but got '" << to_string(inst.ingredients.at(0)) << "'\n" << end(); break; } - if (!is_mu_string(inst.ingredients.at(1))) { + if (!is_mu_text(inst.ingredients.at(1))) { raise << maybe(get(Recipe, r).name) << "second ingredient of 'save' should be an address:array:character, but got '" << to_string(inst.ingredients.at(1)) << "'\n" << end(); break; } @@ -91,14 +91,14 @@ case SAVE: { case SAVE: { if (Current_scenario) break; // do nothing in tests string filename; - if (is_literal_string(current_instruction().ingredients.at(0))) { + if (is_literal_text(current_instruction().ingredients.at(0))) { filename = current_instruction().ingredients.at(0).name; } - else if (is_mu_string(current_instruction().ingredients.at(0))) { - filename = read_mu_string(ingredients.at(0).at(0)); + else if (is_mu_text(current_instruction().ingredients.at(0))) { + filename = read_mu_text(ingredients.at(0).at(0)); } ofstream fout(("lesson/"+filename).c_str()); - string contents = read_mu_string(ingredients.at(1).at(0)); + string contents = read_mu_text(ingredients.at(1).at(0)); fout << contents; fout.close(); if (!exists("lesson/.git")) break; -- cgit 1.4.1-2-gfad0