version 0.8.10

This commit is contained in:
Araq 2010-10-21 00:12:14 +02:00
commit 765366c1f3
58 changed files with 768 additions and 30834 deletions

View file

@ -0,0 +1,68 @@
#! stdtmpl
#proc sunsetTemplate*(current, ticker, content: string,
# tabs: openarray[array[0..1, string]]): string =
# result = ""
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Nimrod Programming System</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<div id="main">
<div id="links">
<!-- **** INSERT LINKS HERE **** -->
</div>
<div id="logo"><h1>Nimrod Programming System</h1></div>
<div id="content">
<div id="menu">
<ul>
#for item in items(tabs):
#var name = item[0]
#var t = item[1]
#if t == current:
<li><a id="selected" href="${t}.html" title = "Nimrod - $name">$name</a></li>
#else:
<li><a href="${t}.html" title = "Nimrod - $name">$name</a></li>
#end if
#end for
</ul>
</div>
<div id="column1">
<div class="sidebaritem">
<div class="sbihead">
<h1>latest news</h1>
</div>
<div class="sbicontent">
$ticker
</div>
</div>
<div class="sidebaritem">
<div class="sbihead">
<h1>additional links</h1>
</div>
<div class="sbilinks">
<!-- **** INSERT ADDITIONAL LINKS HERE **** -->
<ul>
<li><a class="reference" href="http://llvm.org">LLVM</a></li>
<li><a class="reference" href="http://gcc.gnu.org">GCC</a></li>
</ul>
</div>
</div>
</div>
<div id="column2">
$content
</div>
</div>
<div id="footer">
copyright &copy; 2008 Andreas Rumpf | Last update: ${getDateStr()}
| <a class="reference" href="http://validator.w3.org/check?uri=referer">XHTML 1.1</a>
| <a class="reference" href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
| <a class="reference" href="http://www.dcarter.co.uk">design by dcarter</a>
</div>
</div>
</body>
</html>

View file

@ -5,11 +5,15 @@ type
v: TV
PDict[TK, TV] = ref TDict[TK, TV]
proc destroyDict[TK, TV](a : PDict[TK, TV]) =
proc fakeNew[T](x: var ref T, destroy: proc (a: ref T)) =
nil
proc destroyDict[TK, TV](a: PDict[TK, TV]) =
return
proc newDict[TK, TV](a: TK, b: TV): PDict[TK, TV] =
new(result, destroyDict)
Fakenew(result, destroyDict)
# Problem: destroyDict is not instantiated when newDict is instantiated!
discard newDict("a", "b")

View file

@ -42,8 +42,7 @@ proc main*(infile: string, a, b: int, someverylongnamewithtype = 0,
anotherlongthingie = 3) =
var
myInt: int = 0
a b = 9
s: sequence[string]
s: seq[string]
# this should be an error!
if initBaseLexer(L, infile, 30): nil
else:
@ -51,7 +50,7 @@ proc main*(infile: string, a, b: int, someverylongnamewithtype = 0,
writeln(stdout, "Success!")
call(3, # we use 3
12, # we use 12
43 # we use 43
)
43) # we use 43
main(ParamStr(1))
main(ParamStr(1), 9, 0)

View file

@ -5,8 +5,8 @@ var
inp: TFile
line: string
if openFile(inp, "readme.txt"):
if open(inp, "readme.txt"):
while not EndOfFile(inp):
line = readLine(inp)
echo("#" & line & "#")
closeFile(inp)
close(inp)

View file

@ -18,10 +18,10 @@ var i = 0
for item in items(tabs):
var content = $i
var file: TFile
if openFile(file, changeFileExt(item[1], "html"), fmWrite):
if open(file, changeFileExt(item[1], "html"), fmWrite):
write(file, sunsetTemplate(current=item[1], ticker="", content=content,
tabs=tabs))
closeFile(file)
close(file)
else:
write(stdout, "cannot open file for writing")
inc(i)

0
tests/accept/run/mmultim3.nim Normal file → Executable file
View file

View file

