Closed mertyildiran closed 3 years ago
Another case:
num def f7()
num x = 5
return x
end
num def f6(num x)
num y = x - 1
end {
y == 1 : f7()
}
num def f5(num x)
num y = x - 1
end {
y == 2 : f6(y)
}
print f5(3)
symbol_table
Output:
5
[start] =>
{id: 0, name: (null), 2nd_name: x, key: (null), scope: N/A, depth: 0, type: 1, 2nd_type: 3, value_type: 4, role: 1, param_of: f6, value: N/A} =>
{id: 1, name: (null), 2nd_name: x, key: (null), scope: N/A, depth: 0, type: 1, 2nd_type: 3, value_type: 4, role: 1, param_of: f5, value: N/A} =>
{id: 7, name: (null), 2nd_name: (null), key: (null), scope: (null), depth: 3, type: 1, 2nd_type: 0, value_type: 1, role: 0, param_of: , value: 5} =>
{id: 9, name: (null), 2nd_name: (null), key: (null), scope: , depth: 2, type: 1, 2nd_type: 0, value_type: 1, role: 0, param_of: , value: 5} =>
[end]
The output of above Chaos program with interpreter:
with compiler:
means that in case of compiler there are variables leaking.