version 0.7.6
This commit is contained in:
parent
439aa2d04d
commit
e792940f52
106 changed files with 8394 additions and 10083 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# Test the case statment
|
||||
# Test the case statement
|
||||
|
||||
type
|
||||
tenum = enum eA, eB, eC
|
||||
|
|
@ -6,6 +6,7 @@ type
|
|||
var
|
||||
x: string
|
||||
y: Tenum = eA
|
||||
i: int
|
||||
|
||||
case y
|
||||
of eA: write(stdout, "a\n")
|
||||
|
|
@ -18,3 +19,14 @@ of "aa", "bb": write(stdout, "Du bist nicht mein Meister\n")
|
|||
of "cc", "hash", "when": nil
|
||||
of "will", "it", "finally", "be", "generated": nil
|
||||
else: write(stdout, "das sollte nicht passieren!\N")
|
||||
|
||||
case i
|
||||
of 0..5, 8, 9: nil
|
||||
of 6, 7: nil
|
||||
elif x == "Ha":
|
||||
nil
|
||||
elif x == "Ho":
|
||||
nil
|
||||
else:
|
||||
nil
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# Test wether the bindings at least compile...
|
||||
|
||||
import
|
||||
unicode,
|
||||
unicode, cgi, terminal, libcurl, web,
|
||||
parsexml, parseopt, parsecfg,
|
||||
osproc, zipfiles,
|
||||
sdl, smpeg, sdl_gfx, sdl_net, sdl_mixer, sdl_ttf,
|
||||
sdl_image, sdl_mixer_nosmpeg,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
# test variables of type proc
|
||||
|
||||
proc pa() {.cdecl.} = write(stdout, "pa")
|
||||
proc pb() {.cdecl.} = write(stdout, "pb")
|
||||
proc pc() {.cdecl.} = write(stdout, "pc")
|
||||
proc pd() {.cdecl.} = write(stdout, "pd")
|
||||
proc pe() {.cdecl.} = write(stdout, "pe")
|
||||
|
||||
const
|
||||
algos = [pa, pb, pc, pd, pe]
|
||||
|
||||
var
|
||||
x: proc (a, b: int): int {.cdecl.}
|
||||
|
|
@ -6,9 +15,12 @@ var
|
|||
proc ha(c, d: int): int {.cdecl.} =
|
||||
echo(c + d)
|
||||
result = c + d
|
||||
|
||||
for a in items(algos):
|
||||
a()
|
||||
|
||||
x = ha
|
||||
discard x(3, 4)
|
||||
|
||||
#OUT 7
|
||||
#OUT papbpcpdpe7
|
||||
|
||||
|
|
|
|||
|
|
@ -13,5 +13,9 @@ type
|
|||
PB = ref TB
|
||||
TB = array [0..3, P1]
|
||||
T1 = array [0..6, PB]
|
||||
|
||||
var
|
||||
x: PA
|
||||
new(x)
|
||||
#ERROR_MSG internal error: cannot generate C type for: PA
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,17 @@
|
|||
|
||||
import
|
||||
regexprs
|
||||
|
||||
if "keyA = valueA" =~ r"\s*(\w+)\s*\=\s*(\w+)":
|
||||
write(stdout, "key: ", matches[1])
|
||||
elif "# comment!" =~ r"\s*(\#.*)":
|
||||
echo("comment: ", matches[1])
|
||||
else:
|
||||
echo("Bug!")
|
||||
|
||||
if "Username".match("[A-Za-z]+"):
|
||||
echo("Yes!")
|
||||
else:
|
||||
echo("Bug!")
|
||||
|
||||
#OUT Yes!
|
||||
#OUT key: keyAYes!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue