From c8a3ccbeb89221d726542a89b42ddb26827af1f4 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 27 Jul 2019 18:26:18 -0700 Subject: 5490 --- html/003trace.cc.html | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'html/003trace.cc.html') diff --git a/html/003trace.cc.html b/html/003trace.cc.html index 67832b0a..66f007fd 100644 --- a/html/003trace.cc.html +++ b/html/003trace.cc.html @@ -2,7 +2,7 @@ -Mu - subx/003trace.cc +Mu - 003trace.cc @@ -57,7 +57,7 @@ if ('onhashchange' in window) { -https://github.com/akkartik/mu/blob/master/subx/003trace.cc +https://github.com/akkartik/mu/blob/master/003trace.cc
   1 //: The goal of layers is to make programs more easy to understand and more
   2 //: malleable, easy to rewrite in radical ways without accidentally breaking
@@ -125,7 +125,7 @@ if ('onhashchange' in window) {
  64 //:
  65 //:   "Programming properly should be regarded as an activity by which
  66 //:   programmers form a mental model, rather than as production of a program."
- 67 //:   -- Peter Naur (http://alistair.cockburn.us/ASD+book+extract%3A+%22Naur,+Ehn,+Musashi%22)
+ 67 //:   -- Peter Naur (http://akkartik.name/naur.pdf)
  68 
  69 //:: == Core data structures
  70 
@@ -192,7 +192,7 @@ if ('onhashchange' in window) {
 131 
 132 string unescape_newline(string& s) {
 133   std::stringstream ss;
-134   for (int i = 0;  i < SIZE(s);  ++i) {
+134   for (int i = 0;  i < SIZE(s);  ++i) {
 135     if (s.at(i) == '\n')
 136       ss << "\\n";
 137     else
@@ -379,9 +379,9 @@ if ('onhashchange' in window) {
 318   if (!Trace_stream) return false;
 319   vector<string> expected_lines = split(expected, "\n");
 320   int curr_expected_line = 0;
-321   while (curr_expected_line < SIZE(expected_lines) && expected_lines.at(curr_expected_line).empty())
+321   while (curr_expected_line < SIZE(expected_lines) && expected_lines.at(curr_expected_line).empty())
 322     ++curr_expected_line;
-323   if (curr_expected_line == SIZE(expected_lines)) return true;
+323   if (curr_expected_line == SIZE(expected_lines)) return true;
 324   string label, contents;
 325   split_label_contents(expected_lines.at(curr_expected_line), &label, &contents);
 326   for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin();  p != Trace_stream->past_lines.end();  ++p) {
@@ -389,14 +389,14 @@ if ('onhashchange' in window) {
 328     string t = trim(p->contents);
 329     if (contents != unescape_newline(t)) continue;
 330     ++curr_expected_line;
-331     while (curr_expected_line < SIZE(expected_lines) && expected_lines.at(curr_expected_line).empty())
+331     while (curr_expected_line < SIZE(expected_lines) && expected_lines.at(curr_expected_line).empty())
 332       ++curr_expected_line;
-333     if (curr_expected_line == SIZE(expected_lines)) return true;
+333     if (curr_expected_line == SIZE(expected_lines)) return true;
 334     split_label_contents(expected_lines.at(curr_expected_line), &label, &contents);
 335   }
 336 
 337   if (line_exists_anywhere(label, contents)) {
-338     cerr << "\nF - " << FUNCTION << "(" << FILE << ":" << LINE << "): line [" << label << ": " << contents << "] out of order in trace:\n";
+338     cerr << "\nF - " << FUNCTION << "(" << FILE << ":" << LINE << "): line [" << label << ": " << contents << "] out of order in trace:\n";
 339     DUMP("");
 340   }
 341   else {
@@ -409,7 +409,7 @@ if ('onhashchange' in window) {
 348 
 349 bool trace_doesnt_contain(string expected) {
 350   vector<string> tmp = split_first(expected, ": ");
-351   if (SIZE(tmp) == 1) {
+351   if (SIZE(tmp) == 1) {
 352     raise << expected << ": missing label or contents in trace line\n" << end();
 353     assert(false);
 354   }
@@ -420,12 +420,12 @@ if ('onhashchange' in window) {
 359   return trace_count(label, "");
 360 }
 361 
-362 int trace_count(string label, string line) {
+362 int trace_count(string label, string line) {
 363   if (!Trace_stream) return 0;
 364   long result = 0;
 365   for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin();  p != Trace_stream->past_lines.end();  ++p) {
 366     if (label == p->label) {
-367       if (line == "" || trim(line) == trim(p->contents))
+367       if (line == "" || trim(line) == trim(p->contents))
 368         ++result;
 369     }
 370   }
@@ -437,7 +437,7 @@ if ('onhashchange' in window) {
 376   long result = 0;
 377   for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin();  p != Trace_stream->past_lines.end();  ++p) {
 378     if (label == p->label) {
-379       if (starts_with(trim(p->contents), trim(prefix)))
+379       if (starts_with(trim(p->contents), trim(prefix)))
 380         ++result;
 381     }
 382   }
@@ -506,7 +506,7 @@ if ('onhashchange' in window) {
 445 :(before "End Globals")
 446 ofstream Trace_file;
 447 :(before "End Commandline Options(*arg)")
-448 else if (is_equal(*arg, "--trace")) {
+448 else if (is_equal(*arg, "--trace")) {
 449   cerr << "saving trace to 'last_run'\n";
 450   Trace_file.open("last_run");
 451   // Add a dummy line up top; otherwise the `browse_trace` tool currently has
@@ -542,7 +542,7 @@ if ('onhashchange' in window) {
 481 :(before "End Globals")
 482 bool Dump_trace = false;
 483 :(before "End Commandline Options(*arg)")
-484 else if (is_equal(*arg, "--dump")) {
+484 else if (is_equal(*arg, "--dump")) {
 485   Dump_trace = true;
 486 }
 487 :(before "End Incremental Trace Print Conditions")
-- 
cgit 1.4.1-2-gfad0