Update c_src to handle default closures.
[nit.git] / c_src / environ._sep.c
1 /* This C file is generated by NIT to compile module environ. */
2 #include "environ._sep.h"
3 val_t environ___Symbol___environ(val_t self) {
4 struct trace_t trace = {NULL, NULL, 19, LOCATE_environ___Symbol___environ};
5 static val_t once_value_1; static int once_bool_1; /* Once value for variable[4]*/
6 val_t variable[11];
7 void **closurevariable = NULL;
8 trace.prev = tracehead; tracehead = &trace;
9 trace.file = LOCATE_environ;
10 variable[0] = self;
11 variable[3] = variable[0];
12 variable[3] = ((symbol___Symbol___to_s_t)CALL(variable[3],COLOR_string___Object___to_s))(variable[3]) /*Symbol::to_s*/;
13 variable[3] = ((string___String___to_cstring_t)CALL(variable[3],COLOR_string___String___to_cstring))(variable[3]) /*String::to_cstring*/;
14 variable[3] = ((environ___NativeString___get_environ_t)CALL(variable[3],COLOR_environ___NativeString___get_environ))(variable[3]) /*NativeString::get_environ*/;
15 variable[2] = variable[3];
16 if (once_bool_1) variable[4] = once_value_1;
17 else {
18 variable[4] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
19 variable[4] = ((string___String___to_cstring_t)CALL(variable[4],COLOR_string___String___to_cstring))(variable[4]) /*String::to_cstring*/;
20 variable[4] = ((environ___NativeString___get_environ_t)CALL(variable[4],COLOR_environ___NativeString___get_environ))(variable[4]) /*NativeString::get_environ*/;
21 once_value_1 = variable[4];
22 once_bool_1 = true;
23 }
24 variable[3] = variable[4];
25 variable[4] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[2] /*res*/ == variable[3] /*nulstr*/) || (( variable[2] /*res*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[2] /*res*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[2] /*res*/, variable[3] /*nulstr*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[2] /*res*/,COLOR_kernel___Object_____eqeq))( variable[2] /*res*/, variable[3] /*nulstr*/) /*Object::==*/)))))));
26 if (UNTAG_Bool(variable[4])) { /*if*/
27 variable[4] = NEW_String_string___String___init(); /*new String*/
28 variable[5] = NEW_String_string___String___with_native(BOX_NativeString("env "), TAG_Int(4)); /*new String*/
29 variable[6] = variable[5];
30 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
31 variable[7] = variable[0];
32 variable[8] = variable[7];
33 variable[8] = ((string___String___to_s_t)CALL(variable[8],COLOR_string___Object___to_s))(variable[8]) /*String::to_s*/;
34 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[8]) /*String::append*/;
35 variable[9] = NEW_String_string___String___with_native(BOX_NativeString("="), TAG_Int(1)); /*new String*/
36 variable[10] = variable[9];
37 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[10]) /*String::append*/;
38 ((string___String___output_t)CALL(variable[4],COLOR_kernel___Object___output))(variable[4]) /*String::output*/;
39 ((kernel___Object___output_t)CALL( variable[2] /*res*/,COLOR_kernel___Object___output))( variable[2] /*res*/) /*Object::output*/;
40 variable[4] = NEW_String_string___String___from_cstring( variable[2] /*res*/); /*new String*/
41 variable[1] = variable[4];
42 goto return_label0;
43 } else { /*if*/
44 variable[4] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
45 variable[1] = variable[4];
46 goto return_label0;
47 }
48 return_label0: while(false);
49 tracehead = trace.prev;
50 return variable[1];
51 }
52 val_t environ___NativeString___get_environ(val_t self) {
53 struct trace_t trace = {NULL, NULL, 36, LOCATE_environ___NativeString___get_environ};
54 val_t *variable = NULL;
55 void **closurevariable = NULL;
56 trace.prev = tracehead; tracehead = &trace;
57 trace.file = LOCATE_environ;
58 tracehead = trace.prev;
59 return BOX_NativeString(string_NativeString_NativeString_get_environ_0(UNBOX_NativeString( self)));
60 }