about summary refs log tree commit diff stats
path: root/081run_interactive.cc
diff options
context:
space:
mode:
Diffstat (limited to '081run_interactive.cc')
-rw-r--r--081run_interactive.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/081run_interactive.cc b/081run_interactive.cc
index 6d12e368..e9f42041 100644
--- a/081run_interactive.cc
+++ b/081run_interactive.cc
@@ -15,6 +15,8 @@ recipe main [
 # result is null
 +mem: storing 0 in location 1
 
+//: run code in 'interactive mode', i.e. with warnings off, and recording
+//: output in case we want to print it to screen
 :(before "End Primitive Recipe Declarations")
 RUN_INTERACTIVE,
 :(before "End Primitive Recipe Numbers")
@@ -213,3 +215,21 @@ long long int warnings_from_trace() {
   assert(!out.str().empty());
   return new_string(out.str());
 }
+
+//: simpler version of run-interactive: doesn't do any running, just loads
+//: recipes and reports warnings.
+:(before "End Primitive Recipe Declarations")
+RELOAD,
+:(before "End Primitive Recipe Numbers")
+Recipe_ordinal["reload"] = RELOAD;
+:(before "End Primitive Recipe Implementations")
+case RELOAD: {
+  assert(scalar(ingredients.at(0)));
+  Hide_warnings = true;
+  load(to_string(ingredients.at(0).at(0)));
+  transform_all();
+  Hide_warnings = false;
+  products.resize(1);
+  products.at(0).push_back(warnings_from_trace());
+  break;
+}