diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-02-25 20:47:42 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-02-25 20:47:42 -0800 |
commit | d0e29245f9d37256093026d5080452db8a694136 (patch) | |
tree | 0f6658fa7dc42e7ac30c0641d1bcd562c332f3ec | |
parent | dcc060c7d4ef56b978beb34ddce8d8ffcec94fa6 (diff) | |
download | mu-d0e29245f9d37256093026d5080452db8a694136.tar.gz |
2707
-rw-r--r-- | 020run.cc | 1 | ||||
-rw-r--r-- | 032array.cc | 1 | ||||
-rw-r--r-- | 043space.cc | 5 | ||||
-rw-r--r-- | 044space_surround.cc | 5 | ||||
-rw-r--r-- | 045closure_name.cc | 1 | ||||
-rw-r--r-- | 050scenario.cc | 5 | ||||
-rw-r--r-- | 057static_dispatch.cc | 2 | ||||
-rw-r--r-- | 070text.mu | 4 | ||||
-rw-r--r-- | 073list.mu | 4 | ||||
-rw-r--r-- | 077hash.cc | 1 | ||||
-rw-r--r-- | 082scenario_screen.cc | 2 | ||||
-rw-r--r-- | 086scenario_console_test.mu | 5 | ||||
-rw-r--r-- | 091run_interactive.cc | 9 | ||||
-rw-r--r-- | edit/004-programming-environment.mu | 2 | ||||
-rw-r--r-- | edit/005-sandbox.mu | 5 | ||||
-rw-r--r-- | edit/010-errors.mu | 7 | ||||
-rw-r--r-- | sandbox/004-programming-environment.mu | 2 | ||||
-rw-r--r-- | sandbox/005-sandbox.mu | 1 | ||||
-rw-r--r-- | sandbox/010-errors.mu | 4 |
19 files changed, 3 insertions, 63 deletions
diff --git a/020run.cc b/020run.cc index e90cf05a..e600aaed 100644 --- a/020run.cc +++ b/020run.cc @@ -151,7 +151,6 @@ if (argc > 1) { argc--; } transform_all(); -//? dump_recipe("handle-keyboard-event"), exit(0); if (Run_tests) Recipe.erase(get(Recipe_ordinal, "main")); // End Loading .mu Files } diff --git a/032array.cc b/032array.cc index 250e915b..0edf5b2b 100644 --- a/032array.cc +++ b/032array.cc @@ -112,7 +112,6 @@ if (r.type && r.type->value == get(Type_ordinal, "array")) { raise_error << maybe(current_recipe_name()) << "'" << r.original_string << "' is an array of what?\n" << end(); return 1; } -//? trace(9999, "mem") << "computing size of array starting at " << r.value << end(); return 1 + get_or_insert(Memory, r.value)*size_of(array_element(r.type)); } diff --git a/043space.cc b/043space.cc index e068e874..c347d0cb 100644 --- a/043space.cc +++ b/043space.cc @@ -265,7 +265,6 @@ void check_default_space(const recipe_ordinal r) { if (caller.steps.at(0).products.empty() || caller.steps.at(0).products.at(0).name != "default-space") { raise_error << maybe(caller.name) << " does not seem to start with default-space or local-scope\n" << end(); -//? cerr << maybe(caller.name) << " does not seem to start with default-space or local-scope\n" << '\n'; } } :(after "Load .mu Core") @@ -280,10 +279,8 @@ bool contains_non_special_name(const recipe_ordinal r) { for (map<string, long long int>::iterator p = Name[r].begin(); p != Name[r].end(); ++p) { if (p->first.empty()) continue; if (p->first.find("stash_") == 0) continue; // generated by rewrite_stashes_to_text (cross-layer) - if (!is_special_name(p->first)) { -//? cerr << " " << get(Recipe, r).name << ": " << p->first << '\n'; + if (!is_special_name(p->first)) return true; - } } return false; } diff --git a/044space_surround.cc b/044space_surround.cc index 64047e5f..b9979256 100644 --- a/044space_surround.cc +++ b/044space_surround.cc @@ -39,12 +39,9 @@ long long int space_base(const reagent& x) { } long long int space_base(const reagent& x, long long int space_index, long long int base) { -//? trace(9999, "space") << "space-base: " << space_index << " " << base << end(); - if (space_index == 0) { + if (space_index == 0) return base; - } long long int result = space_base(x, space_index-1, get_or_insert(Memory, base+/*skip length*/1))+/*skip refcount*/1; -//? trace(9999, "space") << "space-base: " << space_index << " " << base << " => " << result << end(); return result; } diff --git a/045closure_name.cc b/045closure_name.cc index 701c69fa..df9cafe1 100644 --- a/045closure_name.cc +++ b/045closure_name.cc @@ -78,7 +78,6 @@ void collect_surrounding_spaces(const recipe_ordinal r) { continue; } trace(9993, "name") << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << end(); -//? cerr << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << '\n'; if (!contains_key(Recipe_ordinal, surrounding_recipe_name)) { raise_error << "can't find recipe providing surrounding space for " << get(Recipe, r).name << ": " << surrounding_recipe_name << '\n' << end(); continue; diff --git a/050scenario.cc b/050scenario.cc index 2e09defd..cce79260 100644 --- a/050scenario.cc +++ b/050scenario.cc @@ -210,14 +210,9 @@ case RUN: { assert(Name[Next_recipe_ordinal].empty()); ostringstream tmp; tmp << "recipe run_" << Next_recipe_ordinal << " [ " << current_instruction().ingredients.at(0).name << " ]"; -//? cerr << tmp.str() << '\n'; -//? cerr << "before load\n"; vector<recipe_ordinal> tmp_recipe = load(tmp.str()); -//? cerr << "before bind\n"; bind_special_scenario_names(tmp_recipe.at(0)); -//? cerr << "before transform\n"; transform_all(); -//? cerr << "end\n"; if (Trace_stream) { ++Trace_stream->callstack_depth; trace(9998, "trace") << "run: incrementing callstack depth to " << Trace_stream->callstack_depth << end(); diff --git a/057static_dispatch.cc b/057static_dispatch.cc index 2b64fdd0..3d2246b7 100644 --- a/057static_dispatch.cc +++ b/057static_dispatch.cc @@ -33,7 +33,6 @@ for (map<string, vector<recipe_ordinal> >::iterator p = Recipe_variants.begin(); // there can only ever be one variant for main if (result.name != "main" && contains_key(Recipe_ordinal, result.name)) { const recipe_ordinal r = get(Recipe_ordinal, result.name); -//? cerr << result.name << ": " << contains_key(Recipe, r) << (contains_key(Recipe, r) ? get(Recipe, r).has_header : 0) << matching_variant_name(result) << '\n'; if (!contains_key(Recipe, r) || get(Recipe, r).has_header) { string new_name = matching_variant_name(result); if (new_name.empty()) { @@ -44,7 +43,6 @@ if (result.name != "main" && contains_key(Recipe_ordinal, result.name)) { } trace(9999, "load") << "switching " << result.name << " to " << new_name << end(); result.name = new_name; -//? cerr << "=> " << new_name << '\n'; } } else { diff --git a/070text.mu b/070text.mu index a37e8a6e..f6005f58 100644 --- a/070text.mu +++ b/070text.mu @@ -12,7 +12,6 @@ recipe to-text-line x:_elem -> y:address:shared:array:character [ recipe to-text x:address:shared:array:character -> y:address:shared:array:character [ local-scope load-ingredients -#? $print [to-text text], 10/newline reply x ] @@ -163,7 +162,6 @@ recipe buffer-full? in:address:shared:buffer -> result:boolean [ # most broadly applicable definition of append to a buffer: just call to-text recipe append buf:address:shared:buffer, x:_elem -> buf:address:shared:buffer [ local-scope -#? $print [append _elem to buffer], 10/newline load-ingredients text:address:shared:array:character <- to-text x len:number <- length *text @@ -180,7 +178,6 @@ recipe append buf:address:shared:buffer, x:_elem -> buf:address:shared:buffer [ recipe append in:address:shared:buffer, c:character -> in:address:shared:buffer [ local-scope -#? $print [append character to buffer], 10/newline load-ingredients len:address:number <- get-address *in, length:offset { @@ -392,7 +389,6 @@ scenario integer-to-decimal-digit-negative [ recipe append a:address:shared:array:character, b:address:shared:array:character -> result:address:shared:array:character [ local-scope -#? $print [append text to text], 10/newline load-ingredients # result = new character[a.length + b.length] a-len:number <- length *a diff --git a/073list.mu b/073list.mu index 1971b98e..1dedf573 100644 --- a/073list.mu +++ b/073list.mu @@ -53,7 +53,6 @@ scenario list-handling [ recipe to-text in:address:shared:list:_elem -> result:address:shared:array:character [ local-scope -#? $print [to text: list], 10/newline load-ingredients buf:address:shared:buffer <- new-buffer 80 buf <- to-buffer in, buf @@ -63,7 +62,6 @@ recipe to-text in:address:shared:list:_elem -> result:address:shared:array:chara # variant of 'to-text' which stops printing after a few elements (and so is robust to cycles) recipe to-text-line in:address:shared:list:_elem -> result:address:shared:array:character [ local-scope -#? $print [to text line: list], 10/newline load-ingredients buf:address:shared:buffer <- new-buffer 80 buf <- to-buffer in, buf, 6 # max elements to display @@ -72,7 +70,6 @@ recipe to-text-line in:address:shared:list:_elem -> result:address:shared:array: recipe to-buffer in:address:shared:list:_elem, buf:address:shared:buffer -> buf:address:shared:buffer [ local-scope -#? $print [to buffer: list], 10/newline load-ingredients { break-if in @@ -85,7 +82,6 @@ recipe to-buffer in:address:shared:list:_elem, buf:address:shared:buffer -> buf: # now prepare next next:address:shared:list:_elem <- rest in nextn:number <- copy next -#? buf <- append buf, nextn reply-unless next space:character <- copy 32/space buf <- append buf, space:character diff --git a/077hash.cc b/077hash.cc index eb6879d1..5d48ffe8 100644 --- a/077hash.cc +++ b/077hash.cc @@ -32,7 +32,6 @@ case HASH: { :(code) size_t hash(size_t h, reagent& r) { -//? cerr << debug_string(r) << '\n'; canonize(r); if (is_mu_string(r)) // optimization return hash_mu_string(h, r); diff --git a/082scenario_screen.cc b/082scenario_screen.cc index 89562f6a..1847cdaf 100644 --- a/082scenario_screen.cc +++ b/082scenario_screen.cc @@ -165,8 +165,6 @@ case SCREEN_SHOULD_CONTAIN: { } :(before "End Primitive Recipe Implementations") case SCREEN_SHOULD_CONTAIN: { -//? cerr << SIZE(get(Recipe_variants, "insert")) << '\n'; -//? cerr << debug_string(get(Recipe, get(Recipe_ordinal, "insert_4"))) << '\n'; if (!Passed) break; assert(scalar(ingredients.at(0))); check_screen(current_instruction().ingredients.at(0).name, -1); diff --git a/086scenario_console_test.mu b/086scenario_console_test.mu index 535bfe7b..a11b0091 100644 --- a/086scenario_console_test.mu +++ b/086scenario_console_test.mu @@ -23,8 +23,3 @@ scenario read-key-in-mu [ 8 <- 1 ] ] - -#? recipe foo-editor [ -#? local-scope -#? init:address:shared:list:character <- push 97/a, 0 -#? ] diff --git a/091run_interactive.cc b/091run_interactive.cc index e570dee2..47b0122d 100644 --- a/091run_interactive.cc +++ b/091run_interactive.cc @@ -109,7 +109,6 @@ bool run_interactive(long long int address) { } void run_code_begin(bool snapshot_recently_added_recipes) { -//? cerr << "loading new trace\n"; // stuff to undo later, in run_code_end() Hide_errors = true; Disable_redefine_checks = true; @@ -127,7 +126,6 @@ void run_code_begin(bool snapshot_recently_added_recipes) { } void run_code_end() { -//? cerr << "back to old trace\n"; Hide_errors = false; Disable_redefine_checks = false; delete Trace_stream; @@ -458,7 +456,6 @@ case RELOAD: { } :(before "End Primitive Recipe Implementations") case RELOAD: { -//? cerr << "== reload\n"; // clear any containers in advance for (long long int i = 0; i < SIZE(Recently_added_types); ++i) { if (!contains_key(Type, Recently_added_types.at(i))) continue; @@ -466,14 +463,11 @@ case RELOAD: { Type.erase(Recently_added_types.at(i)); } for (map<string, vector<recipe_ordinal> >::iterator p = Recipe_variants.begin(); p != Recipe_variants.end(); ++p) { -//? cerr << p->first << ":\n"; vector<recipe_ordinal>& variants = p->second; for (long long int i = 0; i < SIZE(p->second); ++i) { if (variants.at(i) == -1) continue; - if (find(Recently_added_shape_shifting_recipes.begin(), Recently_added_shape_shifting_recipes.end(), variants.at(i)) != Recently_added_shape_shifting_recipes.end()) { -//? cerr << " " << variants.at(i) << ' ' << get(Recipe, variants.at(i)).name << '\n'; + if (find(Recently_added_shape_shifting_recipes.begin(), Recently_added_shape_shifting_recipes.end(), variants.at(i)) != Recently_added_shape_shifting_recipes.end()) variants.at(i) = -1; // ghost - } } } for (long long int i = 0; i < SIZE(Recently_added_shape_shifting_recipes); ++i) { @@ -496,7 +490,6 @@ case RELOAD: { products.resize(1); products.at(0).push_back(trace_error_contents()); run_code_end(); // wait until we're done with the trace contents -//? cerr << "reload done\n"; break; } diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu index 79b7c7fe..c712c09b 100644 --- a/edit/004-programming-environment.mu +++ b/edit/004-programming-environment.mu @@ -380,9 +380,7 @@ recipe render-all screen:address:shared:screen, env:address:shared:programming-e # top menu trace 11, [app], [render top menu] width:number <- screen-width screen -#? $print [draw menu], 10/newline draw-horizontal screen, 0, 0/left, width, 32/space, 0/black, 238/grey -#? $print [draw menu end], 10/newline button-start:number <- subtract width, 20 button-on-screen?:boolean <- greater-or-equal button-start, 0 assert button-on-screen?, [screen too narrow for menu] diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu index 4a29254e..48935761 100644 --- a/edit/005-sandbox.mu +++ b/edit/005-sandbox.mu @@ -127,14 +127,11 @@ after <global-keypress> [ { do-run?:boolean <- equal *k, 65532/F4 break-unless do-run? -#? $log [F4 pressed] status:address:shared:array:character <- new [running... ] screen <- update-status screen, status, 245/grey error?:boolean, env, screen <- run-sandboxes env, screen # F4 might update warnings and results on both sides -#? $print [render-all begin], 10/newline screen <- render-all screen, env -#? $print [render-all end], 10/newline { break-if error? status:address:shared:array:character <- new [ ] @@ -243,7 +240,6 @@ recipe save-sandboxes env:address:shared:programming-environment-data [ recipe! render-sandbox-side screen:address:shared:screen, env:address:shared:programming-environment-data -> screen:address:shared:screen [ local-scope load-ingredients -#? $log [render sandbox side] trace 11, [app], [render sandbox side] current-sandbox:address:shared:editor-data <- get *env, current-sandbox:offset row:number, column:number <- copy 1, 0 @@ -268,7 +264,6 @@ recipe! render-sandbox-side screen:address:shared:screen, env:address:shared:pro recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number, render-from:number, idx:number -> row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [ local-scope load-ingredients -#? $log [render sandbox] reply-unless sandbox screen-height:number <- screen-height screen at-bottom?:boolean <- greater-or-equal row, screen-height diff --git a/edit/010-errors.mu b/edit/010-errors.mu index d5d7065f..32dff4fa 100644 --- a/edit/010-errors.mu +++ b/edit/010-errors.mu @@ -8,7 +8,6 @@ container programming-environment-data [ recipe! update-recipes env:address:shared:programming-environment-data, screen:address:shared:screen -> errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [ local-scope load-ingredients -#? $log [update recipes] recipes:address:shared:editor-data <- get *env, recipes:offset in:address:shared:array:character <- editor-contents recipes save [recipes.mu], in @@ -74,9 +73,7 @@ before <render-components-end> [ status-template:address:shared:array:character <- new [errors found (_) ] error-index-text:address:shared:array:character <- to-text error-index status:address:shared:array:character <- interpolate status-template, error-index-text -#? $print [update-status: sandbox error], 10/newline update-status screen, status, 1/red -#? $print [run sandboxes end], 10/newline } ] @@ -87,13 +84,11 @@ container sandbox-data [ recipe! update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number -> sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ local-scope load-ingredients -#? $log [update sandbox] data:address:shared:array:character <- get *sandbox, data:offset response:address:address:shared:array:character <- get-address *sandbox, response:offset errors:address:address:shared:array:character <- get-address *sandbox, errors:offset trace:address:address:shared:array:character <- get-address *sandbox, trace:offset fake-screen:address:address:shared:screen <- get-address *sandbox, screen:offset -#? $print [run-interactive], 10/newline *response, *errors, *fake-screen, *trace, completed?:boolean <- run-interactive data { break-if *errors @@ -103,13 +98,11 @@ recipe! update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:p } { break-unless *errors -#? $print [setting error-index to ], idx, 10/newline error-index:address:number <- get-address *env, error-index:offset error-not-set?:boolean <- equal *error-index, -1 break-unless error-not-set? *error-index <- copy idx } -#? $print [done with run-interactive], 10/newline ] # make sure we render any trace diff --git a/sandbox/004-programming-environment.mu b/sandbox/004-programming-environment.mu index 7a449622..78aca5ae 100644 --- a/sandbox/004-programming-environment.mu +++ b/sandbox/004-programming-environment.mu @@ -160,9 +160,7 @@ recipe render-all screen:address:shared:screen, env:address:shared:programming-e # top menu trace 11, [app], [render top menu] width:number <- screen-width screen -#? $print [draw menu], 10/newline draw-horizontal screen, 0, 0/left, width, 32/space, 0/black, 238/grey -#? $print [draw menu end], 10/newline button-start:number <- subtract width, 20 button-on-screen?:boolean <- greater-or-equal button-start, 0 assert button-on-screen?, [screen too narrow for menu] diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu index e79029f6..31032eb3 100644 --- a/sandbox/005-sandbox.mu +++ b/sandbox/005-sandbox.mu @@ -121,7 +121,6 @@ after <global-keypress> [ screen <- render-all screen, env { break-if error? -#? $print [update-status: clearing], 10/newline status:address:shared:array:character <- new [ ] screen <- update-status screen, status, 245/grey } diff --git a/sandbox/010-errors.mu b/sandbox/010-errors.mu index 6a2c87ed..6794271d 100644 --- a/sandbox/010-errors.mu +++ b/sandbox/010-errors.mu @@ -71,9 +71,7 @@ before <render-components-end> [ status-template:address:shared:array:character <- new [errors found (_) ] error-index-text:address:shared:array:character <- to-text error-index status:address:shared:array:character <- interpolate status-template, error-index-text -#? $print [update-status: sandbox error], 10/newline update-status screen, status, 1/red -#? $print [run sandboxes end], 10/newline } ] @@ -104,13 +102,11 @@ recipe! update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:p } { break-unless *errors -#? $print [setting error-index to ], idx, 10/newline error-index:address:number <- get-address *env, error-index:offset error-not-set?:boolean <- equal *error-index, -1 break-unless error-not-set? *error-index <- copy idx } -#? $print [done with run-interactive], 10/newline ] # make sure we render any trace |