Made parser able to report multiple errors per call, using new Voodoo::Parser::Multip...
[voodoo-lang.git] / test / errors.voo
blobf9faf3a9b96572ff954e7b178bf95ea8928a9b46
1 # Program containing errors, to test error reporting.
3 # A directive that does not exist
4 wrongdirective
6 # Section name must be a symbol or a string
7 section 12
9 # A value must be provided for x
10 let x
12 # Too many parameters to add
13 set y add 1 2 3
15 # Let not allowed directly inside if
16 iflt 2 3
17     let x add 2 3
18 end if
20 # Function not allowed inside function
21 function foo
22     function bar x
23         return x
24     end function
25 end function
27 # At-expression should have a number or a symbol
28 add 2 @"wrong"
30 # Function with errorneous statement in it
31 function
32     let x get-word x
33 end function
35 # Function with multiple errorneous statements in it
36 function
37     let x get-word x
38     set-word x
39 end function
41 # Block should be closed before end of file
42 block
43     let x 4