repo.or.cz
/
voodoo-lang.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Put validation in the parser
[voodoo-lang.git]
/
test
/
raw.voo
blob
e3b1db5b4fedf8c7167e1932be9c5f018caf58ed
1
#### Test for code not contained in functions
2
3
section data
4
5
align
6
result:
7
word 0
8
9
align
10
format:
11
string "%d\n\x00"
12
13
section functions
14
import printf
15
export main
16
17
main:
18
function argc argv
19
goto countdown
20
done:
21
return 0
22
end function
23
24
section code
25
26
print_result:
27
block
28
let x get-word result 0
29
call printf format x
30
end block
31
goto done
32
33
countdown:
34
block
35
let count 10
36
let temp get-word result 0
37
loop:
38
ifgt count 0
39
set temp add temp 1
40
set count sub count 1
41
goto loop
42
else
43
set-word result 0 temp
44
end if
45
end block
46
goto print_result