put everything in a main function

This commit is contained in:
Mylloon 2022-12-10 15:26:31 +01:00
parent 80eb75e891
commit 3e0bfe973e
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
10 changed files with 35 additions and 14 deletions

View file

@ -1 +1,3 @@
a = 1312; # Error on line 1 col 2: Unbound variable "a".
void main () {
a = 1312; # Error on line 2 col 6: Unbound variable "a".
}

View file

@ -1 +1,3 @@
int a = 1312;
void main () {
int a = 1312;
}

View file

@ -1 +1,3 @@
bool a = true;
void main () {
bool a = true;
}

View file

@ -1 +1,3 @@
foo = 1312; # Error on line 1 col 4: Unbound variable "foo".
void main () {
foo = 1312; # Error on line 2 col 8: Unbound variable "foo".
}

View file

@ -1 +1,3 @@
int foo = bar; # Error on line 1 col 10: Unbound variable "bar".
void main () {
int foo = bar; # Error on line 2 col 14: Unbound variable "bar".
}

View file

@ -1,2 +1,4 @@
int foo;
int bar = foo; # Warning on line 2 col 10: Unassigned variable "foo".
void main () {
int foo;
int bar = foo; # Warning on line 3 col 14: Unassigned variable "foo".
}

View file

@ -1 +1,3 @@
int foo = true; # Error on line 1 col 10: Expected int but given bool.
void main () {
int foo = true; # Error on line 2 col 14: Expected int but given bool.
}

View file

@ -1,2 +1,4 @@
int foo = 1312;
bool bar = foo; # Error on line 2 col 11: Expected bool but given int.
void main () {
int foo = 1312;
bool bar = foo; # Error on line 3 col 15: Expected bool but given int.
}

View file

@ -1,2 +1,5 @@
int vie = 42;
return vie;
int main () {
int vie = 42;
return vie;
}

View file

@ -1,2 +1,4 @@
int res = 13 * 100 + 20 - 8;
res = res * 2 / 2;
void main () {
int res = 13 * 100 + 20 - 8;
res = res * 2 / 2;
}