about summary refs log tree commit diff stats
path: root/cpp/002main.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-02-17 13:28:28 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-02-17 13:28:28 -0800
commit0c0eee435482df5e58634cf7d26e3016bba4cf12 (patch)
tree62ab71c70399db019d99375cc9fde81bc640b50f /cpp/002main.cc
parentd51db07c6fd4f661220730b9c9470a7267869ba2 (diff)
downloadmu-0c0eee435482df5e58634cf7d26e3016bba4cf12.tar.gz
772
Diffstat (limited to 'cpp/002main.cc')
-rw-r--r--cpp/002main.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/cpp/002main.cc b/cpp/002main.cc
index 0eaea16a..ec03cf45 100644
--- a/cpp/002main.cc
+++ b/cpp/002main.cc
@@ -165,7 +165,9 @@ void setup_types() {
 }
 
 void setup_recipes() {
-  Recipe.clear();  Recipe_number.clear();  Next_recipe_number = 1;
+  Recipe.clear();  Recipe_number.clear();
+  Recipe_number["idle"] = 0;
+  Next_recipe_number = 1;
   Recipe_number["copy"] = Next_recipe_number++;
 //?   dbg << "AAA " << Recipe_number["copy"] << '\n'; //? 1
 }
@@ -220,6 +222,14 @@ bool next_instruction(istream& in, instruction* curr) {
 //?   cout << '\n'; //? 1
 //?   return true; //? 1
 
+  if (words.size() == 1 && *(words[0].end()-1) == ':') {
+    curr->is_label = true;
+    words[0].erase(words[0].end()-1);
+    curr->label = words[0];
+    trace("parse") << "label: " << curr->label;
+    return !in.eof();
+  }
+
   vector<string>::iterator p = words.begin();
   if (find(words.begin(), words.end(), "<-") != words.end()) {
 //?     cout << "instruction yields products\n"; //? 1