From 201458e3bd2f1d79a0ea0b853552e9df267e92b1 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 26 Dec 2016 20:44:10 -0800 Subject: 3713 - cross-link calls with definitions in html --- html/029tools.cc.html | 82 +++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'html/029tools.cc.html') diff --git a/html/029tools.cc.html b/html/029tools.cc.html index b403273b..e4948edf 100644 --- a/html/029tools.cc.html +++ b/html/029tools.cc.html @@ -62,27 +62,27 @@ if ('onhashchange' in window) { 1 //: Allow Mu programs to log facts just like we've been doing in C++ so far. 2 3 :(scenario trace) - 4 def main [ - 5 trace 1, [foo], [this is a trace in Mu] + 4 def main [ + 5 trace 1, [foo], [this is a trace in Mu] 6 ] - 7 +foo: this is a trace in Mu + 7 +foo: this is a trace in Mu 8 9 :(before "End Primitive Recipe Declarations") 10 TRACE, 11 :(before "End Primitive Recipe Numbers") - 12 put(Recipe_ordinal, "trace", TRACE); + 12 put(Recipe_ordinal, "trace", TRACE); 13 :(before "End Primitive Recipe Checks") 14 case TRACE: { - 15 if (SIZE(inst.ingredients) < 3) { - 16 raise << maybe(get(Recipe, r).name) << "'trace' takes three or more ingredients rather than '" << inst.original_string << "'\n" << end(); + 15 if (SIZE(inst.ingredients) < 3) { + 16 raise << maybe(get(Recipe, r).name) << "'trace' takes three or more ingredients rather than '" << inst.original_string << "'\n" << end(); 17 break; 18 } 19 if (!is_mu_number(inst.ingredients.at(0))) { - 20 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(); + 20 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(); 21 break; 22 } 23 if (!is_literal_text(inst.ingredients.at(1))) { - 24 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(); + 24 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(); 25 break; 26 } 27 break; @@ -92,11 +92,11 @@ if ('onhashchange' in window) { 31 int depth = ingredients.at(0).at(0); 32 string label = current_instruction().ingredients.at(1).name; 33 ostringstream out; - 34 for (int i = 2; i < SIZE(current_instruction().ingredients); ++i) { + 34 for (int i = 2; i < SIZE(current_instruction().ingredients); ++i) { 35 if (i > 2) out << ' '; 36 out << inspect(current_instruction().ingredients.at(i), ingredients.at(i)); 37 } - 38 trace(depth, label) << out.str() << end(); + 38 trace(depth, label) << out.str() << end(); 39 break; 40 } 41 @@ -105,7 +105,7 @@ if ('onhashchange' in window) { 44 :(before "End Primitive Recipe Declarations") 45 STASH, 46 :(before "End Primitive Recipe Numbers") - 47 put(Recipe_ordinal, "stash", STASH); + 47 put(Recipe_ordinal, "stash", STASH); 48 :(before "End Primitive Recipe Checks") 49 case STASH: { 50 break; @@ -113,28 +113,28 @@ if ('onhashchange' in window) { 52 :(before "End Primitive Recipe Implementations") 53 case STASH: { 54 ostringstream out; - 55 for (int i = 0; i < SIZE(current_instruction().ingredients); ++i) { + 55 for (int i = 0; i < SIZE(current_instruction().ingredients); ++i) { 56 if (i) out << ' '; 57 out << inspect(current_instruction().ingredients.at(i), ingredients.at(i)); 58 } - 59 trace(2, "app") << out.str() << end(); + 59 trace(2, "app") << out.str() << end(); 60 break; 61 } 62 63 :(scenario stash_literal_string) - 64 def main [ + 64 def main [ 65 stash [foo] 66 ] 67 +app: foo 68 69 :(scenario stash_literal_number) - 70 def main [ + 70 def main [ 71 stash [foo:], 4 72 ] 73 +app: foo: 4 74 75 :(scenario stash_number) - 76 def main [ + 76 def main [ 77 1:num <- copy 34 78 stash [foo:], 1:num 79 ] @@ -146,7 +146,7 @@ if ('onhashchange' in window) { 85 return r.name; 86 // End inspect Special-cases(r, data) 87 ostringstream out; - 88 for (long long i = 0; i < SIZE(data); ++i) { + 88 for (long long i = 0; i < SIZE(data); ++i) { 89 if (i) out << ' '; 90 out << no_scientific(data.at(i)); 91 } @@ -156,7 +156,7 @@ if ('onhashchange' in window) { 95 :(before "End Primitive Recipe Declarations") 96 HIDE_ERRORS, 97 :(before "End Primitive Recipe Numbers") - 98 put(Recipe_ordinal, "hide-errors", HIDE_ERRORS); + 98 put(Recipe_ordinal, "hide-errors", HIDE_ERRORS); 99 :(before "End Primitive Recipe Checks") 100 case HIDE_ERRORS: { 101 break; @@ -170,7 +170,7 @@ if ('onhashchange' in window) { 109 :(before "End Primitive Recipe Declarations") 110 SHOW_ERRORS, 111 :(before "End Primitive Recipe Numbers") -112 put(Recipe_ordinal, "show-errors", SHOW_ERRORS); +112 put(Recipe_ordinal, "show-errors", SHOW_ERRORS); 113 :(before "End Primitive Recipe Checks") 114 case SHOW_ERRORS: { 115 break; @@ -184,7 +184,7 @@ if ('onhashchange' in window) { 123 :(before "End Primitive Recipe Declarations") 124 TRACE_UNTIL, 125 :(before "End Primitive Recipe Numbers") -126 put(Recipe_ordinal, "trace-until", TRACE_UNTIL); +126 put(Recipe_ordinal, "trace-until", TRACE_UNTIL); 127 :(before "End Primitive Recipe Checks") 128 case TRACE_UNTIL: { 129 break; @@ -200,7 +200,7 @@ if ('onhashchange' in window) { 139 :(before "End Primitive Recipe Declarations") 140 _DUMP_TRACE, 141 :(before "End Primitive Recipe Numbers") -142 put(Recipe_ordinal, "$dump-trace", _DUMP_TRACE); +142 put(Recipe_ordinal, "$dump-trace", _DUMP_TRACE); 143 :(before "End Primitive Recipe Checks") 144 case _DUMP_TRACE: { 145 break; @@ -208,10 +208,10 @@ if ('onhashchange' in window) { 147 :(before "End Primitive Recipe Implementations") 148 case _DUMP_TRACE: { 149 if (ingredients.empty()) { -150 DUMP(""); +150 DUMP(""); 151 } 152 else { -153 DUMP(current_instruction().ingredients.at(0).name); +153 DUMP(current_instruction().ingredients.at(0).name); 154 } 155 break; 156 } @@ -219,21 +219,21 @@ if ('onhashchange' in window) { 158 :(before "End Primitive Recipe Declarations") 159 _CLEAR_TRACE, 160 :(before "End Primitive Recipe Numbers") -161 put(Recipe_ordinal, "$clear-trace", _CLEAR_TRACE); +161 put(Recipe_ordinal, "$clear-trace", _CLEAR_TRACE); 162 :(before "End Primitive Recipe Checks") 163 case _CLEAR_TRACE: { 164 break; 165 } 166 :(before "End Primitive Recipe Implementations") 167 case _CLEAR_TRACE: { -168 if (Trace_stream) Trace_stream->past_lines.clear(); +168 if (Trace_stream) Trace_stream->past_lines.clear(); 169 break; 170 } 171 172 :(before "End Primitive Recipe Declarations") 173 _SAVE_TRACE, 174 :(before "End Primitive Recipe Numbers") -175 put(Recipe_ordinal, "$save-trace", _SAVE_TRACE); +175 put(Recipe_ordinal, "$save-trace", _SAVE_TRACE); 176 :(before "End Primitive Recipe Checks") 177 case _SAVE_TRACE: { 178 break; @@ -242,7 +242,7 @@ if ('onhashchange' in window) { 181 case _SAVE_TRACE: { 182 if (Save_trace) { 183 ofstream fout("last_trace"); -184 fout << Trace_stream->readable_contents(""); +184 fout << Trace_stream->readable_contents(""); 185 fout.close(); 186 } 187 break; @@ -253,16 +253,16 @@ if ('onhashchange' in window) { 192 :(before "End Primitive Recipe Declarations") 193 _PRINT, 194 :(before "End Primitive Recipe Numbers") -195 put(Recipe_ordinal, "$print", _PRINT); +195 put(Recipe_ordinal, "$print", _PRINT); 196 :(before "End Primitive Recipe Checks") 197 case _PRINT: { 198 break; 199 } 200 :(before "End Primitive Recipe Implementations") 201 case _PRINT: { -202 for (int i = 0; i < SIZE(ingredients); ++i) { +202 for (int i = 0; i < SIZE(ingredients); ++i) { 203 if (is_literal(current_instruction().ingredients.at(i))) { -204 trace(9998, "run") << "$print: " << current_instruction().ingredients.at(i).name << end(); +204 trace(9998, "run") << "$print: " << current_instruction().ingredients.at(i).name << end(); 205 if (!has_property(current_instruction().ingredients.at(i), "newline")) { 206 cout << current_instruction().ingredients.at(i).name; 207 } @@ -274,8 +274,8 @@ if ('onhashchange' in window) { 213 } 214 // End $print Special-cases 215 else { -216 for (int j = 0; j < SIZE(ingredients.at(i)); ++j) { -217 trace(9998, "run") << "$print: " << ingredients.at(i).at(j) << end(); +216 for (int j = 0; j < SIZE(ingredients.at(i)); ++j) { +217 trace(9998, "run") << "$print: " << ingredients.at(i).at(j) << end(); 218 if (j > 0) cout << " "; 219 cout << no_scientific(ingredients.at(i).at(j)); 220 } @@ -288,7 +288,7 @@ if ('onhashchange' in window) { 227 :(before "End Primitive Recipe Declarations") 228 _EXIT, 229 :(before "End Primitive Recipe Numbers") -230 put(Recipe_ordinal, "$exit", _EXIT); +230 put(Recipe_ordinal, "$exit", _EXIT); 231 :(before "End Primitive Recipe Checks") 232 case _EXIT: { 233 break; @@ -302,15 +302,15 @@ if ('onhashchange' in window) { 241 :(before "End Primitive Recipe Declarations") 242 _SYSTEM, 243 :(before "End Primitive Recipe Numbers") -244 put(Recipe_ordinal, "$system", _SYSTEM); +244 put(Recipe_ordinal, "$system", _SYSTEM); 245 :(before "End Primitive Recipe Checks") 246 case _SYSTEM: { -247 if (SIZE(inst.ingredients) != 1) { -248 raise << maybe(get(Recipe, r).name) << "'$system' requires exactly one ingredient, but got '" << to_string(inst) << "'\n" << end(); +247 if (SIZE(inst.ingredients) != 1) { +248 raise << maybe(get(Recipe, r).name) << "'$system' requires exactly one ingredient, but got '" << to_string(inst) << "'\n" << end(); 249 break; 250 } 251 if (!is_literal_text(inst.ingredients.at(0))) { -252 raise << maybe(get(Recipe, r).name) << "ingredient to '$system' must be a literal text, but got '" << to_string(inst) << "'\n" << end(); +252 raise << maybe(get(Recipe, r).name) << "ingredient to '$system' must be a literal text, but got '" << to_string(inst) << "'\n" << end(); 253 } 254 break; 255 } @@ -325,7 +325,7 @@ if ('onhashchange' in window) { 264 :(before "End Primitive Recipe Declarations") 265 _DUMP_MEMORY, 266 :(before "End Primitive Recipe Numbers") -267 put(Recipe_ordinal, "$dump-memory", _DUMP_MEMORY); +267 put(Recipe_ordinal, "$dump-memory", _DUMP_MEMORY); 268 :(before "End Primitive Recipe Checks") 269 case _DUMP_MEMORY: { 270 break; @@ -347,7 +347,7 @@ if ('onhashchange' in window) { 286 :(before "End Primitive Recipe Declarations") 287 _LOG, 288 :(before "End Primitive Recipe Numbers") -289 put(Recipe_ordinal, "$log", _LOG); +289 put(Recipe_ordinal, "$log", _LOG); 290 :(before "End Primitive Recipe Checks") 291 case _LOG: { 292 break; @@ -355,7 +355,7 @@ if ('onhashchange' in window) { 294 :(before "End Primitive Recipe Implementations") 295 case _LOG: { 296 ostringstream out; -297 for (int i = 0; i < SIZE(current_instruction().ingredients); ++i) { +297 for (int i = 0; i < SIZE(current_instruction().ingredients); ++i) { 298 out << inspect(current_instruction().ingredients.at(i), ingredients.at(i)); 299 } 300 LOG << out.str() << '\n'; @@ -369,7 +369,7 @@ if ('onhashchange' in window) { 308 :(before "End Primitive Recipe Declarations") 309 _FOO, 310 :(before "End Primitive Recipe Numbers") -311 put(Recipe_ordinal, "$foo", _FOO); +311 put(Recipe_ordinal, "$foo", _FOO); 312 :(before "End Primitive Recipe Checks") 313 case _FOO: { 314 break; -- cgit 1.4.1-2-gfad0