about summary refs log tree commit diff stats
path: root/056recipe_header.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-12-02 18:17:59 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-12-02 18:17:59 -0800
commit3c93ddcbaa5edd4e2c0404c3ef0b149b2a33a9f6 (patch)
tree96b63d6eb8bfab181379e531941b14c89a878580 /056recipe_header.cc
parent1f7e3c056ce0ea71e1337579b24e8fd1ad26abac (diff)
downloadmu-3c93ddcbaa5edd4e2c0404c3ef0b149b2a33a9f6.tar.gz
2615
We don't actually need skip_whitespace_AND_comments_BUT_NOT_newline
anywhere except next_word(). Perhaps what I should really do is split
the definition of next_word() into two variants..
Diffstat (limited to '056recipe_header.cc')
-rw-r--r--056recipe_header.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc
index 2ca02af7..ccfe42d3 100644
--- a/056recipe_header.cc
+++ b/056recipe_header.cc
@@ -36,28 +36,17 @@ void load_recipe_header(istream& in, recipe& result) {
     if (s == "->") break;
     result.ingredients.push_back(reagent(s));
     trace(9999, "parse") << "header ingredient: " << result.ingredients.back().original_string << end();
-    skip_whitespace_and_comments_but_not_newline(in);
+    skip_whitespace_but_not_newline(in);
   }
   while (has_data(in) && in.peek() != '[' && in.peek() != '\n') {
     string s = next_word(in);
     result.products.push_back(reagent(s));
     trace(9999, "parse") << "header product: " << result.products.back().original_string << end();
-    skip_whitespace_and_comments_but_not_newline(in);
+    skip_whitespace_but_not_newline(in);
   }
   // End Load Recipe Header(result)
 }
 
-void skip_whitespace_and_comments_but_not_newline(istream& in) {
-  while (true) {
-    if (!has_data(in)) break;
-    if (in.peek() == '\n') break;
-    if (isspace(in.peek())) in.get();
-    else if (Ignore.find(in.peek()) != string::npos) in.get();
-    else if (in.peek() == '#') skip_comment(in);
-    else break;
-  }
-}
-
 :(scenario recipe_handles_stray_comma)
 recipe main [
   1:number/raw <- add2 3, 5