about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-20 11:05:14 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-20 11:05:14 -0700
commit07efdfd7072d84209b419e66e5a2b48a0c78b2ac (patch)
treed5983420d8b867b9f34fea4bd4c08d9b56220df8
parented84cba28ab0a00fca80807228afd71d3a00ac44 (diff)
downloadmu-07efdfd7072d84209b419e66e5a2b48a0c78b2ac.tar.gz
1110 - 'scenarios' directive applies only to current file
-rw-r--r--cpp/013literal_string1
-rw-r--r--cpp/014types1
-rw-r--r--cpp/020run1
-rw-r--r--cpp/041name1
-rw-r--r--cpp/043space1
-rw-r--r--cpp/050scenario2
-rw-r--r--cpp/tangle/030tangle.cc5
7 files changed, 5 insertions, 7 deletions
diff --git a/cpp/013literal_string b/cpp/013literal_string
index 8dc8c1b5..965f3f60 100644
--- a/cpp/013literal_string
+++ b/cpp/013literal_string
@@ -5,6 +5,7 @@
 //: imagine that 'recipe' might one day itself be defined in mu, doing its own
 //: parsing.
 
+:(scenarios add_recipes)
 :(scenario "string_literal")
 recipe main [
   1:address:array:character <- new [abc def]
diff --git a/cpp/014types b/cpp/014types
index f12aa6f8..60f9c845 100644
--- a/cpp/014types
+++ b/cpp/014types
@@ -1,5 +1,6 @@
 //: Textual form for types.
 
+:(scenarios "add_recipes")
 :(scenario "container")
 container foo [
   x:integer
diff --git a/cpp/020run b/cpp/020run
index 02a949f0..164bc5ac 100644
--- a/cpp/020run
+++ b/cpp/020run
@@ -9,7 +9,6 @@
 //: does nothing, and COPY, which can copy numbers from one memory location to
 //: another. Later layers will add more primitives.
 
-:(scenarios run)
 :(scenario copy_literal)
 recipe main [
   1:integer <- copy 23:literal
diff --git a/cpp/041name b/cpp/041name
index 64a416af..f4c1dffd 100644
--- a/cpp/041name
+++ b/cpp/041name
@@ -2,7 +2,6 @@
 //: locations. In mu, a transform called 'convert-names' provides this
 //: convenience.
 
-:(scenarios run)
 :(scenario "convert_names")
 recipe main [
   x:integer <- copy 0:literal
diff --git a/cpp/043space b/cpp/043space
index cc9c161e..4db3c725 100644
--- a/cpp/043space
+++ b/cpp/043space
@@ -2,7 +2,6 @@
 //: and all addresses in arguments are implicitly based on the 'default-space'
 //: (unless they have the /raw property)
 
-:(scenarios run)
 :(scenario "set_default_space")
 # if default-space is 10, and if an array of 5 locals lies from location 11 to 15 (inclusive),
 # then location 0 is really location 11, location 1 is really location 12, and so on.
diff --git a/cpp/050scenario b/cpp/050scenario
index 9fe50f2d..ff2a43dc 100644
--- a/cpp/050scenario
+++ b/cpp/050scenario
@@ -181,5 +181,3 @@ string &rtrim(string &s) {
   s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(isspace))).base(), s.end());
   return s;
 }
-
-:(scenarios run)
diff --git a/cpp/tangle/030tangle.cc b/cpp/tangle/030tangle.cc
index bbd0e178..1e30cc3c 100644
--- a/cpp/tangle/030tangle.cc
+++ b/cpp/tangle/030tangle.cc
@@ -4,12 +4,15 @@
 
 size_t Line_number = 0;
 string Filename;
+string Toplevel = "run";
 
 int tangle(int argc, const char* argv[]) {
   list<string> result;
   for (int i = 1; i < argc; ++i) {
+//?     cerr << "new file " << argv[i] << '\n'; //? 1
     ifstream in(argv[i]);
     Filename = argv[i];
+    Toplevel = "run";
     tangle(in, result);
   }
   for (list<string>::iterator p = result.begin(); p != result.end(); ++p)
@@ -36,8 +39,6 @@ void tangle(istream& in, list<string>& out) {
   trace_all("tangle", out);
 }
 
-string Toplevel = "run";
-
 void process_next_hunk(istream& in, const string& directive, list<string>& out) {
   list<string> hunk;
   hunk.push_back(line_directive(Line_number, Filename));