Implemented const keyword

This commit is contained in:
2025-02-15 14:38:01 +01:00
parent be028a52d1
commit 0a1a8f741d
21 changed files with 164 additions and 26 deletions

12
tests/programs/const.q Normal file
View File

@ -0,0 +1,12 @@
const num {
one 1
two 2
three 3
}
main() {
assert num.one == 1
assert num.two == 2
assert num.three == 3
assert num.one + num.two == num.three
}

View File

@ -31,6 +31,7 @@ var programs = []struct {
{"binary", "", "", 0},
{"octal", "", "", 0},
{"hexadecimal", "", "", 0},
{"const", "", "", 0},
{"array", "", "", 0},
{"escape-rune", "", "", 0},
{"escape-string", "", "", 0},