about summary refs log tree commit diff stats
path: root/081run_interactive.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-07 00:22:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-07 00:22:49 -0700
commit7afe09fbfeb88e3be98dfe4f0db43f66724d4abf (patch)
tree0592cc6cf3e98aa25ec9c35b638a56baeff1d5e3 /081run_interactive.cc
parent857adbc496dca7d41e46cbece815a24d32c735fe (diff)
downloadmu-7afe09fbfeb88e3be98dfe4f0db43f66724d4abf.tar.gz
2262 - strengthen some type checks
Diffstat (limited to '081run_interactive.cc')
-rw-r--r--081run_interactive.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/081run_interactive.cc b/081run_interactive.cc
index e4c847f1..81c49d42 100644
--- a/081run_interactive.cc
+++ b/081run_interactive.cc
@@ -12,10 +12,11 @@ recipe main [
 
 :(scenario run_interactive_empty)
 recipe main [
-  1:address:array:character <- run-interactive 0
+  1:address:array:character <- copy 0/raw
+  2:address:array:character <- run-interactive 1:address:array:character
 ]
 # result is null
-+mem: storing 0 in location 1
++mem: storing 0 in location 2
 
 //: run code in 'interactive mode', i.e. with errors+warnings off and return:
 //:   stringified output in case we want to print it to screen
@@ -32,7 +33,7 @@ case RUN_INTERACTIVE: {
     raise_error << maybe(Recipe[r].name) << "'run-interactive' requires exactly one ingredient, but got " << inst.to_string() << '\n' << end();
     break;
   }
-  if (!is_mu_scalar(inst.ingredients.at(0))) {
+  if (!is_mu_string(inst.ingredients.at(0))) {
     raise_error << maybe(Recipe[r].name) << "first ingredient of 'run-interactive' should be a string, but got " << inst.ingredients.at(0).to_string() << '\n' << end();
     break;
   }
@@ -138,7 +139,7 @@ load(string(
   "completed?:boolean <- equal sandbox-state, 1/completed\n" +
   "output:address:array:character <- $most-recent-products\n" +
   "warnings:address:array:character <- save-errors-warnings\n" +
-  "stashes:address:array:character <- save-trace [app]\n" +
+  "stashes:address:array:character <- save-app-trace\n" +
   "$cleanup-run-interactive\n" +
   "reply output, warnings, screen, stashes, completed?\n" +
 "]\n");
@@ -217,15 +218,15 @@ case SAVE_ERRORS_WARNINGS: {
 }
 
 :(before "End Primitive Recipe Declarations")
-SAVE_TRACE,
+SAVE_APP_TRACE,
 :(before "End Primitive Recipe Numbers")
-Recipe_ordinal["save-trace"] = SAVE_TRACE;
+Recipe_ordinal["save-app-trace"] = SAVE_APP_TRACE;
 :(before "End Primitive Recipe Checks")
-case SAVE_TRACE: {
+case SAVE_APP_TRACE: {
   break;
 }
 :(before "End Primitive Recipe Implementations")
-case SAVE_TRACE: {
+case SAVE_APP_TRACE: {
   products.resize(1);
   products.at(0).push_back(trace_app_contents());
   break;
@@ -393,8 +394,8 @@ case RELOAD: {
     raise_error << maybe(Recipe[r].name) << "'reload' requires exactly one ingredient, but got " << inst.to_string() << '\n' << end();
     break;
   }
-  if (!is_mu_scalar(inst.ingredients.at(0))) {
-    raise_error << maybe(Recipe[r].name) << "first ingredient of 'reload' should be a literal string, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+  if (!is_mu_string(inst.ingredients.at(0))) {
+    raise_error << maybe(Recipe[r].name) << "first ingredient of 'reload' should be a string, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }
   break;