From 805d58c6aeeeba3e4989c0eed6781b3861e8fae0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 25 Jan 2018 22:39:31 -0800 Subject: 4199 --- html/016dilated_reagent.cc.html | 129 ++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 65 deletions(-) (limited to 'html/016dilated_reagent.cc.html') diff --git a/html/016dilated_reagent.cc.html b/html/016dilated_reagent.cc.html index 617a199a..9da1dc33 100644 --- a/html/016dilated_reagent.cc.html +++ b/html/016dilated_reagent.cc.html @@ -15,19 +15,18 @@ body { font-size: 12pt; font-family: monospace; color: #aaaaaa; background-color a { color:#eeeeee; text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.Conceal { color: #4e4e4e; } -.traceContains { color: #008000; } -.LineNr { color: #444444; } .Error { color: #ffffff; background-color: #ff6060; padding-bottom: 1px; } -.Identifier { color: #c0a020; } +.LineNr { color: #444444; } .Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Delimiter { color: #800080; } +.Special { color: #c00000; } +.Identifier { color: #c0a020; } .Normal { color: #aaaaaa; background-color: #080808; padding-bottom: 1px; } .Comment { color: #9090ff; } .Comment a { color:#0000ee; text-decoration:underline; } -.Delimiter { color: #800080; } -.Special { color: #c00000; } .cSpecial { color: #008000; } -.muRecipe { color: #ff8700; } +.traceContains { color: #008000; } --> @@ -123,33 +122,33 @@ if ('onhashchange' in window) { 59 char c; 60 list<char> open_brackets; 61 while (in >> c) { - 62 ¦ if (c == '(') open_brackets.push_back(c); - 63 ¦ if (c == ')') { - 64 ¦ ¦ if (open_brackets.empty() || open_brackets.back() != '(') { - 65 ¦ ¦ ¦ raise << "unbalanced ')'\n" << end(); - 66 ¦ ¦ ¦ continue; - 67 ¦ ¦ } - 68 ¦ ¦ assert(open_brackets.back() == '('); - 69 ¦ ¦ open_brackets.pop_back(); - 70 ¦ } - 71 ¦ if (c == '[') open_brackets.push_back(c); - 72 ¦ if (c == ']') { - 73 ¦ ¦ if (open_brackets.empty() || open_brackets.back() != '[') { - 74 ¦ ¦ ¦ raise << "unbalanced ']'\n" << end(); - 75 ¦ ¦ ¦ continue; - 76 ¦ ¦ } - 77 ¦ ¦ open_brackets.pop_back(); - 78 ¦ } - 79 ¦ if (c == '{') open_brackets.push_back(c); - 80 ¦ if (c == '}') { - 81 ¦ ¦ if (open_brackets.empty() || open_brackets.back() != '{') { - 82 ¦ ¦ ¦ raise << "unbalanced '}'\n" << end(); - 83 ¦ ¦ ¦ continue; - 84 ¦ ¦ } - 85 ¦ ¦ open_brackets.pop_back(); - 86 ¦ } - 87 ¦ result << c; - 88 ¦ if (open_brackets.empty()) break; + 62 if (c == '(') open_brackets.push_back(c); + 63 if (c == ')') { + 64 if (open_brackets.empty() || open_brackets.back() != '(') { + 65 raise << "unbalanced ')'\n" << end(); + 66 continue; + 67 } + 68 assert(open_brackets.back() == '('); + 69 open_brackets.pop_back(); + 70 } + 71 if (c == '[') open_brackets.push_back(c); + 72 if (c == ']') { + 73 if (open_brackets.empty() || open_brackets.back() != '[') { + 74 raise << "unbalanced ']'\n" << end(); + 75 continue; + 76 } + 77 open_brackets.pop_back(); + 78 } + 79 if (c == '{') open_brackets.push_back(c); + 80 if (c == '}') { + 81 if (open_brackets.empty() || open_brackets.back() != '{') { + 82 raise << "unbalanced '}'\n" << end(); + 83 continue; + 84 } + 85 open_brackets.pop_back(); + 86 } + 87 result << c; + 88 if (open_brackets.empty()) break; 89 } 90 skip_whitespace_and_comments_but_not_newline(in); 91 return result.str(); @@ -163,38 +162,38 @@ if ('onhashchange' in window) { 99 in.get(); // skip '{' 100 name = slurp_key(in); 101 if (name.empty()) { -102 ¦ raise << "invalid reagent '" << s << "' without a name\n" << end(); -103 ¦ return; +102 raise << "invalid reagent '" << s << "' without a name\n" << end(); +103 return; 104 } 105 if (name == "}") { -106 ¦ raise << "invalid empty reagent '" << s << "'\n" << end(); -107 ¦ return; +106 raise << "invalid empty reagent '" << s << "'\n" << end(); +107 return; 108 } 109 { -110 ¦ string s = next_word(in); -111 ¦ if (s.empty()) { -112 ¦ ¦ assert(!has_data(in)); -113 ¦ ¦ raise << "incomplete dilated reagent at end of file (0)\n" << end(); -114 ¦ ¦ return; -115 ¦ } -116 ¦ string_tree* type_names = new string_tree(s); -117 ¦ // End Parsing Dilated Reagent Type Property(type_names) -118 ¦ type = new_type_tree(type_names); -119 ¦ delete type_names; +110 string s = next_word(in); +111 if (s.empty()) { +112 assert(!has_data(in)); +113 raise << "incomplete dilated reagent at end of file (0)\n" << end(); +114 return; +115 } +116 string_tree* type_names = new string_tree(s); +117 // End Parsing Dilated Reagent Type Property(type_names) +118 type = new_type_tree(type_names); +119 delete type_names; 120 } 121 while (has_data(in)) { -122 ¦ string key = slurp_key(in); -123 ¦ if (key.empty()) continue; -124 ¦ if (key == "}") continue; -125 ¦ string s = next_word(in); -126 ¦ if (s.empty()) { -127 ¦ ¦ assert(!has_data(in)); -128 ¦ ¦ raise << "incomplete dilated reagent at end of file (1)\n" << end(); -129 ¦ ¦ return; -130 ¦ } -131 ¦ string_tree* value = new string_tree(s); -132 ¦ // End Parsing Dilated Reagent Property(value) -133 ¦ properties.push_back(pair<string, string_tree*>(key, value)); +122 string key = slurp_key(in); +123 if (key.empty()) continue; +124 if (key == "}") continue; +125 string s = next_word(in); +126 if (s.empty()) { +127 assert(!has_data(in)); +128 raise << "incomplete dilated reagent at end of file (1)\n" << end(); +129 return; +130 } +131 string_tree* value = new string_tree(s); +132 // End Parsing Dilated Reagent Property(value) +133 properties.push_back(pair<string, string_tree*>(key, value)); 134 } 135 return; 136 } @@ -203,14 +202,14 @@ if ('onhashchange' in window) { 139 string slurp_key(istream& in) { 140 string result = next_word(in); 141 if (result.empty()) { -142 ¦ assert(!has_data(in)); -143 ¦ raise << "incomplete dilated reagent at end of file (2)\n" << end(); -144 ¦ return result; +142 assert(!has_data(in)); +143 raise << "incomplete dilated reagent at end of file (2)\n" << end(); +144 return result; 145 } 146 while (!result.empty() && *result.rbegin() == ':') -147 ¦ strip_last(result); +147 strip_last(result); 148 while (isspace(in.peek()) || in.peek() == ':') -149 ¦ in.get(); +149 in.get(); 150 return result; 151 } -- cgit 1.4.1-2-gfad0