about summary refs log tree commit diff stats
path: root/config.default.h
diff options
context:
space:
mode:
Diffstat (limited to 'config.default.h')
-rw-r--r--config.default.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.default.h b/config.default.h
index 9eaef03..14f33ec 100644
--- a/config.default.h
+++ b/config.default.h
@@ -48,9 +48,9 @@ static Key key[] = { \
 };
 
 #define RULES \
-	const unsigned int tag2[] = { 2 }; \
+	const unsigned int two[] = { 2 }; \
 static Rule rule[] = { \
 	/* class:instance	tags		isfloat */ \
-	{ "Firefox.*",		tag2,	False }, \
+	{ "Firefox.*",		two,	False }, \
 	{ "Gimp.*",		NULL,		True}, \
 };
ory.py?h=v1.9.3&id=419e4aa53fc99c29dce66cd46b7f894efd2d57a8'>419e4aa5 ^
3ea48208 ^


65cb1a32 ^
b0f0027f ^
3ea48208 ^
419e4aa5 ^




fae694a0 ^
b0f0027f ^
fae694a0 ^
92abe81a ^
fae694a0 ^

(scenario jump_to_label)
recipe main [
  jump +target:offset
  1:integer <- copy 0:literal
  +target
]
-mem: storing 0 in location 1

:(after "int main")
  Transform.push_back(transform_labels);

:(code)
void transform_labels(const recipe_number r) {
  map<string, index_t> offset;
  for (index_t i = 0; i < Recipe[r].steps.size(); ++i) {
    const instruction& inst = Recipe[r].steps.at(i);
    if (!inst.label.empty()) offset[inst.label] = i;
  }
  for (index_t i = 0; i < Recipe[r].steps.size(); ++i) {
    instruction& inst = Recipe[r].steps.at(i);
    if (inst.operation == Recipe_number["jump"]) {
//?       cerr << inst.to_string() << '\n'; //? 1
      replace_offset(inst.ingredients.at(0), offset, i, r);
    }
    if (inst.operation == Recipe_number["jump-if"] || inst.operation == Recipe_number["jump-unless"]) {
      replace_offset(inst.ingredients.at(1), offset, i, r);
    }
    if ((inst.operation == Recipe_number["loop"] || inst.operation == Recipe_number["break"])
        && inst.ingredients.size() == 1) {
      replace_offset(inst.ingredients.at(0), offset, i, r);
    }
    if ((inst.operation == Recipe_number["loop-if"] || inst.operation == Recipe_number["loop-unless"]
            || inst.operation == Recipe_number["break-if"] || inst.operation == Recipe_number["break-unless"])
        && inst.ingredients.size() == 2) {
      replace_offset(inst.ingredients.at(1), offset, i, r);
    }
  }
}

:(code)
void replace_offset(reagent& x, /*const*/ map<string, index_t>& offset, const index_t current_offset, const recipe_number r) {
//?   cerr << "AAA " << x.to_string() << '\n'; //? 1
  assert(isa_literal(x));
//?   cerr << "BBB " << x.to_string() << '\n'; //? 1
  assert(!x.initialized);
//?   cerr << "CCC " << x.to_string() << '\n'; //? 1
  if (is_number(x.name)) return;  // non-labels will be handled like other integer operands
//?   cerr << "DDD " << x.to_string() << '\n'; //? 1
  if (offset.find(x.name) == offset.end())
    raise << "can't find label " << x.name << " in routine " << Recipe[r].name << '\n';
  x.set_value(offset[x.name]-current_offset);
}

:(scenario break_to_label)
recipe main [
#?   $print [aaa]
  {
    {
      break +target:offset
      1:integer <- copy 0:literal
    }
  }
  +target
]
-mem: storing 0 in location 1

:(scenario jump_if_to_label)
recipe main [
  {
    {
      jump-if 1:literal, +target:offset
      1:integer <- copy 0:literal
    }
  }
  +target
]
-mem: storing 0 in location 1

:(scenario loop_unless_to_label)
recipe main [
  {
    {
      loop-unless 0:literal, +target:offset  # loop/break with a label don't care about braces
      1:integer <- copy 0:literal
    }
  }
  +target
]
-mem: storing 0 in location 1

:(scenario jump_runs_code_after_label)
recipe main [
  # first a few lines of padding to exercise the offset computation
  1:integer <- copy 0:literal
  2:integer <- copy 0:literal
  3:integer <- copy 0:literal
  jump +target:offset
  4:integer <- copy 0:literal
  +target
  5:integer <- copy 0:literal
]
+mem: storing 0 in location 5
-mem: storing 0 in location 4
on' href='/akspecs/ranger/blame/ranger/directory.py?h=v1.9.3&id=9f36be13fa069a2a14fda8f2812269c4227d532f'>^
dd7a4f63 ^
419e4aa5 ^

dd7a4f63 ^



db9bb0c9 ^
dd7a4f63 ^
db9bb0c9 ^
ffec67de ^






















dd7a4f63 ^
db9bb0c9 ^
419e4aa5 ^
db9bb0c9 ^
419e4aa5 ^


db9bb0c9 ^
419e4aa5 ^

db9bb0c9 ^
419e4aa5 ^





3ea48208 ^
fae694a0 ^
f6f26231 ^





f6f26231 ^

65cb1a32 ^

dd7a4f63 ^


f6f26231 ^







92abe81a ^
419e4aa5 ^


ffec67de ^


b0f0027f ^
9506fb8e ^
db9bb0c9 ^
b0f0027f ^

9506fb8e ^
798d06a2 ^
b0f0027f ^
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213