about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStephen Malina <stephenmalina@gmail.com>2016-07-14 04:47:18 -0700
committerStephen Malina <stephenmalina@gmail.com>2016-07-14 05:42:03 -0700
commit8ee533693acdea45ff9baae3ca0c5b3e0c43de7a (patch)
treecfe296fd2b4374d0c10c3d13cac1ec3f1dea6341
parent8dccf184feebe1acd2354231e16d464ef6f8251d (diff)
downloadmu-8ee533693acdea45ff9baae3ca0c5b3e0c43de7a.tar.gz
3111
Show number of instructions in the editor when a
user clicks on a run instruction in the sandbox.
-rw-r--r--091run_interactive.cc10
-rw-r--r--edit/010-sandbox-trace.mu7
-rw-r--r--edit/011-errors.mu7
3 files changed, 16 insertions, 8 deletions
diff --git a/091run_interactive.cc b/091run_interactive.cc
index f1647c59..70dbed0f 100644
--- a/091run_interactive.cc
+++ b/091run_interactive.cc
@@ -166,10 +166,12 @@ load(string(
 "recipe sandbox [\n" +
   "local-scope\n" +
   "screen:address:screen <- new-fake-screen 30, 5\n" +
-  "r:number/routine_id <- start-running interactive, screen\n" +
-  "limit-time r, 100000/instructions\n" +
-  "wait-for-routine r\n" +
-  "sandbox-state:number <- routine-state r/routine_id\n" +
+  "routine-id:number <- start-running interactive, screen\n" +
+  "limit-time routine-id, 100000/instructions\n" +
+  "wait-for-routine routine-id\n" +
+  "instructions-run:number <- number-of-instructions routine-id\n" +
+  "stash instructions-run [instructions run]\n" +
+  "sandbox-state:number <- routine-state routine-id\n" +
   "completed?:boolean <- equal sandbox-state, 1/completed\n" +
   "output:address:array:character <- $most-recent-products\n" +
   "errors:address:array:character <- save-errors\n" +
diff --git a/edit/010-sandbox-trace.mu b/edit/010-sandbox-trace.mu
index e7297b75..fd256732 100644
--- a/edit/010-sandbox-trace.mu
+++ b/edit/010-sandbox-trace.mu
@@ -41,6 +41,7 @@ recipe foo [
     .  stash [abc]                                     ┊0   edit          copy            delete         .
     .]                                                 ┊foo                                              .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊abc                                              .
+    .                                                  ┊8 instructions run                               .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                                  ┊                                                 .
   ]
@@ -51,6 +52,7 @@ recipe foo [
     .                                                  ┊                                                 .
     .                                                  ┊                                                 .
     .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊abc                                              .
+    .                                                  ┊8 instructions run                               .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                                  ┊                                                 .
   ]
@@ -115,7 +117,8 @@ recipe foo [
     .  stash [abc]                                     ┊0   edit          copy            delete         .
     .  reply 4                                         ┊foo                                              .
     .]                                                 ┊abc                                              .
-    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊4                                                .
+    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊8 instructions run                               .
+    .                                                  ┊4                                                .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                                  ┊                                                 .
   ]
@@ -140,6 +143,7 @@ scenario clicking-on-app-trace-does-nothing [
     .                                                  ┊0   edit          copy            delete         .
     .                                                  ┊stash 123456789                                  .
     .                                                  ┊123456789                                        .
+    .                                                  ┊6 instructions run                               .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                                  ┊                                                 .
   ]
@@ -158,6 +162,7 @@ scenario clicking-on-app-trace-does-nothing [
     .                                                  ┊0   edit          copy            delete         .
     .                                                  ┊stash 123456789                                  .
     .                                                  ┊123456789                                        .
+    .                                                  ┊6 instructions run                               .
     .                                                  ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .                                                  ┊                                                 .
   ]
diff --git a/edit/011-errors.mu b/edit/011-errors.mu
index c27ec54f..8e239e5d 100644
--- a/edit/011-errors.mu
+++ b/edit/011-errors.mu
@@ -684,8 +684,9 @@ reply b
     .a:number <- next-ingredient                       ┊0   edit          copy            delete         .
     .b:number <- next-ingredient                       ┊foo 4, 0                                         .
     .stash [dividing by], b                            ┊dividing by 0                                    .
-    ._, c:number <- divide-with-remainder a, b         ┊foo: divide by zero in '_, c:number <- divide-wi↩.
-    .reply b                                           ┊th-remainder a, b'                               .
-    .]                                                 ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
+    ._, c:number <- divide-with-remainder a, b         ┊14 instructions run                              .
+    .reply b                                           ┊foo: divide by zero in '_, c:number <- divide-wi↩.
+    .]                                                 ┊th-remainder a, b'                               .
+    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
   ]
 ]
/a> 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474