From f0eb35562a623c642af7ae5b9427ea85755cf3cd Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 8 Jul 2015 23:10:02 -0700 Subject: 1733 - load all recipes before running sandboxes This is starting to look good! I need to add some tests for render-string, but we'll see. --- 081run_interactive.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to '081run_interactive.cc') 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; +} -- cgit 1.4.1-2-gfad0