misc: update Changelog and NOTICE; remove BUGS and TODO
[nit.git] / c_src / utils._sep.c
1 /* This C file is generated by NIT to compile module utils. */
2 #include "utils._sep.h"
3 val_t utils___Object___cmangle(val_t self, val_t param0) {
4 struct trace_t trace = {NULL, NULL, 21, LOCATE_utils___Object___cmangle};
5 static val_t once_value_1; static int once_bool_1; /* Once value for variable[4]*/
6 val_t variable[15];
7 struct WBT_ **closurevariable = NULL;
8 trace.prev = tracehead; tracehead = &trace;
9 trace.file = LOCATE_utils;
10 /* Register variable[0]: Local variable */
11 variable[0] = self;
12 /* Register variable[1]: Local variable */
13 /* check if p<Array[Symbol] with p:Symbol */
14 if (( param0!=NIT_NULL) && !VAL_ISA( param0, COLOR_Array, ID_Array)) { fprintf(stderr, "Cast failled"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_utils___Object___cmangle, LOCATE_utils, 22); nit_exit(1); } /*cast Array[Symbol]*/;
15 variable[1] = param0;
16 /* Register variable[2]: Method return value and escape marker */
17 /* Register variable[3]: Local variable */
18 /* Register variable[4]: Once expression result */
19 if (once_bool_1) variable[4] = once_value_1;
20 else {
21 /* Register variable[4]: Result */
22 variable[4] = CALL_utils___Object___cmangle_table(variable[0])(variable[0]) /*Object::cmangle_table*/;
23 once_value_1 = variable[4];
24 once_bool_1 = true;
25 }
26 /* Register variable[4]: Result */
27 variable[3] = variable[4];
28 /* Register variable[4]: Local variable */
29 /* Register variable[5]: Result */
30 variable[5] = NEW_Buffer_string___Buffer___init() /*new Buffer*/;
31 variable[4] = variable[5];
32 /* Register variable[5]: For iterator */
33 variable[5] = CALL_abstract_collection___Collection___iterator( variable[1] /*symbols*/)( variable[1] /*symbols*/) /*AbstractArrayRead::iterator*/;
34 while (true) { /*for*/
35 /* Register variable[6]: For 'is_ok' result */
36 variable[6] = CALL_abstract_collection___Iterator___is_ok(variable[5])(variable[5]) /*ArrayIterator::is_ok*/;
37 if (!UNTAG_Bool(variable[6])) break; /*for*/
38 variable[6] = CALL_abstract_collection___Iterator___item(variable[5])(variable[5]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
39 /* Register variable[7]: Local variable */
40 variable[7] = variable[6];
41 /* Register variable[8]: Result */
42 variable[8] = CALL_abstract_collection___Collection___is_empty( variable[4] /*res*/)( variable[4] /*res*/) /*AbstractArrayRead::is_empty*/;
43 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[8])))) { /*if*/
44 CALL_abstract_collection___SimpleCollection___add( variable[4] /*res*/)( variable[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
45 CALL_abstract_collection___SimpleCollection___add( variable[4] /*res*/)( variable[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
46 CALL_abstract_collection___SimpleCollection___add( variable[4] /*res*/)( variable[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
47 }
48 /* Register variable[8]: Local variable */
49 variable[8] = TAG_Bool(false);
50 /* Register variable[9]: Local variable */
51 variable[9] = TAG_Bool(true);
52 /* Register variable[10]: Local variable */
53 /* Register variable[11]: Result */
54 variable[11] = CALL_string___Object___to_s( variable[7] /*sym*/)( variable[7] /*sym*/) /*Symbol::to_s*/;
55 variable[10] = variable[11];
56 /* Register variable[11]: For iterator */
57 variable[11] = CALL_abstract_collection___Collection___iterator( variable[10] /*s*/)( variable[10] /*s*/) /*AbstractArrayRead::iterator*/;
58 while (true) { /*for*/
59 /* Register variable[12]: For 'is_ok' result */
60 variable[12] = CALL_abstract_collection___Iterator___is_ok(variable[11])(variable[11]) /*ArrayIterator::is_ok*/;
61 if (!UNTAG_Bool(variable[12])) break; /*for*/
62 variable[12] = CALL_abstract_collection___Iterator___item(variable[11])(variable[11]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
63 /* Register variable[13]: Local variable */
64 variable[13] = variable[12];
65 /* Register variable[14]: Result */
66 variable[14] = TAG_Bool(UNTAG_Char( variable[13] /*c*/)>=UNTAG_Char( TAG_Char('a')));
67 /* Ensure var variable[14]: Left 'and' operand*/
68 if (UNTAG_Bool(variable[14])) { /* and */
69 /* Register variable[14]: Result */
70 variable[14] = TAG_Bool(UNTAG_Char( variable[13] /*c*/)<=UNTAG_Char( TAG_Char('z')));
71 }
72 /* Register variable[14]: Result */
73 /* Ensure var variable[14]: Left 'or' operand*/
74 if (!UNTAG_Bool(variable[14])) { /* or */
75 /* Register variable[14]: Result */
76 variable[14] = TAG_Bool(UNTAG_Char( variable[13] /*c*/)>=UNTAG_Char( TAG_Char('A')));
77 /* Ensure var variable[14]: Left 'and' operand*/
78 if (UNTAG_Bool(variable[14])) { /* and */
79 /* Register variable[14]: Result */
80 variable[14] = TAG_Bool(UNTAG_Char( variable[13] /*c*/)<=UNTAG_Char( TAG_Char('Z')));
81 }
82 /* Register variable[14]: Result */
83 }
84 /* Register variable[14]: Result */
85 /* Ensure var variable[14]: Left 'or' operand*/
86 if (!UNTAG_Bool(variable[14])) { /* or */
87 /* Register variable[14]: Result */
88 variable[14] = TAG_Bool(UNTAG_Char( variable[13] /*c*/)>=UNTAG_Char( TAG_Char('0')));
89 /* Ensure var variable[14]: Left 'and' operand*/
90 if (UNTAG_Bool(variable[14])) { /* and */
91 /* Register variable[14]: Result */
92 variable[14] = TAG_Bool(UNTAG_Char( variable[13] /*c*/)<=UNTAG_Char( TAG_Char('9')));
93 }
94 /* Register variable[14]: Result */
95 }
96 /* Register variable[14]: Result */
97 if (UNTAG_Bool(variable[14])) { /*if*/
98 CALL_abstract_collection___SimpleCollection___add( variable[4] /*res*/)( variable[4] /*res*/, variable[13] /*c*/) /*Buffer::add*/;
99 variable[8] = TAG_Bool(false) /*underscore=*/;
100 variable[9] = TAG_Bool(true) /*normal=*/;
101 } else { /*if*/
102 /* Register variable[14]: Result */
103 variable[14] = TAG_Bool(( variable[13] /*c*/)==( TAG_Char('_')));
104 /* Ensure var variable[14]: Left 'and' operand*/
105 if (UNTAG_Bool(variable[14])) { /* and */
106 variable[14] = TAG_Bool(!UNTAG_Bool( variable[8] /*underscore*/));
107 }
108 /* Register variable[14]: Result */
109 if (UNTAG_Bool(variable[14])) { /*if*/
110 CALL_abstract_collection___SimpleCollection___add( variable[4] /*res*/)( variable[4] /*res*/, variable[13] /*c*/) /*Buffer::add*/;
111 variable[8] = TAG_Bool(true) /*underscore=*/;
112 variable[9] = TAG_Bool(true) /*normal=*/;
113 } else { /*if*/
114 /* Register variable[14]: Result */
115 variable[14] = CALL_abstract_collection___MapRead___has_key( variable[3] /*table*/)( variable[3] /*table*/, variable[13] /*c*/) /*CoupleMap::has_key*/;
116 if (UNTAG_Bool(variable[14])) { /*if*/
117 if (UNTAG_Bool( variable[9] /*normal*/)) { /*if*/
118 CALL_abstract_collection___SimpleCollection___add( variable[4] /*res*/)( variable[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
119 CALL_abstract_collection___SimpleCollection___add( variable[4] /*res*/)( variable[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
120 }
121 /* Register variable[14]: Result */
122 variable[14] = CALL_abstract_collection___MapRead_____bra( variable[3] /*table*/)( variable[3] /*table*/, variable[13] /*c*/) /*CoupleMap::[]*/;
123 CALL_abstract_collection___IndexedCollection___append( variable[4] /*res*/)( variable[4] /*res*/, variable[14]) /*Buffer::append*/;
124 variable[9] = TAG_Bool(false) /*normal=*/;
125 variable[8] = TAG_Bool(false) /*underscore=*/;
126 }
127 }
128 }
129 continue_3: while(0);
130 CALL_abstract_collection___Iterator___next(variable[11])(variable[11]) /*ArrayIterator::next*/;
131 }
132 break_3: while(0);
133 continue_2: while(0);
134 CALL_abstract_collection___Iterator___next(variable[5])(variable[5]) /*ArrayIterator::next*/;
135 }
136 break_2: while(0);
137 /* Register variable[5]: Result */
138 variable[5] = CALL_string___Object___to_s( variable[4] /*res*/)( variable[4] /*res*/) /*Buffer::to_s*/;
139 variable[2] = variable[5];
140 goto return_label0;
141 return_label0: while(false);
142 tracehead = trace.prev;
143 return variable[2];
144 }
145 val_t utils___Object___cmangle_table(val_t self) {
146 struct trace_t trace = {NULL, NULL, 58, LOCATE_utils___Object___cmangle_table};
147 static val_t once_value_5 = NIT_NULL; /* Once value for string variable[3]*/
148 static val_t once_value_6 = NIT_NULL; /* Once value for string variable[3]*/
149 static val_t once_value_7 = NIT_NULL; /* Once value for string variable[3]*/
150 static val_t once_value_8 = NIT_NULL; /* Once value for string variable[3]*/
151 static val_t once_value_9 = NIT_NULL; /* Once value for string variable[3]*/
152 static val_t once_value_10 = NIT_NULL; /* Once value for string variable[3]*/
153 static val_t once_value_11 = NIT_NULL; /* Once value for string variable[3]*/
154 static val_t once_value_12 = NIT_NULL; /* Once value for string variable[3]*/
155 static val_t once_value_13 = NIT_NULL; /* Once value for string variable[3]*/
156 static val_t once_value_14 = NIT_NULL; /* Once value for string variable[3]*/
157 static val_t once_value_15 = NIT_NULL; /* Once value for string variable[3]*/
158 static val_t once_value_16 = NIT_NULL; /* Once value for string variable[3]*/
159 val_t variable[4];
160 struct WBT_ **closurevariable = NULL;
161 trace.prev = tracehead; tracehead = &trace;
162 trace.file = LOCATE_utils;
163 /* Register variable[0]: Local variable */
164 variable[0] = self;
165 /* Register variable[1]: Method return value and escape marker */
166 /* Register variable[2]: Local variable */
167 /* Register variable[3]: Result */
168 variable[3] = NEW_HashMap_hash___HashMap___init() /*new HashMap[Char, String]*/;
169 variable[2] = variable[3];
170 /* Register variable[3]: Once String constant */
171 if (once_value_5 != NIT_NULL) variable[3] = once_value_5;
172 else {
173 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("plus"), TAG_Int(4)) /*new String*/;
174 once_value_5 = variable[3];
175 }
176 /* Register variable[3]: Result */
177 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('+'), variable[3]) /*HashMap::[]=*/;
178 /* Register variable[3]: Once String constant */
179 if (once_value_6 != NIT_NULL) variable[3] = once_value_6;
180 else {
181 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("minus"), TAG_Int(5)) /*new String*/;
182 once_value_6 = variable[3];
183 }
184 /* Register variable[3]: Result */
185 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('-'), variable[3]) /*HashMap::[]=*/;
186 /* Register variable[3]: Once String constant */
187 if (once_value_7 != NIT_NULL) variable[3] = once_value_7;
188 else {
189 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("star"), TAG_Int(4)) /*new String*/;
190 once_value_7 = variable[3];
191 }
192 /* Register variable[3]: Result */
193 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('*'), variable[3]) /*HashMap::[]=*/;
194 /* Register variable[3]: Once String constant */
195 if (once_value_8 != NIT_NULL) variable[3] = once_value_8;
196 else {
197 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("slash"), TAG_Int(5)) /*new String*/;
198 once_value_8 = variable[3];
199 }
200 /* Register variable[3]: Result */
201 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('/'), variable[3]) /*HashMap::[]=*/;
202 /* Register variable[3]: Once String constant */
203 if (once_value_9 != NIT_NULL) variable[3] = once_value_9;
204 else {
205 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("percent"), TAG_Int(7)) /*new String*/;
206 once_value_9 = variable[3];
207 }
208 /* Register variable[3]: Result */
209 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('%'), variable[3]) /*HashMap::[]=*/;
210 /* Register variable[3]: Once String constant */
211 if (once_value_10 != NIT_NULL) variable[3] = once_value_10;
212 else {
213 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("bra"), TAG_Int(3)) /*new String*/;
214 once_value_10 = variable[3];
215 }
216 /* Register variable[3]: Result */
217 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('['), variable[3]) /*HashMap::[]=*/;
218 /* Register variable[3]: Once String constant */
219 if (once_value_11 != NIT_NULL) variable[3] = once_value_11;
220 else {
221 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("eq"), TAG_Int(2)) /*new String*/;
222 once_value_11 = variable[3];
223 }
224 /* Register variable[3]: Result */
225 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('='), variable[3]) /*HashMap::[]=*/;
226 /* Register variable[3]: Once String constant */
227 if (once_value_12 != NIT_NULL) variable[3] = once_value_12;
228 else {
229 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("l"), TAG_Int(1)) /*new String*/;
230 once_value_12 = variable[3];
231 }
232 /* Register variable[3]: Result */
233 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('<'), variable[3]) /*HashMap::[]=*/;
234 /* Register variable[3]: Once String constant */
235 if (once_value_13 != NIT_NULL) variable[3] = once_value_13;
236 else {
237 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("g"), TAG_Int(1)) /*new String*/;
238 once_value_13 = variable[3];
239 }
240 /* Register variable[3]: Result */
241 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('>'), variable[3]) /*HashMap::[]=*/;
242 /* Register variable[3]: Once String constant */
243 if (once_value_14 != NIT_NULL) variable[3] = once_value_14;
244 else {
245 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("n"), TAG_Int(1)) /*new String*/;
246 once_value_14 = variable[3];
247 }
248 /* Register variable[3]: Result */
249 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('!'), variable[3]) /*HashMap::[]=*/;
250 /* Register variable[3]: Once String constant */
251 if (once_value_15 != NIT_NULL) variable[3] = once_value_15;
252 else {
253 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("u"), TAG_Int(1)) /*new String*/;
254 once_value_15 = variable[3];
255 }
256 /* Register variable[3]: Result */
257 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('_'), variable[3]) /*HashMap::[]=*/;
258 /* Register variable[3]: Once String constant */
259 if (once_value_16 != NIT_NULL) variable[3] = once_value_16;
260 else {
261 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("at"), TAG_Int(2)) /*new String*/;
262 once_value_16 = variable[3];
263 }
264 /* Register variable[3]: Result */
265 CALL_abstract_collection___Map_____braeq( variable[2] /*res*/)( variable[2] /*res*/, TAG_Char('@'), variable[3]) /*HashMap::[]=*/;
266 variable[1] = variable[2] /*res*/;
267 goto return_label4;
268 return_label4: while(false);
269 tracehead = trace.prev;
270 return variable[1];
271 }