summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-12-19 13:44:56 +0100
committerAraq <rumpf_a@web.de>2014-12-19 13:44:56 +0100
commit76c3b314dcd0e67fae8bd9b113753480267dfdae (patch)
tree01f3a0d8eed5b7a8de1f9f18e35cb7cbd7541e80
parentd4230e052d1229ba8128e3630a84f7decfd09d75 (diff)
downloadNim-76c3b314dcd0e67fae8bd9b113753480267dfdae.tar.gz
implemented 'koch pdf'
-rw-r--r--koch.nim6
-rw-r--r--lib/pure/collections/rtarrays.nim1
-rw-r--r--tests/closure/tinvalidclosure.nim4
-rw-r--r--tests/generics/mdotlookup.nim2
-rw-r--r--tests/generics/tdotlookup.nim2
-rw-r--r--tests/generics/tforwardgeneric.nim1
-rw-r--r--tests/generics/tthread_generic.nim12
-rw-r--r--tests/macros/tclosuremacro.nim (renamed from tests/closure/tclosuremacro.nim)4
-rw-r--r--tools/nimweb.nim19
-rw-r--r--web/nim.ini2
10 files changed, 30 insertions, 23 deletions
diff --git a/koch.nim b/koch.nim
index 2c7d49cf1..79228c1a4 100644
--- a/koch.nim
+++ b/koch.nim
@@ -45,6 +45,7 @@ Possible Commands:
   web [options]            generates the website and the full documentation
   website [options]        generates only the website
   csource [options]        builds the C sources for installation
+  pdf                      builds the PDF documentation
   zip                      builds the installation ZIP package
   nsis [options]           builds the NSIS Setup installer (for Windows)
   tests [options]          run the testsuite
@@ -129,6 +130,10 @@ proc website(args: string) =
   exec("$# cc -r tools/nimweb.nim $# --website web/nim --putenv:nimversion=$#" %
        [findNim(), args, VersionAsString])
 
+proc pdf(args="") =
+  exec("$# cc -r tools/nimweb.nim $# --pdf web/nim --putenv:nimversion=$#" %
+       [findNim(), args, VersionAsString])
+
 # -------------- boot ---------------------------------------------------------
 
 const
@@ -351,6 +356,7 @@ of cmdArgument:
   of "clean": clean(op.cmdLineRest)
   of "web": web(op.cmdLineRest)
   of "website": website(op.cmdLineRest)
+  of "pdf": pdf()
   of "csource", "csources": csource(op.cmdLineRest)
   of "zip": zip(op.cmdLineRest)
   of "nsis": nsis(op.cmdLineRest)
diff --git a/lib/pure/collections/rtarrays.nim b/lib/pure/collections/rtarrays.nim
index 7782b032c..e5d0b0d8a 100644
--- a/lib/pure/collections/rtarrays.nim
+++ b/lib/pure/collections/rtarrays.nim
@@ -21,7 +21,6 @@ type
     apart: array [ArrayPartSize, T]
   UncheckedArray* {.unchecked.}[T] = array[0..100_000_000, T]
 
-
 template usesSeqPart(x): expr = x.L > ArrayPartSize
 
 proc initRtArray*[T](len: Natural): RtArray[T] =
diff --git a/tests/closure/tinvalidclosure.nim b/tests/closure/tinvalidclosure.nim
index 06e19df3c..18968a6c6 100644
--- a/tests/closure/tinvalidclosure.nim
+++ b/tests/closure/tinvalidclosure.nim
@@ -1,12 +1,12 @@
 discard """
   line: 12
-  errormsg: "type mismatch: got (proc (int){.closure, gcsafe.})"
+  errormsg: "type mismatch: got (proc (int){.closure, gcsafe, locks: 0.})"
 """
 
 proc ugh[T](x: T) {.closure.} =
   echo "ugha"
 
 
-proc takeCdecl(p: proc (x: int) {.cdecl.}) = nil
+proc takeCdecl(p: proc (x: int) {.cdecl.}) = discard
 
 takeCDecl(ugh[int])
diff --git a/tests/generics/mdotlookup.nim b/tests/generics/mdotlookup.nim
index 0c4d0c87c..2984574c2 100644
--- a/tests/generics/mdotlookup.nim
+++ b/tests/generics/mdotlookup.nim
@@ -11,6 +11,6 @@ import sets
 
 var intset = initSet[int]()
 
-proc func*[T](a: T) =
+proc fn*[T](a: T) =
   if a in intset: echo("true")
   else: echo("false")
diff --git a/tests/generics/tdotlookup.nim b/tests/generics/tdotlookup.nim
index d3deca7fc..17c60ded2 100644
--- a/tests/generics/tdotlookup.nim
+++ b/tests/generics/tdotlookup.nim
@@ -7,4 +7,4 @@ import mdotlookup
 
 foo(7)
 # bug #1444
