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-07-08 13:26:02 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-08 13:37:43 -0700
commit2e8c5d39157d1178ad453c86d94d4e1830d8dfe6 (patch)
tree7fe460af6045a8fa161c19acb2021f46ec9cdb46 /081run_interactive.cc
parent6dc1379b5ab74bbd081a4e059cd04257ba7272c3 (diff)
downloadmu-2e8c5d39157d1178ad453c86d94d4e1830d8dfe6.tar.gz
1723
Some reorg before we start plumbing 'reply' from 'run-interactive' to
return a string containing the results.
Diffstat (limited to '081run_interactive.cc')
-rw-r--r--081run_interactive.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/081run_interactive.cc b/081run_interactive.cc
index fd076c06..bf995c39 100644
--- a/081run_interactive.cc
+++ b/081run_interactive.cc
@@ -36,13 +36,11 @@ case RUN_INTERACTIVE: {
 }
 
 :(code)
-// reads a string, tries to call it as code.
+// reads a string, tries to call it as code, saving all warnings.
 // returns true if successfully called (no errors found during load and transform)
 bool run_interactive(long long int address) {
   long long int size = Memory[address];
-  if (size == 0) {
-    return false;
-  }
+  if (size == 0) return false;
   ostringstream tmp;
   for (long long int curr = address+1; curr <= address+size; ++curr) {
     // todo: unicode
@@ -65,6 +63,15 @@ bool run_interactive(long long int address) {
   return true;
 }
 
+:(after "Starting Reply")
+if (current_recipe_name() == "interactive") clean_up_interactive();
+:(after "Falling Through End Of Recipe")
+if (current_recipe_name() == "interactive") clean_up_interactive();
+:(code)
+void clean_up_interactive() {
+  Hide_warnings = false;
+}
+
 string strip_comments(string in) {
   ostringstream result;
   for (long long int i = 0; i < SIZE(in); ++i) {