version 0.8.10

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

208
build.bat
View File

@@ -1,4 +1,4 @@
@echo on
@echo off
REM Generated by niminst
SET CC=gcc
SET LINKER=gcc
@@ -7,77 +7,147 @@ SET LINK_FLAGS=
REM call the compiler:
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/system.c -o build/1_1/system.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/winlean.c -o build/1_1/winlean.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/times.c -o build/1_1/times.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/lists.c -o build/1_1/lists.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nhashes.c -o build/1_1/nhashes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nstrtabs.c -o build/1_1/nstrtabs.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/options.c -o build/1_1/options.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/msgs.c -o build/1_1/msgs.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nversion.c -o build/1_1/nversion.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/crc.c -o build/1_1/crc.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/platform.c -o build/1_1/platform.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ropes.c -o build/1_1/ropes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/idents.c -o build/1_1/idents.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ast.c -o build/1_1/ast.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/astalgo.c -o build/1_1/astalgo.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/condsyms.c -o build/1_1/condsyms.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/hashes.c -o build/1_1/hashes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/strtabs.c -o build/1_1/strtabs.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/streams.c -o build/1_1/streams.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/osproc.c -o build/1_1/osproc.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/extccomp.c -o build/1_1/extccomp.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/wordrecg.c -o build/1_1/wordrecg.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/commands.c -o build/1_1/commands.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/llstream.c -o build/1_1/llstream.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/lexbase.c -o build/1_1/lexbase.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/scanner.c -o build/1_1/scanner.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimconf.c -o build/1_1/nimconf.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/pnimsyn.c -o build/1_1/pnimsyn.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/pbraces.c -o build/1_1/pbraces.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rnimsyn.c -o build/1_1/rnimsyn.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/filters.c -o build/1_1/filters.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ptmplsyn.c -o build/1_1/ptmplsyn.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/syntaxes.c -o build/1_1/syntaxes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rodread.c -o build/1_1/rodread.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/trees.c -o build/1_1/trees.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/types.c -o build/1_1/types.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/math.c -o build/1_1/math.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/magicsys.c -o build/1_1/magicsys.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/bitsets.c -o build/1_1/bitsets.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimsets.c -o build/1_1/nimsets.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/passes.c -o build/1_1/passes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/treetab.c -o build/1_1/treetab.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/semdata.c -o build/1_1/semdata.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/lookups.c -o build/1_1/lookups.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/importer.c -o build/1_1/importer.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rodwrite.c -o build/1_1/rodwrite.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/semfold.c -o build/1_1/semfold.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/evals.c -o build/1_1/evals.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/procfind.c -o build/1_1/procfind.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/pragmas.c -o build/1_1/pragmas.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/sem.c -o build/1_1/sem.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rst.c -o build/1_1/rst.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/highlite.c -o build/1_1/highlite.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/docgen.c -o build/1_1/docgen.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ccgutils.c -o build/1_1/ccgutils.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/cgmeth.c -o build/1_1/cgmeth.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/cgen.c -o build/1_1/cgen.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ecmasgen.c -o build/1_1/ecmasgen.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/interact.c -o build/1_1/interact.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/passaux.c -o build/1_1/passaux.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/depends.c -o build/1_1/depends.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/transf.c -o build/1_1/transf.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/main.c -o build/1_1/main.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/parseopt.c -o build/1_1/parseopt.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/nim__dat.c -o build/1_1/nim__dat.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nim__dat.c -o build/1_1/nim__dat.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/parseutils.c -o build/1_1/parseutils.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/strutils.c -o build/1_1/strutils.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/os.c -o build/1_1/os.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/system.c -o build/1_1/system.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/system.c -o build/1_1/system.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimrod.c -o build/1_1/nimrod.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimrod.c -o build/1_1/nimrod.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/times.c -o build/1_1/times.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/times.c -o build/1_1/times.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/strutils.c -o build/1_1/strutils.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/strutils.c -o build/1_1/strutils.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/parseutils.c -o build/1_1/parseutils.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/parseutils.c -o build/1_1/parseutils.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/winlean.c -o build/1_1/winlean.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/winlean.c -o build/1_1/winlean.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/commands.c -o build/1_1/commands.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/commands.c -o build/1_1/commands.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/os.c -o build/1_1/os.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/os.c -o build/1_1/os.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/msgs.c -o build/1_1/msgs.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/msgs.c -o build/1_1/msgs.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/options.c -o build/1_1/options.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/options.c -o build/1_1/options.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/lists.c -o build/1_1/lists.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/lists.c -o build/1_1/lists.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/nstrtabs.c -o build/1_1/nstrtabs.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nstrtabs.c -o build/1_1/nstrtabs.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/nhashes.c -o build/1_1/nhashes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nhashes.c -o build/1_1/nhashes.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/nversion.c -o build/1_1/nversion.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nversion.c -o build/1_1/nversion.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/condsyms.c -o build/1_1/condsyms.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/condsyms.c -o build/1_1/condsyms.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/ast.c -o build/1_1/ast.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ast.c -o build/1_1/ast.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/crc.c -o build/1_1/crc.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/crc.c -o build/1_1/crc.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/ropes.c -o build/1_1/ropes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ropes.c -o build/1_1/ropes.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/platform.c -o build/1_1/platform.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/platform.c -o build/1_1/platform.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/idents.c -o build/1_1/idents.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/idents.c -o build/1_1/idents.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/astalgo.c -o build/1_1/astalgo.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/astalgo.c -o build/1_1/astalgo.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/extccomp.c -o build/1_1/extccomp.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/extccomp.c -o build/1_1/extccomp.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/osproc.c -o build/1_1/osproc.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/osproc.c -o build/1_1/osproc.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/strtabs.c -o build/1_1/strtabs.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/strtabs.c -o build/1_1/strtabs.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/hashes.c -o build/1_1/hashes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/hashes.c -o build/1_1/hashes.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/streams.c -o build/1_1/streams.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/streams.c -o build/1_1/streams.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/wordrecg.c -o build/1_1/wordrecg.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/wordrecg.c -o build/1_1/wordrecg.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/scanner.c -o build/1_1/scanner.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/scanner.c -o build/1_1/scanner.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/lexbase.c -o build/1_1/lexbase.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/lexbase.c -o build/1_1/lexbase.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/llstream.c -o build/1_1/llstream.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/llstream.c -o build/1_1/llstream.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimconf.c -o build/1_1/nimconf.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimconf.c -o build/1_1/nimconf.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/main.c -o build/1_1/main.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/main.c -o build/1_1/main.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/syntaxes.c -o build/1_1/syntaxes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/syntaxes.c -o build/1_1/syntaxes.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/pnimsyn.c -o build/1_1/pnimsyn.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/pnimsyn.c -o build/1_1/pnimsyn.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/pbraces.c -o build/1_1/pbraces.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/pbraces.c -o build/1_1/pbraces.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/ptmplsyn.c -o build/1_1/ptmplsyn.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ptmplsyn.c -o build/1_1/ptmplsyn.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/rnimsyn.c -o build/1_1/rnimsyn.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rnimsyn.c -o build/1_1/rnimsyn.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/filters.c -o build/1_1/filters.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/filters.c -o build/1_1/filters.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/rodread.c -o build/1_1/rodread.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rodread.c -o build/1_1/rodread.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/rodwrite.c -o build/1_1/rodwrite.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rodwrite.c -o build/1_1/rodwrite.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/passes.c -o build/1_1/passes.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/passes.c -o build/1_1/passes.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/types.c -o build/1_1/types.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/types.c -o build/1_1/types.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/trees.c -o build/1_1/trees.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/trees.c -o build/1_1/trees.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/math.c -o build/1_1/math.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/math.c -o build/1_1/math.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/magicsys.c -o build/1_1/magicsys.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/magicsys.c -o build/1_1/magicsys.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimsets.c -o build/1_1/nimsets.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/nimsets.c -o build/1_1/nimsets.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/bitsets.c -o build/1_1/bitsets.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/bitsets.c -o build/1_1/bitsets.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/importer.c -o build/1_1/importer.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/importer.c -o build/1_1/importer.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/lookups.c -o build/1_1/lookups.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/lookups.c -o build/1_1/lookups.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/semdata.c -o build/1_1/semdata.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/semdata.c -o build/1_1/semdata.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/treetab.c -o build/1_1/treetab.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/treetab.c -o build/1_1/treetab.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/sem.c -o build/1_1/sem.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/sem.c -o build/1_1/sem.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/evals.c -o build/1_1/evals.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/evals.c -o build/1_1/evals.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/semfold.c -o build/1_1/semfold.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/semfold.c -o build/1_1/semfold.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/procfind.c -o build/1_1/procfind.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/procfind.c -o build/1_1/procfind.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/pragmas.c -o build/1_1/pragmas.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/pragmas.c -o build/1_1/pragmas.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/docgen.c -o build/1_1/docgen.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/docgen.c -o build/1_1/docgen.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/rst.c -o build/1_1/rst.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/rst.c -o build/1_1/rst.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/highlite.c -o build/1_1/highlite.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/highlite.c -o build/1_1/highlite.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/cgen.c -o build/1_1/cgen.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/cgen.c -o build/1_1/cgen.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/ccgutils.c -o build/1_1/ccgutils.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ccgutils.c -o build/1_1/ccgutils.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/cgmeth.c -o build/1_1/cgmeth.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/cgmeth.c -o build/1_1/cgmeth.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/ecmasgen.c -o build/1_1/ecmasgen.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/ecmasgen.c -o build/1_1/ecmasgen.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/interact.c -o build/1_1/interact.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/interact.c -o build/1_1/interact.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/passaux.c -o build/1_1/passaux.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/passaux.c -o build/1_1/passaux.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/depends.c -o build/1_1/depends.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/depends.c -o build/1_1/depends.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/transf.c -o build/1_1/transf.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/transf.c -o build/1_1/transf.o
ECHO %CC% %COMP_FLAGS% -Ibuild -c build/1_1/parseopt.c -o build/1_1/parseopt.o
%CC% %COMP_FLAGS% -Ibuild -c build/1_1/parseopt.c -o build/1_1/parseopt.o
%LINKER% %LINK_FLAGS% -o bin\nimrod.exe build/1_1/system.o build/1_1/winlean.o build/1_1/times.o build/1_1/lists.o build/1_1/nhashes.o build/1_1/nstrtabs.o build/1_1/options.o build/1_1/msgs.o build/1_1/nversion.o build/1_1/crc.o build/1_1/platform.o build/1_1/ropes.o build/1_1/idents.o build/1_1/ast.o build/1_1/astalgo.o build/1_1/condsyms.o build/1_1/hashes.o build/1_1/strtabs.o build/1_1/streams.o build/1_1/osproc.o build/1_1/extccomp.o build/1_1/wordrecg.o build/1_1/commands.o build/1_1/llstream.o build/1_1/lexbase.o build/1_1/scanner.o build/1_1/nimconf.o build/1_1/pnimsyn.o build/1_1/pbraces.o build/1_1/rnimsyn.o build/1_1/filters.o build/1_1/ptmplsyn.o build/1_1/syntaxes.o build/1_1/rodread.o build/1_1/trees.o build/1_1/types.o build/1_1/math.o build/1_1/magicsys.o build/1_1/bitsets.o build/1_1/nimsets.o build/1_1/passes.o build/1_1/treetab.o build/1_1/semdata.o build/1_1/lookups.o build/1_1/importer.o build/1_1/rodwrite.o build/1_1/semfold.o build/1_1/evals.o build/1_1/procfind.o build/1_1/pragmas.o build/1_1/sem.o build/1_1/rst.o build/1_1/highlite.o build/1_1/docgen.o build/1_1/ccgutils.o build/1_1/cgmeth.o build/1_1/cgen.o build/1_1/ecmasgen.o build/1_1/interact.o build/1_1/passaux.o build/1_1/depends.o build/1_1/transf.o build/1_1/main.o build/1_1/parseopt.o build/1_1/nim__dat.o build/1_1/parseutils.o build/1_1/strutils.o build/1_1/os.o build/1_1/nimrod.o
ECHO %LINKER% %LINK_FLAGS% -o bin\nimrod.exe build/1_1/nim__dat.o build/1_1/system.o build/1_1/nimrod.o build/1_1/times.o build/1_1/strutils.o build/1_1/parseutils.o build/1_1/winlean.o build/1_1/commands.o build/1_1/os.o build/1_1/msgs.o build/1_1/options.o build/1_1/lists.o build/1_1/nstrtabs.o build/1_1/nhashes.o build/1_1/nversion.o build/1_1/condsyms.o build/1_1/ast.o build/1_1/crc.o build/1_1/ropes.o build/1_1/platform.o build/1_1/idents.o build/1_1/astalgo.o build/1_1/extccomp.o build/1_1/osproc.o build/1_1/strtabs.o build/1_1/hashes.o build/1_1/streams.o build/1_1/wordrecg.o build/1_1/scanner.o build/1_1/lexbase.o build/1_1/llstream.o build/1_1/nimconf.o build/1_1/main.o build/1_1/syntaxes.o build/1_1/pnimsyn.o build/1_1/pbraces.o build/1_1/ptmplsyn.o build/1_1/rnimsyn.o build/1_1/filters.o build/1_1/rodread.o build/1_1/rodwrite.o build/1_1/passes.o build/1_1/types.o build/1_1/trees.o build/1_1/math.o build/1_1/magicsys.o build/1_1/nimsets.o build/1_1/bitsets.o build/1_1/importer.o build/1_1/lookups.o build/1_1/semdata.o build/1_1/treetab.o build/1_1/sem.o build/1_1/evals.o build/1_1/semfold.o build/1_1/procfind.o build/1_1/pragmas.o build/1_1/docgen.o build/1_1/rst.o build/1_1/highlite.o build/1_1/cgen.o build/1_1/ccgutils.o build/1_1/cgmeth.o build/1_1/ecmasgen.o build/1_1/interact.o build/1_1/passaux.o build/1_1/depends.o build/1_1/transf.o build/1_1/parseopt.o
%LINKER% %LINK_FLAGS% -o bin\nimrod.exe build/1_1/nim__dat.o build/1_1/system.o build/1_1/nimrod.o build/1_1/times.o build/1_1/strutils.o build/1_1/parseutils.o build/1_1/winlean.o build/1_1/commands.o build/1_1/os.o build/1_1/msgs.o build/1_1/options.o build/1_1/lists.o build/1_1/nstrtabs.o build/1_1/nhashes.o build/1_1/nversion.o build/1_1/condsyms.o build/1_1/ast.o build/1_1/crc.o build/1_1/ropes.o build/1_1/platform.o build/1_1/idents.o build/1_1/astalgo.o build/1_1/extccomp.o build/1_1/osproc.o build/1_1/strtabs.o build/1_1/hashes.o build/1_1/streams.o build/1_1/wordrecg.o build/1_1/scanner.o build/1_1/lexbase.o build/1_1/llstream.o build/1_1/nimconf.o build/1_1/main.o build/1_1/syntaxes.o build/1_1/pnimsyn.o build/1_1/pbraces.o build/1_1/ptmplsyn.o build/1_1/rnimsyn.o build/1_1/filters.o build/1_1/rodread.o build/1_1/rodwrite.o build/1_1/passes.o build/1_1/types.o build/1_1/trees.o build/1_1/math.o build/1_1/magicsys.o build/1_1/nimsets.o build/1_1/bitsets.o build/1_1/importer.o build/1_1/lookups.o build/1_1/semdata.o build/1_1/treetab.o build/1_1/sem.o build/1_1/evals.o build/1_1/semfold.o build/1_1/procfind.o build/1_1/pragmas.o build/1_1/docgen.o build/1_1/rst.o build/1_1/highlite.o build/1_1/cgen.o build/1_1/ccgutils.o build/1_1/cgmeth.o build/1_1/ecmasgen.o build/1_1/interact.o build/1_1/passaux.o build/1_1/depends.o build/1_1/transf.o build/1_1/parseopt.o
ECHO SUCCESS

