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 static val_t once_value_2
= NIT_NULL
; /* Once value for string variable[4]*/
7 static val_t once_value_3
= NIT_NULL
; /* Once value for string variable[5]*/
8 static val_t once_value_4
= NIT_NULL
; /* Once value for string variable[5]*/
9 static val_t once_value_5
= NIT_NULL
; /* Once value for string variable[4]*/
11 struct WBT_
**closurevariable
= NULL
;
12 trace
.prev
= tracehead
; tracehead
= &trace
;
13 trace
.file
= LOCATE_environ
;
14 /* Register variable[0]: Local variable */
16 /* Register variable[1]: Method return value and escape marker */
17 /* Register variable[2]: Local variable */
18 /* Register variable[3]: Result */
19 variable
[3] = CALL_string___Object___to_s(variable
[0])(variable
[0]) /*Symbol::to_s*/;
20 /* Register variable[3]: Result */
21 variable
[3] = CALL_string___String___to_cstring(variable
[3])(variable
[3]) /*String::to_cstring*/;
22 /* Register variable[3]: Result */
23 variable
[3] = CALL_environ___NativeString___get_environ(variable
[3])(variable
[3]) /*NativeString::get_environ*/;
24 variable
[2] = variable
[3];
25 /* Register variable[3]: Local variable */
26 /* Register variable[4]: Once expression result */
27 if (once_bool_1
) variable
[4] = once_value_1
;
29 /* Register variable[4]: Once String constant */
30 if (once_value_2
!= NIT_NULL
) variable
[4] = once_value_2
;
32 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
33 once_value_2
= variable
[4];
35 /* Register variable[4]: Result */
36 /* Register variable[4]: Result */
37 variable
[4] = CALL_string___String___to_cstring(variable
[4])(variable
[4]) /*String::to_cstring*/;
38 /* Register variable[4]: Result */
39 variable
[4] = CALL_environ___NativeString___get_environ(variable
[4])(variable
[4]) /*NativeString::get_environ*/;
40 once_value_1
= variable
[4];
43 /* Register variable[4]: Result */
44 variable
[3] = variable
[4];
45 /* Register variable[4]: Result */
46 variable
[4] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable
[2] /*res*/ == variable
[3] /*nulstr*/) || (( variable
[2] /*res*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[2] /*res*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[2] /*res*/, variable
[3] /*nulstr*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[2] /*res*/)( variable
[2] /*res*/, variable
[3] /*nulstr*/) /*Object::==*/)))))));
47 if (UNTAG_Bool(variable
[4])) { /*if*/
48 variable
[4] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
49 /* Register variable[5]: Once String constant */
50 if (once_value_3
!= NIT_NULL
) variable
[5] = once_value_3
;
52 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("env "), TAG_Int(4)) /*new String*/;
53 once_value_3
= variable
[5];
55 /* Register variable[5]: Result */
56 /* Ensure var variable[5]: super-string element*/
57 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
58 /* Ensure var variable[0]: super-string element*/
59 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], CALL_string___Object___to_s(variable
[0])(variable
[0]) /*Object::to_s*/) /*AbstractArray::add*/;
60 /* Register variable[5]: Once String constant */
61 if (once_value_4
!= NIT_NULL
) variable
[5] = once_value_4
;
63 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("="), TAG_Int(1)) /*new String*/;
64 once_value_4
= variable
[5];
66 /* Register variable[5]: Result */
67 /* Ensure var variable[5]: super-string element*/
68 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
69 /* Register variable[4]: Result */
70 variable
[4] = CALL_string___Object___to_s(variable
[4])(variable
[4]) /*Object::to_s*/;
71 CALL_kernel___Object___output(variable
[4])(variable
[4]) /*AbstractString::output*/;
72 CALL_kernel___Object___output( variable
[2] /*res*/)( variable
[2] /*res*/) /*Object::output*/;
73 /* Register variable[4]: Result */
74 variable
[4] = NEW_String_string___String___from_cstring( variable
[2] /*res*/) /*new String*/;
75 variable
[1] = variable
[4];
78 /* Register variable[4]: Once String constant */
79 if (once_value_5
!= NIT_NULL
) variable
[4] = once_value_5
;
81 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
82 once_value_5
= variable
[4];
84 /* Register variable[4]: Result */
85 variable
[1] = variable
[4];
88 return_label0
: while(false);
89 tracehead
= trace
.prev
;
92 val_t
environ___NativeString___get_environ(val_t self
) {
93 struct trace_t trace
= {NULL
, NULL
, 36, LOCATE_environ___NativeString___get_environ
};
94 val_t
*variable
= NULL
;
95 struct WBT_
**closurevariable
= NULL
;
96 trace
.prev
= tracehead
; tracehead
= &trace
;
97 trace
.file
= LOCATE_environ
;
98 tracehead
= trace
.prev
;
99 return BOX_NativeString(string_NativeString_NativeString_get_environ_0(UNBOX_NativeString( self
)));