From dbe124108b7a3529feeeba91339928c4ac737072 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 23 Jun 2015 14:02:12 -0700 Subject: 1631 - update html versions Html is a little more readable thanks to feedback from J David Eisenberg (https://news.ycombinator.com/item?id=9766330), in particular the suggestion to use https://addons.mozilla.org/En-us/firefox/addon/wcag-contrast-checker. --- html/050scenario.cc.html | 54 +++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) (limited to 'html/050scenario.cc.html') diff --git a/html/050scenario.cc.html b/html/050scenario.cc.html index 18576b21..ae05aa68 100644 --- a/html/050scenario.cc.html +++ b/html/050scenario.cc.html @@ -12,16 +12,16 @@ @@ -110,11 +110,18 @@ scenario parse_scenario(istream& in//? cerr << "parse scenario\n"; //? 1 scenario result; result.name = next_word(in); +//? cerr << "scenario: " << result.name << '\n'; //? 2 skip_whitespace_and_comments(in); assert(in.peek() == '['); // scenarios are take special 'code' strings so we need to ignore brackets // inside comments - result.to_run = slurp_quoted_ignoring_comments(in); + result.to_run = slurp_quoted(in); + // delete [] delimiters + assert(result.to_run.at(0) == '['); + result.to_run.erase(0, 1); +//? cerr << (int)result.to_run.at(SIZE(result.to_run)-1) << '\n'; //? 1 + assert(result.to_run.at(SIZE(result.to_run)-1) == ']'); + result.to_run.erase(SIZE(result.to_run)-1); return result; } @@ -161,13 +168,16 @@ const scenario* Current_scenario = NULL(const scenario& s) { Current_scenario = &s; bool not_already_inside_test = !Trace_stream; +//? cerr << s.name << '\n'; //? 4 if (not_already_inside_test) { Trace_file = s.name; Trace_stream = new trace_stream; setup(); } -//? cerr << '^' << s.to_run << "$\n"; //? 1 +//? cerr << '^' << s.to_run << "$\n"; //? 4 + assert(Routines.empty()); run("recipe "+s.name+" [ " + s.to_run + " ]"); +//? cerr << s.name << " done\n"; //? 1 if (not_already_inside_test && Trace_stream) { teardown(); ofstream fout((Trace_dir+Trace_file).c_str()); @@ -557,36 +567,6 @@ void run_mu_scenario(const string& form(in); run_mu_scenario(s); } - -string slurp_quoted_ignoring_comments(istream& in) { - assert(in.get() == '['); // drop initial '[' - char c; - ostringstream out; - while (in >> c) { -//? cerr << c << '\n'; //? 3 - if (c == '#') { - // skip comment - in.putback(c); - skip_comment(in); - continue; - } - if (c == '[') { - // nested strings won't detect comments - // can't yet handle scenarios inside strings inside scenarios.. - in.putback(c); - out << slurp_quoted(in); -//? cerr << "snapshot: ^" << out.str() << "$\n"; //? 1 - continue; - } - if (c == ']') { - // must be at the outermost level; drop final ']' - break; - } - out << c; - } -//? cerr << "done\n"; //? 2 - return out.str(); -} -- cgit 1.4.1-2-gfad0