mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-27 09:43:58 +00:00
version 0.7.4
This commit is contained in:
@@ -25,9 +25,9 @@ stackbox = gtk_vbox_new(TRUE, 10)
|
||||
button1 = gtk_button_new_with_label("Move mouse over button")
|
||||
buttonstyle = gtk_style_copy(gtk_widget_get_style(Button1))
|
||||
ButtonStyle.bg[GTK_STATE_PRELIGHT].pixel = 0
|
||||
ButtonStyle.bg[GTK_STATE_PRELIGHT].red = 0x0000FFFF
|
||||
ButtonStyle.bg[GTK_STATE_PRELIGHT].blue = 0
|
||||
ButtonStyle.bg[GTK_STATE_PRELIGHT].green = 0
|
||||
ButtonStyle.bg[GTK_STATE_PRELIGHT].red = 0x0000FFFF'i16
|
||||
ButtonStyle.bg[GTK_STATE_PRELIGHT].blue = 0'i16
|
||||
ButtonStyle.bg[GTK_STATE_PRELIGHT].green = 0'i16
|
||||
gtk_widget_set_style(button1, buttonstyle)
|
||||
button2 = gtk_button_new()
|
||||
ALabel = gtk_label_new(Outside)
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
Note: Most test cases are not up to date to the current Nimrod
|
||||
version. Only ``thallo`` is frequently tested! The best test is
|
||||
to bootstrap, anyway.
|
||||
|
||||
This directory contains the test cases.
|
||||
Each test must have a filename of the form: ``t*.nim``
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
# Hallo
|
||||
|
||||
import
|
||||
os
|
||||
os, strutils, macros
|
||||
|
||||
type
|
||||
TMyEnum = enum
|
||||
meA, meB, meC, meD
|
||||
|
||||
when isMainModule:
|
||||
{.hint: "this is the main file".}
|
||||
@@ -9,7 +13,7 @@ when isMainModule:
|
||||
proc fac[T](x: T): T =
|
||||
# test recursive generic procs
|
||||
if x <= 1: return 1
|
||||
else: return x * fac(x-1)
|
||||
else: return x.`*`(fac(x-1))
|
||||
|
||||
macro macrotest(n: expr): stmt =
|
||||
expectKind(n, nnkCall)
|
||||
@@ -35,22 +39,41 @@ echo("This was compiled by Nimrod version " & system.nimrodVersion)
|
||||
writeln(stdout, "Hallo", " World", "!")
|
||||
|
||||
echo(["a", "b", "c", "d"].len)
|
||||
for x in items(["What's", "your", "name", "?"]):
|
||||
for x in items(["What's", "your", "name", "?", ]):
|
||||
echo(x = x)
|
||||
var `name` = readLine(stdin)
|
||||
{.breakpoint.}
|
||||
echo("Hi " & thallo.name & "!\n")
|
||||
debug(name)
|
||||
|
||||
var testseq: seq[string] = @[ "a", "b", "c", "d", "e"]
|
||||
var testseq: seq[string] = @[
|
||||
"a", "b", "c", "d", "e"
|
||||
]
|
||||
echo(repr(testseq))
|
||||
|
||||
var dummy = "hallo"
|
||||
echo(copy(dummy, 2, 3))
|
||||
|
||||
echo($meC)
|
||||
|
||||
# test tuples:
|
||||
for x, y in items([(1, 2), (3, 4), (6, 1), (5, 2)]):
|
||||
echo x
|
||||
echo y
|
||||
|
||||
# test constant evaluation:
|
||||
const
|
||||
constEval = "abc".contains('b')
|
||||
constEval2 = fac(7)
|
||||
|
||||
echo(constEval)
|
||||
echo(constEval2)
|
||||
echo(1.`+`(2))
|
||||
|
||||
for i in 2..6:
|
||||
for j in countdown(i+4, 2):
|
||||
echo(fac(i * j))
|
||||
|
||||
when isMainModule:
|
||||
{.hint: "this is the main file".}
|
||||
|
||||
|
||||
@@ -32,3 +32,13 @@ for i in xrange(0, 5):
|
||||
for j in interval(45, 45):
|
||||
write(stdout, "test2!")
|
||||
write(stdout, "test3?")
|
||||
|
||||
for x in items(["hi", "what's", "your", "name"]):
|
||||
echo(x)
|
||||
|
||||
const
|
||||
stringArray = ["hi", "what's", "your", "name"]
|
||||
|
||||
for i in 0..len(stringArray)-1:
|
||||
echo(stringArray[i])
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# Test wether the bindings at least compile...
|
||||
|
||||
import
|
||||
unicode,
|
||||
osproc, zipfiles,
|
||||
sdl, smpeg, sdl_gfx, sdl_net, sdl_mixer, sdl_ttf,
|
||||
sdl_image, sdl_mixer_nosmpeg
|
||||
sdl_image, sdl_mixer_nosmpeg,
|
||||
cursorfont, xatom, xf86vmode, xkb, xrandr, xshm, xvlib, keysym, xcms, xi,
|
||||
xkblib, xrender, xutil, x, xf86dga, xinerama, xlib, xresource, xv,
|
||||
gtk2, glib2, pango, gdk2,
|
||||
|
||||
@@ -31,7 +31,7 @@ proc main() =
|
||||
|
||||
n = newNode(i, nil, newNode(i + 10000, nil, nil))
|
||||
inc(i)
|
||||
#new(p)
|
||||
new(p)
|
||||
|
||||
write(stdout, "Simple tree node allocation worked!\n")
|
||||
i = 0
|
||||
|
||||
Reference in New Issue
Block a user