general update, updated cimport so it parses struct definitions from imported headers, improved the error reporting, added ifdef and ifndef, added proper support for extern variadic functions, added some new sections and pages to the doc tool and added --check to only check the program corectness and run compile time defs without producing a binary
This commit is contained in:
33
tests/ifndef.sl
Normal file
33
tests/ifndef.sl
Normal file
@@ -0,0 +1,33 @@
|
||||
import stdlib/stdlib.sl
|
||||
import stdlib/io.sl
|
||||
|
||||
# No -D flags, so ifdef FOO is false, ifndef FOO is true
|
||||
|
||||
ifdef FOO
|
||||
word dead_code
|
||||
"BUG" puts cr
|
||||
end
|
||||
endif
|
||||
|
||||
ifndef FOO
|
||||
word guarded
|
||||
"guard_ok" puts cr
|
||||
end
|
||||
endif
|
||||
|
||||
# elsedef: ifdef FALSE → skip, elsedef → include
|
||||
ifdef MISSING
|
||||
word wrong
|
||||
"BUG" puts cr
|
||||
end
|
||||
elsedef
|
||||
word right
|
||||
"else_ok" puts cr
|
||||
end
|
||||
endif
|
||||
|
||||
word main
|
||||
guarded
|
||||
right
|
||||
0
|
||||
end
|
||||
Reference in New Issue
Block a user