From 07efdfd7072d84209b419e66e5a2b48a0c78b2ac Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 20 Apr 2015 11:05:14 -0700 Subject: 1110 - 'scenarios' directive applies only to current file --- cpp/013literal_string | 1 + cpp/014types | 1 + cpp/020run | 1 - cpp/041name | 1 - cpp/043space | 1 - cpp/050scenario | 2 -- cpp/tangle/030tangle.cc | 5 +++-- 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(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 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::iterator p = result.begin(); p != result.end(); ++p) @@ -36,8 +39,6 @@ void tangle(istream& in, list& out) { trace_all("tangle", out); } -string Toplevel = "run"; - void process_next_hunk(istream& in, const string& directive, list& out) { list hunk; hunk.push_back(line_directive(Line_number, Filename)); -- cgit 1.4.1-2-gfad0