diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-04-13 20:52:04 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-04-13 20:52:04 -0700 |
commit | d2f360d85eb9129983fc77a7d756ddd0676dd9dc (patch) | |
tree | 2ca4b2b63470cb1e4bd64c015d2e146ca100e804 /subx | |
parent | 7e32b35c9c54e111841f0ed4f9f7343367055460 (diff) | |
download | mu-d2f360d85eb9129983fc77a7d756ddd0676dd9dc.tar.gz |
5089
Fix CI; unfortunately it runs C++98.
Diffstat (limited to 'subx')
-rw-r--r-- | subx/003trace.cc | 8 | ||||
-rw-r--r-- | subx/038---literal_strings.cc | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/subx/003trace.cc b/subx/003trace.cc index e1dadaf6..590fb7fa 100644 --- a/subx/003trace.cc +++ b/subx/003trace.cc @@ -131,16 +131,16 @@ struct trace_line { string unescape_newline(string& s) { std::stringstream ss; - for(char c : s) { - if(c == '\n') + for (int i = 0; i < SIZE(s); ++i) { + if (s.at(i) == '\n') ss << "\\n"; else - ss << c; + ss << s.at(i); } return ss.str(); } -void dump_trace_line(ostream& s, trace_line &t) { +void dump_trace_line(ostream& s, trace_line& t) { s << std::setw(4) << t.depth << ' ' << t.label << ": " << unescape_newline(t.contents) << '\n'; } diff --git a/subx/038---literal_strings.cc b/subx/038---literal_strings.cc index 19ed2690..407470ff 100644 --- a/subx/038---literal_strings.cc +++ b/subx/038---literal_strings.cc @@ -123,11 +123,11 @@ void parse_instruction_character_by_character(const string& line_data, vector<li d << c; while (has_data(in)) { in >> c; - if(c == '\\') { + if (c == '\\') { in >> c; - if(c == 'n') d << '\n'; - else if(c == 't') d << '\t'; - else if(c == '"') d << '"'; + if (c == 'n') d << '\n'; + else if (c == 't') d << '\t'; + else if (c == '"') d << '"'; else { raise << "parse_instruction_character_by_character: unknown escape sequence '\\" << c << "'\n" << end(); return; |