View File

@@ -38,8 +38,8 @@ if [ $# -eq 1 ] ; then
echo "removing files..."
rm -f $bindir/nimrod
rm -f $configdir/nimdoc.cfg
rm -f $configdir/nimrod.cfg
rm -f $configdir/nimdoc.cfg
rm -f $configdir/nimdoc.tex.cfg
rm -rf $docdir
rm -rf $datadir

View File

@@ -16,6 +16,9 @@ The documentation consists of several documents:
| The user guide lists command line arguments, special features of the
compiler, etc.
- | `Tools documentation <tools.html>`_
| Description of some tools that come with the standard distribution.
- | `Manual <manual.html>`_
| The Nimrod manual is a draft that will evolve into a proper specification.

11
doc/lib.txt Executable file → Normal file
View File

@@ -256,7 +256,7 @@ Other
Wrappers
========
The generated HTML for some of these wrappers is so huge, that it is
The generated HTML for some of these wrappers is so huge that it is
not contained in the distribution. You can then find them on the website.
Windows specific
@@ -321,6 +321,15 @@ UNIX specific
Part of the wrapper for X11.
Regular expressions
-------------------
* `pcre <pcre.html>`_
Wrapper for the PCRE library.
* `tre <tre.html>`_
Wrapper for the TRE library.
Graphics libraries
------------------

191
doc/niminst.txt Executable file
View File

@@ -0,0 +1,191 @@
=================================
niminst User's manual
=================================
:Author: Andreas Rumpf
:Version: |nimrodversion|
.. contents::
Introduction
============
niminst is a tool to generate an installer for a Nimrod program. Currently
it can create an installer for Windows via `Inno Setup <>`_ as well as
installation/deinstallation scripts for UNIX. Later versions will support
Linux' package management systems.
niminst works by reading a configuration file that contains all the
information that it needs to generate an installer for the different operating
systems.
Configuration file
==================
niminst uses the Nimrod `parsecfg <parsecfg.html>`_ module to parse the
configuration file. Here's an example of how the syntax looks like:
.. include:: doc/mytest.cfg
:literal:
The value of a key-value pair can reference user-defined variables via
the ``$variable`` notation: They can be defined in the command line with the
``--var:name=value`` switch. This is useful to not hard-coding the
program's version number into the configuration file, for instance.
It follows a description of each possible section and how it affects the
generated installers.
Project section
---------------
The project section gathers general information about your project. It must
contain the following key-value pairs:
==================== =======================================================
Key description
==================== =======================================================
``Name`` the project's name; this needs to be a single word
``DisplayName`` the project's long name; this can contain spaces. If
not specified, this is the same as ``Name``.
``Version`` the project's version
``OS`` the OSes to generate C code for; for example:
``"windows;linux;macosx"``
``CPU`` the CPUs to generate C code for; for example:
``"i386;amd64;powerpc"``
``Authors`` the project's authors
``Description`` the project's description
``App`` the application's type: "Console" or "GUI". If
"Console", niminst generates a special batch file
for Windows to open up the command line shell.
``License`` the filename of the application's license
==================== =======================================================
``files`` key
-------------
Many sections support the ``files`` key. Listed filenames
can be separated by semicolon or the ``files`` key can be repeated. Wildcards
in filenames are supported. If it is a directory name, all files in the
directory are used::
[Config]
Files: "configDir"
Files: "otherconfig/*.conf;otherconfig/*.cfg"
Config section
--------------
The ``config`` section currently only supports the ``files`` key. Listed files
will be installed into the OS's configuration directory.
Documentation section
---------------------
The ``documentation`` section currently only supports the ``files`` key.
Listed files will be installed into the OS's native documentation directory
(which might be ``$appdir/doc``).
Other section
-------------
The ``other`` section currently only supports the ``files`` key.
Listed files will be installed into the application installation directory
(``$appdir``).
Lib section
-----------
The ``lib`` section currently only supports the ``files`` key.
Listed files will be installed into the OS's native library directory
(which might be ``$appdir/lib``).
Windows section
---------------
The ``windows`` section supports the ``files`` key for Windows specific files.
Listed files will be installed into the application installation directory
(``$appdir``).
Other possible options are:
==================== =======================================================
Key description
==================== =======================================================
``BinPath`` paths to add to the Windows ``%PATH%`` environment
variable. Example: ``BinPath: r"bin;dist\mingw\bin"``
``InnoSetup`` boolean flag whether an Inno Setup installer should be
generated for Windows. Example: ``InnoSetup: "Yes"``
==================== =======================================================
UnixBin section
---------------
The ``UnixBin`` section currently only supports the ``files`` key.
Listed files will be installed into the OS's native bin directory
(e.g. ``/usr/local/bin``). The exact location depends on the
installation path the user specifies when running the ``install.sh`` script.
Unix section
------------
Possible options are:
==================== =======================================================
Key description
==================== =======================================================
``InstallScript`` boolean flag whether an installation shell script
should be generated. Example: ``InstallScript: "Yes"``
``UninstallScript`` boolean flag whether a deinstallation shell script
should be generated.
Example: ``UninstallScript: "Yes"``
==================== =======================================================
InnoSetup section
-----------------
Possible options are:
==================== =======================================================
Key description
==================== =======================================================
``path`` Path to Inno Setup.
Example: ``path = r"c:\inno setup 5\iscc.exe"``
``flags`` Flags to pass to Inno Setup.
Example: ``flags = "/Q"``
==================== =======================================================
C_Compiler section
------------------
Possible options are:
==================== =======================================================
Key description
==================== =======================================================
``path`` Path to the C compiler.
``flags`` Flags to pass to the C Compiler.
Example: ``flags = "-w"``
==================== =======================================================
Real world example
==================
The installers for the Nimrod compiler itself are generated by niminst. Have a
look at its configuration file:
.. include:: rod/nimrod.ini
:literal:

File diff suppressed because it is too large Load Diff

12
doc/tools.txt Executable file
View File

@@ -0,0 +1,12 @@
=====
Tools
=====
The standard distribution ships with the following tools:
- | `Nimrod Installation Generator <niminst.html>`_
| How to generate a nice installer for your Nimrod program.
- | `C2nim <c2nim.html>`_
| C to Nimrod source converter. Translates C header files to Nimrod.

BIN
icons/koch.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

3
icons/koch.rc Normal file
View File

@@ -0,0 +1,3 @@
kochicon ICON "koch.ico"

BIN
icons/koch.res Normal file

Binary file not shown.

BIN
icons/nimrod.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

3
icons/nimrod.rc Normal file
View File

@@ -0,0 +1,3 @@
nimrodicon ICON "nimrod.ico"

BIN
icons/nimrod.res Normal file

Binary file not shown.

21
koch.nim Executable file → Normal file
View File

@@ -7,6 +7,9 @@
# distribution, for details about the copyright.
#
when defined(gcc) and defined(windows):
{.link: "icons/koch.res".}
import
os, strutils, parseopt
@@ -29,11 +32,13 @@ Possible Commands:
web generates the website
csource [options] builds the C sources for installation
zip builds the installation ZIP package
inno builds the Inno Setup installer
inno [options] builds the Inno Setup installer
Boot options:
-d:release produce a release version of the compiler
-d:tinyc include the Tiny C backend (not supported on Windows)
"""
proc exe(f: string): string = return addFileExt(f, ExeExt)
proc exec(cmd: string) =
echo(cmd)
@@ -51,9 +56,15 @@ proc zip(args: string) =
exec("nimrod cc -r tools/niminst --var:version=$# zip rod/nimrod" %
NimrodVersion)
proc inno(args: string) =
exec("nimrod cc -r tools/niminst --var:version=$# inno rod/nimrod" %
NimrodVersion)
proc buildTool(toolname, args: string) =
exec("nimrod cc $# $#" % [args, toolname])
copyFile(dest="bin"/ splitFile(toolname).name.exe, source=toolname.exe)
proc inno(args: string) =
# make sure we have generated the c2nim and niminst executables:
buildTool("tools/niminst", args)
buildTool("rod/c2nim/c2nim", args)
exec("tools/niminst --var:version=$# inno rod/nimrod" % NimrodVersion)
proc install(args: string) =
exec("sh ./build.sh")
@@ -61,8 +72,6 @@ proc install(args: string) =
proc web(args: string) =
exec("nimrod cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" %
NimrodVersion)
proc exe(f: string): string = return addFileExt(f, ExeExt)
# -------------- nim ----------------------------------------------------------

View File

@@ -1,181 +0,0 @@
#
#
# Nimrod's Runtime Library
# (c) Copyright 2010 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
## Parses & constructs URLs.
# From the spec:
#
# This specification uses the Augmented Backus-Naur Form (ABNF)
# notation of [RFC2234], including the following core ABNF syntax rules
# defined by that specification: ALPHA (letters), CR (carriage return),
# DIGIT (decimal digits), DQUOTE (double quote), HEXDIG (hexadecimal
# digits), LF (line feed), and SP (space).
#
#
# URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
#
# hier-part = "//" authority path-abempty
# / path-absolute
# / path-rootless
# / path-empty
#
# URI-reference = URI / relative-ref
#
# absolute-URI = scheme ":" hier-part [ "?" query ]
#
# relative-ref = relative-part [ "?" query ] [ "#" fragment ]
#
# relative-part = "//" authority path-abempty
# / path-absolute
# / path-noscheme
# / path-empty
#
# scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
#
# authority = [ userinfo "@" ] host [ ":" port ]
# userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
# host = IP-literal / IPv4address / reg-name
# port = *DIGIT
#
# IP-literal = "[" ( IPv6address / IPvFuture ) "]"
#
# IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
#
# IPv6address = 6( h16 ":" ) ls32
# / "::" 5( h16 ":" ) ls32
# / [ h16 ] "::" 4( h16 ":" ) ls32
# / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
# / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
# / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
# / [ *4( h16 ":" ) h16 ] "::" ls32
# / [ *5( h16 ":" ) h16 ] "::" h16
# / [ *6( h16 ":" ) h16 ] "::"
#
# h16 = 1*4HEXDIG
# ls32 = ( h16 ":" h16 ) / IPv4address
# IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
#
# dec-octet = DIGIT ; 0-9
# / %x31-39 DIGIT ; 10-99
# / "1" 2DIGIT ; 100-199
# / "2" %x30-34 DIGIT ; 200-249
# / "25" %x30-35 ; 250-255
#
# reg-name = *( unreserved / pct-encoded / sub-delims )
#
# path = path-abempty ; begins with "/" or is empty
# / path-absolute ; begins with "/" but not "//"
# / path-noscheme ; begins with a non-colon segment
# / path-rootless ; begins with a segment
# / path-empty ; zero characters
#
# path-abempty = *( "/" segment )
# path-absolute = "/" [ segment-nz *( "/" segment ) ]
# path-noscheme = segment-nz-nc *( "/" segment )
# path-rootless = segment-nz *( "/" segment )
# path-empty = 0<pchar>
#
# segment = *pchar
# segment-nz = 1*pchar
# segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
# ; non-zero-length segment without any colon ":"
#
# pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
#
# query = *( pchar / "/" / "?" )
#
# fragment = *( pchar / "/" / "?" )
#
# pct-encoded = "%" HEXDIG HEXDIG
#
# unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
# reserved = gen-delims / sub-delims
# gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
# / "*" / "+" / "," / ";" / "="
#
import strutils
type
TUrl* = tuple[ ## represents a *Uniform Resource Locator* (URL)
## any optional component is "" if it does not exist
protocol: string ## for example ``http:``
username: string ## for example ``paul`` (optional)
password: string ## for example ``r2d2`` (optional)
subdomain: string ##
domain,
port,
path,
query,
anchor: string]
proc host*(u: TUrl): string =
## returns the host of the URL
proc parse*(url: string): TURL =
const pattern = r"([a-zA-Z]+://)?(.+@)?(.+\.)?(\w+)(\.\w+)(:[0-9]+)?(/.+)?"
var m: array[0..7, string] #Array with the matches
discard regexprs.match(url, pattern, m)
var msplit = m[2].split(':')
var username: string = ""
var password: string = ""
if m[2] != "":
username = msplit[0]
if msplit.len() == 2:
password = msplit[1].replace("@", "")
var path: string = ""
var query: string = ""
var anchor: string = ""
if m[7] != nil:
msplit = m[7].split('?')
path = msplit[0]
query = ""
anchor = ""
if msplit.len() == 2:
query = "?" & msplit[1]
msplit = path.split('#')
if msplit.len() == 2:
anchor = "#" & msplit[1]
path = msplit[0]
msplit = query.split('#')
if msplit.len() == 2:
anchor = "#" & msplit[1]
query = msplit[0]
result = (protocol: m[1], username: username, password: password,
subdomain: m[3], domain: m[4] & m[5], port: m[6], path: path, query: query, anchor: anchor)
when isMainModule:
proc test(r: TURL) =
echo("protocol=" & r.protocol)
echo("username=" & r.username)
echo("password=" & r.password)
echo("subdomain=" & r.subdomain)
echo("domain=" & r.domain)
echo("port=" & r.port)
echo("path=" & r.path)
echo("query=" & r.query)
echo("anchor=" & r.anchor)
echo("---------------")
var r: TUrl
r = parse(r"http://google.co.uk/search?var=bleahdhsad")
test(r)
r = parse(r"http://dom96:test@google.com:80/search.php?q=562gs6&foo=6gs6&bar=7hs6#test")
test(r)
r = parse(r"http://www.google.co.uk/search?q=multiple+subdomains&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:pl:official&client=firefox-a")
test(r)

View File

@@ -9,7 +9,7 @@
## Regular expression support for Nimrod. Consider using the pegs module
## instead.
## Currently this module is implemented by providing a wrapper around the
## This module is implemented by providing a wrapper around the
## `PRCE (Perl-Compatible Regular Expressions) <http://www.pcre.org>`_
## C library. This means that your application will depend on the PRCE
## library's licence when using this module, which should not be a problem
@@ -45,8 +45,8 @@ type
proc rawCompile(pattern: string, flags: cint): PPcre =
var
msg: CString
offset: int
com = pcreCompile(pattern, flags, addr(msg), addr(offset), nil)
offset: cint
com = pcre.Compile(pattern, flags, addr(msg), addr(offset), nil)
if com == nil:
var e: ref EInvalidRegEx
new(e)
@@ -54,7 +54,11 @@ proc rawCompile(pattern: string, flags: cint): PPcre =
raise e
return com
proc finalizeRegEx(x: TRegEx) = dealloc(x.h)
proc finalizeRegEx(x: TRegEx) =
# XXX This is a hack, but PCRE does not export it's "free" function properly.
# Sigh. The hack relies on PCRE's implementation (see ``pcre_get.c``).
# Fortunately the implementation is unlikely to change.
pcre.free_substring(cast[cstring](x.h))
proc re*(s: string, flags = {reExtended}): TRegEx =
## Constructor of regular expressions. Note that Nimrod's
@@ -67,7 +71,7 @@ proc matchOrFind(s: string, pattern: TRegEx, matches: var openarray[string],
start, flags: cint): cint =
var
rawMatches: array[0..maxSubpatterns * 3 - 1, cint]
res = pcreExec(pattern.h, nil, s, len(s), start, flags,
res = pcre.Exec(pattern.h, nil, s, len(s), start, flags,
cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3)
if res < 0'i32: return res
for i in 1..int(res)-1:
@@ -79,7 +83,7 @@ proc matchOrFind(s: string, pattern: TRegEx, matches: var openarray[string],
proc matchOrFind(s: string, pattern: TRegEx, start, flags: cint): cint =
var rawMatches: array [0..maxSubpatterns * 3 - 1, cint]
result = pcreExec(pattern.h, nil, s, len(s), start, flags,
result = pcre.Exec(pattern.h, nil, s, len(s), start, flags,
cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3)
if result >= 0'i32:
result = rawMatches[1] - rawMatches[0]
@@ -91,24 +95,24 @@ proc match*(s: string, pattern: TRegEx, matches: var openarray[string],
## match, nothing is written into ``matches`` and ``false`` is
## returned.
return matchOrFind(s, pattern, matches, start,
PCRE_ANCHORED) == cint(s.len - start)
pcre.ANCHORED) == cint(s.len - start)
proc match*(s: string, pattern: TRegEx, start = 0): bool =
## returns ``true`` if ``s[start..]`` matches the ``pattern``.
return matchOrFind(s, pattern, start, PCRE_ANCHORED) == cint(s.len - start)
return matchOrFind(s, pattern, start, pcre.ANCHORED) == cint(s.len - start)
proc matchLen*(s: string, pattern: TRegEx, matches: var openarray[string],
start = 0): int =
## the same as ``match``, but it returns the length of the match,
## if there is no match, -1 is returned. Note that a match length
## of zero can happen.
return matchOrFind(s, pattern, matches, start, PCRE_ANCHORED)
return matchOrFind(s, pattern, matches, start, pcre.ANCHORED)
proc matchLen*(s: string, pattern: TRegEx, start = 0): int =
## the same as ``match``, but it returns the length of the match,
## if there is no match, -1 is returned. Note that a match length
## of zero can happen.
return matchOrFind(s, pattern, start, PCRE_ANCHORED)
return matchOrFind(s, pattern, start, pcre.ANCHORED)
proc find*(s: string, pattern: TRegEx, matches: var openarray[string],
start = 0): int =
@@ -117,7 +121,7 @@ proc find*(s: string, pattern: TRegEx, matches: var openarray[string],
## is written into ``matches`` and -1 is returned.
var
rawMatches: array[0..maxSubpatterns * 3 - 1, cint]
res = pcreExec(pattern.h, nil, s, len(s), start, 0'i32,
res = pcre.Exec(pattern.h, nil, s, len(s), start, 0'i32,
cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3)
if res < 0'i32: return res
for i in 1..int(res)-1:

View File

@@ -64,7 +64,7 @@ proc rawCompile(pattern: string, flags: cint): PPcre =
var
msg: CString
offset: int
com = pcreCompile(pattern, flags, addr(msg), addr(offset), nil)
com = pcre.Compile(pattern, flags, addr(msg), addr(offset), nil)
if com == nil:
var e: ref EInvalidRegEx
new(e)

View File

@@ -185,7 +185,7 @@ template gcTrace(cell, state: expr): stmt =
# forward declarations:
proc collectCT(gch: var TGcHeap)
proc IsOnStack(p: pointer): bool {.noinline.}
proc IsOnStack*(p: pointer): bool {.noinline.}
proc forAllChildren(cell: PCell, op: TWalkOp)
proc doOperation(p: pointer, op: TWalkOp)
proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp)
@@ -223,6 +223,7 @@ proc decRef(c: PCell) {.inline.} =
if c.refcount <% rcIncrement:
writeCell("broken cell", c)
assert(c.refcount >=% rcIncrement)
#if c.refcount <% rcIncrement: quit("leck mich")
if atomicDec(c.refcount, rcIncrement) <% rcIncrement:
rtlAddZCT(c)
elif canBeCycleRoot(c):
@@ -523,7 +524,7 @@ when defined(sparc): # For SPARC architecture.
var b = cast[TAddress](stackBottom)
var a = cast[TAddress](addr(stackTop))
var x = cast[TAddress](p)
result = x >=% a and x <=% b
result = a <=% x and x <=% b
proc markStackAndRegisters(gch: var TGcHeap) {.noinline, cdecl.} =
when defined(sparcv9):
@@ -553,7 +554,7 @@ elif stackIncreases:
var a = cast[TAddress](stackBottom)
var b = cast[TAddress](addr(stackTop))
var x = cast[TAddress](p)
result = x >=% a and x <=% b
result = a <=% x and x <=% b
var
jmpbufSize {.importc: "sizeof(jmp_buf)", nodecl.}: int
@@ -580,7 +581,7 @@ else:
var b = cast[TAddress](stackBottom)
var a = cast[TAddress](addr(stackTop))
var x = cast[TAddress](p)
result = x >=% a and x <=% b
result = a <=% x and x <=% b
proc markStackAndRegisters(gch: var TGcHeap) {.noinline, cdecl.} =
# We use a jmp_buf buffer that is in the C stack.

View File

@@ -36,7 +36,7 @@ type
DWORD_PTR* = ptr DWORD
pHICON* = ptr HICON
pBool* = ptr BOOL
STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows.
STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows.
cb*: DWORD
lpReserved*: LPTSTR
lpDesktop*: LPTSTR

View File

@@ -17,7 +17,6 @@ type
PWideChar* = ptr int16
type # WinNT.h -- Defines the 32-Bit Windows types and constants
CHAR* = int8
SHORT* = int16
LONG* = int
# UNICODE (Wide Character) types

View File

@@ -8,7 +8,7 @@ when not defined(expatDll):
expatDll = "expat.dll"
elif defined(macosx):
const
expatDll = "libexpat.dynlib"
expatDll = "libexpat.dylib"
else:
const
expatDll = "libexpat.so(.1|)"

View File

@@ -1,259 +0,0 @@
#
#
# Nimrod's Runtime Library
# (c) Copyright 2009 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
{.compile: "pcre_all.c".}
type
Pbyte = ptr byte
PPchar = ptr cstring
Pint = ptr cint
PPcre* = ptr Tpcre
Pcallout_block* = ptr tcallout_block
Pextra* = ptr Textra
Tpcre {.final, pure.} = object
# The structure for passing additional data to pcre_exec(). This is defined
# in such as way as to be extensible.
# Bits for which fields are set
# Opaque data from pcre_study()
# Maximum number of calls to match()
# Data passed back in callouts
# Const before type ignored
# Pointer to character tables
Textra*{.final, pure.} = object # The structure for passing out data via the pcre_callout_function. We use a
# structure so that new fields can be added on the end in future versions,
# without changing the API of the function, thereby allowing old clients to
# work without modification.
# Identifies version of block
# ------------------------ Version 0 -------------------------------
# Number compiled into pattern
# The offset vector
# Const before type ignored
# The subject being matched
# The length of the subject
# Offset to start of this match attempt
# Where we currently are in the subject
# Max current capture
# Most recently closed capture
# Data passed in with the call
# ------------------- Added for Version 1 --------------------------
# Offset to next item in the pattern
# Length of next item in the pattern
#
# ------------------------------------------------------------------
flags: cint
study_data: pointer
match_limit: cint
callout_data: pointer
tables: ptr byte
Tcallout_block*{.final, pure.} = object
version: cint
callout_number: cint
offset_vector: ptr cint
subject: ptr char
subject_length: cint
start_match: cint
current_position: cint
capture_top: cint
capture_last: cint
callout_data: pointer
pattern_position: cint
next_item_length: cint
#************************************************
#* Perl-Compatible Regular Expressions *
#************************************************
#
# Modified by Andreas Rumpf for h2pas.
# In its original form, this is the .in file that is transformed by
# "configure" into pcre.h.
#
# Copyright (c) 1997-2005 University of Cambridge
#
# -----------------------------------------------------------------------------
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the University of Cambridge nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# The file pcre.h is build by "configure". Do not edit it; instead
# make changes to pcre.in.
const
PCRE_MAJOR* = 6
PCRE_MINOR* = 3
PCRE_DATE* = "2005/11/29"
# Options
PCRE_CASELESS* = 0x00000001
PCRE_MULTILINE* = 0x00000002
PCRE_DOTALL* = 0x00000004
PCRE_EXTENDED* = 0x00000008
PCRE_ANCHORED* = 0x00000010
PCRE_DOLLAR_ENDONLY* = 0x00000020
PCRE_EXTRA* = 0x00000040
PCRE_NOTBOL* = 0x00000080
PCRE_NOTEOL* = 0x00000100
PCRE_UNGREEDY* = 0x00000200
PCRE_NOTEMPTY* = 0x00000400
PCRE_UTF8* = 0x00000800
PCRE_NO_AUTO_CAPTURE* = 0x00001000
PCRE_NO_UTF8_CHECK* = 0x00002000
PCRE_AUTO_CALLOUT* = 0x00004000
PCRE_PARTIAL* = 0x00008000
PCRE_DFA_SHORTEST* = 0x00010000
PCRE_DFA_RESTART* = 0x00020000
PCRE_FIRSTLINE* = 0x00040000
# Exec-time and get/set-time error codes
PCRE_ERROR_NOMATCH* = - (1)
PCRE_ERROR_NULL* = - (2)
PCRE_ERROR_BADOPTION* = - (3)
PCRE_ERROR_BADMAGIC* = - (4)
PCRE_ERROR_UNKNOWN_NODE* = - (5)
PCRE_ERROR_NOMEMORY* = - (6)
PCRE_ERROR_NOSUBSTRING* = - (7)
PCRE_ERROR_MATCHLIMIT* = - (8)
# Never used by PCRE itself
PCRE_ERROR_CALLOUT* = - (9)
PCRE_ERROR_BADUTF8* = - (10)
PCRE_ERROR_BADUTF8_OFFSET* = - (11)
PCRE_ERROR_PARTIAL* = - (12)
PCRE_ERROR_BADPARTIAL* = - (13)
PCRE_ERROR_INTERNAL* = - (14)
PCRE_ERROR_BADCOUNT* = - (15)
PCRE_ERROR_DFA_UITEM* = - (16)
PCRE_ERROR_DFA_UCOND* = - (17)
PCRE_ERROR_DFA_UMLIMIT* = - (18)
PCRE_ERROR_DFA_WSSIZE* = - (19)
PCRE_ERROR_DFA_RECURSE* = - (20)
# Request types for pcre_fullinfo()
PCRE_INFO_OPTIONS* = 0
PCRE_INFO_SIZE* = 1
PCRE_INFO_CAPTURECOUNT* = 2
PCRE_INFO_BACKREFMAX* = 3
PCRE_INFO_FIRSTBYTE* = 4
# For backwards compatibility
PCRE_INFO_FIRSTCHAR* = 4
PCRE_INFO_FIRSTTABLE* = 5
PCRE_INFO_LASTLITERAL* = 6
PCRE_INFO_NAMEENTRYSIZE* = 7
PCRE_INFO_NAMECOUNT* = 8
PCRE_INFO_NAMETABLE* = 9
PCRE_INFO_STUDYSIZE* = 10
PCRE_INFO_DEFAULT_TABLES* = 11
# Request types for pcre_config()
PCRE_CONFIG_UTF8* = 0
PCRE_CONFIG_NEWLINE* = 1
PCRE_CONFIG_LINK_SIZE* = 2
PCRE_CONFIG_POSIX_MALLOC_THRESHOLD* = 3
PCRE_CONFIG_MATCH_LIMIT* = 4
PCRE_CONFIG_STACKRECURSE* = 5
PCRE_CONFIG_UNICODE_PROPERTIES* = 6
# Bit flags for the pcre_extra structure
PCRE_EXTRA_STUDY_DATA* = 0x00000001
PCRE_EXTRA_MATCH_LIMIT* = 0x00000002
PCRE_EXTRA_CALLOUT_DATA* = 0x00000004
PCRE_EXTRA_TABLES* = 0x00000008
# Exported PCRE functions
proc pcre_compile*(para1: cstring, para2: cint, para3: ptr cstring,
para4: ptr int, para5: Pbyte): PPcre{.importc: "pcre_compile",
noconv.}
proc pcre_compile2*(para1: cstring, para2: cint, para3: Pint, para4: PPchar,
para5: ptr int, para6: Pbyte): PPcre{.importc: "pcre_compile2",
noconv.}
proc pcre_config*(para1: cint, para2: pointer): cint{.importc: "pcre_config",
noconv.}
proc pcre_copy_named_substring*(para1: PPcre, para2: cstring, para3: Pint,
para4: cint, para5: cstring, para6: cstring,
para7: cint): cint{.
importc: "pcre_copy_named_substring", noconv.}
proc pcre_copy_substring*(para1: cstring, para2: Pint, para3: cint, para4: cint,
para5: cstring, para6: cint): cint{.
importc: "pcre_copy_substring", noconv.}
proc pcre_dfa_exec*(para1: PPcre, para2: Pextra, para3: cstring, para4: cint,
para5: cint, para6: cint, para7: Pint, para8: cint,
para9: Pint, para10: cint): cint{.importc: "pcre_dfa_exec",
noconv.}
proc pcre_exec*(para1: PPcre, para2: Pextra, para3: cstring, para4: cint,
para5: cint, para6: cint, para7: Pint, para8: cint): cint{.
importc: "pcre_exec", noconv.}
proc pcre_free_substring*(para1: cstring){.importc: "pcre_free_substring",
noconv.}
proc pcre_free_substring_list*(para1: PPchar){.
importc: "pcre_free_substring_list", noconv.}
proc pcre_fullinfo*(para1: PPcre, para2: Pextra, para3: cint, para4: pointer): cint{.
importc: "pcre_fullinfo", noconv.}
proc pcre_get_named_substring*(para1: PPcre, para2: cstring, para3: Pint,
para4: cint, para5: cstring, para6: PPchar): cint{.
importc: "pcre_get_named_substring", noconv.}
proc pcre_get_stringnumber*(para1: PPcre, para2: cstring): cint{.
importc: "pcre_get_stringnumber", noconv.}
proc pcre_get_substring*(para1: cstring, para2: Pint, para3: cint, para4: cint,
para5: PPchar): cint{.importc: "pcre_get_substring",
noconv.}
proc pcre_get_substring_list*(para1: cstring, para2: Pint, para3: cint,
para4: ptr PPchar): cint{.
importc: "pcre_get_substring_list", noconv.}
proc pcre_info*(para1: PPcre, para2: Pint, para3: Pint): cint{.importc: "pcre_info",
noconv.}
proc pcre_maketables*(): ptr byte{.importc: "pcre_maketables", noconv.}
proc pcre_refcount*(para1: PPcre, para2: cint): cint{.importc: "pcre_refcount",
noconv.}
proc pcre_study*(para1: PPcre, para2: cint, para3: ptr CString): Pextra{.
importc: "pcre_study", noconv.}
proc pcre_version*(): CString{.importc: "pcre_version", noconv.}
# Indirection for store get and free functions. These can be set to
# alternative malloc/free functions if required. Special ones are used in the
# non-recursive case for "frames". There is also an optional callout function
# that is triggered by the (?) regex item.
#
# we use Nimrod's memory manager (but not GC!) for these functions:
type
TMalloc = proc (para1: int): pointer{.noconv.}
TFree = proc (para1: pointer){.noconv.}
var
pcre_malloc{.importc: "pcre_malloc".}: TMalloc
pcre_free{.importc: "pcre_free".}: TFree
pcre_stack_malloc{.importc: "pcre_stack_malloc".}: TMalloc
pcre_stack_free{.importc: "pcre_stack_free".}: TFree
pcre_callout{.importc: "pcre_callout".}: proc (para1: Pcallout_block): cint{.
noconv.}
pcre_malloc = cast[TMalloc](system.alloc)
pcre_free = cast[TFree](system.dealloc)
pcre_stack_malloc = cast[TMalloc](system.alloc)
pcre_stack_free = cast[TFree](system.dealloc)
pcre_callout = nil

File diff suppressed because it is too large Load Diff

View File

@@ -719,6 +719,8 @@ proc enumFields(p: var TParser): PNode =
addSon(result, e)
if p.tok.xkind != pxComma: break
getTok(p, e)
# allow trailing comma:
if p.tok.xkind == pxCurlyRi: break
proc parseTypedefStruct(p: var TParser, result: PNode, isUnion: bool) =
getTok(p, result)
@@ -965,6 +967,8 @@ proc enumSpecifier(p: var TParser): PNode =
addSon(result, c)
if p.tok.xkind != pxComma: break
getTok(p, c)
# allow trailing comma:
if p.tok.xkind == pxCurlyRi: break
eat(p, pxCurlyRi, result)
eat(p, pxSemicolon)
of pxSymbol:

3
rod/extccomp.nim Executable file → Normal file
View File

@@ -294,7 +294,8 @@ proc addLinkOption(option: string) =
if find(linkOptions, option, 0) < 0: addOpt(linkOptions, option)
proc toObjFile(filenameWithoutExt: string): string =
result = changeFileExt(filenameWithoutExt, cc[ccompiler].objExt)
# BUGFIX: changeFileExt is wrong, use addFileExt!
result = addFileExt(filenameWithoutExt, cc[ccompiler].objExt)
proc addFileToCompile(filename: string) =
appendStr(toCompile, filename)

17
rod/nimrod.ini Executable file → Normal file
View File

@@ -21,24 +21,29 @@ App: Console
License: "copying.txt"
[Config]
Files: "config/nimdoc.cfg"
Files: "config/nimrod.cfg"
Files: "config/nimdoc.cfg"
Files: "config/nimdoc.tex.cfg"
[Documentation]
Files: "doc/*.txt"
Files: "doc/*.html"
Files: "doc/*.cfg"
Files: "doc/*.pdf"
[Other]
Files: "readme.txt;install.txt;contributors.txt"
Files: "configure;makefile"
Files: "*.html"
Files: "gpl.html"
Files: "*.ini"
Files: "*.nim"
Files: "koch.nim"
Files: "icons/nimrod.ico"
Files: "icons/nimrod.rc"
Files: "icons/nimrod.res"
Files: "icons/koch.ico"
Files: "icons/koch.rc"
Files: "icons/koch.res"
Files: "rod/readme.txt"
Files: "rod/nimrod.ini"
@@ -66,8 +71,6 @@ Files: "lib/wrappers/cairo/*.nim"
Files: "lib/wrappers/gtk/*.nim"
Files: "lib/wrappers/lua/*.nim"
Files: "lib/wrappers/opengl/*.nim"
Files: "lib/wrappers/pcre/*.nim"
Files: "lib/wrappers/pcre/pcre_all.c"
Files: "lib/wrappers/sdl/*.nim"
Files: "lib/wrappers/x11/*.nim"
Files: "lib/wrappers/zip/*.nim"
@@ -108,10 +111,12 @@ Files: "examples/*.tmpl"
[Windows]
Files: "bin/nimrod.exe"
Files: "bin/c2nim.exe"
Files: "bin/niminst.exe"
Files: "koch.exe"
Files: "dist/mingw"
Files: "start.bat"
BinPath: r"bin;dist\mingw\bin"
BinPath: r"bin;dist\mingw\bin;deps"
InnoSetup: "Yes"
[UnixBin]

3
rod/nimrod.nim Executable file → Normal file
View File

@@ -7,6 +7,9 @@
# distribution, for details about the copyright.
#
when defined(gcc) and defined(windows):
{.link: "icons/nimrod.res".}
import
times, commands, scanner, condsyms, options, msgs, nversion, nimconf, ropes,
extccomp, strutils, os, platform, main, parseopt

View File

@@ -15,6 +15,6 @@ const
defaultAsmMarkerSymbol* = '!'
VersionMajor* = 0
VersionMinor* = 8
VersionPatch* = 9
VersionPatch* = 10
VersionAsString* = $VersionMajor & "." & $VersionMinor & "." & $VersionPatch

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('/'))

View File

@@ -1,12 +1,7 @@
For version 0.8.10
==================
- fix implicit generic routines
High priority (version 0.9.0)
=============================
- fix implicit generic routines
- fix the streams implementation so that it uses methods
- fix overloading resolution
- wrong co-/contravariance
@@ -27,9 +22,6 @@ To implement
* the two other parsers
* distinct types for array/seq indexes
* constant sequences
* IMPLEMENT GENERIC TYPES!
- implement expr parameters
- document generic types better
* implement closures for the C code generator

View File

@@ -1,6 +1,6 @@
#! stdtmpl(subsChar='?') | standard
#proc GenerateBuildBatchScript(c: TConfigData): string =
# result = "@echo on\nREM Generated by niminst\n"
# result = "@echo off\nREM Generated by niminst\n"
SET CC=gcc
SET LINKER=gcc
SET COMP_FLAGS=-w -O3 -fno-strict-aliasing
@@ -10,10 +10,12 @@ REM call the compiler:
# var linkCmd = ""
# for f in items(c.cfiles[1][1]):
ECHO %CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
%CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
# linkCmd.add(" " & changeFileExt(f, "o"))
# end for
ECHO %LINKER% %LINK_FLAGS% -o ?{c.binPaths[0]}\?{toLower(c.name)}.exe ?linkCmd
%LINKER% %LINK_FLAGS% -o ?{c.binPaths[0]}\?{toLower(c.name)}.exe ?linkCmd
ECHO SUCCESS

View File

@@ -6,7 +6,7 @@
if [ $# -eq 1 ] ; then
case $1 in
"--help"|"-h"|"help"|"h")
echo "?c.name deinstallation script"
echo "?c.displayName deinstallation script"
echo "Usage: [sudo] sh deinstall.sh DIR"
echo "Where DIR may be:"
echo " /usr/bin"
@@ -51,7 +51,7 @@ if [ $# -eq 1 ] ; then
echo "deinstallation successful"
else
echo "?c.name deinstallation script"
echo "?c.displayName deinstallation script"
echo "Usage: [sudo] sh deinstall.sh DIR"
echo "Where DIR may be:"
echo " /usr/bin"

View File

@@ -3,10 +3,10 @@
# result = ""
; Default Template for NimInst
[Setup]
AppName=$c.name
AppVerName=$c.name $c.version
AppName=$c.displayName
AppVerName=$c.displayName $c.version
DefaultDirName={code:GiveMeAPath|nimrod}
DefaultGroupName=$c.name
DefaultGroupName=$c.displayName
AllowNoIcons=yes
LicenseFile=${expandFilename(c.license)}
OutputBaseFilename=${c.name}_${c.version}
@@ -27,16 +27,16 @@ Source: ${expandFilename(f)}; DestDir: {app}\${splitFile(f).dir}; Flags: ignorev
[Icons]
#if c.app == appConsole:
Name: {group}\Console for $c.name; Filename: {cmd}
Name: {group}\Console for $c.displayName; Filename: {cmd}
#else:
Name: {group}\$c.name; Filename: {app}
Name: {group}\$c.displayName; Filename: {app}
#end if
Name: {group}\Documentation; Filename: {app}\doc\overview.html
Name: {group}\{cm:UninstallProgram,$c.name}; Filename: {uninstallexe}
Name: {group}\{cm:UninstallProgram,$c.displayName}; Filename: {uninstallexe}
#if c.binPaths.len > 0:
[Tasks]
Name: modifypath; Description: &Add $c.name to your system path (if not in path already);
Name: modifypath; Description: &Add $c.displayName to your system path (if not in path already);
#end if
[Code]

View File

@@ -7,15 +7,15 @@ if [ $# -eq 1 ] ; then
# if c.cat[fcUnixBin].len > 0:
if test -f ?{c.cat[fcUnixBin][0]}
then
echo "?c.name build detected"
echo "?c.displayName build detected"
else
echo "Please build ?c.name before installing it"
echo "Please build ?c.displayName before installing it"
exit 1
fi
# end if
case $1 in
"--help"|"-h"|"help"|"h")
echo "?c.name installation script"
echo "?c.displayName installation script"
echo "Usage: [sudo] sh install.sh DIR"
echo "Where DIR may be:"
echo " /usr/bin"
@@ -92,7 +92,7 @@ if [ $# -eq 1 ] ; then
echo "installation successful"
else
echo "?c.name installation script"
echo "?c.displayName installation script"
echo "Usage: [sudo] sh install.sh DIR"
echo "Where DIR may be:"
echo " /usr/bin"

View File

@@ -49,7 +49,7 @@ type
binPaths, authors, oses, cpus: seq[string]
cfiles: array[1..maxOS, array[1..maxCPU, seq[string]]]
ccompiler, innosetup: tuple[path, flags: string]
name, version, description, license, infile, outdir: string
name, displayName, version, description, license, infile, outdir: string
innoSetupFlag, installScript, uninstallScript: bool
vars: PStringTable
app: TAppType
@@ -70,6 +70,7 @@ proc initConfigData(c: var TConfigData) =
c.ccompiler = ("", "")
c.innosetup = ("", "")
c.name = ""
c.displayName = ""
c.version = ""
c.description = ""
c.license = ""
@@ -98,7 +99,7 @@ include "deinstall.tmpl"
# ------------------------- configuration file -------------------------------
const
Version = "0.8"
Version = "0.9"
Usage = "niminst - Nimrod Installation Generator Version " & version & """
(c) 2010 Andreas Rumpf
@@ -209,6 +210,7 @@ proc parseIniFile(c: var TConfigData) =
of "project":
case normalize(k.key)
of "name": c.name = v
of "displayname": c.displayName = v
of "version": c.version = v
of "os": c.oses = split(v, {';'})
of "cpu": c.cpus = split(v, {';'})
@@ -249,6 +251,7 @@ proc parseIniFile(c: var TConfigData) =
of cfgError: quit(errorStr(p, k.msg))
close(p)
if c.name.len == 0: c.name = changeFileExt(extractFilename(c.infile), "")
if c.displayName.len == 0: c.displayName = c.name
else:
quit("cannot open: " & c.infile)
@@ -363,6 +366,7 @@ when haveZipLib:
else: n = c.outdir / n
var z: TZipArchive
if open(z, n, fmWrite):
addFile(z, proj / buildBatFile, buildBatFile)
addFile(z, proj / buildShFile, buildShFile)
addFile(z, proj / installShFile, installShFile)
addFile(z, proj / deinstallShFile, deinstallShFile)

View File

@@ -1,8 +1,8 @@
Discuss Nimrod in our `forum <http://force7.de/heimdall>`_.
We also have a `Wiki <http://force7.de/niwiki>`_.
Visit our project page at GitHub: http://github.com/Araq/Nimrod.
Visit our project page at Launchpad: https://launchpad.net/nimrod.
Wiki: http://github.com/Araq/Nimrod/wiki.
Bug reports: https://bugs.launchpad.net/nimrod.
Bug reports: http://github.com/Araq/Nimrod/issues.

View File

@@ -3,8 +3,8 @@
Here you can download the latest version of the Nimrod Compiler.
Please choose your platform:
* source-based installation: `<download/nimrod_0.8.8.zip>`_
* installer for Windows XP/Vista (i386): `<download/nimrod_0.8.8.exe>`_
* source-based installation: `<download/nimrod_0.8.10.zip>`_
* installer for Windows XP/Vista (i386): `<download/nimrod_0.8.10.exe>`_
(includes GCC and everything else you need)
The source-based installation has been tested on these systems:

View File

@@ -2,7 +2,7 @@
News
====
2010-XX-XX Version 0.8.10 released
2010-10-20 Version 0.8.10 released
==================================
Bugfixes
@@ -40,6 +40,7 @@ Changes affecting backwards compatibility
is not raised anymore. Instead ``system.quit()`` is called. This is because
raising an exception requires heap allocations. However the memory manager
might be contained in the DLL that failed to load.
- The ``re`` module (and the ``pcre`` wrapper) now depend on the pcre dll.
Additions
@@ -53,7 +54,6 @@ Additions
- Added ``system.compileOption``.
- Added ``times.epochTime`` and ``times.cpuTime``.
- Implemented explicit type arguments for generics.
- Implemented implicit type arguments for generics.
- Implemented ``{.size: sizeof(cint).}`` pragma for enum types. This is useful
for interfacing with C.
- Implemented ``{.pragma.}`` pragma for user defined pragmas.
@@ -65,6 +65,9 @@ Additions
improved.
- Added ``expat`` module.
- Added ``json`` module.
- Added support for a *Tiny C* backend. Currently this only works on Linux.
You need to bootstrap with ``-d:tinyc`` to enable Tiny C support. Nimrod
can then execute code directly via ``nimrod run myfile``.
2010-03-14 Version 0.8.8 released

8
web/nimrod.ini Executable file → Normal file
View File

@@ -22,9 +22,10 @@ file: ticker
[Documentation]
doc: "endb;intern;apis;lib;manual;tut1;tut2;nimrodc;overview"
pdf: "manual;lib;tut1;tut2;nimrodc"
doc: "tools;c2nim;niminst"
pdf: "manual;lib;tut1;tut2;nimrodc;c2nim;niminst"
srcdoc: "impure/graphics;pure/sockets"
srcdoc: "system.nim;pure/os;pure/strutils;pure/re;pure/math"
srcdoc: "system.nim;pure/os;pure/strutils;pure/math"
srcdoc: "pure/complex;pure/times;pure/osproc;pure/pegs;pure/dynlib"
srcdoc: "pure/parseopt;pure/hashes;pure/strtabs;pure/lexbase"
srcdoc: "pure/parsecfg;pure/parsexml;pure/parsecsv;pure/parsesql"
@@ -38,7 +39,8 @@ srcdoc: "pure/json;impure/graphics"
webdoc: "wrappers/libcurl;pure/md5;wrappers/mysql;wrappers/iup"
webdoc: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc"
webdoc: "wrappers/python;wrappers/tcl;wrappers/expat"
webdoc: "wrappers/python;wrappers/tcl;wrappers/expat;wrappers/pcre"
webdoc: "wrappers/tre"
webdoc: "posix/posix;wrappers/odbcsql;impure/dialogs"
webdoc: "wrappers/zip/zlib;wrappers/zip/libzip"

View File

@@ -1,6 +1,9 @@
| `2010-10-20`:newsdate:
| Nimrod version 0.8.10 has been released!
Get it `here <./download.html>`_.
| `2010-03-14`:newsdate:
| Nimrod version 0.8.8 has been released!
Get it `here <./download.html>`_.
| `2009-12-21`:newsdate:
| Nimrod version 0.8.6 has been released!