about summary refs log tree commit diff stats
path: root/cpp
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-16 21:14:16 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-16 21:14:16 -0700
commit3a787ca752d2b931c71ed6f34a5aecbf40b8be23 (patch)
treee8fd9aa26ae02f35012a9f4b3e7f8506c76c6080 /cpp
parent37e4573b9382707a0c345246d7507dc269bd0df3 (diff)
downloadmu-3a787ca752d2b931c71ed6f34a5aecbf40b8be23.tar.gz
935 - permit '{' and '}' as legal labels
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)
hut@lavabit.com> 2010-01-26 20:03:54 +0100 committer hut <hut@lavabit.com> 2010-01-26 20:03:54 +0100 added unittest for flatten and unique' href='/akspecs/ranger/commit/test/tc_ext.py?h=v1.7.2&id=5a087b1667813ad75f84d0cfbe38babd428bf5d6'>5a087b16 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145