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-10-29 13:01:04 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-29 13:01:04 -0700
commitdf40cb6e4d9d274b618682c315545d5c55508fa5 (patch)
tree2500f56dae28518c4d2f2cf29b90259d4d21c23f /056recipe_header.cc
parent30277d2e370210b17099387abf03e75199340e98 (diff)
downloadmu-df40cb6e4d9d274b618682c315545d5c55508fa5.tar.gz
2316 - preparing for static dispatch
Diffstat (limited to '056recipe_header.cc')
-rw-r--r--056recipe_header.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc
index 0c09cb75..bba301b1 100644
--- a/056recipe_header.cc
+++ b/056recipe_header.cc
@@ -16,10 +16,13 @@ recipe add2 x:number, y:number -> z:number [
 //: When loading recipes save any header.
 
 :(before "End recipe Fields")
+bool has_header;
 vector<reagent> ingredients;
 vector<reagent> products;
+:(before "End recipe Constructor")
+has_header = false;
 
-:(before "slurp_body(in, result);" following "long long int slurp_recipe(istream& in)")
+:(before "End recipe Refinements")
 skip_whitespace(in);
 if (in.peek() != '[') {
   trace(9999, "parse") << "recipe has a header; parsing";
@@ -28,6 +31,7 @@ if (in.peek() != '[') {
 
 :(code)
 void load_recipe_header(istream& in, recipe& result) {
+  result.has_header = true;
   while (in.peek() != '[') {
     string s = next_word(in);
     if (s == "->") break;
@@ -41,6 +45,7 @@ void load_recipe_header(istream& in, recipe& result) {
     trace(9999, "parse") << "header product: " << result.products.back().original_string << end();
     skip_whitespace(in);
   }
+  // End Load Recipe Header(result)
 }
 
 //: Now rewrite 'load-ingredients' to instructions to create all reagents in