about summary refs log tree commit diff stats
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/.traces/parse_label2
-rw-r--r--cpp/011load7
2 files changed, 4 insertions, 5 deletions
diff --git a/cpp/.traces/parse_label b/cpp/.traces/parse_label
index ba16e988..e32481af 100644
--- a/cpp/.traces/parse_label
+++ b/cpp/.traces/parse_label
@@ -1 +1 @@
-parse/0: label: foo
+parse/0: label: +foo
diff --git a/cpp/011load b/cpp/011load
index 0891a247..9806bfd0 100644
--- a/cpp/011load
+++ b/cpp/011load
@@ -70,9 +70,8 @@ bool next_instruction(istream& in, instruction* curr) {
     return false;  // end of recipe
   }
 
-  if (words.size() == 1 && *(words[0].end()-1) == ':') {
+  if (words.size() == 1 && !isalnum(words[0][0])) {
     curr->is_label = true;
-    words[0].erase(words[0].end()-1);
     curr->label = words[0];
     trace("parse") << "label: " << curr->label;
     return !in.eof();
@@ -153,9 +152,9 @@ void skip_comma(istream& in) {
 
 :(scenario parse_label)
 recipe main [
-  foo:
+  +foo
 ]
-+parse: label: foo
++parse: label: +foo
 -parse: instruction: 1
 
 :(scenario parse_multiple_products)