Collect all declared variables at start of program execution

This commit is contained in:
Peter
2024-04-16 08:12:52 +02:00
parent cb7f6f8e5d
commit f5f5626521
21 changed files with 299 additions and 284 deletions

View File

@@ -4,61 +4,56 @@ initialise-binding scope
("x",
allocate-variable
(integers)),
bind
("y",
allocate-variable
(integers)),
map
( ),
map
( ),
bind
("y",
allocate-variable
(integers)),
map
( ),
map
( )),
sequential
(assign
(initialise-variable
(bound "x",
int-mul
(decimal-natural
("10"),
decimal-natural
("10"))),
print assigned
(bound
("x")),
scope
(collateral
(bind
("x",
allocate-variable
(integers)),
bind
("y",
allocate-variable
(integers)),
map
( ),
map
( ),
map
( )),
sequential
(assign
(bound "x",
decimal-natural
("10")),
assign
(bound "y",
int-mul
(assigned
(bound
("x")),
assigned
(bound
("x")))),
print assigned
(bound
("x")),
print assigned
(bound
("y")))),
print assigned
(bound
("x"))))
sequential
(initialise-variable
(bound "y",
int-mul
(assigned bound
"x",
assigned bound
"x")),
print
(to-string assigned bound
"x",
"
"),
print
(to-string assigned bound
"y",
"
")),
if-else
(false,
initialise-variable
(bound "y",
0),
null),
print
(to-string assigned bound
"y",
"
")))