about summary refs log tree commit diff stats
path: root/050scenario.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-12-12 10:01:12 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-12-12 10:07:59 -0800
commit49620728e805a3bbc3477c14b8b6ef7e2b5d3ead (patch)
treec80ecf970ec78dfc0c40944a4b9e827c0eb77078 /050scenario.cc
parentd81fcff20567a1d5e793e813bc761222885660b1 (diff)
downloadmu-49620728e805a3bbc3477c14b8b6ef7e2b5d3ead.tar.gz
3707
Be more disciplined about tagging 2 different concepts in the codebase:

a) Use the phrase "later layers" to highlight places where a layer
doesn't have the simplest possible self-contained implementation.

b) Use the word "hook" to point out functions that exist purely to
provide waypoints for extension by future layers.

Since both these only make sense in the pre-tangled representation of
the codebase, using '//:' and '#:' comments to get them stripped out of
tangled output.

(Though '#:' comments still make it to tangled output at the moment.
Let's see if we use it enough to be worth supporting. Scenarios are
pretty unreadable in tangled output anyway.)
Diffstat (limited to '050scenario.cc')
-rw-r--r--050scenario.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/050scenario.cc b/050scenario.cc
index d67b51e0..5e19c5db 100644
--- a/050scenario.cc
+++ b/050scenario.cc
@@ -220,6 +220,12 @@ void run_mu_scenario(const scenario& s) {
   Current_scenario = NULL;
 }
 
+//: Permit numeric locations to be accessed in scenarios.
+:(before "End check_default_space Special-cases")
+// user code should never create recipes with underscores in their names
+if (caller.name.find("scenario_") == 0) return;  // skip Mu scenarios which will use raw memory locations
+if (caller.name.find("run_") == 0) return;  // skip calls to 'run', which should be in scenarios and will also use raw memory locations
+
 //: Some variables for fake resources always get special /raw addresses in scenarios.
 
 // Should contain everything passed by is_special_name but failed by is_disqualified.