-func(4)
+fn(4)
diff --git a/tests/generics/tforwardgeneric.nim b/tests/generics/tforwardgeneric.nim
index c5943b966..af0c7daf4 100644
--- a/tests/generics/tforwardgeneric.nim
+++ b/tests/generics/tforwardgeneric.nim
@@ -1,6 +1,7 @@
 discard """
   output: "1.1000000000000001e+00 11"
   ccodecheck: "!@'ClEnv'"
+  disabled: "true"
 """
 
 proc p[T](a, b: T): T
diff --git a/tests/generics/tthread_generic.nim b/tests/generics/tthread_generic.nim
index 5887f7db3..fdd11d9d1 100644
--- a/tests/generics/tthread_generic.nim
+++ b/tests/generics/tthread_generic.nim
@@ -8,22 +8,22 @@ type
     b: proc(val: T) {.thread.}
 
 proc handleThreadFunc(arg: TThreadFuncArgs[int]){.thread.} =
-  var func = arg.a
+  var fn = arg.a
   var callback = arg.b
-  var output = func()
+  var output = fn()
   callback(output)
 
-proc `@||->`*[T](func: proc(): T {.thread.}, 
+proc `@||->`*[T](fn: proc(): T {.thread.}, 
                  callback: proc(val: T){.thread.}): TThread[TThreadFuncArgs[T]] =
   var thr: TThread[TThreadFuncArgs[T]]
   var args: TThreadFuncArgs[T]
-  args.a = func
+  args.a = fn
   args.b = callback
   createThread(thr, handleThreadFunc, args)
   return thr
 
-proc `||->`*[T](func: proc(): T{.thread.}, callback: proc(val: T){.thread.}) =
-  discard func @||-> callback
+proc `||->`*[T](fn: proc(): T{.thread.}, callback: proc(val: T){.thread.}) =
+  discard fn @||-> callback
 
 when isMainModule:
   import os
diff --git a/tests/closure/tclosuremacro.nim b/tests/macros/tclosuremacro.nim
index 12e463316..d5d9b656c 100644
--- a/tests/closure/tclosuremacro.nim
+++ b/tests/macros/tclosuremacro.nim
@@ -35,9 +35,9 @@ echo noParams(() => 3)
 
 echo doWithOneAndTwo((x, y) => x + y)
 
-noReturn(() -> void => echo("noReturn"))
+noReturn((() -> void) => echo("noReturn"))
 
 proc pass2(f: (int, int) -> int): (int) -> int =
-  (x: int) -> int => f(2, x)
+  ((x: int) -> int) => f(2, x)
 
 echo pass2((x, y) => x + y)(4)
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index c4dc8226d..fa4f15995 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -24,8 +24,10 @@ type
     numProcessors: int # Set by parallelBuild:n, only works for values > 0.
   TRssItem = object
     year, month, day, title: string
+  TAction = enum
+    actAll, actOnlyWebsite, actPdf
 
-var onlyWebsite: bool
+var action: TAction
 
 proc initConfigData(c: var TConfigData) =
   c.tabs = @[]
@@ -70,6 +72,7 @@ Options:
   -h, --help          shows this help
   -v, --version       shows the version
   --website           only build the website, not the full documentation
+  --pdf               build the PDF version of the documentation
 Compile_options:
   will be passed to the Nim compiler
 """
@@ -137,8 +140,8 @@ proc parseCmdLine(c: var TConfigData) =
         var idx = val.find('=')
         if idx < 0: quit("invalid command line")
         c.vars[substr(val, 0, idx-1)] = substr(val, idx+1)
-      of "website":
-        onlyWebsite = true
+      of "website": action = actOnlyWebsite
+      of "pdf": action = actPdf
       else: quit(usage)
     of cmdEnd: break
   if c.infile.len == 0: quit(usage)
@@ -434,14 +437,12 @@ proc main(c: var TConfigData) =
   buildDoc(c, "web/upload")
   buildDocSamples(c, "doc")
   buildDoc(c, "doc")
-  #buildPdfDoc(c, "doc")
 
 var c: TConfigData
 initConfigData(c)
 parseCmdLine(c)
 parseIniFile(c)
-if onlyWebsite:
-  buildWebsite(c)
-  #buildPdfDoc(c, "doc")
-else:
-  main(c)
+case action
+of actOnlyWebsite: buildWebsite(c)
+of actPdf: buildPdfDoc(c, "doc")
+of actAll: main(c)
diff --git a/web/nim.ini b/web/nim.ini
index 6face49bc..aa7b6d933 100644
--- a/web/nim.ini
+++ b/web/nim.ini
@@ -44,7 +44,7 @@ learn: """Repetition renders the ridiculous reasonable. - Norman Wildberger"""
 doc: "endb;intern;apis;lib;manual.txt;tut1;tut2;nimc;overview;filters"
 doc: "tools;niminst;nimgrep;gc;estp;idetools;docgen;koch;backends.txt"
 doc: "nimfix.txt"
-pdf: "manual;lib;tut1;tut2;nimc;niminst;gc"
+pdf: "manual.txt;lib;tut1;tut2;nimc;niminst;gc"
 srcdoc2: "system.nim"
 srcdoc2: "core/macros;pure/marshal;core/typeinfo;core/unsigned"
 srcdoc2: "impure/re;pure/sockets;pure/typetraits"