From beea7ce25cfe42c363259705a6b5741ad47484ab Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 22 Oct 2016 04:04:46 -0700 Subject: 3543 --- html/053recipe_header.cc.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'html/053recipe_header.cc.html') diff --git a/html/053recipe_header.cc.html b/html/053recipe_header.cc.html index 5e9a957c..cce0a02f 100644 --- a/html/053recipe_header.cc.html +++ b/html/053recipe_header.cc.html @@ -21,7 +21,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.Identifier { color: #ecf32c; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Error { color: #ffffff; background-color: #ff6060; padding-bottom: 1px; } .SalientComment { color: #00ffff; } @@ -71,6 +71,11 @@ has_header = false; result.has_header = true; while (has_data(in) && in.peek() != '[' && in.peek() != '\n') { string s = next_word(in); + if (s.empty()) { + assert(!has_data(in)); + raise << "incomplete recipe header at end of file (0)\n" << end(); + return; + } if (s == "<-") raise << "recipe " << result.name << " should say '->' and not '<-'\n" << end(); if (s == "->") break; @@ -80,6 +85,11 @@ has_header = false; } while (has_data(in) && in.peek() != '[' && in.peek() != '\n') { string s = next_word(in); + if (s.empty()) { + assert(!has_data(in)); + raise << "incomplete recipe header at end of file (1)\n" << end(); + return; + } result.products.push_back(reagent(s)); trace(9999, "parse") << "header product: " << result.products.back().original_string << end(); skip_whitespace_but_not_newline(in); @@ -242,9 +252,7 @@ put(Recipe_ordinal,else { products.resize(2); // pad the first product with sufficient zeros to match its type - int size = size_of(current_instruction().products.at(0)); - for (int i = 0; i < size; ++i) - products.at(0).push_back(0); + products.at(0).resize(size_of(current_instruction().products.at(0))); products.at(1).push_back(0); } break; -- cgit 1.4.1-2-gfad0