@ -7,8 +7,8 @@ tarray3.nim;3
tassert.nim;assertion failure!this shall be always written
tbind1.nim;3
tbind3.nim;1
tbintre2.nim;halloworld99110223
tbintree.nim;halloworld99110223
tbintre2.nim;helloworld99110223
tbintree.nim;helloworld99110223
tbug499771.nim;TSubRange: 5 from 1 to 10
tbug511622.nim;3
tcasestm.nim;ayyy
@ -38,15 +38,17 @@ tlowhigh.nim;10
tmatrix.nim;111
tmultim1.nim;7
tmultim2.nim;collide: unit, thing collide: unit, thing collide: thing, unit
tmultim3.nim;Hi derived!
tnestif.nim;i == 2
tnestprc.nim;10
toop1.nim;34[]o 5
topenarrayrepr.nim;5 - [1]
topenlen.nim;7
toverflw.nim;the computation overflowed
toverflw2.nim;Error: unhandled exception: over- or underflow [EOverflow]
toverl2.nim;true012
toverlop.nim;3
toverwr.nim;hallo
toverwr.nim;hello
tovfint.nim;works!
tpos.nim;6
tprintf.nim;Andreas Rumpf
@ -54,19 +56,24 @@ tprocvar.nim;papbpcpdpe7
tquotewords.nim;thisanexample
tregex.nim;key: keyAYes!
treguse.nim;055this should be the casehugh
treraise.nim;Error: unhandled exception: bla [ESomeOtherErr]
tromans.nim;success
tseqcon.nim;Hithere, what's your name?Hathere, what's your name?
tseqtuple.nim;fA13msg1falsefB14msg2truefC15msg3false
tsets.nim;Ha ein F ist in s!
tsidee2.nim;5
tsidee3.nim;5
tsimmeth.nim;HALLO WORLD!
tsimmeth.nim;HELLO WORLD!
tsplit.nim;true
tstrange.nim;hallo4
tstrlits.nim;a""long string"""""abc"def
tstrutil.nim;ha/home/a1xyz/usr/bin
tvardecl.nim;44
tvariantasgn.nim;came here
tvariantstack.nim;came here
tvarnums.nim;Success!
tvartup.nim;2 3
tunhandledexc.nim;Error: unhandled exception: bla [ESomeOtherErr]
twrongexc.nim;Error: unhandled exception [EInvalidValue]
txmlgen.nim;<h1><a href="http://force7.de/nimrod">Nimrod</a></h1>
txmltree.nim;true

Can't render this file because it contains an unexpected character in line 69 and column 15.

0
tests/accept/run/tcontinuexc.nim Normal file → Executable file
View file

View file

@ -11,5 +11,5 @@ proc main: int =
stdout.write("here ")
return 3
echo main() #OUT came here 1
echo main() #OUT came here 3

0
tests/accept/run/tfinally2.nim Normal file → Executable file
View file

0
tests/accept/run/tfinally3.nim Normal file → Executable file
View file

0
tests/accept/run/tmultim3.nim Normal file → Executable file
View file

View file

@ -2,16 +2,16 @@
# which is based on the PCRE library
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!")
re
if "Username".match("[A-Za-z]+"):
if "keyA = valueA" =~ re"\s*(\w+)\s*\=\s*(\w+)":
write(stdout, "key: ", matches[0])
elif "# comment!" =~ re"\s*(\#.*)":
echo("comment: ", matches[0])
else:
echo("Bug!")
if "Username".match(re"[A-Za-z]+"):
echo("Yes!")
else:
echo("Bug!")

View file

@ -21,4 +21,4 @@ nr.intVal = 78
# s = nr # works
nr = s # fails!
echo "came here"

View file

@ -42,5 +42,5 @@ nr.intVal = 78
stack.push(nr)
var t = stack.pop()
echo "came here"

View file

@ -32,5 +32,6 @@ tsimtych.nim;5;type mismatch: got (bool) but expected 'string'
tstatret.nim;4;statement not allowed after
tstmtexp.nim;3;value returned by statement has to be discarded
ttempl2.nim;13;undeclared identifier: 'b'
ttypelessemptyset.nim;0;Error: internal error: invalid kind for last(tyEmpty)
tunderscores.nim;3;invalid token: _
typredef.nim;2;illegal recursion in type 'Uint8'

Can't render this file because it contains an unexpected character in line 23 and column 23.

View file

@ -2,5 +2,5 @@
from sdl import PSurface
discard SDL.CreateRGBSurface(SDL.SWSURFACE, 23, 34,
32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xff000000)
32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xff000000'i32)

View file

@ -1,4 +1,4 @@
import regexprs, strutils
import re, strutils
type
TURL = tuple[protocol, subdomain, domain, port: string, path: seq[string]]
@ -8,7 +8,7 @@ proc parseURL(url: string): TURL =
var pattern: string = r"([a-zA-Z]+://)?(\w+?\.)?(\w+)(\.\w+)(:[0-9]+)?(/.+)?"
var m: array[0..6, string] #Array with the matches
newSeq(m, 7) #ERROR
discard regexprs.match(url, pattern, m)
discard regexprs.match(url, re(pattern), m)
result = (protocol: m[1], subdomain: m[2], domain: m[3] & m[4],
port: m[5], path: m[6].split('/'))