diff options
-rwxr-xr-x | build.bat | 10 | ||||
-rw-r--r-- | build64.bat | 10 | ||||
-rwxr-xr-x | compiler/ast.nim | 40 | ||||
-rwxr-xr-x | compiler/ccgexprs.nim | 12 | ||||
-rwxr-xr-x | compiler/ccgtypes.nim | 12 | ||||
-rwxr-xr-x | compiler/ccgutils.nim | 4 | ||||
-rw-r--r-- | compiler/cgendata.nim | 8 | ||||
-rwxr-xr-x | compiler/docgen.nim | 4 | ||||
-rwxr-xr-x | compiler/evals.nim | 2 | ||||
-rwxr-xr-x | compiler/extccomp.nim | 2 | ||||
-rwxr-xr-x | compiler/lexer.nim | 41 | ||||
-rwxr-xr-x | compiler/magicsys.nim | 6 | ||||
-rwxr-xr-x | compiler/parser.nim | 24 | ||||
-rwxr-xr-x | compiler/renderer.nim | 6 | ||||
-rwxr-xr-x | compiler/semexprs.nim | 36 | ||||
-rwxr-xr-x | compiler/semfold.nim | 12 | ||||
-rwxr-xr-x | compiler/semtypes.nim | 6 | ||||
-rwxr-xr-x | compiler/sigmatch.nim | 8 | ||||
-rwxr-xr-x | compiler/types.nim | 22 | ||||
-rwxr-xr-x | install.sh | 845 | ||||
-rwxr-xr-x | lib/core/macros.nim | 5 | ||||
-rwxr-xr-x | lib/system.nim | 114 |
22 files changed, 643 insertions, 586 deletions
diff --git a/build.bat b/build.bat index ed2a177ea..6d28dd4c9 100755 --- a/build.bat +++ b/build.bat @@ -2,7 +2,7 @@ REM Generated by niminst SET CC=gcc SET LINKER=gcc -SET COMP_FLAGS=-w -O3 -fno-strict-aliasing +SET COMP_FLAGS=-w -g3 -O0 -O3 -fno-strict-aliasing SET LINK_FLAGS= REM call the compiler: @@ -143,8 +143,12 @@ ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_1\aliases.c -o build\1_1\aliases.o %CC% %COMP_FLAGS% -Ibuild -c build\1_1\aliases.c -o build\1_1\aliases.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\rstast.c -o build\1_1\rstast.o +%CC% %COMP_FLAGS% -Ibuild -c build\1_1\rstast.c -o build\1_1\rstast.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\rstgen.c -o build\1_1\rstgen.o +%CC% %COMP_FLAGS% -Ibuild -c build\1_1\rstgen.c -o build\1_1\rstgen.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 @@ -164,8 +168,8 @@ ECHO %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\parseopt.c -o build\1_1\parseopt.o %CC% %COMP_FLAGS% -Ibuild -c build\1_1\parseopt.c -o build\1_1\parseopt.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\strtabs.o build\1_1\hashes.o build\1_1\tables.o build\1_1\math.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\intsets.o build\1_1\idgen.o build\1_1\astalgo.o build\1_1\rodutils.o build\1_1\extccomp.o build\1_1\osproc.o build\1_1\streams.o build\1_1\wordrecg.o build\1_1\lexer.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\parser.o build\1_1\pbraces.o build\1_1\filters.o build\1_1\renderer.o build\1_1\filter_tmpl.o build\1_1\rodread.o build\1_1\memfiles.o build\1_1\rodwrite.o build\1_1\passes.o build\1_1\types.o build\1_1\trees.o build\1_1\magicsys.o build\1_1\nimsets.o build\1_1\bitsets.o build\1_1\semthreads.o build\1_1\importer.o build\1_1\lookups.o build\1_1\semdata.o build\1_1\treetab.o build\1_1\evals.o build\1_1\semfold.o build\1_1\transf.o build\1_1\cgmeth.o build\1_1\sem.o build\1_1\procfind.o build\1_1\pragmas.o build\1_1\semtypinst.o build\1_1\sigmatch.o build\1_1\suggest.o build\1_1\aliases.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\cgendata.o build\1_1\ccgmerge.o build\1_1\ecmasgen.o build\1_1\passaux.o build\1_1\depends.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\strtabs.o build\1_1\hashes.o build\1_1\tables.o build\1_1\math.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\intsets.o build\1_1\idgen.o build\1_1\astalgo.o build\1_1\rodutils.o build\1_1\extccomp.o build\1_1\osproc.o build\1_1\streams.o build\1_1\wordrecg.o build\1_1\lexer.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\parser.o build\1_1\pbraces.o build\1_1\filters.o build\1_1\renderer.o build\1_1\filter_tmpl.o build\1_1\rodread.o build\1_1\memfiles.o build\1_1\rodwrite.o build\1_1\passes.o build\1_1\types.o build\1_1\trees.o build\1_1\magicsys.o build\1_1\nimsets.o build\1_1\bitsets.o build\1_1\semthreads.o build\1_1\importer.o build\1_1\lookups.o build\1_1\semdata.o build\1_1\treetab.o build\1_1\evals.o build\1_1\semfold.o build\1_1\transf.o build\1_1\cgmeth.o build\1_1\sem.o build\1_1\procfind.o build\1_1\pragmas.o build\1_1\semtypinst.o build\1_1\sigmatch.o build\1_1\suggest.o build\1_1\aliases.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\cgendata.o build\1_1\ccgmerge.o build\1_1\ecmasgen.o build\1_1\passaux.o build\1_1\depends.o build\1_1\parseopt.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\strtabs.o build\1_1\hashes.o build\1_1\tables.o build\1_1\math.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\intsets.o build\1_1\idgen.o build\1_1\astalgo.o build\1_1\rodutils.o build\1_1\extccomp.o build\1_1\osproc.o build\1_1\streams.o build\1_1\wordrecg.o build\1_1\lexer.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\parser.o build\1_1\pbraces.o build\1_1\filters.o build\1_1\renderer.o build\1_1\filter_tmpl.o build\1_1\rodread.o build\1_1\memfiles.o build\1_1\rodwrite.o build\1_1\passes.o build\1_1\types.o build\1_1\trees.o build\1_1\magicsys.o build\1_1\nimsets.o build\1_1\bitsets.o build\1_1\semthreads.o build\1_1\importer.o build\1_1\lookups.o build\1_1\semdata.o build\1_1\treetab.o build\1_1\evals.o build\1_1\semfold.o build\1_1\transf.o build\1_1\cgmeth.o build\1_1\sem.o build\1_1\procfind.o build\1_1\pragmas.o build\1_1\semtypinst.o build\1_1\sigmatch.o build\1_1\suggest.o build\1_1\aliases.o build\1_1\docgen.o build\1_1\rstast.o build\1_1\rst.o build\1_1\rstgen.o build\1_1\highlite.o build\1_1\cgen.o build\1_1\ccgutils.o build\1_1\cgendata.o build\1_1\ccgmerge.o build\1_1\ecmasgen.o build\1_1\passaux.o build\1_1\depends.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\strtabs.o build\1_1\hashes.o build\1_1\tables.o build\1_1\math.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\intsets.o build\1_1\idgen.o build\1_1\astalgo.o build\1_1\rodutils.o build\1_1\extccomp.o build\1_1\osproc.o build\1_1\streams.o build\1_1\wordrecg.o build\1_1\lexer.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\parser.o build\1_1\pbraces.o build\1_1\filters.o build\1_1\renderer.o build\1_1\filter_tmpl.o build\1_1\rodread.o build\1_1\memfiles.o build\1_1\rodwrite.o build\1_1\passes.o build\1_1\types.o build\1_1\trees.o build\1_1\magicsys.o build\1_1\nimsets.o build\1_1\bitsets.o build\1_1\semthreads.o build\1_1\importer.o build\1_1\lookups.o build\1_1\semdata.o build\1_1\treetab.o build\1_1\evals.o build\1_1\semfold.o build\1_1\transf.o build\1_1\cgmeth.o build\1_1\sem.o build\1_1\procfind.o build\1_1\pragmas.o build\1_1\semtypinst.o build\1_1\sigmatch.o build\1_1\suggest.o build\1_1\aliases.o build\1_1\docgen.o build\1_1\rstast.o build\1_1\rst.o build\1_1\rstgen.o build\1_1\highlite.o build\1_1\cgen.o build\1_1\ccgutils.o build\1_1\cgendata.o build\1_1\ccgmerge.o build\1_1\ecmasgen.o build\1_1\passaux.o build\1_1\depends.o build\1_1\parseopt.o ECHO SUCCESS diff --git a/build64.bat b/build64.bat index aa981feb9..cc2948056 100644 --- a/build64.bat +++ b/build64.bat @@ -2,7 +2,7 @@ REM Generated by niminst SET CC=gcc SET LINKER=gcc -SET COMP_FLAGS=-w -O3 -fno-strict-aliasing +SET COMP_FLAGS=-w -g3 -O0 -O3 -fno-strict-aliasing SET LINK_FLAGS= REM call the compiler: @@ -143,8 +143,12 @@ ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\aliases.c -o build\1_2\aliases.o %CC% %COMP_FLAGS% -Ibuild -c build\1_2\aliases.c -o build\1_2\aliases.o ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\docgen.c -o build\1_2\docgen.o %CC% %COMP_FLAGS% -Ibuild -c build\1_2\docgen.c -o build\1_2\docgen.o +ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\rstast.c -o build\1_2\rstast.o +%CC% %COMP_FLAGS% -Ibuild -c build\1_2\rstast.c -o build\1_2\rstast.o ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\rst.c -o build\1_2\rst.o %CC% %COMP_FLAGS% -Ibuild -c build\1_2\rst.c -o build\1_2\rst.o +ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\rstgen.c -o build\1_2\rstgen.o +%CC% %COMP_FLAGS% -Ibuild -c build\1_2\rstgen.c -o build\1_2\rstgen.o ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\highlite.c -o build\1_2\highlite.o %CC% %COMP_FLAGS% -Ibuild -c build\1_2\highlite.c -o build\1_2\highlite.o ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\cgen.c -o build\1_2\cgen.o @@ -164,8 +168,8 @@ ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\depends.c -o build\1_2\depends.o ECHO %CC% %COMP_FLAGS% -Ibuild -c build\1_2\parseopt.c -o build\1_2\parseopt.o %CC% %COMP_FLAGS% -Ibuild -c build\1_2\parseopt.c -o build\1_2\parseopt.o -ECHO %LINKER% %LINK_FLAGS% -o bin\nimrod.exe build\1_2\nim__dat.o build\1_2\system.o build\1_2\nimrod.o build\1_2\times.o build\1_2\strutils.o build\1_2\parseutils.o build\1_2\winlean.o build\1_2\commands.o build\1_2\os.o build\1_2\msgs.o build\1_2\options.o build\1_2\lists.o build\1_2\strtabs.o build\1_2\hashes.o build\1_2\tables.o build\1_2\math.o build\1_2\nversion.o build\1_2\condsyms.o build\1_2\ast.o build\1_2\crc.o build\1_2\ropes.o build\1_2\platform.o build\1_2\idents.o build\1_2\intsets.o build\1_2\idgen.o build\1_2\astalgo.o build\1_2\rodutils.o build\1_2\extccomp.o build\1_2\osproc.o build\1_2\streams.o build\1_2\wordrecg.o build\1_2\lexer.o build\1_2\lexbase.o build\1_2\llstream.o build\1_2\nimconf.o build\1_2\main.o build\1_2\syntaxes.o build\1_2\parser.o build\1_2\pbraces.o build\1_2\filters.o build\1_2\renderer.o build\1_2\filter_tmpl.o build\1_2\rodread.o build\1_2\memfiles.o build\1_2\rodwrite.o build\1_2\passes.o build\1_2\types.o build\1_2\trees.o build\1_2\magicsys.o build\1_2\nimsets.o build\1_2\bitsets.o build\1_2\semthreads.o build\1_2\importer.o build\1_2\lookups.o build\1_2\semdata.o build\1_2\treetab.o build\1_2\evals.o build\1_2\semfold.o build\1_2\transf.o build\1_2\cgmeth.o build\1_2\sem.o build\1_2\procfind.o build\1_2\pragmas.o build\1_2\semtypinst.o build\1_2\sigmatch.o build\1_2\suggest.o build\1_2\aliases.o build\1_2\docgen.o build\1_2\rst.o build\1_2\highlite.o build\1_2\cgen.o build\1_2\ccgutils.o build\1_2\cgendata.o build\1_2\ccgmerge.o build\1_2\ecmasgen.o build\1_2\passaux.o build\1_2\depends.o build\1_2\parseopt.o -%LINKER% %LINK_FLAGS% -o bin\nimrod.exe build\1_2\nim__dat.o build\1_2\system.o build\1_2\nimrod.o build\1_2\times.o build\1_2\strutils.o build\1_2\parseutils.o build\1_2\winlean.o build\1_2\commands.o build\1_2\os.o build\1_2\msgs.o build\1_2\options.o build\1_2\lists.o build\1_2\strtabs.o build\1_2\hashes.o build\1_2\tables.o build\1_2\math.o build\1_2\nversion.o build\1_2\condsyms.o build\1_2\ast.o build\1_2\crc.o build\1_2\ropes.o build\1_2\platform.o build\1_2\idents.o build\1_2\intsets.o build\1_2\idgen.o build\1_2\astalgo.o build\1_2\rodutils.o build\1_2\extccomp.o build\1_2\osproc.o build\1_2\streams.o build\1_2\wordrecg.o build\1_2\lexer.o build\1_2\lexbase.o build\1_2\llstream.o build\1_2\nimconf.o build\1_2\main.o build\1_2\syntaxes.o build\1_2\parser.o build\1_2\pbraces.o build\1_2\filters.o build\1_2\renderer.o build\1_2\filter_tmpl.o build\1_2\rodread.o build\1_2\memfiles.o build\1_2\rodwrite.o build\1_2\passes.o build\1_2\types.o build\1_2\trees.o build\1_2\magicsys.o build\1_2\nimsets.o build\1_2\bitsets.o build\1_2\semthreads.o build\1_2\importer.o build\1_2\lookups.o build\1_2\semdata.o build\1_2\treetab.o build\1_2\evals.o build\1_2\semfold.o build\1_2\transf.o build\1_2\cgmeth.o build\1_2\sem.o build\1_2\procfind.o build\1_2\pragmas.o build\1_2\semtypinst.o build\1_2\sigmatch.o build\1_2\suggest.o build\1_2\aliases.o build\1_2\docgen.o build\1_2\rst.o build\1_2\highlite.o build\1_2\cgen.o build\1_2\ccgutils.o build\1_2\cgendata.o build\1_2\ccgmerge.o build\1_2\ecmasgen.o build\1_2\passaux.o build\1_2\depends.o build\1_2\parseopt.o +ECHO %LINKER% %LINK_FLAGS% -o bin\nimrod.exe build\1_2\nim__dat.o build\1_2\system.o build\1_2\nimrod.o build\1_2\times.o build\1_2\strutils.o build\1_2\parseutils.o build\1_2\winlean.o build\1_2\commands.o build\1_2\os.o build\1_2\msgs.o build\1_2\options.o build\1_2\lists.o build\1_2\strtabs.o build\1_2\hashes.o build\1_2\tables.o build\1_2\math.o build\1_2\nversion.o build\1_2\condsyms.o build\1_2\ast.o build\1_2\crc.o build\1_2\ropes.o build\1_2\platform.o build\1_2\idents.o build\1_2\intsets.o build\1_2\idgen.o build\1_2\astalgo.o build\1_2\rodutils.o build\1_2\extccomp.o build\1_2\osproc.o build\1_2\streams.o build\1_2\wordrecg.o build\1_2\lexer.o build\1_2\lexbase.o build\1_2\llstream.o build\1_2\nimconf.o build\1_2\main.o build\1_2\syntaxes.o build\1_2\parser.o build\1_2\pbraces.o build\1_2\filters.o build\1_2\renderer.o build\1_2\filter_tmpl.o build\1_2\rodread.o build\1_2\memfiles.o build\1_2\rodwrite.o build\1_2\passes.o build\1_2\types.o build\1_2\trees.o build\1_2\magicsys.o build\1_2\nimsets.o build\1_2\bitsets.o build\1_2\semthreads.o build\1_2\importer.o build\1_2\lookups.o build\1_2\semdata.o build\1_2\treetab.o build\1_2\evals.o build\1_2\semfold.o build\1_2\transf.o build\1_2\cgmeth.o build\1_2\sem.o build\1_2\procfind.o build\1_2\pragmas.o build\1_2\semtypinst.o build\1_2\sigmatch.o build\1_2\suggest.o build\1_2\aliases.o build\1_2\docgen.o build\1_2\rstast.o build\1_2\rst.o build\1_2\rstgen.o build\1_2\highlite.o build\1_2\cgen.o build\1_2\ccgutils.o build\1_2\cgendata.o build\1_2\ccgmerge.o build\1_2\ecmasgen.o build\1_2\passaux.o build\1_2\depends.o build\1_2\parseopt.o +%LINKER% %LINK_FLAGS% -o bin\nimrod.exe build\1_2\nim__dat.o build\1_2\system.o build\1_2\nimrod.o build\1_2\times.o build\1_2\strutils.o build\1_2\parseutils.o build\1_2\winlean.o build\1_2\commands.o build\1_2\os.o build\1_2\msgs.o build\1_2\options.o build\1_2\lists.o build\1_2\strtabs.o build\1_2\hashes.o build\1_2\tables.o build\1_2\math.o build\1_2\nversion.o build\1_2\condsyms.o build\1_2\ast.o build\1_2\crc.o build\1_2\ropes.o build\1_2\platform.o build\1_2\idents.o build\1_2\intsets.o build\1_2\idgen.o build\1_2\astalgo.o build\1_2\rodutils.o build\1_2\extccomp.o build\1_2\osproc.o build\1_2\streams.o build\1_2\wordrecg.o build\1_2\lexer.o build\1_2\lexbase.o build\1_2\llstream.o build\1_2\nimconf.o build\1_2\main.o build\1_2\syntaxes.o build\1_2\parser.o build\1_2\pbraces.o build\1_2\filters.o build\1_2\renderer.o build\1_2\filter_tmpl.o build\1_2\rodread.o build\1_2\memfiles.o build\1_2\rodwrite.o build\1_2\passes.o build\1_2\types.o build\1_2\trees.o build\1_2\magicsys.o build\1_2\nimsets.o build\1_2\bitsets.o build\1_2\semthreads.o build\1_2\importer.o build\1_2\lookups.o build\1_2\semdata.o build\1_2\treetab.o build\1_2\evals.o build\1_2\semfold.o build\1_2\transf.o build\1_2\cgmeth.o build\1_2\sem.o build\1_2\procfind.o build\1_2\pragmas.o build\1_2\semtypinst.o build\1_2\sigmatch.o build\1_2\suggest.o build\1_2\aliases.o build\1_2\docgen.o build\1_2\rstast.o build\1_2\rst.o build\1_2\rstgen.o build\1_2\highlite.o build\1_2\cgen.o build\1_2\ccgutils.o build\1_2\cgendata.o build\1_2\ccgmerge.o build\1_2\ecmasgen.o build\1_2\passaux.o build\1_2\depends.o build\1_2\parseopt.o ECHO SUCCESS diff --git a/compiler/ast.nim b/compiler/ast.nim index 0c25b24a1..eb258e383 100755 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -52,9 +52,15 @@ type nkInt16Lit, nkInt32Lit, nkInt64Lit, + nkUIntLit, # an unsigned integer literal + nkUInt8Lit, + nkUInt16Lit, + nkUInt32Lit, + nkUInt64Lit, nkFloatLit, # a floating point literal nkFloat32Lit, nkFloat64Lit, + nkFloat128Lit, nkStrLit, # a string literal "" nkRStrLit, # a raw string literal r"" nkTripleStrLit, # a triple string literal """ @@ -323,6 +329,7 @@ type tfEnumHasHoles, # enum cannot be mapped into a range tfShallow, # type can be shallow copied on assignment tfThread, # proc type is marked as ``thread`` + tfLiteral # type represents literal value tfFromGeneric # type is an instantiation of a generic; this is needed # because for instantiations of objects, structural # type equality has to be used @@ -406,8 +413,11 @@ type mNewString, mNewStringOfCap, mReset, mArray, mOpenArray, mRange, mSet, mSeq, - mOrdinal, mInt, mInt8, mInt16, mInt32, - mInt64, mFloat, mFloat32, mFloat64, mBool, mChar, mString, mCstring, + mOrdinal, + mInt, mInt8, mInt16, mInt32, mInt64, + mUInt, mUInt8, mUInt16, mUInt32, mUInt64, + mFloat, mFloat32, mFloat64, mFloat128, + mBool, mChar, mString, mCstring, mPointer, mEmptySet, mIntSetBaseType, mNil, mExpr, mStmt, mTypeDesc, mVoidType, mPNimrodNode, mIsMainModule, mCompileDate, mCompileTime, mNimrodVersion, mNimrodMajor, @@ -462,11 +472,11 @@ type info*: TLineInfo flags*: TNodeFlags case Kind*: TNodeKind - of nkCharLit..nkInt64Lit: + of nkCharLit..nkUInt64Lit: intVal*: biggestInt - of nkFloatLit..nkFloat64Lit: + of nkFloatLit..nkFloat128Lit: floatVal*: biggestFloat - of nkStrLit..nkTripleStrLit: + of nkStrLit..nkTripleStrLit: strVal*: string of nkSym: sym*: PSym @@ -763,8 +773,8 @@ const # for all kind of hash tables: proc ValueToString*(a: PNode): string = case a.kind - of nkCharLit..nkInt64Lit: result = $(a.intVal) - of nkFloatLit, nkFloat32Lit, nkFloat64Lit: result = $(a.floatVal) + of nkCharLit..nkUInt64Lit: result = $(a.intVal) + of nkFloatLit..nkFloat128Lit: result = $(a.floatVal) of nkStrLit..nkTripleStrLit: result = a.strVal else: InternalError(a.info, "valueToString") @@ -1019,8 +1029,8 @@ proc copyNode(src: PNode): PNode = result.typ = src.typ result.flags = src.flags * PersistentNodeFlags case src.Kind - of nkCharLit..nkInt64Lit: result.intVal = src.intVal - of nkFloatLit, nkFloat32Lit, nkFloat64Lit: result.floatVal = src.floatVal + of nkCharLit..nkUInt64Lit: result.intVal = src.intVal + of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal of nkSym: result.sym = src.sym of nkIdent: result.ident = src.ident of nkStrLit..nkTripleStrLit: result.strVal = src.strVal @@ -1034,8 +1044,8 @@ proc shallowCopy*(src: PNode): PNode = result.typ = src.typ result.flags = src.flags * PersistentNodeFlags case src.Kind - of nkCharLit..nkInt64Lit: result.intVal = src.intVal - of nkFloatLit, nkFloat32Lit, nkFloat64Lit: result.floatVal = src.floatVal + of nkCharLit..nkUInt64Lit: result.intVal = src.intVal + of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal of nkSym: result.sym = src.sym of nkIdent: result.ident = src.ident of nkStrLit..nkTripleStrLit: result.strVal = src.strVal @@ -1050,8 +1060,8 @@ proc copyTree(src: PNode): PNode = result.typ = src.typ result.flags = src.flags * PersistentNodeFlags case src.Kind - of nkCharLit..nkInt64Lit: result.intVal = src.intVal - of nkFloatLit, nkFloat32Lit, nkFloat64Lit: result.floatVal = src.floatVal + of nkCharLit..nkUInt64Lit: result.intVal = src.intVal + of nkFloatLit..nkFloat128Lit: result.floatVal = src.floatVal of nkSym: result.sym = src.sym of nkIdent: result.ident = src.ident of nkStrLit..nkTripleStrLit: result.strVal = src.strVal @@ -1101,14 +1111,14 @@ proc sonsNotNil(n: PNode): bool = proc getInt*(a: PNode): biggestInt = case a.kind - of nkIntLit..nkInt64Lit: result = a.intVal + of nkIntLit..nkUInt64Lit: result = a.intVal else: internalError(a.info, "getInt") result = 0 proc getFloat*(a: PNode): biggestFloat = case a.kind - of nkFloatLit..nkFloat64Lit: result = a.floatVal + of nkFloatLit..nkFloat128Lit: result = a.floatVal else: internalError(a.info, "getFloat") result = 0.0 diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 5b04111b3..a929b5af0 100755 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -34,7 +34,7 @@ proc int32Literal(i: Int): PRope = proc genHexLiteral(v: PNode): PRope = # hex literals are unsigned in C # so we don't generate hex literals any longer. - if not (v.kind in {nkIntLit..nkInt64Lit}): + if not (v.kind in {nkIntLit..nkUInt64Lit}): internalError(v.info, "genHexLiteral") result = intLiteral(v.intVal) @@ -47,7 +47,7 @@ proc getStrLit(m: BModule, s: string): PRope = proc genLiteral(p: BProc, v: PNode, ty: PType): PRope = if ty == nil: internalError(v.info, "genLiteral: ty is nil") case v.kind - of nkCharLit..nkInt64Lit: + of nkCharLit..nkUInt64Lit: case skipTypes(ty, abstractVarRange).kind of tyChar, tyInt64, tyNil: result = intLiteral(v.intVal) @@ -277,7 +277,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = else: appcg(p, cpsStmts, "$1 = $2;$n", [rdLoc(dest), rdLoc(src)]) of tyPtr, tyPointer, tyChar, tyBool, tyEnum, tyCString, - tyInt..tyFloat128, tyRange: + tyInt..tyUInt64, tyRange: appcg(p, cpsStmts, "$1 = $2;$n", [rdLoc(dest), rdLoc(src)]) else: InternalError("genAssignment(" & $ty.kind & ')') @@ -582,7 +582,7 @@ proc genTupleElem(p: BProc, e: PNode, d: var TLoc) = var ty = a.t var r = rdLoc(a) case e.sons[1].kind - of nkIntLit..nkInt64Lit: i = int(e.sons[1].intVal) + of nkIntLit..nkUInt64Lit: i = int(e.sons[1].intVal) else: internalError(e.info, "genTupleElem") when false: if ty.n != nil: @@ -1684,8 +1684,8 @@ proc expr(p: BProc, e: PNode, d: var TLoc) = InternalError(e.info, "expr: param not init " & sym.name.s) putLocIntoDest(p, d, sym.loc) else: InternalError(e.info, "expr(" & $sym.kind & "); unknown symbol") - of nkStrLit..nkTripleStrLit, nkIntLit..nkInt64Lit, nkFloatLit..nkFloat64Lit, - nkNilLit, nkCharLit: + of nkStrLit..nkTripleStrLit, nkIntLit..nkUInt64Lit, + nkFloatLit..nkFloat128Lit, nkNilLit, nkCharLit: putIntoDest(p, d, e.typ, genLiteral(p, e)) of nkCall, nkHiddenCallConv, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit: diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 4492c2fea..e456a1eaa 100755 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -174,7 +174,7 @@ proc mapType(typ: PType): TCTypeKind = of tyProc: result = if typ.callConv != ccClosure: ctProc else: ctStruct of tyString: result = ctNimStr of tyCString: result = ctCString - of tyInt..tyFloat128: + of tyInt..tyUInt64: result = TCTypeKind(ord(typ.kind) - ord(tyInt) + ord(ctInt)) else: InternalError("mapType") @@ -313,8 +313,10 @@ proc typeNameOrLiteral(t: PType, literal: string): PRope = proc getSimpleTypeDesc(m: BModule, typ: PType): PRope = const - NumericalTypeToStr: array[tyInt..tyFloat128, string] = ["NI", "NI8", - "NI16", "NI32", "NI64", "NF", "NF32", "NF64", "NF128"] + NumericalTypeToStr: array[tyInt..tyUInt64, string] = [ + "NI", "NI8", "NI16", "NI32", "NI64", + "NF", "NF32", "NF64", "NF128", + "NU", "NU8", "NU16", "NU32", "NU64",] case typ.Kind of tyPointer: result = typeNameOrLiteral(typ, "void*") @@ -337,7 +339,7 @@ proc getSimpleTypeDesc(m: BModule, typ: PType): PRope = of tyBool: result = typeNameOrLiteral(typ, "NIM_BOOL") of tyChar: result = typeNameOrLiteral(typ, "NIM_CHAR") of tyNil: result = typeNameOrLiteral(typ, "0") - of tyInt..tyFloat128, tyUInt..tyUInt64: + of tyInt..tyUInt64: result = typeNameOrLiteral(typ, NumericalTypeToStr[typ.Kind]) of tyRange: result = getSimpleTypeDesc(m, typ.sons[0]) else: result = nil @@ -871,7 +873,7 @@ proc genTypeInfo(m: BModule, typ: PType): PRope = if dataGenerated: return case t.kind of tyEmpty: result = toRope"0" - of tyPointer, tyBool, tyChar, tyCString, tyString, tyInt..tyFloat128, tyVar: + of tyPointer, tyBool, tyChar, tyCString, tyString, tyInt..tyUInt64, tyVar: genTypeInfoAuxBase(gNimDat, t, result, toRope"0") of tyProc: if t.callConv != ccClosure: diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index 5ba523070..de49897c5 100755 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -70,9 +70,7 @@ proc GetUniqueType*(key: PType): PType = var k = key.kind case k of tyBool, tyChar, - tyInt, tyInt8, tyInt16, tyInt32, tyInt64, - tyFloat, tyFloat32, tyFloat64, tyFloat128, - tyUInt, tyUInt8, tyUInt16, tyUInt32, tyUInt64: + tyInt..tyUInt64: # no canonicalization for integral types, so that e.g. ``pid_t`` is # produced instead of ``NI``. result = key diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim index bcdf53afd..72c7ceae5 100644 --- a/compiler/cgendata.nim +++ b/compiler/cgendata.nim @@ -37,9 +37,11 @@ type cfsDynLibDeinit # section for deinitialization of dynamic # libraries TCTypeKind* = enum # describes the type kind of a C type - ctVoid, ctChar, ctBool, ctUInt, ctUInt8, ctUInt16, ctUInt32, ctUInt64, - ctInt, ctInt8, ctInt16, ctInt32, ctInt64, ctFloat, ctFloat32, ctFloat64, - ctFloat128, ctArray, ctStruct, ctPtr, ctNimStr, ctNimSeq, ctProc, ctCString + ctVoid, ctChar, ctBool, + ctInt, ctInt8, ctInt16, ctInt32, ctInt64, + ctFloat, ctFloat32, ctFloat64, ctFloat128, + ctUInt, ctUInt8, ctUInt16, ctUInt32, ctUInt64, + ctArray, ctStruct, ctPtr, ctNimStr, ctNimSeq, ctProc, ctCString TCFileSections* = array[TCFileSection, PRope] # represents a generated C file TCProcSection* = enum # the sections a generated C proc consists of cpsLocals, # section of local variables for C proc diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 6e249b888..ae654fda4 100755 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -206,10 +206,10 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) = of tkCharLit: dispA(result, "<span class=\"CharLit\">$1</span>", "\\spanCharLit{$1}", [toRope(esc(d.target, literal))]) - of tkIntLit..tkInt64Lit: + of tkIntLit..tkUInt64Lit: dispA(result, "<span class=\"DecNumber\">$1</span>", "\\spanDecNumber{$1}", [toRope(esc(d.target, literal))]) - of tkFloatLit..tkFloat64Lit: + of tkFloatLit..tkFloat128Lit: dispA(result, "<span class=\"FloatNumber\">$1</span>", "\\spanFloatNumber{$1}", [toRope(esc(d.target, literal))]) of tkSymbol: diff --git a/compiler/evals.nim b/compiler/evals.nim index 5c77a4d94..62649cb08 100755 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -235,6 +235,8 @@ proc getNullValue(typ: PType, info: TLineInfo): PNode = case t.kind of tyBool, tyEnum, tyChar, tyInt..tyInt64: result = newNodeIT(nkIntLit, info, t) + of tyUInt..tyUInt64: + result = newNodeIT(nkUIntLit, info, t) of tyFloat..tyFloat128: result = newNodeIt(nkFloatLit, info, t) of tyVar, tyPointer, tyPtr, tyRef, tyCString, tySequence, tyString, tyExpr, diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index fb2e5f3f5..2872f28a7 100755 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -597,7 +597,7 @@ proc CallCCompiler*(projectfile: string) = proc genMappingFiles(list: TLinkedList): PRope = var it = PStrEntry(list.head) while it != nil: - appf(result, "--file:r\"$1\"$n", [toRope(AddFileExt(it.data, cExt))]) + appf(result, "--file:r\"$1\"$N", [toRope(AddFileExt(it.data, cExt))]) it = PStrEntry(it.next) proc writeMapping*(gSymbolMapping: PRope) = diff --git a/compiler/lexer.nim b/compiler/lexer.nim index a17871e3a..73a818e32 100755 --- a/compiler/lexer.nim +++ b/compiler/lexer.nim @@ -45,8 +45,10 @@ type tkTemplate, tkTry, tkTuple, tkType, tkVar, tkWhen, tkWhile, tkWith, tkWithout, tkXor, tkYield, # end of keywords - tkIntLit, tkInt8Lit, tkInt16Lit, tkInt32Lit, tkInt64Lit, tkFloatLit, - tkFloat32Lit, tkFloat64Lit, tkStrLit, tkRStrLit, tkTripleStrLit, + tkIntLit, tkInt8Lit, tkInt16Lit, tkInt32Lit, tkInt64Lit, + tkUIntLit, tkUInt8Lit, tkUInt16Lit, tkUInt32Lit, tkUInt64Lit, + tkFloatLit, tkFloat32Lit, tkFloat64Lit, tkFloat128Lit, + tkStrLit, tkRStrLit, tkTripleStrLit, tkGStrLit, tkGTripleStrLit, tkCharLit, tkParLe, tkParRi, tkBracketLe, tkBracketRi, tkCurlyLe, tkCurlyRi, tkBracketDotLe, tkBracketDotRi, # [. and .] @@ -77,8 +79,10 @@ const "template", "try", "tuple", "type", "var", "when", "while", "with", "without", "xor", "yield", - "tkIntLit", "tkInt8Lit", "tkInt16Lit", "tkInt32Lit", "tkInt64Lit", - "tkFloatLit", "tkFloat32Lit", "tkFloat64Lit", "tkStrLit", "tkRStrLit", + "tkIntLit", "tkInt8Lit", "tkInt16Lit", "tkInt32Lit", "tkInt64Lit", + "tkUIntLit", "tkUInt8Lit", "tkUInt16Lit", "tkUInt32Lit", "tkUInt64Lit", + "tkFloatLit", "tkFloat32Lit", "tkFloat64Lit", "tkFloat128Lit", + "tkStrLit", "tkRStrLit", "tkTripleStrLit", "tkGStrLit", "tkGTripleStrLit", "tkCharLit", "(", ")", "[", "]", "{", "}", "[.", ".]", "{.", ".}", "(.", ".)", ",", ";", @@ -283,12 +287,17 @@ proc GetNumber(L: var TLexer): TToken = case L.buf[endpos] of 'f', 'F': inc(endpos) - if (L.buf[endpos] == '6') and (L.buf[endpos + 1] == '4'): - result.tokType = tkFloat64Lit - inc(endpos, 2) - elif (L.buf[endpos] == '3') and (L.buf[endpos + 1] == '2'): + if (L.buf[endpos] == '3') and (L.buf[endpos + 1] == '2'): result.tokType = tkFloat32Lit inc(endpos, 2) + elif (L.buf[endpos] == '6') and (L.buf[endpos + 1] == '4'): + result.tokType = tkFloat64Lit + inc(endpos, 2) + elif (L.buf[endpos] == '1') and + (L.buf[endpos + 1] == '2') and + (L.buf[endpos + 2] == '8'): + result.tokType = tkFloat128Lit + inc(endpos, 3) else: lexMessage(L, errInvalidNumber, result.literal & "'f" & L.buf[endpos]) of 'i', 'I': @@ -307,6 +316,22 @@ proc GetNumber(L: var TLexer): TToken = inc(endpos) else: lexMessage(L, errInvalidNumber, result.literal & "'i" & L.buf[endpos]) + of 'u', 'U': + inc(endpos) + if (L.buf[endpos] == '6') and (L.buf[endpos + 1] == '4'): + result.tokType = tkUInt64Lit + inc(endpos, 2) + elif (L.buf[endpos] == '3') and (L.buf[endpos + 1] == '2'): + result.tokType = tkUInt32Lit + inc(endpos, 2) + elif (L.buf[endpos] == '1') and (L.buf[endpos + 1] == '6'): + result.tokType = tkUInt16Lit + inc(endpos, 2) + elif (L.buf[endpos] == '8'): + result.tokType = tkUInt8Lit + inc(endpos) + else: + result.tokType = tkUIntLit else: lexMessage(L, errInvalidNumber, result.literal & "'" & L.buf[endpos]) else: L.bufpos = pos # restore position diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim index 5b9987efa..a69b40fbf 100755 --- a/compiler/magicsys.nim +++ b/compiler/magicsys.nim @@ -53,9 +53,15 @@ proc getSysType(kind: TTypeKind): PType = of tyInt16: result = sysTypeFromName("int16") of tyInt32: result = sysTypeFromName("int32") of tyInt64: result = sysTypeFromName("int64") + of tyUInt: result = sysTypeFromName("uint") + of tyUInt8: result = sysTypeFromName("uint8") + of tyUInt16: result = sysTypeFromName("uint16") + of tyUInt32: result = sysTypeFromName("uint32") + of tyUInt64: result = sysTypeFromName("uint64") of tyFloat: result = sysTypeFromName("float") of tyFloat32: result = sysTypeFromName("float32") of tyFloat64: result = sysTypeFromName("float64") + of tyFloat128: result = sysTypeFromName("float128") of tyBool: result = sysTypeFromName("bool") of tyChar: result = sysTypeFromName("char") of tyString: result = sysTypeFromName("string") diff --git a/compiler/parser.nim b/compiler/parser.nim index 4baee5b43..d1042b04d 100755 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -416,6 +416,26 @@ proc identOrLiteral(p: var TParser): PNode = result = newIntNodeP(nkInt64Lit, p.tok.iNumber, p) setBaseFlags(result, p.tok.base) getTok(p) + of tkUIntLit: + result = newIntNodeP(nkUIntLit, p.tok.iNumber, p) + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt8Lit: + result = newIntNodeP(nkUInt8Lit, p.tok.iNumber, p) + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt16Lit: + result = newIntNodeP(nkUInt16Lit, p.tok.iNumber, p) + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt32Lit: + result = newIntNodeP(nkUInt32Lit, p.tok.iNumber, p) + setBaseFlags(result, p.tok.base) + getTok(p) + of tkUInt64Lit: + result = newIntNodeP(nkUInt64Lit, p.tok.iNumber, p) + setBaseFlags(result, p.tok.base) + getTok(p) of tkFloatLit: result = newFloatNodeP(nkFloatLit, p.tok.fNumber, p) setBaseFlags(result, p.tok.base) @@ -428,6 +448,10 @@ proc identOrLiteral(p: var TParser): PNode = result = newFloatNodeP(nkFloat64Lit, p.tok.fNumber, p) setBaseFlags(result, p.tok.base) getTok(p) + of tkFloat128Lit: + result = newFloatNodeP(nkFloat128Lit, p.tok.fNumber, p) + setBaseFlags(result, p.tok.base) + getTok(p) of tkStrLit: result = newStrNodeP(nkStrLit, p.tok.literal, p) getTok(p) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index a5e79762c..21b0f2287 100755 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -705,9 +705,15 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = of nkInt16Lit: put(g, tkInt16Lit, atom(n)) of nkInt32Lit: put(g, tkInt32Lit, atom(n)) of nkInt64Lit: put(g, tkInt64Lit, atom(n)) + of nkUIntLit: put(g, tkUIntLit, atom(n)) + of nkUInt8Lit: put(g, tkUInt8Lit, atom(n)) + of nkUInt16Lit: put(g, tkUInt16Lit, atom(n)) + of nkUInt32Lit: put(g, tkUInt32Lit, atom(n)) + of nkUInt64Lit: put(g, tkUInt64Lit, atom(n)) of nkFloatLit: put(g, tkFloatLit, atom(n)) of nkFloat32Lit: put(g, tkFloat32Lit, atom(n)) of nkFloat64Lit: put(g, tkFloat64Lit, atom(n)) + of nkFloat128Lit: put(g, tkFloat128Lit, atom(n)) of nkStrLit: put(g, tkStrLit, atom(n)) of nkRStrLit: put(g, tkRStrLit, atom(n)) of nkCharLit: put(g, tkCharLit, atom(n)) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index ac9075d4f..8910e54c2 100755 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -132,10 +132,10 @@ proc checkConversionBetweenObjects(info: TLineInfo, castDest, src: PType) = proc checkConvertible(info: TLineInfo, castDest, src: PType) = const - IntegralTypes = {tyBool, tyEnum, tyChar, tyInt..tyFloat128} + IntegralTypes = {tyBool, tyEnum, tyChar, tyInt..tyUInt64} if sameType(castDest, src) and castDest.sym == src.sym: # don't annoy conversions that may be needed on another processor: - if not (castDest.kind in {tyInt..tyFloat128, tyNil}): + if not (castDest.kind in {tyInt..tyUInt64, tyNil}): Message(info, hintConvFromXtoItselfNotNeeded, typeToString(castDest)) return var d = skipTypes(castDest, abstractVar) @@ -143,7 +143,7 @@ proc checkConvertible(info: TLineInfo, castDest, src: PType) = while (d != nil) and (d.Kind in {tyPtr, tyRef}) and (d.Kind == s.Kind): d = base(d) s = base(s) - if d == nil: + if d == nil: GlobalError(info, errGenerated, msgKindToString(errIllegalConvFromXtoY) % [ src.typeToString, castDest.typeToString]) elif d.Kind == tyObject and s.Kind == tyObject: @@ -1283,6 +1283,20 @@ proc semMacroStmt(c: PContext, n: PNode, semCheck = true): PNode = GlobalError(n.info, errInvalidExpressionX, renderTree(a, {renderNoComments})) +proc litIntType(kind: TTypeKind): PType = + result = getSysType(kind).copyType(getCurrOwner(), true) + result.flags.incl(tfLiteral) + +template memoize(e: expr): expr = + var `*guard` {.global.} = false + var `*memo` {.global.} : type(e) + + if not `*guard`: + `*memo` = e + `*guard` = true + + `*memo` + proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = result = n if gCmd == cmdIdeTools: suggestExpr(c, n) @@ -1303,9 +1317,9 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = if result.typ == nil: let i = result.intVal if i >= low(int32) and i <= high(int32): - result.typ = getSysType(tyInt) + result.typ = litIntType(tyInt).memoize else: - result.typ = getSysType(tyInt64) + result.typ = litIntType(tyInt64).memoize of nkInt8Lit: if result.typ == nil: result.typ = getSysType(tyInt8) of nkInt16Lit: @@ -1314,12 +1328,24 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = if result.typ == nil: result.typ = getSysType(tyInt32) of nkInt64Lit: if result.typ == nil: result.typ = getSysType(tyInt64) + of nkUIntLit: + if result.typ == nil: result.typ = getSysType(tyUInt) + of nkUInt8Lit: + if result.typ == nil: result.typ = getSysType(tyUInt8) + of nkUInt16Lit: + if result.typ == nil: result.typ = getSysType(tyUInt16) + of nkUInt32Lit: + if result.typ == nil: result.typ = getSysType(tyUInt32) + of nkUInt64Lit: + if result.typ == nil: result.typ = getSysType(tyUInt64) of nkFloatLit: if result.typ == nil: result.typ = getSysType(tyFloat) of nkFloat32Lit: if result.typ == nil: result.typ = getSysType(tyFloat32) of nkFloat64Lit: if result.typ == nil: result.typ = getSysType(tyFloat64) + of nkFloat128Lit: + if result.typ == nil: result.typ = getSysType(tyFloat128) of nkStrLit..nkTripleStrLit: if result.typ == nil: result.typ = getSysType(tyString) of nkCharLit: diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 565155791..f67e58e2f 100755 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -258,15 +258,15 @@ proc partialOrExpr(c: PSym, n: PNode): PNode = proc leValueConv(a, b: PNode): bool = result = false case a.kind - of nkCharLit..nkInt64Lit: + of nkCharLit..nkUInt64Lit: case b.kind - of nkCharLit..nkInt64Lit: result = a.intVal <= b.intVal - of nkFloatLit..nkFloat64Lit: result = a.intVal <= round(b.floatVal) + of nkCharLit..nkUInt64Lit: result = a.intVal <= b.intVal + of nkFloatLit..nkFloat128Lit: result = a.intVal <= round(b.floatVal) else: InternalError(a.info, "leValueConv") - of nkFloatLit..nkFloat64Lit: + of nkFloatLit..nkFloat128Lit: case b.kind - of nkFloatLit..nkFloat64Lit: result = a.floatVal <= b.floatVal - of nkCharLit..nkInt64Lit: result = a.floatVal <= toFloat(int(b.intVal)) + of nkFloatLit..nkFloat128Lit: result = a.floatVal <= b.floatVal + of nkCharLit..nkUInt64Lit: result = a.floatVal <= toFloat(int(b.intVal)) else: InternalError(a.info, "leValueConv") else: InternalError(a.info, "leValueConv") diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 19f37f405..e68ea007e 100755 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -822,9 +822,15 @@ proc processMagicType(c: PContext, m: PSym) = of mInt16: setMagicType(m, tyInt16, 2) of mInt32: setMagicType(m, tyInt32, 4) of mInt64: setMagicType(m, tyInt64, 8) + of mUInt: setMagicType(m, tyUInt, intSize) + of mUInt8: setMagicType(m, tyUInt8, 1) + of mUInt16: setMagicType(m, tyUInt16, 2) + of mUInt32: setMagicType(m, tyUInt32, 4) + of mUInt64: setMagicType(m, tyUInt64, 8) of mFloat: setMagicType(m, tyFloat, floatSize) of mFloat32: setMagicType(m, tyFloat32, 4) of mFloat64: setMagicType(m, tyFloat64, 8) + of mFloat128: setMagicType(m, tyFloat128, 16) of mBool: setMagicType(m, tyBool, 1) of mChar: setMagicType(m, tyChar, 1) of mString: diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 9881e84a3..168936ed4 100755 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -163,6 +163,9 @@ proc handleRange(f, a: PType, min, max: TTypeKind): TTypeRelation = var k = skipTypes(a, {tyRange}).kind if k == f.kind: result = isSubtype elif f.kind == tyInt and k in {tyInt..tyInt32}: result = isIntConv + elif f.kind == tyUInt and k in {tyUInt..tyUInt32}: result = isIntConv + elif f.kind in {tyUInt..tyUInt64} and k == tyInt and tfLiteral in a.flags: + result = isIntConv elif k >= min and k <= max: result = isConvertible else: result = isNone @@ -306,6 +309,11 @@ proc typeRel(mapping: var TIdTable, f, a: PType): TTypeRelation = of tyInt16: result = handleRange(f, a, tyInt8, tyInt16) of tyInt32: result = handleRange(f, a, tyInt, tyInt32) of tyInt64: result = handleRange(f, a, tyInt, tyInt64) + of tyUInt: result = handleRange(f, a, tyUInt8, tyUInt32) + of tyUInt8: result = handleRange(f, a, tyUInt8, tyUInt8) + of tyUInt16: result = handleRange(f, a, tyUInt8, tyUInt16) + of tyUInt32: result = handleRange(f, a, tyUInt, tyUInt32) + of tyUInt64: result = handleRange(f, a, tyUInt, tyUInt64) of tyFloat: result = handleFloatRange(f, a) of tyFloat32: result = handleFloatRange(f, a) of tyFloat64: result = handleFloatRange(f, a) diff --git a/compiler/types.nim b/compiler/types.nim index ecc250a5a..fb0e9a123 100755 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -141,7 +141,7 @@ proc skipTypes(t: PType, kinds: TTypeKinds): PType = proc isOrdinalType(t: PType): bool = assert(t != nil) - result = (t.Kind in {tyChar, tyInt..tyInt64, tyBool, tyEnum}) or + result = (t.Kind in {tyChar, tyInt..tyInt64, tyUInt..tyUInt64, tyBool, tyEnum}) or (t.Kind in {tyRange, tyOrdinal, tyConst, tyMutable, tyGenericInst}) and isOrdinalType(t.sons[0]) @@ -386,10 +386,11 @@ proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string = "GenericInvokation", "GenericBody", "GenericInst", "GenericParam", "distinct $1", "enum", "ordinal[$1]", "array[$1, $2]", "object", "tuple", "set[$1]", "range[$1]", "ptr ", "ref ", "var ", "seq[$1]", "proc", - "pointer", "OpenArray[$1]", "string", "CString", "Forward", "int", "int8", - "int16", "int32", "int64", "float", "float32", "float64", "float128", - - "uint", "uint8", "uint16", "uint32", "uint64", "bignum", "const ", + "pointer", "OpenArray[$1]", "string", "CString", "Forward", + "int", "int8", "int16", "int32", "int64", + "float", "float32", "float64", "float128", + "uint", "uint8", "uint16", "uint32", "uint64", + "bignum", "const ", "!", "varargs[$1]", "iter[$1]", "proxy[$1]", "TypeClass" ] var t = typ result = "" @@ -494,6 +495,7 @@ proc firstOrd(t: PType): biggestInt = of tyInt16: result = - 32768 of tyInt32: result = - 2147483646 - 2 of tyInt64: result = 0x8000000000000000'i64 + of tyUInt..tyUInt64: result = 0 of tyEnum: # if basetype <> nil then return firstOrd of basetype if (sonsLen(t) > 0) and (t.sons[0] != nil): @@ -524,6 +526,13 @@ proc lastOrd(t: PType): biggestInt = of tyInt16: result = 0x00007FFF of tyInt32: result = 0x7FFFFFFF of tyInt64: result = 0x7FFFFFFFFFFFFFFF'i64 + of tyUInt: + if platform.intSize == 4: result = 0xFFFFFFFF + else: result = 0x7FFFFFFFFFFFFFFF'i64 + of tyUInt8: result = 0x7F # XXX: Fix these + of tyUInt16: result = 0x7FFF + of tyUInt32: result = 0x7FFFFFFF + of tyUInt64: result = 0x7FFFFFFFFFFFFFFF'i64 of tyEnum: assert(t.n.sons[sonsLen(t.n) - 1].kind == nkSym) result = t.n.sons[sonsLen(t.n) - 1].sym.position @@ -980,6 +989,9 @@ proc computeSizeAux(typ: PType, a: var biggestInt): biggestInt = of tyInt64, tyUInt64, tyFloat64: result = 8 a = result + of tyFloat128: + result = 16 + a = result of tyFloat: result = floatSize a = result diff --git a/install.sh b/install.sh index fde6c82a2..4feabbb77 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,8 @@ #! /bin/sh # Generated by niminst +set -e + if [ $# -eq 1 ] ; then if test -f bin/nimrod then @@ -43,692 +45,573 @@ if [ $# -eq 1 ] ; then docdir="$1/nimrod/doc" datadir="$1/nimrod/data" - mkdir -p $1/nimrod || exit 1 - mkdir -p $bindir || exit 1 - mkdir -p $configdir || exit 1 + mkdir -p $1/nimrod + mkdir -p $bindir + mkdir -p $configdir ;; esac - mkdir -p $libdir || exit 1 - mkdir -p $docdir || exit 1 + mkdir -p $libdir + mkdir -p $docdir echo "copying files..." - mkdir -p $libdir/system || exit 1 - mkdir -p $libdir/core || exit 1 - mkdir -p $libdir/pure || exit 1 - mkdir -p $libdir/pure/collections || exit 1 - mkdir -p $libdir/impure || exit 1 - mkdir -p $libdir/wrappers || exit 1 - mkdir -p $libdir/wrappers/cairo || exit 1 - mkdir -p $libdir/wrappers/gtk || exit 1 - mkdir -p $libdir/wrappers/lua || exit 1 - mkdir -p $libdir/wrappers/opengl || exit 1 - mkdir -p $libdir/wrappers/sdl || exit 1 - mkdir -p $libdir/wrappers/x11 || exit 1 - mkdir -p $libdir/wrappers/zip || exit 1 - mkdir -p $libdir/windows || exit 1 - mkdir -p $libdir/posix || exit 1 - mkdir -p $libdir/ecmas || exit 1 + mkdir -p $libdir/system + mkdir -p $libdir/core + mkdir -p $libdir/pure + mkdir -p $libdir/pure/collections + mkdir -p $libdir/impure + mkdir -p $libdir/wrappers + mkdir -p $libdir/wrappers/cairo + mkdir -p $libdir/wrappers/gtk + mkdir -p $libdir/wrappers/lua + mkdir -p $libdir/wrappers/opengl + mkdir -p $libdir/wrappers/readline + mkdir -p $libdir/wrappers/sdl + mkdir -p $libdir/wrappers/x11 + mkdir -p $libdir/wrappers/zip + mkdir -p $libdir/windows + mkdir -p $libdir/posix + mkdir -p $libdir/ecmas - cp bin/nimrod $bindir/nimrod || exit 1 + cp bin/nimrod $bindir/nimrod chmod 755 $bindir/nimrod - cp config/nimrod.cfg $configdir/nimrod.cfg || exit 1 + cp config/nimrod.cfg $configdir/nimrod.cfg chmod 644 $configdir/nimrod.cfg - cp config/nimdoc.cfg $configdir/nimdoc.cfg || exit 1 + cp config/nimdoc.cfg $configdir/nimdoc.cfg chmod 644 $configdir/nimdoc.cfg - cp config/nimdoc.tex.cfg $configdir/nimdoc.tex.cfg || exit 1 + cp config/nimdoc.tex.cfg $configdir/nimdoc.tex.cfg chmod 644 $configdir/nimdoc.tex.cfg - cp doc/abstypes.txt $docdir/abstypes.txt || exit 1 - chmod 644 $docdir/abstypes.txt - cp doc/advopt.txt $docdir/advopt.txt || exit 1 - chmod 644 $docdir/advopt.txt - cp doc/apis.txt $docdir/apis.txt || exit 1 - chmod 644 $docdir/apis.txt - cp doc/astspec.txt $docdir/astspec.txt || exit 1 - chmod 644 $docdir/astspec.txt - cp doc/basicopt.txt $docdir/basicopt.txt || exit 1 - chmod 644 $docdir/basicopt.txt - cp doc/c2nim.txt $docdir/c2nim.txt || exit 1 - chmod 644 $docdir/c2nim.txt - cp doc/docs.txt $docdir/docs.txt || exit 1 - chmod 644 $docdir/docs.txt - cp doc/effects.txt $docdir/effects.txt || exit 1 - chmod 644 $docdir/effects.txt - cp doc/endb.txt $docdir/endb.txt || exit 1 - chmod 644 $docdir/endb.txt - cp doc/filelist.txt $docdir/filelist.txt || exit 1 - chmod 644 $docdir/filelist.txt - cp doc/filters.txt $docdir/filters.txt || exit 1 - chmod 644 $docdir/filters.txt - cp doc/grammar.txt $docdir/grammar.txt || exit 1 - chmod 644 $docdir/grammar.txt - cp doc/intern.txt $docdir/intern.txt || exit 1 - chmod 644 $docdir/intern.txt - cp doc/keywords.txt $docdir/keywords.txt || exit 1 - chmod 644 $docdir/keywords.txt - cp doc/lib.txt $docdir/lib.txt || exit 1 - chmod 644 $docdir/lib.txt - cp doc/manual.txt $docdir/manual.txt || exit 1 - chmod 644 $docdir/manual.txt - cp doc/niminst.txt $docdir/niminst.txt || exit 1 - chmod 644 $docdir/niminst.txt - cp doc/nimrodc.txt $docdir/nimrodc.txt || exit 1 - chmod 644 $docdir/nimrodc.txt - cp doc/overview.txt $docdir/overview.txt || exit 1 - chmod 644 $docdir/overview.txt - cp doc/pegdocs.txt $docdir/pegdocs.txt || exit 1 - chmod 644 $docdir/pegdocs.txt - cp doc/readme.txt $docdir/readme.txt || exit 1 - chmod 644 $docdir/readme.txt - cp doc/regexprs.txt $docdir/regexprs.txt || exit 1 - chmod 644 $docdir/regexprs.txt - cp doc/rst.txt $docdir/rst.txt || exit 1 - chmod 644 $docdir/rst.txt - cp doc/subexes.txt $docdir/subexes.txt || exit 1 - chmod 644 $docdir/subexes.txt - cp doc/targets.txt $docdir/targets.txt || exit 1 - chmod 644 $docdir/targets.txt - cp doc/theindex.txt $docdir/theindex.txt || exit 1 - chmod 644 $docdir/theindex.txt - cp doc/tools.txt $docdir/tools.txt || exit 1 - chmod 644 $docdir/tools.txt - cp doc/tut1.txt $docdir/tut1.txt || exit 1 - chmod 644 $docdir/tut1.txt - cp doc/tut2.txt $docdir/tut2.txt || exit 1 - chmod 644 $docdir/tut2.txt - cp doc/actors.html $docdir/actors.html || exit 1 - chmod 644 $docdir/actors.html - cp doc/algorithm.html $docdir/algorithm.html || exit 1 - chmod 644 $docdir/algorithm.html - cp doc/apis.html $docdir/apis.html || exit 1 - chmod 644 $docdir/apis.html - cp doc/asyncio.html $docdir/asyncio.html || exit 1 - chmod 644 $docdir/asyncio.html - cp doc/base64.html $docdir/base64.html || exit 1 - chmod 644 $docdir/base64.html - cp doc/browsers.html $docdir/browsers.html || exit 1 - chmod 644 $docdir/browsers.html - cp doc/c2nim.html $docdir/c2nim.html || exit 1 - chmod 644 $docdir/c2nim.html - cp doc/cgi.html $docdir/cgi.html || exit 1 - chmod 644 $docdir/cgi.html - cp doc/channels.html $docdir/channels.html || exit 1 - chmod 644 $docdir/channels.html - cp doc/colors.html $docdir/colors.html || exit 1 - chmod 644 $docdir/colors.html - cp doc/complex.html $docdir/complex.html || exit 1 - chmod 644 $docdir/complex.html - cp doc/critbits.html $docdir/critbits.html || exit 1 - chmod 644 $docdir/critbits.html - cp doc/db_mysql.html $docdir/db_mysql.html || exit 1 - chmod 644 $docdir/db_mysql.html - cp doc/db_postgres.html $docdir/db_postgres.html || exit 1 - chmod 644 $docdir/db_postgres.html - cp doc/db_sqlite.html $docdir/db_sqlite.html || exit 1 - chmod 644 $docdir/db_sqlite.html - cp doc/dom.html $docdir/dom.html || exit 1 - chmod 644 $docdir/dom.html - cp doc/dynlib.html $docdir/dynlib.html || exit 1 - chmod 644 $docdir/dynlib.html - cp doc/encodings.html $docdir/encodings.html || exit 1 - chmod 644 $docdir/encodings.html - cp doc/endb.html $docdir/endb.html || exit 1 - chmod 644 $docdir/endb.html - cp doc/events.html $docdir/events.html || exit 1 - chmod 644 $docdir/events.html - cp doc/filters.html $docdir/filters.html || exit 1 - chmod 644 $docdir/filters.html - cp doc/ftpclient.html $docdir/ftpclient.html || exit 1 - chmod 644 $docdir/ftpclient.html - cp doc/graphics.html $docdir/graphics.html || exit 1 - chmod 644 $docdir/graphics.html - cp doc/hashes.html $docdir/hashes.html || exit 1 - chmod 644 $docdir/hashes.html - cp doc/htmlgen.html $docdir/htmlgen.html || exit 1 - chmod 644 $docdir/htmlgen.html - cp doc/htmlparser.html $docdir/htmlparser.html || exit 1 - chmod 644 $docdir/htmlparser.html - cp doc/httpclient.html $docdir/httpclient.html || exit 1 - chmod 644 $docdir/httpclient.html - cp doc/httpserver.html $docdir/httpserver.html || exit 1 - chmod 644 $docdir/httpserver.html - cp doc/intern.html $docdir/intern.html || exit 1 - chmod 644 $docdir/intern.html - cp doc/intsets.html $docdir/intsets.html || exit 1 - chmod 644 $docdir/intsets.html - cp doc/irc.html $docdir/irc.html || exit 1 - chmod 644 $docdir/irc.html - cp doc/json.html $docdir/json.html || exit 1 - chmod 644 $docdir/json.html - cp doc/lexbase.html $docdir/lexbase.html || exit 1 - chmod 644 $docdir/lexbase.html - cp doc/lib.html $docdir/lib.html || exit 1 - chmod 644 $docdir/lib.html - cp doc/lists.html $docdir/lists.html || exit 1 - chmod 644 $docdir/lists.html - cp doc/locks.html $docdir/locks.html || exit 1 - chmod 644 $docdir/locks.html - cp doc/macros.html $docdir/macros.html || exit 1 - chmod 644 $docdir/macros.html - cp doc/manual.html $docdir/manual.html || exit 1 - chmod 644 $docdir/manual.html - cp doc/marshal.html $docdir/marshal.html || exit 1 - chmod 644 $docdir/marshal.html - cp doc/matchers.html $docdir/matchers.html || exit 1 - chmod 644 $docdir/matchers.html - cp doc/math.html $docdir/math.html || exit 1 - chmod 644 $docdir/math.html - cp doc/memfiles.html $docdir/memfiles.html || exit 1 - chmod 644 $docdir/memfiles.html - cp doc/niminst.html $docdir/niminst.html || exit 1 - chmod 644 $docdir/niminst.html - cp doc/nimrodc.html $docdir/nimrodc.html || exit 1 - chmod 644 $docdir/nimrodc.html - cp doc/os.html $docdir/os.html || exit 1 - chmod 644 $docdir/os.html - cp doc/osproc.html $docdir/osproc.html || exit 1 - chmod 644 $docdir/osproc.html - cp doc/overview.html $docdir/overview.html || exit 1 - chmod 644 $docdir/overview.html - cp doc/parsecfg.html $docdir/parsecfg.html || exit 1 - chmod 644 $docdir/parsecfg.html - cp doc/parsecsv.html $docdir/parsecsv.html || exit 1 - chmod 644 $docdir/parsecsv.html - cp doc/parseopt.html $docdir/parseopt.html || exit 1 - chmod 644 $docdir/parseopt.html - cp doc/parsesql.html $docdir/parsesql.html || exit 1 - chmod 644 $docdir/parsesql.html - cp doc/parseutils.html $docdir/parseutils.html || exit 1 - chmod 644 $docdir/parseutils.html - cp doc/parsexml.html $docdir/parsexml.html || exit 1 - chmod 644 $docdir/parsexml.html - cp doc/pegs.html $docdir/pegs.html || exit 1 - chmod 644 $docdir/pegs.html - cp doc/queues.html $docdir/queues.html || exit 1 - chmod 644 $docdir/queues.html - cp doc/rdstdin.html $docdir/rdstdin.html || exit 1 - chmod 644 $docdir/rdstdin.html - cp doc/re.html $docdir/re.html || exit 1 - chmod 644 $docdir/re.html - cp doc/redis.html $docdir/redis.html || exit 1 - chmod 644 $docdir/redis.html - cp doc/ropes.html $docdir/ropes.html || exit 1 - chmod 644 $docdir/ropes.html - cp doc/scgi.html $docdir/scgi.html || exit 1 - chmod 644 $docdir/scgi.html - cp doc/sequtils.html $docdir/sequtils.html || exit 1 - chmod 644 $docdir/sequtils.html - cp doc/sets.html $docdir/sets.html || exit 1 - chmod 644 $docdir/sets.html - cp doc/smtp.html $docdir/smtp.html || exit 1 - chmod 644 $docdir/smtp.html - cp doc/sockets.html $docdir/sockets.html || exit 1 - chmod 644 $docdir/sockets.html - cp doc/sphinx.html $docdir/sphinx.html || exit 1 - chmod 644 $docdir/sphinx.html - cp doc/ssl.html $docdir/ssl.html || exit 1 - chmod 644 $docdir/ssl.html - cp doc/streams.html $docdir/streams.html || exit 1 - chmod 644 $docdir/streams.html - cp doc/strtabs.html $docdir/strtabs.html || exit 1 - chmod 644 $docdir/strtabs.html - cp doc/strutils.html $docdir/strutils.html || exit 1 - chmod 644 $docdir/strutils.html - cp doc/subexes.html $docdir/subexes.html || exit 1 - chmod 644 $docdir/subexes.html - cp doc/system.html $docdir/system.html || exit 1 - chmod 644 $docdir/system.html - cp doc/tables.html $docdir/tables.html || exit 1 - chmod 644 $docdir/tables.html - cp doc/terminal.html $docdir/terminal.html || exit 1 - chmod 644 $docdir/terminal.html - cp doc/theindex.html $docdir/theindex.html || exit 1 - chmod 644 $docdir/theindex.html - cp doc/threads.html $docdir/threads.html || exit 1 - chmod 644 $docdir/threads.html - cp doc/times.html $docdir/times.html || exit 1 - chmod 644 $docdir/times.html - cp doc/tools.html $docdir/tools.html || exit 1 - chmod 644 $docdir/tools.html - cp doc/tut1.html $docdir/tut1.html || exit 1 - chmod 644 $docdir/tut1.html - cp doc/tut2.html $docdir/tut2.html || exit 1 - chmod 644 $docdir/tut2.html - cp doc/typeinfo.html $docdir/typeinfo.html || exit 1 - chmod 644 $docdir/typeinfo.html - cp doc/unicode.html $docdir/unicode.html || exit 1 - chmod 644 $docdir/unicode.html - cp doc/unidecode.html $docdir/unidecode.html || exit 1 - chmod 644 $docdir/unidecode.html - cp doc/web.html $docdir/web.html || exit 1 - chmod 644 $docdir/web.html - cp doc/xmldom.html $docdir/xmldom.html || exit 1 - chmod 644 $docdir/xmldom.html - cp doc/xmldomparser.html $docdir/xmldomparser.html || exit 1 - chmod 644 $docdir/xmldomparser.html - cp doc/xmlparser.html $docdir/xmlparser.html || exit 1 - chmod 644 $docdir/xmlparser.html - cp doc/xmltree.html $docdir/xmltree.html || exit 1 - chmod 644 $docdir/xmltree.html - cp doc/zipfiles.html $docdir/zipfiles.html || exit 1 - chmod 644 $docdir/zipfiles.html - cp doc/zmq.html $docdir/zmq.html || exit 1 - chmod 644 $docdir/zmq.html - cp doc/mytest.cfg $docdir/mytest.cfg || exit 1 - chmod 644 $docdir/mytest.cfg - cp doc/c2nim.pdf $docdir/c2nim.pdf || exit 1 - chmod 644 $docdir/c2nim.pdf - cp doc/lib.pdf $docdir/lib.pdf || exit 1 - chmod 644 $docdir/lib.pdf - cp doc/manual.pdf $docdir/manual.pdf || exit 1 - chmod 644 $docdir/manual.pdf - cp doc/niminst.pdf $docdir/niminst.pdf || exit 1 - chmod 644 $docdir/niminst.pdf - cp doc/nimrodc.pdf $docdir/nimrodc.pdf || exit 1 - chmod 644 $docdir/nimrodc.pdf - cp doc/tut1.pdf $docdir/tut1.pdf || exit 1 - chmod 644 $docdir/tut1.pdf - cp doc/tut2.pdf $docdir/tut2.pdf || exit 1 - chmod 644 $docdir/tut2.pdf - cp doc/nimrod.ini $docdir/nimrod.ini || exit 1 - chmod 644 $docdir/nimrod.ini - cp lib/nimbase.h $libdir/nimbase.h || exit 1 + if [ -f doc/abstypes.txt ]; then + cp doc/abstypes.txt $docdir/abstypes.txt + chmod 644 $docdir/abstypes.txt + fi + if [ -f doc/advopt.txt ]; then + cp doc/advopt.txt $docdir/advopt.txt + chmod 644 $docdir/advopt.txt + fi + if [ -f doc/apis.txt ]; then + cp doc/apis.txt $docdir/apis.txt + chmod 644 $docdir/apis.txt + fi + if [ -f doc/astspec.txt ]; then + cp doc/astspec.txt $docdir/astspec.txt + chmod 644 $docdir/astspec.txt + fi + if [ -f doc/basicopt.txt ]; then + cp doc/basicopt.txt $docdir/basicopt.txt + chmod 644 $docdir/basicopt.txt + fi + if [ -f doc/c2nim.txt ]; then + cp doc/c2nim.txt $docdir/c2nim.txt + chmod 644 $docdir/c2nim.txt + fi + if [ -f doc/docs.txt ]; then + cp doc/docs.txt $docdir/docs.txt + chmod 644 $docdir/docs.txt + fi + if [ -f doc/effects.txt ]; then + cp doc/effects.txt $docdir/effects.txt + chmod 644 $docdir/effects.txt + fi + if [ -f doc/endb.txt ]; then + cp doc/endb.txt $docdir/endb.txt + chmod 644 $docdir/endb.txt + fi + if [ -f doc/filelist.txt ]; then + cp doc/filelist.txt $docdir/filelist.txt + chmod 644 $docdir/filelist.txt + fi + if [ -f doc/filters.txt ]; then + cp doc/filters.txt $docdir/filters.txt + chmod 644 $docdir/filters.txt + fi + if [ -f doc/gc.txt ]; then + cp doc/gc.txt $docdir/gc.txt + chmod 644 $docdir/gc.txt + fi + if [ -f doc/grammar.txt ]; then + cp doc/grammar.txt $docdir/grammar.txt + chmod 644 $docdir/grammar.txt + fi + if [ -f doc/intern.txt ]; then + cp doc/intern.txt $docdir/intern.txt + chmod 644 $docdir/intern.txt + fi + if [ -f doc/keywords.txt ]; then + cp doc/keywords.txt $docdir/keywords.txt + chmod 644 $docdir/keywords.txt + fi + if [ -f doc/lib.txt ]; then + cp doc/lib.txt $docdir/lib.txt + chmod 644 $docdir/lib.txt + fi + if [ -f doc/manual.txt ]; then + cp doc/manual.txt $docdir/manual.txt + chmod 644 $docdir/manual.txt + fi + if [ -f doc/nimgrep.txt ]; then + cp doc/nimgrep.txt $docdir/nimgrep.txt + chmod 644 $docdir/nimgrep.txt + fi + if [ -f doc/niminst.txt ]; then + cp doc/niminst.txt $docdir/niminst.txt + chmod 644 $docdir/niminst.txt + fi + if [ -f doc/nimrodc.txt ]; then + cp doc/nimrodc.txt $docdir/nimrodc.txt + chmod 644 $docdir/nimrodc.txt + fi + if [ -f doc/overview.txt ]; then + cp doc/overview.txt $docdir/overview.txt + chmod 644 $docdir/overview.txt + fi + if [ -f doc/pegdocs.txt ]; then + cp doc/pegdocs.txt $docdir/pegdocs.txt + chmod 644 $docdir/pegdocs.txt + fi + if [ -f doc/readme.txt ]; then + cp doc/readme.txt $docdir/readme.txt + chmod 644 $docdir/readme.txt + fi + if [ -f doc/regexprs.txt ]; then + cp doc/regexprs.txt $docdir/regexprs.txt + chmod 644 $docdir/regexprs.txt + fi + if [ -f doc/rst.txt ]; then + cp doc/rst.txt $docdir/rst.txt + chmod 644 $docdir/rst.txt + fi + if [ -f doc/subexes.txt ]; then + cp doc/subexes.txt $docdir/subexes.txt + chmod 644 $docdir/subexes.txt + fi + if [ -f doc/tools.txt ]; then + cp doc/tools.txt $docdir/tools.txt + chmod 644 $docdir/tools.txt + fi + if [ -f doc/tut1.txt ]; then + cp doc/tut1.txt $docdir/tut1.txt + chmod 644 $docdir/tut1.txt + fi + if [ -f doc/tut2.txt ]; then + cp doc/tut2.txt $docdir/tut2.txt + chmod 644 $docdir/tut2.txt + fi + if [ -f doc/mytest.cfg ]; then + cp doc/mytest.cfg $docdir/mytest.cfg + chmod 644 $docdir/mytest.cfg + fi + cp lib/nimbase.h $libdir/nimbase.h chmod 644 $libdir/nimbase.h - cp lib/cycle.h $libdir/cycle.h || exit 1 + cp lib/cycle.h $libdir/cycle.h chmod 644 $libdir/cycle.h - cp lib/nimrtl.nim $libdir/nimrtl.nim || exit 1 + cp lib/nimrtl.nim $libdir/nimrtl.nim chmod 644 $libdir/nimrtl.nim - cp lib/prelude.nim $libdir/prelude.nim || exit 1 + cp lib/prelude.nim $libdir/prelude.nim chmod 644 $libdir/prelude.nim - cp lib/system.nim $libdir/system.nim || exit 1 + cp lib/system.nim $libdir/system.nim chmod 644 $libdir/system.nim - cp lib/nimrtl.nimrod.cfg $libdir/nimrtl.nimrod.cfg || exit 1 + cp lib/nimrtl.nimrod.cfg $libdir/nimrtl.nimrod.cfg chmod 644 $libdir/nimrtl.nimrod.cfg - cp lib/system/alloc.nim $libdir/system/alloc.nim || exit 1 + cp lib/system/alloc.nim $libdir/system/alloc.nim chmod 644 $libdir/system/alloc.nim - cp lib/system/ansi_c.nim $libdir/system/ansi_c.nim || exit 1 + cp lib/system/ansi_c.nim $libdir/system/ansi_c.nim chmod 644 $libdir/system/ansi_c.nim - cp lib/system/arithm.nim $libdir/system/arithm.nim || exit 1 + cp lib/system/arithm.nim $libdir/system/arithm.nim chmod 644 $libdir/system/arithm.nim - cp lib/system/assign.nim $libdir/system/assign.nim || exit 1 + cp lib/system/assign.nim $libdir/system/assign.nim chmod 644 $libdir/system/assign.nim - cp lib/system/atomics.nim $libdir/system/atomics.nim || exit 1 + cp lib/system/atomics.nim $libdir/system/atomics.nim chmod 644 $libdir/system/atomics.nim - cp lib/system/avltree.nim $libdir/system/avltree.nim || exit 1 + cp lib/system/avltree.nim $libdir/system/avltree.nim chmod 644 $libdir/system/avltree.nim - cp lib/system/cellsets.nim $libdir/system/cellsets.nim || exit 1 + cp lib/system/cellsets.nim $libdir/system/cellsets.nim chmod 644 $libdir/system/cellsets.nim - cp lib/system/cgprocs.nim $libdir/system/cgprocs.nim || exit 1 + cp lib/system/cgprocs.nim $libdir/system/cgprocs.nim chmod 644 $libdir/system/cgprocs.nim - cp lib/system/channels.nim $libdir/system/channels.nim || exit 1 + cp lib/system/channels.nim $libdir/system/channels.nim chmod 644 $libdir/system/channels.nim - cp lib/system/debugger.nim $libdir/system/debugger.nim || exit 1 + cp lib/system/debugger.nim $libdir/system/debugger.nim chmod 644 $libdir/system/debugger.nim - cp lib/system/dyncalls.nim $libdir/system/dyncalls.nim || exit 1 + cp lib/system/dyncalls.nim $libdir/system/dyncalls.nim chmod 644 $libdir/system/dyncalls.nim - cp lib/system/ecmasys.nim $libdir/system/ecmasys.nim || exit 1 + cp lib/system/ecmasys.nim $libdir/system/ecmasys.nim chmod 644 $libdir/system/ecmasys.nim - cp lib/system/embedded.nim $libdir/system/embedded.nim || exit 1 + cp lib/system/embedded.nim $libdir/system/embedded.nim chmod 644 $libdir/system/embedded.nim - cp lib/system/excpt.nim $libdir/system/excpt.nim || exit 1 + cp lib/system/excpt.nim $libdir/system/excpt.nim chmod 644 $libdir/system/excpt.nim - cp lib/system/gc.nim $libdir/system/gc.nim || exit 1 + cp lib/system/gc.nim $libdir/system/gc.nim chmod 644 $libdir/system/gc.nim - cp lib/system/hti.nim $libdir/system/hti.nim || exit 1 + cp lib/system/hti.nim $libdir/system/hti.nim chmod 644 $libdir/system/hti.nim - cp lib/system/inclrtl.nim $libdir/system/inclrtl.nim || exit 1 + cp lib/system/inclrtl.nim $libdir/system/inclrtl.nim chmod 644 $libdir/system/inclrtl.nim - cp lib/system/mmdisp.nim $libdir/system/mmdisp.nim || exit 1 + cp lib/system/mmdisp.nim $libdir/system/mmdisp.nim chmod 644 $libdir/system/mmdisp.nim - cp lib/system/profiler.nim $libdir/system/profiler.nim || exit 1 + cp lib/system/profiler.nim $libdir/system/profiler.nim chmod 644 $libdir/system/profiler.nim - cp lib/system/repr.nim $libdir/system/repr.nim || exit 1 + cp lib/system/repr.nim $libdir/system/repr.nim chmod 644 $libdir/system/repr.nim - cp lib/system/reprjs.nim $libdir/system/reprjs.nim || exit 1 + cp lib/system/reprjs.nim $libdir/system/reprjs.nim chmod 644 $libdir/system/reprjs.nim - cp lib/system/sets.nim $libdir/system/sets.nim || exit 1 + cp lib/system/sets.nim $libdir/system/sets.nim chmod 644 $libdir/system/sets.nim - cp lib/system/sysio.nim $libdir/system/sysio.nim || exit 1 + cp lib/system/sysio.nim $libdir/system/sysio.nim chmod 644 $libdir/system/sysio.nim - cp lib/system/syslocks.nim $libdir/system/syslocks.nim || exit 1 + cp lib/system/syslocks.nim $libdir/system/syslocks.nim chmod 644 $libdir/system/syslocks.nim - cp lib/system/sysstr.nim $libdir/system/sysstr.nim || exit 1 + cp lib/system/sysstr.nim $libdir/system/sysstr.nim chmod 644 $libdir/system/sysstr.nim - cp lib/system/threads.nim $libdir/system/threads.nim || exit 1 + cp lib/system/threads.nim $libdir/system/threads.nim chmod 644 $libdir/system/threads.nim - cp lib/system/widestrs.nim $libdir/system/widestrs.nim || exit 1 + cp lib/system/timers.nim $libdir/system/timers.nim + chmod 644 $libdir/system/timers.nim + cp lib/system/widestrs.nim $libdir/system/widestrs.nim chmod 644 $libdir/system/widestrs.nim - cp lib/core/locks.nim $libdir/core/locks.nim || exit 1 + cp lib/core/locks.nim $libdir/core/locks.nim chmod 644 $libdir/core/locks.nim - cp lib/core/macros.nim $libdir/core/macros.nim || exit 1 + cp lib/core/macros.nim $libdir/core/macros.nim chmod 644 $libdir/core/macros.nim - cp lib/core/typeinfo.nim $libdir/core/typeinfo.nim || exit 1 + cp lib/core/typeinfo.nim $libdir/core/typeinfo.nim chmod 644 $libdir/core/typeinfo.nim - cp lib/pure/actors.nim $libdir/pure/actors.nim || exit 1 + cp lib/pure/actors.nim $libdir/pure/actors.nim chmod 644 $libdir/pure/actors.nim - cp lib/pure/algorithm.nim $libdir/pure/algorithm.nim || exit 1 + cp lib/pure/algorithm.nim $libdir/pure/algorithm.nim chmod 644 $libdir/pure/algorithm.nim - cp lib/pure/asyncio.nim $libdir/pure/asyncio.nim || exit 1 + cp lib/pure/asyncio.nim $libdir/pure/asyncio.nim chmod 644 $libdir/pure/asyncio.nim - cp lib/pure/base64.nim $libdir/pure/base64.nim || exit 1 + cp lib/pure/base64.nim $libdir/pure/base64.nim chmod 644 $libdir/pure/base64.nim - cp lib/pure/browsers.nim $libdir/pure/browsers.nim || exit 1 + cp lib/pure/browsers.nim $libdir/pure/browsers.nim chmod 644 $libdir/pure/browsers.nim - cp lib/pure/bson.nim $libdir/pure/bson.nim || exit 1 - chmod 644 $libdir/pure/bson.nim - cp lib/pure/cgi.nim $libdir/pure/cgi.nim || exit 1 + cp lib/pure/cgi.nim $libdir/pure/cgi.nim chmod 644 $libdir/pure/cgi.nim - cp lib/pure/colors.nim $libdir/pure/colors.nim || exit 1 + cp lib/pure/colors.nim $libdir/pure/colors.nim chmod 644 $libdir/pure/colors.nim - cp lib/pure/complex.nim $libdir/pure/complex.nim || exit 1 + cp lib/pure/complex.nim $libdir/pure/complex.nim chmod 644 $libdir/pure/complex.nim - cp lib/pure/cookies.nim $libdir/pure/cookies.nim || exit 1 + cp lib/pure/cookies.nim $libdir/pure/cookies.nim chmod 644 $libdir/pure/cookies.nim - cp lib/pure/dynlib.nim $libdir/pure/dynlib.nim || exit 1 + cp lib/pure/dynlib.nim $libdir/pure/dynlib.nim chmod 644 $libdir/pure/dynlib.nim - cp lib/pure/encodings.nim $libdir/pure/encodings.nim || exit 1 + cp lib/pure/encodings.nim $libdir/pure/encodings.nim chmod 644 $libdir/pure/encodings.nim - cp lib/pure/endians.nim $libdir/pure/endians.nim || exit 1 + cp lib/pure/endians.nim $libdir/pure/endians.nim chmod 644 $libdir/pure/endians.nim - cp lib/pure/events.nim $libdir/pure/events.nim || exit 1 + cp lib/pure/events.nim $libdir/pure/events.nim chmod 644 $libdir/pure/events.nim - cp lib/pure/ftpclient.nim $libdir/pure/ftpclient.nim || exit 1 + cp lib/pure/ftpclient.nim $libdir/pure/ftpclient.nim chmod 644 $libdir/pure/ftpclient.nim - cp lib/pure/gentabs.nim $libdir/pure/gentabs.nim || exit 1 + cp lib/pure/gentabs.nim $libdir/pure/gentabs.nim chmod 644 $libdir/pure/gentabs.nim - cp lib/pure/hashes.nim $libdir/pure/hashes.nim || exit 1 + cp lib/pure/hashes.nim $libdir/pure/hashes.nim chmod 644 $libdir/pure/hashes.nim - cp lib/pure/htmlgen.nim $libdir/pure/htmlgen.nim || exit 1 + cp lib/pure/htmlgen.nim $libdir/pure/htmlgen.nim chmod 644 $libdir/pure/htmlgen.nim - cp lib/pure/htmlparser.nim $libdir/pure/htmlparser.nim || exit 1 + cp lib/pure/htmlparser.nim $libdir/pure/htmlparser.nim chmod 644 $libdir/pure/htmlparser.nim - cp lib/pure/httpclient.nim $libdir/pure/httpclient.nim || exit 1 + cp lib/pure/httpclient.nim $libdir/pure/httpclient.nim chmod 644 $libdir/pure/httpclient.nim - cp lib/pure/httpserver.nim $libdir/pure/httpserver.nim || exit 1 + cp lib/pure/httpserver.nim $libdir/pure/httpserver.nim chmod 644 $libdir/pure/httpserver.nim - cp lib/pure/irc.nim $libdir/pure/irc.nim || exit 1 + cp lib/pure/irc.nim $libdir/pure/irc.nim chmod 644 $libdir/pure/irc.nim - cp lib/pure/json.nim $libdir/pure/json.nim || exit 1 + cp lib/pure/json.nim $libdir/pure/json.nim chmod 644 $libdir/pure/json.nim - cp lib/pure/lexbase.nim $libdir/pure/lexbase.nim || exit 1 + cp lib/pure/lexbase.nim $libdir/pure/lexbase.nim chmod 644 $libdir/pure/lexbase.nim - cp lib/pure/marshal.nim $libdir/pure/marshal.nim || exit 1 + cp lib/pure/marshal.nim $libdir/pure/marshal.nim chmod 644 $libdir/pure/marshal.nim - cp lib/pure/matchers.nim $libdir/pure/matchers.nim || exit 1 + cp lib/pure/matchers.nim $libdir/pure/matchers.nim chmod 644 $libdir/pure/matchers.nim - cp lib/pure/math.nim $libdir/pure/math.nim || exit 1 + cp lib/pure/math.nim $libdir/pure/math.nim chmod 644 $libdir/pure/math.nim - cp lib/pure/md5.nim $libdir/pure/md5.nim || exit 1 + cp lib/pure/md5.nim $libdir/pure/md5.nim chmod 644 $libdir/pure/md5.nim - cp lib/pure/memfiles.nim $libdir/pure/memfiles.nim || exit 1 + cp lib/pure/memfiles.nim $libdir/pure/memfiles.nim chmod 644 $libdir/pure/memfiles.nim - cp lib/pure/oids.nim $libdir/pure/oids.nim || exit 1 + cp lib/pure/mimetypes.nim $libdir/pure/mimetypes.nim + chmod 644 $libdir/pure/mimetypes.nim + cp lib/pure/oids.nim $libdir/pure/oids.nim chmod 644 $libdir/pure/oids.nim - cp lib/pure/os.nim $libdir/pure/os.nim || exit 1 + cp lib/pure/os.nim $libdir/pure/os.nim chmod 644 $libdir/pure/os.nim - cp lib/pure/osproc.nim $libdir/pure/osproc.nim || exit 1 + cp lib/pure/osproc.nim $libdir/pure/osproc.nim chmod 644 $libdir/pure/osproc.nim - cp lib/pure/parsecfg.nim $libdir/pure/parsecfg.nim || exit 1 + cp lib/pure/parsecfg.nim $libdir/pure/parsecfg.nim chmod 644 $libdir/pure/parsecfg.nim - cp lib/pure/parsecsv.nim $libdir/pure/parsecsv.nim || exit 1 + cp lib/pure/parsecsv.nim $libdir/pure/parsecsv.nim chmod 644 $libdir/pure/parsecsv.nim - cp lib/pure/parseopt.nim $libdir/pure/parseopt.nim || exit 1 + cp lib/pure/parseopt.nim $libdir/pure/parseopt.nim chmod 644 $libdir/pure/parseopt.nim - cp lib/pure/parsesql.nim $libdir/pure/parsesql.nim || exit 1 + cp lib/pure/parsesql.nim $libdir/pure/parsesql.nim chmod 644 $libdir/pure/parsesql.nim - cp lib/pure/parseurl.nim $libdir/pure/parseurl.nim || exit 1 + cp lib/pure/parseurl.nim $libdir/pure/parseurl.nim chmod 644 $libdir/pure/parseurl.nim - cp lib/pure/parseutils.nim $libdir/pure/parseutils.nim || exit 1 + cp lib/pure/parseutils.nim $libdir/pure/parseutils.nim chmod 644 $libdir/pure/parseutils.nim - cp lib/pure/parsexml.nim $libdir/pure/parsexml.nim || exit 1 + cp lib/pure/parsexml.nim $libdir/pure/parsexml.nim chmod 644 $libdir/pure/parsexml.nim - cp lib/pure/pegs.nim $libdir/pure/pegs.nim || exit 1 + cp lib/pure/pegs.nim $libdir/pure/pegs.nim chmod 644 $libdir/pure/pegs.nim - cp lib/pure/redis.nim $libdir/pure/redis.nim || exit 1 + cp lib/pure/redis.nim $libdir/pure/redis.nim chmod 644 $libdir/pure/redis.nim - cp lib/pure/romans.nim $libdir/pure/romans.nim || exit 1 + cp lib/pure/romans.nim $libdir/pure/romans.nim chmod 644 $libdir/pure/romans.nim - cp lib/pure/ropes.nim $libdir/pure/ropes.nim || exit 1 + cp lib/pure/ropes.nim $libdir/pure/ropes.nim chmod 644 $libdir/pure/ropes.nim - cp lib/pure/scgi.nim $libdir/pure/scgi.nim || exit 1 + cp lib/pure/scgi.nim $libdir/pure/scgi.nim chmod 644 $libdir/pure/scgi.nim - cp lib/pure/smtp.nim $libdir/pure/smtp.nim || exit 1 + cp lib/pure/smtp.nim $libdir/pure/smtp.nim chmod 644 $libdir/pure/smtp.nim - cp lib/pure/sockets.nim $libdir/pure/sockets.nim || exit 1 + cp lib/pure/sockets.nim $libdir/pure/sockets.nim chmod 644 $libdir/pure/sockets.nim - cp lib/pure/streams.nim $libdir/pure/streams.nim || exit 1 + cp lib/pure/streams.nim $libdir/pure/streams.nim chmod 644 $libdir/pure/streams.nim - cp lib/pure/strtabs.nim $libdir/pure/strtabs.nim || exit 1 + cp lib/pure/strtabs.nim $libdir/pure/strtabs.nim chmod 644 $libdir/pure/strtabs.nim - cp lib/pure/strutils.nim $libdir/pure/strutils.nim || exit 1 + cp lib/pure/strutils.nim $libdir/pure/strutils.nim chmod 644 $libdir/pure/strutils.nim - cp lib/pure/subexes.nim $libdir/pure/subexes.nim || exit 1 + cp lib/pure/subexes.nim $libdir/pure/subexes.nim chmod 644 $libdir/pure/subexes.nim - cp lib/pure/terminal.nim $libdir/pure/terminal.nim || exit 1 + cp lib/pure/templateutil.nim $libdir/pure/templateutil.nim + chmod 644 $libdir/pure/templateutil.nim + cp lib/pure/terminal.nim $libdir/pure/terminal.nim chmod 644 $libdir/pure/terminal.nim - cp lib/pure/times.nim $libdir/pure/times.nim || exit 1 + cp lib/pure/times.nim $libdir/pure/times.nim chmod 644 $libdir/pure/times.nim - cp lib/pure/unicode.nim $libdir/pure/unicode.nim || exit 1 + cp lib/pure/typetraits.nim $libdir/pure/typetraits.nim + chmod 644 $libdir/pure/typetraits.nim + cp lib/pure/unicode.nim $libdir/pure/unicode.nim chmod 644 $libdir/pure/unicode.nim - cp lib/pure/unittest.nim $libdir/pure/unittest.nim || exit 1 + cp lib/pure/unittest.nim $libdir/pure/unittest.nim chmod 644 $libdir/pure/unittest.nim - cp lib/pure/xmldom.nim $libdir/pure/xmldom.nim || exit 1 + cp lib/pure/uri.nim $libdir/pure/uri.nim + chmod 644 $libdir/pure/uri.nim + cp lib/pure/xmldom.nim $libdir/pure/xmldom.nim chmod 644 $libdir/pure/xmldom.nim - cp lib/pure/xmldomparser.nim $libdir/pure/xmldomparser.nim || exit 1 + cp lib/pure/xmldomparser.nim $libdir/pure/xmldomparser.nim chmod 644 $libdir/pure/xmldomparser.nim - cp lib/pure/xmlparser.nim $libdir/pure/xmlparser.nim || exit 1 + cp lib/pure/xmlparser.nim $libdir/pure/xmlparser.nim chmod 644 $libdir/pure/xmlparser.nim - cp lib/pure/xmltree.nim $libdir/pure/xmltree.nim || exit 1 + cp lib/pure/xmltree.nim $libdir/pure/xmltree.nim chmod 644 $libdir/pure/xmltree.nim - cp lib/pure/collections/critbits.nim $libdir/pure/collections/critbits.nim || exit 1 + cp lib/pure/collections/critbits.nim $libdir/pure/collections/critbits.nim chmod 644 $libdir/pure/collections/critbits.nim - cp lib/pure/collections/intsets.nim $libdir/pure/collections/intsets.nim || exit 1 + cp lib/pure/collections/intsets.nim $libdir/pure/collections/intsets.nim chmod 644 $libdir/pure/collections/intsets.nim - cp lib/pure/collections/lists.nim $libdir/pure/collections/lists.nim || exit 1 + cp lib/pure/collections/lists.nim $libdir/pure/collections/lists.nim chmod 644 $libdir/pure/collections/lists.nim - cp lib/pure/collections/queues.nim $libdir/pure/collections/queues.nim || exit 1 + cp lib/pure/collections/queues.nim $libdir/pure/collections/queues.nim chmod 644 $libdir/pure/collections/queues.nim - cp lib/pure/collections/sequtils.nim $libdir/pure/collections/sequtils.nim || exit 1 + cp lib/pure/collections/sequtils.nim $libdir/pure/collections/sequtils.nim chmod 644 $libdir/pure/collections/sequtils.nim - cp lib/pure/collections/sets.nim $libdir/pure/collections/sets.nim || exit 1 + cp lib/pure/collections/sets.nim $libdir/pure/collections/sets.nim chmod 644 $libdir/pure/collections/sets.nim - cp lib/pure/collections/tables.nim $libdir/pure/collections/tables.nim || exit 1 + cp lib/pure/collections/tables.nim $libdir/pure/collections/tables.nim chmod 644 $libdir/pure/collections/tables.nim - cp lib/impure/db_mysql.nim $libdir/impure/db_mysql.nim || exit 1 + cp lib/impure/db_mongo.nim $libdir/impure/db_mongo.nim + chmod 644 $libdir/impure/db_mongo.nim + cp lib/impure/db_mysql.nim $libdir/impure/db_mysql.nim chmod 644 $libdir/impure/db_mysql.nim - cp lib/impure/db_postgres.nim $libdir/impure/db_postgres.nim || exit 1 + cp lib/impure/db_postgres.nim $libdir/impure/db_postgres.nim chmod 644 $libdir/impure/db_postgres.nim - cp lib/impure/db_sqlite.nim $libdir/impure/db_sqlite.nim || exit 1 + cp lib/impure/db_sqlite.nim $libdir/impure/db_sqlite.nim chmod 644 $libdir/impure/db_sqlite.nim - cp lib/impure/dialogs.nim $libdir/impure/dialogs.nim || exit 1 + cp lib/impure/dialogs.nim $libdir/impure/dialogs.nim chmod 644 $libdir/impure/dialogs.nim - cp lib/impure/fpc.nim $libdir/impure/fpc.nim || exit 1 - chmod 644 $libdir/impure/fpc.nim - cp lib/impure/graphics.nim $libdir/impure/graphics.nim || exit 1 + cp lib/impure/graphics.nim $libdir/impure/graphics.nim chmod 644 $libdir/impure/graphics.nim - cp lib/impure/osinfo_posix.nim $libdir/impure/osinfo_posix.nim || exit 1 + cp lib/impure/osinfo_posix.nim $libdir/impure/osinfo_posix.nim chmod 644 $libdir/impure/osinfo_posix.nim - cp lib/impure/osinfo_win.nim $libdir/impure/osinfo_win.nim || exit 1 + cp lib/impure/osinfo_win.nim $libdir/impure/osinfo_win.nim chmod 644 $libdir/impure/osinfo_win.nim - cp lib/impure/rdstdin.nim $libdir/impure/rdstdin.nim || exit 1 + cp lib/impure/rdstdin.nim $libdir/impure/rdstdin.nim chmod 644 $libdir/impure/rdstdin.nim - cp lib/impure/re.nim $libdir/impure/re.nim || exit 1 + cp lib/impure/re.nim $libdir/impure/re.nim chmod 644 $libdir/impure/re.nim - cp lib/impure/ssl.nim $libdir/impure/ssl.nim || exit 1 + cp lib/impure/ssl.nim $libdir/impure/ssl.nim chmod 644 $libdir/impure/ssl.nim - cp lib/impure/web.nim $libdir/impure/web.nim || exit 1 + cp lib/impure/web.nim $libdir/impure/web.nim chmod 644 $libdir/impure/web.nim - cp lib/impure/zipfiles.nim $libdir/impure/zipfiles.nim || exit 1 + cp lib/impure/zipfiles.nim $libdir/impure/zipfiles.nim chmod 644 $libdir/impure/zipfiles.nim - cp lib/wrappers/claro.nim $libdir/wrappers/claro.nim || exit 1 + cp lib/wrappers/claro.nim $libdir/wrappers/claro.nim chmod 644 $libdir/wrappers/claro.nim - cp lib/wrappers/expat.nim $libdir/wrappers/expat.nim || exit 1 + cp lib/wrappers/expat.nim $libdir/wrappers/expat.nim chmod 644 $libdir/wrappers/expat.nim - cp lib/wrappers/iup.nim $libdir/wrappers/iup.nim || exit 1 + cp lib/wrappers/iup.nim $libdir/wrappers/iup.nim chmod 644 $libdir/wrappers/iup.nim - cp lib/wrappers/joyent_http_parser.nim $libdir/wrappers/joyent_http_parser.nim || exit 1 + cp lib/wrappers/joyent_http_parser.nim $libdir/wrappers/joyent_http_parser.nim chmod 644 $libdir/wrappers/joyent_http_parser.nim - cp lib/wrappers/libcurl.nim $libdir/wrappers/libcurl.nim || exit 1 + cp lib/wrappers/libcurl.nim $libdir/wrappers/libcurl.nim chmod 644 $libdir/wrappers/libcurl.nim - cp lib/wrappers/libsvm.nim $libdir/wrappers/libsvm.nim || exit 1 + cp lib/wrappers/libsvm.nim $libdir/wrappers/libsvm.nim chmod 644 $libdir/wrappers/libsvm.nim - cp lib/wrappers/libuv.nim $libdir/wrappers/libuv.nim || exit 1 + cp lib/wrappers/libuv.nim $libdir/wrappers/libuv.nim chmod 644 $libdir/wrappers/libuv.nim - cp lib/wrappers/mongo.nim $libdir/wrappers/mongo.nim || exit 1 + cp lib/wrappers/mongo.nim $libdir/wrappers/mongo.nim chmod 644 $libdir/wrappers/mongo.nim - cp lib/wrappers/mysql.nim $libdir/wrappers/mysql.nim || exit 1 + cp lib/wrappers/mysql.nim $libdir/wrappers/mysql.nim chmod 644 $libdir/wrappers/mysql.nim - cp lib/wrappers/odbcsql.nim $libdir/wrappers/odbcsql.nim || exit 1 + cp lib/wrappers/odbcsql.nim $libdir/wrappers/odbcsql.nim chmod 644 $libdir/wrappers/odbcsql.nim - cp lib/wrappers/openssl.nim $libdir/wrappers/openssl.nim || exit 1 + cp lib/wrappers/openssl.nim $libdir/wrappers/openssl.nim chmod 644 $libdir/wrappers/openssl.nim - cp lib/wrappers/pcre.nim $libdir/wrappers/pcre.nim || exit 1 + cp lib/wrappers/pcre.nim $libdir/wrappers/pcre.nim chmod 644 $libdir/wrappers/pcre.nim - cp lib/wrappers/postgres.nim $libdir/wrappers/postgres.nim || exit 1 + cp lib/wrappers/postgres.nim $libdir/wrappers/postgres.nim chmod 644 $libdir/wrappers/postgres.nim - cp lib/wrappers/python.nim $libdir/wrappers/python.nim || exit 1 + cp lib/wrappers/python.nim $libdir/wrappers/python.nim chmod 644 $libdir/wrappers/python.nim - cp lib/wrappers/sphinx.nim $libdir/wrappers/sphinx.nim || exit 1 + cp lib/wrappers/sphinx.nim $libdir/wrappers/sphinx.nim chmod 644 $libdir/wrappers/sphinx.nim - cp lib/wrappers/sqlite3.nim $libdir/wrappers/sqlite3.nim || exit 1 + cp lib/wrappers/sqlite3.nim $libdir/wrappers/sqlite3.nim chmod 644 $libdir/wrappers/sqlite3.nim - cp lib/wrappers/tcl.nim $libdir/wrappers/tcl.nim || exit 1 + cp lib/wrappers/tcl.nim $libdir/wrappers/tcl.nim chmod 644 $libdir/wrappers/tcl.nim - cp lib/wrappers/tinyc.nim $libdir/wrappers/tinyc.nim || exit 1 + cp lib/wrappers/tinyc.nim $libdir/wrappers/tinyc.nim chmod 644 $libdir/wrappers/tinyc.nim - cp lib/wrappers/tre.nim $libdir/wrappers/tre.nim || exit 1 + cp lib/wrappers/tre.nim $libdir/wrappers/tre.nim chmod 644 $libdir/wrappers/tre.nim - cp lib/wrappers/zmq.nim $libdir/wrappers/zmq.nim || exit 1 + cp lib/wrappers/zmq.nim $libdir/wrappers/zmq.nim chmod 644 $libdir/wrappers/zmq.nim - cp lib/wrappers/cairo/cairo.nim $libdir/wrappers/cairo/cairo.nim || exit 1 + cp lib/wrappers/cairo/cairo.nim $libdir/wrappers/cairo/cairo.nim chmod 644 $libdir/wrappers/cairo/cairo.nim - cp lib/wrappers/cairo/cairoft.nim $libdir/wrappers/cairo/cairoft.nim || exit 1 + cp lib/wrappers/cairo/cairoft.nim $libdir/wrappers/cairo/cairoft.nim chmod 644 $libdir/wrappers/cairo/cairoft.nim - cp lib/wrappers/cairo/cairowin32.nim $libdir/wrappers/cairo/cairowin32.nim || exit 1 + cp lib/wrappers/cairo/cairowin32.nim $libdir/wrappers/cairo/cairowin32.nim chmod 644 $libdir/wrappers/cairo/cairowin32.nim - cp lib/wrappers/cairo/cairoxlib.nim $libdir/wrappers/cairo/cairoxlib.nim || exit 1 + cp lib/wrappers/cairo/cairoxlib.nim $libdir/wrappers/cairo/cairoxlib.nim chmod 644 $libdir/wrappers/cairo/cairoxlib.nim - cp lib/wrappers/gtk/atk.nim $libdir/wrappers/gtk/atk.nim || exit 1 + cp lib/wrappers/gtk/atk.nim $libdir/wrappers/gtk/atk.nim chmod 644 $libdir/wrappers/gtk/atk.nim - cp lib/wrappers/gtk/gdk2.nim $libdir/wrappers/gtk/gdk2.nim || exit 1 + cp lib/wrappers/gtk/gdk2.nim $libdir/wrappers/gtk/gdk2.nim chmod 644 $libdir/wrappers/gtk/gdk2.nim - cp lib/wrappers/gtk/gdk2pixbuf.nim $libdir/wrappers/gtk/gdk2pixbuf.nim || exit 1 + cp lib/wrappers/gtk/gdk2pixbuf.nim $libdir/wrappers/gtk/gdk2pixbuf.nim chmod 644 $libdir/wrappers/gtk/gdk2pixbuf.nim - cp lib/wrappers/gtk/gdkglext.nim $libdir/wrappers/gtk/gdkglext.nim || exit 1 + cp lib/wrappers/gtk/gdkglext.nim $libdir/wrappers/gtk/gdkglext.nim chmod 644 $libdir/wrappers/gtk/gdkglext.nim - cp lib/wrappers/gtk/glib2.nim $libdir/wrappers/gtk/glib2.nim || exit 1 + cp lib/wrappers/gtk/glib2.nim $libdir/wrappers/gtk/glib2.nim chmod 644 $libdir/wrappers/gtk/glib2.nim - cp lib/wrappers/gtk/gtk2.nim $libdir/wrappers/gtk/gtk2.nim || exit 1 + cp lib/wrappers/gtk/gtk2.nim $libdir/wrappers/gtk/gtk2.nim chmod 644 $libdir/wrappers/gtk/gtk2.nim - cp lib/wrappers/gtk/gtkglext.nim $libdir/wrappers/gtk/gtkglext.nim || exit 1 + cp lib/wrappers/gtk/gtkglext.nim $libdir/wrappers/gtk/gtkglext.nim chmod 644 $libdir/wrappers/gtk/gtkglext.nim - cp lib/wrappers/gtk/gtkhtml.nim $libdir/wrappers/gtk/gtkhtml.nim || exit 1 + cp lib/wrappers/gtk/gtkhtml.nim $libdir/wrappers/gtk/gtkhtml.nim chmod 644 $libdir/wrappers/gtk/gtkhtml.nim - cp lib/wrappers/gtk/libglade2.nim $libdir/wrappers/gtk/libglade2.nim || exit 1 + cp lib/wrappers/gtk/libglade2.nim $libdir/wrappers/gtk/libglade2.nim chmod 644 $libdir/wrappers/gtk/libglade2.nim - cp lib/wrappers/gtk/pango.nim $libdir/wrappers/gtk/pango.nim || exit 1 + cp lib/wrappers/gtk/pango.nim $libdir/wrappers/gtk/pango.nim chmod 644 $libdir/wrappers/gtk/pango.nim - cp lib/wrappers/gtk/pangoutils.nim $libdir/wrappers/gtk/pangoutils.nim || exit 1 + cp lib/wrappers/gtk/pangoutils.nim $libdir/wrappers/gtk/pangoutils.nim chmod 644 $libdir/wrappers/gtk/pangoutils.nim - cp lib/wrappers/lua/lauxlib.nim $libdir/wrappers/lua/lauxlib.nim || exit 1 + cp lib/wrappers/lua/lauxlib.nim $libdir/wrappers/lua/lauxlib.nim chmod 644 $libdir/wrappers/lua/lauxlib.nim - cp lib/wrappers/lua/lua.nim $libdir/wrappers/lua/lua.nim || exit 1 + cp lib/wrappers/lua/lua.nim $libdir/wrappers/lua/lua.nim chmod 644 $libdir/wrappers/lua/lua.nim - cp lib/wrappers/lua/lualib.nim $libdir/wrappers/lua/lualib.nim || exit 1 + cp lib/wrappers/lua/lualib.nim $libdir/wrappers/lua/lualib.nim chmod 644 $libdir/wrappers/lua/lualib.nim - cp lib/wrappers/opengl/gl.nim $libdir/wrappers/opengl/gl.nim || exit 1 + cp lib/wrappers/opengl/gl.nim $libdir/wrappers/opengl/gl.nim chmod 644 $libdir/wrappers/opengl/gl.nim - cp lib/wrappers/opengl/glext.nim $libdir/wrappers/opengl/glext.nim || exit 1 + cp lib/wrappers/opengl/glext.nim $libdir/wrappers/opengl/glext.nim chmod 644 $libdir/wrappers/opengl/glext.nim - cp lib/wrappers/opengl/glu.nim $libdir/wrappers/opengl/glu.nim || exit 1 + cp lib/wrappers/opengl/glu.nim $libdir/wrappers/opengl/glu.nim chmod 644 $libdir/wrappers/opengl/glu.nim - cp lib/wrappers/opengl/glut.nim $libdir/wrappers/opengl/glut.nim || exit 1 + cp lib/wrappers/opengl/glut.nim $libdir/wrappers/opengl/glut.nim chmod 644 $libdir/wrappers/opengl/glut.nim - cp lib/wrappers/opengl/glx.nim $libdir/wrappers/opengl/glx.nim || exit 1 + cp lib/wrappers/opengl/glx.nim $libdir/wrappers/opengl/glx.nim chmod 644 $libdir/wrappers/opengl/glx.nim - cp lib/wrappers/opengl/opengl.nim $libdir/wrappers/opengl/opengl.nim || exit 1 + cp lib/wrappers/opengl/opengl.nim $libdir/wrappers/opengl/opengl.nim chmod 644 $libdir/wrappers/opengl/opengl.nim - cp lib/wrappers/opengl/wingl.nim $libdir/wrappers/opengl/wingl.nim || exit 1 + cp lib/wrappers/opengl/wingl.nim $libdir/wrappers/opengl/wingl.nim chmod 644 $libdir/wrappers/opengl/wingl.nim - cp lib/wrappers/sdl/sdl.nim $libdir/wrappers/sdl/sdl.nim || exit 1 + cp lib/wrappers/readline/history.nim $libdir/wrappers/readline/history.nim + chmod 644 $libdir/wrappers/readline/history.nim + cp lib/wrappers/readline/readline.nim $libdir/wrappers/readline/readline.nim + chmod 644 $libdir/wrappers/readline/readline.nim + cp lib/wrappers/readline/rltypedefs.nim $libdir/wrappers/readline/rltypedefs.nim + chmod 644 $libdir/wrappers/readline/rltypedefs.nim + cp lib/wrappers/sdl/sdl.nim $libdir/wrappers/sdl/sdl.nim chmod 644 $libdir/wrappers/sdl/sdl.nim - cp lib/wrappers/sdl/sdl_gfx.nim $libdir/wrappers/sdl/sdl_gfx.nim || exit 1 + cp lib/wrappers/sdl/sdl_gfx.nim $libdir/wrappers/sdl/sdl_gfx.nim chmod 644 $libdir/wrappers/sdl/sdl_gfx.nim - cp lib/wrappers/sdl/sdl_image.nim $libdir/wrappers/sdl/sdl_image.nim || exit 1 + cp lib/wrappers/sdl/sdl_image.nim $libdir/wrappers/sdl/sdl_image.nim chmod 644 $libdir/wrappers/sdl/sdl_image.nim - cp lib/wrappers/sdl/sdl_mixer.nim $libdir/wrappers/sdl/sdl_mixer.nim || exit 1 + cp lib/wrappers/sdl/sdl_mixer.nim $libdir/wrappers/sdl/sdl_mixer.nim chmod 644 $libdir/wrappers/sdl/sdl_mixer.nim - cp lib/wrappers/sdl/sdl_mixer_nosmpeg.nim $libdir/wrappers/sdl/sdl_mixer_nosmpeg.nim || exit 1 + cp lib/wrappers/sdl/sdl_mixer_nosmpeg.nim $libdir/wrappers/sdl/sdl_mixer_nosmpeg.nim chmod 644 $libdir/wrappers/sdl/sdl_mixer_nosmpeg.nim - cp lib/wrappers/sdl/sdl_net.nim $libdir/wrappers/sdl/sdl_net.nim || exit 1 + cp lib/wrappers/sdl/sdl_net.nim $libdir/wrappers/sdl/sdl_net.nim chmod 644 $libdir/wrappers/sdl/sdl_net.nim - cp lib/wrappers/sdl/sdl_ttf.nim $libdir/wrappers/sdl/sdl_ttf.nim || exit 1 + cp lib/wrappers/sdl/sdl_ttf.nim $libdir/wrappers/sdl/sdl_ttf.nim chmod 644 $libdir/wrappers/sdl/sdl_ttf.nim - cp lib/wrappers/sdl/smpeg.nim $libdir/wrappers/sdl/smpeg.nim || exit 1 + cp lib/wrappers/sdl/smpeg.nim $libdir/wrappers/sdl/smpeg.nim chmod 644 $libdir/wrappers/sdl/smpeg.nim - cp lib/wrappers/x11/cursorfont.nim $libdir/wrappers/x11/cursorfont.nim || exit 1 + cp lib/wrappers/x11/cursorfont.nim $libdir/wrappers/x11/cursorfont.nim chmod 644 $libdir/wrappers/x11/cursorfont.nim - cp lib/wrappers/x11/keysym.nim $libdir/wrappers/x11/keysym.nim || exit 1 + cp lib/wrappers/x11/keysym.nim $libdir/wrappers/x11/keysym.nim chmod 644 $libdir/wrappers/x11/keysym.nim - cp lib/wrappers/x11/x.nim $libdir/wrappers/x11/x.nim || exit 1 + cp lib/wrappers/x11/x.nim $libdir/wrappers/x11/x.nim chmod 644 $libdir/wrappers/x11/x.nim - cp lib/wrappers/x11/xatom.nim $libdir/wrappers/x11/xatom.nim || exit 1 + cp lib/wrappers/x11/xatom.nim $libdir/wrappers/x11/xatom.nim chmod 644 $libdir/wrappers/x11/xatom.nim - cp lib/wrappers/x11/xcms.nim $libdir/wrappers/x11/xcms.nim || exit 1 + cp lib/wrappers/x11/xcms.nim $libdir/wrappers/x11/xcms.nim chmod 644 $libdir/wrappers/x11/xcms.nim - cp lib/wrappers/x11/xf86dga.nim $libdir/wrappers/x11/xf86dga.nim || exit 1 + cp lib/wrappers/x11/xf86dga.nim $libdir/wrappers/x11/xf86dga.nim chmod 644 $libdir/wrappers/x11/xf86dga.nim - cp lib/wrappers/x11/xf86vmode.nim $libdir/wrappers/x11/xf86vmode.nim || exit 1 + cp lib/wrappers/x11/xf86vmode.nim $libdir/wrappers/x11/xf86vmode.nim chmod 644 $libdir/wrappers/x11/xf86vmode.nim - cp lib/wrappers/x11/xi.nim $libdir/wrappers/x11/xi.nim || exit 1 + cp lib/wrappers/x11/xi.nim $libdir/wrappers/x11/xi.nim chmod 644 $libdir/wrappers/x11/xi.nim - cp lib/wrappers/x11/xinerama.nim $libdir/wrappers/x11/xinerama.nim || exit 1 + cp lib/wrappers/x11/xinerama.nim $libdir/wrappers/x11/xinerama.nim chmod 644 $libdir/wrappers/x11/xinerama.nim - cp lib/wrappers/x11/xkb.nim $libdir/wrappers/x11/xkb.nim || exit 1 + cp lib/wrappers/x11/xkb.nim $libdir/wrappers/x11/xkb.nim chmod 644 $libdir/wrappers/x11/xkb.nim - cp lib/wrappers/x11/xkblib.nim $libdir/wrappers/x11/xkblib.nim || exit 1 + cp lib/wrappers/x11/xkblib.nim $libdir/wrappers/x11/xkblib.nim chmod 644 $libdir/wrappers/x11/xkblib.nim - cp lib/wrappers/x11/xlib.nim $libdir/wrappers/x11/xlib.nim || exit 1 + cp lib/wrappers/x11/xlib.nim $libdir/wrappers/x11/xlib.nim chmod 644 $libdir/wrappers/x11/xlib.nim - cp lib/wrappers/x11/xrandr.nim $libdir/wrappers/x11/xrandr.nim || exit 1 + cp lib/wrappers/x11/xrandr.nim $libdir/wrappers/x11/xrandr.nim chmod 644 $libdir/wrappers/x11/xrandr.nim - cp lib/wrappers/x11/xrender.nim $libdir/wrappers/x11/xrender.nim || exit 1 + cp lib/wrappers/x11/xrender.nim $libdir/wrappers/x11/xrender.nim chmod 644 $libdir/wrappers/x11/xrender.nim - cp lib/wrappers/x11/xresource.nim $libdir/wrappers/x11/xresource.nim || exit 1 + cp lib/wrappers/x11/xresource.nim $libdir/wrappers/x11/xresource.nim chmod 644 $libdir/wrappers/x11/xresource.nim - cp lib/wrappers/x11/xshm.nim $libdir/wrappers/x11/xshm.nim || exit 1 + cp lib/wrappers/x11/xshm.nim $libdir/wrappers/x11/xshm.nim chmod 644 $libdir/wrappers/x11/xshm.nim - cp lib/wrappers/x11/xutil.nim $libdir/wrappers/x11/xutil.nim || exit 1 + cp lib/wrappers/x11/xutil.nim $libdir/wrappers/x11/xutil.nim chmod 644 $libdir/wrappers/x11/xutil.nim - cp lib/wrappers/x11/xv.nim $libdir/wrappers/x11/xv.nim || exit 1 + cp lib/wrappers/x11/xv.nim $libdir/wrappers/x11/xv.nim chmod 644 $libdir/wrappers/x11/xv.nim - cp lib/wrappers/x11/xvlib.nim $libdir/wrappers/x11/xvlib.nim || exit 1 + cp lib/wrappers/x11/xvlib.nim $libdir/wrappers/x11/xvlib.nim chmod 644 $libdir/wrappers/x11/xvlib.nim - cp lib/wrappers/zip/libzip.nim $libdir/wrappers/zip/libzip.nim || exit 1 + cp lib/wrappers/zip/libzip.nim $libdir/wrappers/zip/libzip.nim chmod 644 $libdir/wrappers/zip/libzip.nim - cp lib/wrappers/zip/zlib.nim $libdir/wrappers/zip/zlib.nim || exit 1 + cp lib/wrappers/zip/zlib.nim $libdir/wrappers/zip/zlib.nim chmod 644 $libdir/wrappers/zip/zlib.nim - cp lib/wrappers/zip/zzip.nim $libdir/wrappers/zip/zzip.nim || exit 1 + cp lib/wrappers/zip/zzip.nim $libdir/wrappers/zip/zzip.nim chmod 644 $libdir/wrappers/zip/zzip.nim - cp lib/wrappers/zip/libzip_all.c $libdir/wrappers/zip/libzip_all.c || exit 1 + cp lib/wrappers/zip/libzip_all.c $libdir/wrappers/zip/libzip_all.c chmod 644 $libdir/wrappers/zip/libzip_all.c - cp lib/windows/mmsystem.nim $libdir/windows/mmsystem.nim || exit 1 + cp lib/windows/mmsystem.nim $libdir/windows/mmsystem.nim chmod 644 $libdir/windows/mmsystem.nim - cp lib/windows/nb30.nim $libdir/windows/nb30.nim || exit 1 + cp lib/windows/nb30.nim $libdir/windows/nb30.nim chmod 644 $libdir/windows/nb30.nim - cp lib/windows/ole2.nim $libdir/windows/ole2.nim || exit 1 + cp lib/windows/ole2.nim $libdir/windows/ole2.nim chmod 644 $libdir/windows/ole2.nim - cp lib/windows/psapi.nim $libdir/windows/psapi.nim || exit 1 + cp lib/windows/psapi.nim $libdir/windows/psapi.nim chmod 644 $libdir/windows/psapi.nim - cp lib/windows/shellapi.nim $libdir/windows/shellapi.nim || exit 1 + cp lib/windows/shellapi.nim $libdir/windows/shellapi.nim chmod 644 $libdir/windows/shellapi.nim - cp lib/windows/shfolder.nim $libdir/windows/shfolder.nim || exit 1 + cp lib/windows/shfolder.nim $libdir/windows/shfolder.nim chmod 644 $libdir/windows/shfolder.nim - cp lib/windows/windows.nim $libdir/windows/windows.nim || exit 1 + cp lib/windows/windows.nim $libdir/windows/windows.nim chmod 644 $libdir/windows/windows.nim - cp lib/windows/winlean.nim $libdir/windows/winlean.nim || exit 1 + cp lib/windows/winlean.nim $libdir/windows/winlean.nim chmod 644 $libdir/windows/winlean.nim - cp lib/posix/posix.nim $libdir/posix/posix.nim || exit 1 + cp lib/posix/posix.nim $libdir/posix/posix.nim chmod 644 $libdir/posix/posix.nim - cp lib/ecmas/dom.nim $libdir/ecmas/dom.nim || exit 1 + cp lib/ecmas/dom.nim $libdir/ecmas/dom.nim chmod 644 $libdir/ecmas/dom.nim echo "installation successful" diff --git a/lib/core/macros.nim b/lib/core/macros.nim index b0f237924..9d0994c2f 100755 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -17,8 +17,9 @@ type TNimrodNodeKind* = enum nnkNone, nnkEmpty, nnkIdent, nnkSym, nnkType, nnkCharLit, nnkIntLit, nnkInt8Lit, - nnkInt16Lit, nnkInt32Lit, nnkInt64Lit, nnkFloatLit, - nnkFloat32Lit, nnkFloat64Lit, nnkStrLit, nnkRStrLit, + nnkInt16Lit, nnkInt32Lit, nnkInt64Lit, nnkUIntLit, nnkUInt8Lit, + nnkUInt16Lit, nnkUInt32Lit, nnkUInt64Lit, nnkFloatLit, + nnkFloat32Lit, nnkFloat64Lit, nnkFloat128Lit, nnkStrLit, nnkRStrLit, nnkTripleStrLit, nnkNilLit, nnkMetaNode, nnkDotCall, nnkCommand, nnkCall, nnkCallStrLit, nnkExprEqExpr, nnkExprColonExpr, nnkIdentDefs, nnkVarTuple, nnkInfix, diff --git a/lib/system.nim b/lib/system.nim index 5d01c5a44..fe8f7a517 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -21,9 +21,15 @@ type int16* {.magic: Int16.} ## signed 16 bit integer type int32* {.magic: Int32.} ## signed 32 bit integer type int64* {.magic: Int64.} ## signed 64 bit integer type + uint* {.magic: UInt.} ## unsigned default integer type + uint8* {.magic: UInt8.} ## unsigned 8 bit integer type + uint16* {.magic: UInt16.} ## unsigned 16 bit integer type + uint32* {.magic: UInt32.} ## unsigned 32 bit integer type + uint64* {.magic: UInt64.} ## unsigned 64 bit integer type float* {.magic: Float.} ## default floating point type float32* {.magic: Float32.} ## 32 bit floating point type float64* {.magic: Float64.} ## 64 bit floating point type + type # we need to start a new type section here, so that ``0`` can have a type bool* {.magic: Bool.} = enum ## built-in boolean type false = 0, true = 1 @@ -49,14 +55,23 @@ type ## a type description (for templates) void* {.magic: "VoidType".} ## meta type to denote the absense of any type - TInteger* = int|int8|int16|int32|int64 + TSignedInt* = distinct int|int8|int16|int32|int64 + ## type class matching all signed integer types + + TUnsignedInt* = distinct uint|uint8|uint16|uint32|uint64 + ## type class matching all unsigned integer types + + TInteger* = distinct TSignedInt|TUnsignedInt ## type class matching all integer types - TOrdinal* = TInteger|bool|enum + TOrdinal* = distinct TInteger|bool|enum ## type class matching all ordinal types; however this includes enums with ## holes. + + TReal* = distinct float|float32|float64 + ## type class matching all floating point number types - TNumber* = TInteger|float|float32|float64 + TNumber* = distinct TInteger|TReal ## type class matching all number types proc defined*(x: expr): bool {.magic: "Defined", noSideEffect.} @@ -517,65 +532,88 @@ proc abs*(x: int64): int64 {.magic: "AbsI64", noSideEffect.} ## is -MININT for its type), an overflow exception is thrown (if overflow ## checking is turned on). -proc `+%` *(x, y: int): int {.magic: "AddU", noSideEffect.} -proc `+%` *(x, y: int8): int8 {.magic: "AddU", noSideEffect.} -proc `+%` *(x, y: int16): int16 {.magic: "AddU", noSideEffect.} -proc `+%` *(x, y: int32): int32 {.magic: "AddU", noSideEffect.} -proc `+%` *(x, y: int64): int64 {.magic: "AddU64", noSideEffect.} +type + UIntMax32 = distinct uint|uint8|uint16|uint32 + IntMax32 = distinct int|int8|int16|int32 + +proc `+` *(x, y: UIntMax32): UIntMax32 {.magic: "AddU", noSideEffect.} +proc `+` *(x, y: UInt64): uint64 {.magic: "AddU64", noSideEffect.} + ## Binary `+` operator for unsigned integers. + +proc `+%` *(x, y: IntMax32): IntMax32 {.magic: "AddU", noSideEffect.} +proc `+%` *(x, y: Int64): Int64 {.magic: "AddU64", noSideEffect.} ## treats `x` and `y` as unsigned and adds them. The result is truncated to ## fit into the result. This implements modulo arithmetic. No overflow ## errors are possible. -proc `-%` *(x, y: int): int {.magic: "SubU", noSideEffect.} -proc `-%` *(x, y: int8): int8 {.magic: "SubU", noSideEffect.} -proc `-%` *(x, y: int16): int16 {.magic: "SubU", noSideEffect.} -proc `-%` *(x, y: int32): int32 {.magic: "SubU", noSideEffect.} -proc `-%` *(x, y: int64): int64 {.magic: "SubU64", noSideEffect.} +proc `-` *(x, y: UIntMax32): UIntMax32 {.magic: "SubU", noSideEffect.} +proc `-` *(x, y: UInt64): UInt64 {.magic: "SubU64", noSideEffect.} + ## Binary `-` operator for unsigned integers. + +proc `-%` *(x, y: IntMax32): IntMax32 {.magic: "SubU", noSideEffect.} +proc `-%` *(x, y: Int64): Int64 {.magic: "SubU64", noSideEffect.} ## treats `x` and `y` as unsigned and subtracts them. The result is ## truncated to fit into the result. This implements modulo arithmetic. ## No overflow errors are possible. -proc `*%` *(x, y: int): int {.magic: "MulU", noSideEffect.} -proc `*%` *(x, y: int8): int8 {.magic: "MulU", noSideEffect.} -proc `*%` *(x, y: int16): int16 {.magic: "MulU", noSideEffect.} -proc `*%` *(x, y: int32): int32 {.magic: "MulU", noSideEffect.} -proc `*%` *(x, y: int64): int64 {.magic: "MulU64", noSideEffect.} +proc `*` *(x, y: UIntMax32): UIntMax32 {.magic: "MulU", noSideEffect.} +proc `*` *(x, y: UInt64): UInt64 {.magic: "MulU64", noSideEffect.} + ## Binary `*` operator for unsigned integers. + +proc `*%` *(x, y: IntMax32): IntMax32 {.magic: "MulU", noSideEffect.} +proc `*%` *(x, y: Int64): Int64 {.magic: "MulU64", noSideEffect.} ## treats `x` and `y` as unsigned and multiplies them. The result is ## truncated to fit into the result. This implements modulo arithmetic. ## No overflow errors are possible. -proc `/%` *(x, y: int): int {.magic: "DivU", noSideEffect.} -proc `/%` *(x, y: int8): int8 {.magic: "DivU", noSideEffect.} -proc `/%` *(x, y: int16): int16 {.magic: "DivU", noSideEffect.} -proc `/%` *(x, y: int32): int32 {.magic: "DivU", noSideEffect.} -proc `/%` *(x, y: int64): int64 {.magic: "DivU64", noSideEffect.} +proc `div` *(x, y: UIntMax32): UIntMax32 {.magic: "DivU", noSideEffect.} +proc `div` *(x, y: UInt64): UInt64 {.magic: "DivU64", noSideEffect.} + ## computes the integer division. This is roughly the same as + ## ``floor(x/y)``. + +proc `/` *(x, y: UIntMax32): UIntMax32 {.magic: "DivU", noSideEffect.} +proc `/` *(x, y: UInt64): UInt64 {.magic: "DivU64", noSideEffect.} + ## computes the integer division. This is roughly the same as + ## ``floor(x/y)``. + +proc `/%` *(x, y: IntMax32): IntMax32 {.magic: "DivU", noSideEffect.} +proc `/%` *(x, y: Int64): Int64 {.magic: "DivU64", noSideEffect.} ## treats `x` and `y` as unsigned and divides them. The result is ## truncated to fit into the result. This implements modulo arithmetic. ## No overflow errors are possible. -proc `%%` *(x, y: int): int {.magic: "ModU", noSideEffect.} -proc `%%` *(x, y: int8): int8 {.magic: "ModU", noSideEffect.} -proc `%%` *(x, y: int16): int16 {.magic: "ModU", noSideEffect.} -proc `%%` *(x, y: int32): int32 {.magic: "ModU", noSideEffect.} -proc `%%` *(x, y: int64): int64 {.magic: "ModU64", noSideEffect.} +proc `%` *(x, y: UIntMax32): UIntMax32 {.magic: "DivU", noSideEffect.} +proc `%` *(x, y: UInt64): UInt64 {.magic: "DivU64", noSideEffect.} + ## computes the integer modulo operation. This is the same as + ## ``x - (x div y) * y``. + +proc `mod` *(x, y: UIntMax32): UIntMax32 {.magic: "DivU", noSideEffect.} +proc `mod` *(x, y: UInt64): UInt64 {.magic: "DivU64", noSideEffect.} + ## computes the integer modulo operation. This is the same as + ## ``x - (x div y) * y``. + +proc `%%` *(x, y: IntMax32): IntMax32 {.magic: "ModU", noSideEffect.} +proc `%%` *(x, y: Int64): Int64 {.magic: "ModU64", noSideEffect.} ## treats `x` and `y` as unsigned and compute the modulo of `x` and `y`. ## The result is truncated to fit into the result. ## This implements modulo arithmetic. ## No overflow errors are possible. -proc `<=%` *(x, y: int): bool {.magic: "LeU", noSideEffect.} -proc `<=%` *(x, y: int8): bool {.magic: "LeU", noSideEffect.} -proc `<=%` *(x, y: int16): bool {.magic: "LeU", noSideEffect.} -proc `<=%` *(x, y: int32): bool {.magic: "LeU", noSideEffect.} -proc `<=%` *(x, y: int64): bool {.magic: "LeU64", noSideEffect.} +proc `<=` *(x, y: UIntMax32): bool {.magic: "LeU", noSideEffect.} +proc `<=` *(x, y: UInt64): bool {.magic: "LeU64", noSideEffect.} + ## Returns true iff ``x <= y``. + +proc `<=%` *(x, y: IntMax32): bool {.magic: "LeU", noSideEffect.} +proc `<=%` *(x, y: Int64): bool {.magic: "LeU64", noSideEffect.} ## treats `x` and `y` as unsigned and compares them. ## Returns true iff ``unsigned(x) <= unsigned(y)``. -proc `<%` *(x, y: int): bool {.magic: "LtU", noSideEffect.} -proc `<%` *(x, y: int8): bool {.magic: "LtU", noSideEffect.} -proc `<%` *(x, y: int16): bool {.magic: "LtU", noSideEffect.} -proc `<%` *(x, y: int32): bool {.magic: "LtU", noSideEffect.} -proc `<%` *(x, y: int64): bool {.magic: "LtU64", noSideEffect.} +proc `<` *(x, y: UIntMax32): bool {.magic: "LtU", noSideEffect.} +proc `<` *(x, y: UInt64): bool {.magic: "LtU64", noSideEffect.} + ## Returns true iff ``unsigned(x) < unsigned(y)``. + +proc `<%` *(x, y: IntMax32): bool {.magic: "LtU", noSideEffect.} +proc `<%` *(x, y: Int64): bool {.magic: "LtU64", noSideEffect.} ## treats `x` and `y` as unsigned and compares them. ## Returns true iff ``unsigned(x) < unsigned(y)``. |