about summary refs log tree commit diff stats
path: root/050scenario.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-27 11:27:50 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-27 11:27:50 -0700
commit1326a4ec1ba2dfa093f8cf66e02d93ff7f4cebc6 (patch)
treebffbf0999e8c017e00f146930cc4c378461393e8 /050scenario.cc
parentab3aa2d4c141c30958f65aaf5bd86091b0e61621 (diff)
downloadmu-1326a4ec1ba2dfa093f8cf66e02d93ff7f4cebc6.tar.gz
1483 - *really* check color screens in scenarios
Required fixing two levels of bugs:

a) The hack in tangle to drop initial comments a '%' directive..

b) ..was masking a bug where run_mu_scenario wasn't robust to initial
comments.

Mildly concerned that neither of the sub-issues have their own tests,
but I'm just removing hacks, and writing tests for that throwaway
function like run_mu_scenario seems pointless. Instead I've solved the
problem by disallowing comments before '%' directives.

I've also taken this opportunity to at least try to document the
'scenarios' and '%' directives at the first layer where they appear.
Diffstat (limited to '050scenario.cc')
-rw-r--r--050scenario.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/050scenario.cc b/050scenario.cc
index c4acc688..06c14c8e 100644
--- a/050scenario.cc
+++ b/050scenario.cc
@@ -494,8 +494,9 @@ recipe main [
 void run_mu_scenario(const string& form) {
   istringstream in(form);
   in >> std::noskipws;
+  skip_whitespace_and_comments(in);
   string _scenario = next_word(in);
-//?   cout << _scenario << '\n'; //? 1
+//?   cout << _scenario << '\n'; //? 2
   assert(_scenario == "scenario");
   scenario s = parse_scenario(in);
   run_mu_scenario(s);