diff options
-rw-r--r-- | 050scenario.cc | 5 | ||||
-rw-r--r-- | edit.mu | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/050scenario.cc b/050scenario.cc index cfaedc24..e5e0878e 100644 --- a/050scenario.cc +++ b/050scenario.cc @@ -60,6 +60,7 @@ struct scenario { :(before "End Globals") vector<scenario> Scenarios; +set<string> Scenario_names; //:: Parse the 'scenario' form. //: Simply store the text of the scenario. @@ -75,6 +76,9 @@ scenario parse_scenario(istream& in) { scenario result; result.name = next_word(in); //? cerr << "scenario: " << result.name << '\n'; //? 2 + if (Scenario_names.find(result.name) != Scenario_names.end()) + raise << "duplicate scenario name: " << result.name << '\n' << end(); + Scenario_names.insert(result.name); skip_whitespace_and_comments(in); assert(in.peek() == '['); // scenarios are take special 'code' strings so we need to ignore brackets @@ -622,6 +626,7 @@ recipe main [ :(code) // just for the scenarios running scenarios in C++ layers void run_mu_scenario(const string& form) { + Scenario_names.clear(); //? cerr << form << '\n'; //? 1 istringstream in(form); in >> std::noskipws; diff --git a/edit.mu b/edit.mu index fd1b8243..43d7b864 100644 --- a/edit.mu +++ b/edit.mu @@ -1117,7 +1117,7 @@ d] check-trace-count-for-label 1, [print-character] ] -scenario editor-inserts-characters-at-cursor-5 [ +scenario editor-inserts-characters-at-cursor-6 [ assume-screen 10/width, 5/height 1:address:array:character <- new [abc d] |