From a9a5766c665c1d88f61669d562483fc8794d3960 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 5 Oct 2014 03:06:19 +0200 Subject: [PATCH] docgen should work again --- compiler/condsyms.nim | 2 ++ compiler/msgs.nim | 6 ++-- compiler/nim.ini | 4 +-- compiler/sempass2.nim | 13 +++++++-- doc/manual/threads.txt | 2 +- lib/impure/db_postgres.nim | 12 ++++---- lib/js/dom.nim | 36 +++++++++++------------ lib/pure/ftpclient.nim | 15 +++++----- lib/pure/json.nim | 58 ++++++++++++++++++------------------ lib/pure/logging.nim | 5 +++- lib/system/jssys.nim | 5 ++-- lib/wrappers/libuv.nim | 60 +++++++++++++++++++------------------- tools/nimweb.nim | 2 +- web/babelpkglist.nim | 4 +-- web/nim.ini | 2 +- 15 files changed, 120 insertions(+), 106 deletions(-) diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 137ec409f..8652844f3 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -69,6 +69,8 @@ const reportMissedDeadlines avoidTimeMachine useClone ignoreAllocationSize debugExecProcesses pcreDll useLipzipSrc preventDeadlocks UNICODE winUnicode trackGcHeaders posixRealtime + + nimStdSetjmp nimRawSetjmp nimSigSetjmp """.split proc initDefines*() = diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 8368fe5fd..51d2836f8 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -119,7 +119,7 @@ type warnDifferentHeaps, warnWriteToForeignHeap, warnUnsafeCode, warnEachIdentIsTuple, warnShadowIdent, warnProveInit, warnProveField, warnProveIndex, warnGcUnsafe, warnGcUnsafe2, - warnUninit, warnGcMem, warnUnguardedAccess, warnUser, + warnUninit, warnGcMem, warnLockLevel, warnUser, hintSuccess, hintSuccessX, hintLineTooLong, hintXDeclaredButNotUsed, hintConvToBaseNotNeeded, hintConvFromXtoItselfNotNeeded, hintExprAlwaysX, hintQuitCalled, @@ -390,7 +390,7 @@ const warnGcUnsafe2: "cannot prove '$1' is GC-safe. Does not compile with --threads:on.", warnUninit: "'$1' might not have been initialized [Uninit]", warnGcMem: "'$1' uses GC'ed memory [GcMem]", - warnUnguardedAccess: "'$1' is accessed without its guard [UnguardedAccess]", + warnLockLevel: "$1 [LockLevel]", warnUser: "$1 [User]", hintSuccess: "operation successful [Success]", hintSuccessX: "operation successful ($# lines compiled; $# sec total; $#) [SuccessX]", @@ -420,7 +420,7 @@ const "AnalysisLoophole", "DifferentHeaps", "WriteToForeignHeap", "UnsafeCode", "EachIdentIsTuple", "ShadowIdent", "ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit", - "GcMem", "UnguardedAccess", "User"] + "GcMem", "LockLevel", "User"] HintsToStr*: array[0..16, string] = ["Success", "SuccessX", "LineTooLong", "XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded", diff --git a/compiler/nim.ini b/compiler/nim.ini index 3833a77cd..6f3f663d9 100644 --- a/compiler/nim.ini +++ b/compiler/nim.ini @@ -29,7 +29,7 @@ App: Console License: "copying.txt" [Config] -Files: "config/nimrod.cfg" +Files: "config/nim.cfg" Files: "config/nimdoc.cfg" Files: "config/nimdoc.tex.cfg" @@ -59,7 +59,7 @@ Files: "icons/koch_icon.o" Files: "compiler/readme.txt" Files: "compiler/nim.ini" -Files: "compiler/nimrod.cfg" +Files: "compiler/nim.nimrod.cfg" Files: "compiler/*.nim" Files: "compiler/c2nim/*.nim" Files: "compiler/c2nim/*.cfg" diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index 94a3b49e3..f9c577977 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -411,6 +411,7 @@ proc getLockLevel(s: PSym): TLockLevel = result = 0.TLockLevel else: result = UnknownLockLevel + #message(s.info, warnUser, "FOR THIS " & s.name.s) proc mergeLockLevels(tracked: PEffects, n: PNode, lockLevel: TLockLevel) = if lockLevel >= tracked.currLockLevel: @@ -757,9 +758,15 @@ proc checkMethodEffects*(disp, branch: PSym) = localError(branch.info, "base method is GC-safe, but '$1' is not" % branch.name.s) if branch.typ.lockLevel > disp.typ.lockLevel: - localError(branch.info, - "base method has lock level $1, but dispatcher has $2" % - [$branch.typ.lockLevel, $disp.typ.lockLevel]) + when true: + message(branch.info, warnLockLevel, + "base method has lock level $1, but dispatcher has $2" % + [$branch.typ.lockLevel, $disp.typ.lockLevel]) + else: + # XXX make this an error after bigbreak has been released: + localError(branch.info, + "base method has lock level $1, but dispatcher has $2" % + [$branch.typ.lockLevel, $disp.typ.lockLevel]) proc setEffectsForProcType*(t: PType, n: PNode) = var effects = t.n.sons[0] diff --git a/doc/manual/threads.txt b/doc/manual/threads.txt index d29cab6ca..a96abf060 100644 --- a/doc/manual/threads.txt +++ b/doc/manual/threads.txt @@ -101,7 +101,7 @@ The compiler can ensure the location in ``location = spawn f(...)`` is not read prematurely within a ``parallel`` section and so there is no need for the overhead of an indirection via ``FlowVar[T]`` to ensure correctness. -**Note**: Currently exceptions are not propagated between ``spawn``ed tasks! +**Note**: Currently exceptions are not propagated between ``spawn``'ed tasks! Spawn statement diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim index 4080cd61f..6ba539377 100644 --- a/lib/impure/db_postgres.nim +++ b/lib/impure/db_postgres.nim @@ -143,12 +143,12 @@ iterator fastRows*(db: TDbConn, stmtName: TSqlPrepared, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = ## executes the prepared query and iterates over the result dataset. var res = setupQuery(db, stmtName, args) - var L = PQnfields(res) + var L = pqNfields(res) var result = newRow(L) - for i in 0..PQntuples(res)-1: + for i in 0..pqNtuples(res)-1: setRow(res, result, i, L) yield result - PQclear(res) + pqClear(res) proc getRow*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = @@ -163,10 +163,10 @@ proc getRow*(db: TDbConn, query: TSqlQuery, proc getRow*(db: TDbConn, stmtName: TSqlPrepared, args: varargs[string, `$`]): TRow {.tags: [FReadDB].} = var res = setupQuery(db, stmtName, args) - var L = PQnfields(res) + var L = pqNfields(res) result = newRow(L) setRow(res, result, 0, L) - PQclear(res) + pqClear(res) proc getAllRows*(db: TDbConn, query: TSqlQuery, args: varargs[string, `$`]): seq[TRow] {.tags: [FReadDB].} = @@ -179,7 +179,7 @@ proc getAllRows*(db: TDbConn, stmtName: TSqlPrepared, args: varargs[string, `$`]): seq[TRow] {.tags: [FReadDB].} = ## executes the prepared query and returns the whole result dataset. result = @[] - for r in FastRows(db, stmtName, args): + for r in fastRows(db, stmtName, args): result.add(r) iterator rows*(db: TDbConn, query: TSqlQuery, diff --git a/lib/js/dom.nim b/lib/js/dom.nim index b07666dd1..91b260a64 100644 --- a/lib/js/dom.nim +++ b/lib/js/dom.nim @@ -14,7 +14,7 @@ when not defined(js) and not defined(Nimdoc): {.error: "This module only works on the JavaScript platform".} type - TEventHandlers* {.importc.} = object of TObject + TEventHandlers* {.importc.} = object of RootObj onabort*: proc (event: ref TEvent) {.nimcall.} onblur*: proc (event: ref TEvent) {.nimcall.} onchange*: proc (event: ref TEvent) {.nimcall.} @@ -124,14 +124,14 @@ type embeds*: seq[ref TEmbed] links*: seq[ref TLink] - TLink* {.importc.} = object of TObject + TLink* {.importc.} = object of RootObj name*: cstring target*: cstring text*: cstring x*: int y*: int - TEmbed* {.importc.} = object of TObject + TEmbed* {.importc.} = object of RootObj height*: int hspace*: int name*: cstring @@ -142,12 +142,12 @@ type play*: proc () {.nimcall.} stop*: proc () {.nimcall.} - TAnchor* {.importc.} = object of TObject + TAnchor* {.importc.} = object of RootObj name*: cstring text*: cstring x*, y*: int - TApplet* {.importc.} = object of TObject + TApplet* {.importc.} = object of RootObj TElement* {.importc.} = object of TEventHandlers checked*: bool @@ -166,7 +166,7 @@ type select*: proc () {.nimcall.} options*: seq[ref TOption] - TOption* {.importc.} = object of TObject + TOption* {.importc.} = object of RootObj defaultSelected*: bool selected*: bool selectedIndex*: int @@ -209,7 +209,7 @@ type DocumentTypeNode, DocumentFragmentNode, NotationNode - TNode* {.importc.} = object of TObject + TNode* {.importc.} = object of RootObj attributes*: seq[ref TNode] childNodes*: seq[ref TNode] data*: cstring @@ -241,7 +241,7 @@ type setAttributeNode*: proc (attr: ref TNode) {.nimcall.} style*: ref TStyle - TStyle* {.importc.} = object of TObject + TStyle* {.importc.} = object of RootObj background*: cstring backgroundAttachment*: cstring backgroundColor*: cstring @@ -335,7 +335,7 @@ type removeAttribute*: proc (attr: cstring, caseSensitive=false) {.nimcall.} setAttribute*: proc (attr, value: cstring, caseSensitive=false) {.nimcall.} - TEvent* {.importc.} = object of TObject + TEvent* {.importc.} = object of RootObj altKey*, ctrlKey*, shiftKey*: bool button*: int clientX*, clientY*: int @@ -373,7 +373,7 @@ type SUBMIT*: int UNLOAD*: int - TLocation* {.importc.} = object of TObject + TLocation* {.importc.} = object of RootObj hash*: cstring host*: cstring hostname*: cstring @@ -385,13 +385,13 @@ type reload*: proc () {.nimcall.} replace*: proc (s: cstring) {.nimcall.} - THistory* {.importc.} = object of TObject + THistory* {.importc.} = object of RootObj length*: int back*: proc () {.nimcall.} forward*: proc () {.nimcall.} go*: proc (pagesToJump: int) {.nimcall.} - TNavigator* {.importc.} = object of TObject + TNavigator* {.importc.} = object of RootObj appCodeName*: cstring appName*: cstring appVersion*: cstring @@ -402,18 +402,18 @@ type javaEnabled*: proc (): bool {.nimcall.} mimeTypes*: seq[ref TMimeType] - TPlugin* {.importc.} = object of TObject + TPlugin* {.importc.} = object of RootObj description*: cstring filename*: cstring name*: cstring - TMimeType* {.importc.} = object of TObject + TMimeType* {.importc.} = object of RootObj description*: cstring enabledPlugin*: ref TPlugin suffixes*: seq[cstring] `type`*: cstring - TLocationBar* {.importc.} = object of TObject + TLocationBar* {.importc.} = object of RootObj visible*: bool TMenuBar* = TLocationBar TPersonalBar* = TLocationBar @@ -421,7 +421,7 @@ type TToolBar* = TLocationBar TStatusBar* = TLocationBar - TScreen* {.importc.} = object of TObject + TScreen* {.importc.} = object of RootObj availHeight*: int availWidth*: int colorDepth*: int @@ -429,8 +429,8 @@ type pixelDepth*: int width*: int - TTimeOut* {.importc.} = object of TObject - TInterval* {.importc.} = object of TObject + TTimeOut* {.importc.} = object of RootObj + TInterval* {.importc.} = object of RootObj var window* {.importc, nodecl.}: ref TWindow diff --git a/lib/pure/ftpclient.nim b/lib/pure/ftpclient.nim index 37b25871d..975eae7e2 100644 --- a/lib/pure/ftpclient.nim +++ b/lib/pure/ftpclient.nim @@ -446,13 +446,14 @@ proc getFile[T](ftp: FtpBase[T], async = false): bool = ftp.job.file.write(r2) elif returned and r2 == "": ftp.dsockConnected = false - - if not async: - var readSocks: seq[TSocket] = @[ftp.csock] - blockingOperation(ftp.csock): - if readSocks.select(1) != 0 and ftp.csock in readSocks: - assertReply ftp.expectReply(), "226" - return true + + when T is TSocket: + if not async: + var readSocks: seq[TSocket] = @[ftp.csock] + blockingOperation(ftp.csock): + if readSocks.select(1) != 0 and ftp.csock in readSocks: + assertReply ftp.expectReply(), "226" + return true proc retrFile*[T](ftp: FtpBase[T], file, dest: string, async = false) = ## Downloads ``file`` and saves it to ``dest``. Usage of this function diff --git a/lib/pure/json.nim b/lib/pure/json.nim index 8bd05ad55..385787d6c 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -542,7 +542,7 @@ proc raiseParseErr*(p: JsonParser, msg: string) {.noinline, noreturn.} = raise newException(JsonParsingError, errorMsgExpected(p, msg)) proc newJString*(s: string): JsonNode = - ## Creates a new `JString PJsonNode`. + ## Creates a new `JString JsonNode`. new(result) result.kind = JString result.str = s @@ -553,73 +553,73 @@ proc newJStringMove(s: string): JsonNode = shallowCopy(result.str, s) proc newJInt*(n: BiggestInt): JsonNode = - ## Creates a new `JInt PJsonNode`. + ## Creates a new `JInt JsonNode`. new(result) result.kind = JInt result.num = n proc newJFloat*(n: float): JsonNode = - ## Creates a new `JFloat PJsonNode`. + ## Creates a new `JFloat JsonNode`. new(result) result.kind = JFloat result.fnum = n proc newJBool*(b: bool): JsonNode = - ## Creates a new `JBool PJsonNode`. + ## Creates a new `JBool JsonNode`. new(result) result.kind = JBool result.bval = b proc newJNull*(): JsonNode = - ## Creates a new `JNull PJsonNode`. + ## Creates a new `JNull JsonNode`. new(result) proc newJObject*(): JsonNode = - ## Creates a new `JObject PJsonNode` + ## Creates a new `JObject JsonNode` new(result) result.kind = JObject result.fields = @[] proc newJArray*(): JsonNode = - ## Creates a new `JArray PJsonNode` + ## Creates a new `JArray JsonNode` new(result) result.kind = JArray result.elems = @[] proc `%`*(s: string): JsonNode = - ## Generic constructor for JSON data. Creates a new `JString PJsonNode`. + ## Generic constructor for JSON data. Creates a new `JString JsonNode`. new(result) result.kind = JString result.str = s proc `%`*(n: BiggestInt): JsonNode = - ## Generic constructor for JSON data. Creates a new `JInt PJsonNode`. + ## Generic constructor for JSON data. Creates a new `JInt JsonNode`. new(result) result.kind = JInt result.num = n proc `%`*(n: float): JsonNode = - ## Generic constructor for JSON data. Creates a new `JFloat PJsonNode`. + ## Generic constructor for JSON data. Creates a new `JFloat JsonNode`. new(result) result.kind = JFloat result.fnum = n proc `%`*(b: bool): JsonNode = - ## Generic constructor for JSON data. Creates a new `JBool PJsonNode`. + ## Generic constructor for JSON data. Creates a new `JBool JsonNode`. new(result) result.kind = JBool result.bval = b proc `%`*(keyVals: openArray[tuple[key: string, val: JsonNode]]): JsonNode = - ## Generic constructor for JSON data. Creates a new `JObject PJsonNode` + ## Generic constructor for JSON data. Creates a new `JObject JsonNode` new(result) result.kind = JObject newSeq(result.fields, keyVals.len) for i, p in pairs(keyVals): result.fields[i] = p proc `%`*(elements: openArray[JsonNode]): JsonNode = - ## Generic constructor for JSON data. Creates a new `JArray PJsonNode` + ## Generic constructor for JSON data. Creates a new `JArray JsonNode` new(result) result.kind = JArray newSeq(result.elems, elements.len) @@ -932,7 +932,7 @@ proc parseJson(p: var JsonParser): JsonNode = when not defined(js): proc parseJson*(s: Stream, filename: string): JsonNode = - ## Parses from a stream `s` into a `PJsonNode`. `filename` is only needed + ## Parses from a stream `s` into a `JsonNode`. `filename` is only needed ## for nice error messages. var p: JsonParser p.open(s, filename) @@ -945,7 +945,7 @@ when not defined(js): result = parseJson(newStringStream(buffer), "input") proc parseFile*(filename: string): JsonNode = - ## Parses `file` into a `PJsonNode`. + ## Parses `file` into a `JsonNode`. var stream = newFileStream(filename, fmRead) if stream == nil: raise newException(IOError, "cannot read from file: " & filename) @@ -956,7 +956,7 @@ else: TJSObject = object proc parseNativeJson(x: cstring): TJSObject {.importc: "JSON.parse".} - proc getVarType(x): TJsonNodeKind = + proc getVarType(x): JsonNodeKind = result = JNull proc getProtoName(y): cstring {.importc: "Object.prototype.toString.call".} @@ -991,7 +991,7 @@ else: return `x`[`y`]; """ - proc convertObject(x: TJSObject): PJsonNode = + proc convertObject(x: TJSObject): JsonNode = case getVarType(x) of JArray: result = newJArray() @@ -1018,15 +1018,15 @@ else: of JNull: result = newJNull() - proc parseJson*(buffer: string): PJsonNode = + proc parseJson*(buffer: string): JsonNode = return parseNativeJson(buffer).convertObject() when false: import os - var s = newFileStream(ParamStr(1), fmRead) - if s == nil: quit("cannot open the file" & ParamStr(1)) - var x: TJsonParser - open(x, s, ParamStr(1)) + var s = newFileStream(paramStr(1), fmRead) + if s == nil: quit("cannot open the file" & paramStr(1)) + var x: JsonParser + open(x, s, paramStr(1)) while true: next(x) case x.kind @@ -1035,13 +1035,13 @@ when false: break of jsonEof: break of jsonString, jsonInt, jsonFloat: echo(x.str) - of jsonTrue: Echo("!TRUE") - of jsonFalse: Echo("!FALSE") - of jsonNull: Echo("!NULL") - of jsonObjectStart: Echo("{") - of jsonObjectEnd: Echo("}") - of jsonArrayStart: Echo("[") - of jsonArrayEnd: Echo("]") + of jsonTrue: echo("!TRUE") + of jsonFalse: echo("!FALSE") + of jsonNull: echo("!NULL") + of jsonObjectStart: echo("{") + of jsonObjectEnd: echo("}") + of jsonArrayStart: echo("[") + of jsonArrayEnd: echo("]") close(x) diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim index bd5e1bf42..9247f69c5 100644 --- a/lib/pure/logging.nim +++ b/lib/pure/logging.nim @@ -107,9 +107,12 @@ proc substituteLog(frmt: string): string = of "app": result.add(app) of "appdir": result.add(app.splitFile.dir) of "appname": result.add(app.splitFile.name) + else: discard method log*(logger: Logger, level: Level, - frmt: string, args: varargs[string, `$`]) {.raises: [Exception], tags: [FTime, FWriteIO, FReadIO].} = + frmt: string, args: varargs[string, `$`]) {. + raises: [Exception], + tags: [TimeEffect, WriteIOEffect, ReadIOEffect].} = ## Override this method in custom loggers. Default implementation does ## nothing. discard diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim index f76c0e515..9b4a7d556 100644 --- a/lib/system/jssys.nim +++ b/lib/system/jssys.nim @@ -345,11 +345,12 @@ else: node.appendChild(document.createTextNode(x)) node.appendChild(document.createElement("br")) else: - raise newException(EInvalidValue, " element does not exist yet!") + raise newException(ValueError, " element does not exist yet!") proc rawEcho {.compilerproc.} = var node = document.getElementsByTagName("body")[0] - if node == nil: raise newException(EIO, " element does not exist yet!") + if node == nil: + raise newException(IOError, " element does not exist yet!") asm """ for (var i = 0; i < arguments.length; ++i) { var x = `toJSStr`(arguments[i]); diff --git a/lib/wrappers/libuv.nim b/lib/wrappers/libuv.nim index 1b6416982..3189ec408 100644 --- a/lib/wrappers/libuv.nim +++ b/lib/wrappers/libuv.nim @@ -35,7 +35,7 @@ type GetAddrInfoProc* = proc (handle: PGetAddrInfo, status: cint, res: ptr TAddrInfo) ExitProc* = proc (a2: PProcess, exit_status: cint, term_signal: cint) - FsProc* = proc (req: pFS) + FsProc* = proc (req: PFS) WorkProc* = proc (req: PWork) AfterWorkProc* = proc (req: PWork) @@ -338,7 +338,7 @@ type FS_CHMOD, FS_FCHMOD, FS_FSYNC, FS_FDATASYNC, FS_UNLINK, FS_RMDIR, FS_MKDIR, FS_RENAME, FS_READDIR, FS_LINK, FS_SYMLINK, FS_READLINK, FS_CHOWN, FS_FCHOWN - tFS* {.pure, final, importc: "uv_fs_t", header: "uv.h".} = object + TFS* {.pure, final, importc: "uv_fs_t", header: "uv.h".} = object typ* {.importc: "type".}: TReqType data* {.importc: "data".}: pointer loop* {.importc: "loop".}: PLoop @@ -349,7 +349,7 @@ type path* {.importc: "path".}: cstring errorno* {.importc: "errorno".}: cint - pFS* = ptr tFS + PFS* = ptr TFS TReq* {.pure, final, importc: "uv_req_t", header: "uv.h".} = object typ* {.importc: "type".}: TReqType @@ -591,85 +591,85 @@ proc process_kill*(a2: PProcess, signum: cint): cint{. proc queue_work*(loop: PLoop, req: PWork, work_cb: WorkProc, after_work_cb: AfterWorkProc): cint{. importc: "uv_queue_work", header: "uv.h".} -proc req_cleanup*(req: pFS){. +proc req_cleanup*(req: PFS){. importc: "uv_fs_req_cleanup", header: "uv.h".} -proc close*(loop: PLoop, req: pFS, file: TFile, cb: FsProc): cint{. +proc close*(loop: PLoop, req: PFS, file: TFile, cb: FsProc): cint{. importc: "uv_fs_close", header: "uv.h".} -proc open*(loop: PLoop, req: pFS, path: cstring, flags: cint, mode: cint, cb: FsProc): cint{. +proc open*(loop: PLoop, req: PFS, path: cstring, flags: cint, mode: cint, cb: FsProc): cint{. importc: "uv_fs_open", header: "uv.h".} -proc read*(loop: PLoop, req: pFS, file: TFile, buf: pointer, length: csize, offset: coff, cb: FsProc): cint{. +proc read*(loop: PLoop, req: PFS, file: TFile, buf: pointer, length: csize, offset: coff, cb: FsProc): cint{. importc: "uv_fs_read", header: "uv.h".} -proc unlink*(loop: PLoop, req: pFS, path: cstring, cb: FsProc): cint{. +proc unlink*(loop: PLoop, req: PFS, path: cstring, cb: FsProc): cint{. importc: "uv_fs_unlink", header: "uv.h".} -proc write*(loop: PLoop, req: pFS, file: TFile, buf: pointer, length: csize, offset: coff, cb: FsProc): cint{. +proc write*(loop: PLoop, req: PFS, file: TFile, buf: pointer, length: csize, offset: coff, cb: FsProc): cint{. importc: "uv_fs_write", header: "uv.h".} -proc mkdir*(loop: PLoop, req: pFS, path: cstring, mode: cint, cb: FsProc): cint{. +proc mkdir*(loop: PLoop, req: PFS, path: cstring, mode: cint, cb: FsProc): cint{. importc: "uv_fs_mkdir", header: "uv.h".} -proc rmdir*(loop: PLoop, req: pFS, path: cstring, cb: FsProc): cint{. +proc rmdir*(loop: PLoop, req: PFS, path: cstring, cb: FsProc): cint{. importc: "uv_fs_rmdir", header: "uv.h".} -proc readdir*(loop: PLoop, req: pFS, path: cstring, flags: cint, cb: FsProc): cint{. +proc readdir*(loop: PLoop, req: PFS, path: cstring, flags: cint, cb: FsProc): cint{. importc: "uv_fs_readdir", header: "uv.h".} -proc stat*(loop: PLoop, req: pFS, path: cstring, cb: FsProc): cint{. +proc stat*(loop: PLoop, req: PFS, path: cstring, cb: FsProc): cint{. importc: "uv_fs_stat", header: "uv.h".} -proc fstat*(loop: PLoop, req: pFS, file: TFile, cb: FsProc): cint{. +proc fstat*(loop: PLoop, req: PFS, file: TFile, cb: FsProc): cint{. importc: "uv_fs_fstat", header: "uv.h".} -proc rename*(loop: PLoop, req: pFS, path: cstring, new_path: cstring, cb: FsProc): cint{. +proc rename*(loop: PLoop, req: PFS, path: cstring, new_path: cstring, cb: FsProc): cint{. importc: "uv_fs_rename", header: "uv.h".} -proc fsync*(loop: PLoop, req: pFS, file: TFile, cb: FsProc): cint{. +proc fsync*(loop: PLoop, req: PFS, file: TFile, cb: FsProc): cint{. importc: "uv_fs_fsync", header: "uv.h".} -proc fdatasync*(loop: PLoop, req: pFS, file: TFile, cb: FsProc): cint{. +proc fdatasync*(loop: PLoop, req: PFS, file: TFile, cb: FsProc): cint{. importc: "uv_fs_fdatasync", header: "uv.h".} -proc ftruncate*(loop: PLoop, req: pFS, file: TFile, offset: coff, cb: FsProc): cint{. +proc ftruncate*(loop: PLoop, req: PFS, file: TFile, offset: coff, cb: FsProc): cint{. importc: "uv_fs_ftruncate", header: "uv.h".} -proc sendfile*(loop: PLoop, req: pFS, out_fd: TFile, in_fd: TFile, in_offset: coff, length: csize, cb: FsProc): cint{. +proc sendfile*(loop: PLoop, req: PFS, out_fd: TFile, in_fd: TFile, in_offset: coff, length: csize, cb: FsProc): cint{. importc: "uv_fs_sendfile", header: "uv.h".} -proc chmod*(loop: PLoop, req: pFS, path: cstring, mode: cint, cb: FsProc): cint{. +proc chmod*(loop: PLoop, req: PFS, path: cstring, mode: cint, cb: FsProc): cint{. importc: "uv_fs_chmod", header: "uv.h".} -proc utime*(loop: PLoop, req: pFS, path: cstring, atime: cdouble, mtime: cdouble, cb: FsProc): cint{. +proc utime*(loop: PLoop, req: PFS, path: cstring, atime: cdouble, mtime: cdouble, cb: FsProc): cint{. importc: "uv_fs_utime", header: "uv.h".} -proc futime*(loop: PLoop, req: pFS, file: TFile, atime: cdouble, mtime: cdouble, cb: FsProc): cint{. +proc futime*(loop: PLoop, req: PFS, file: TFile, atime: cdouble, mtime: cdouble, cb: FsProc): cint{. importc: "uv_fs_futime", header: "uv.h".} -proc lstat*(loop: PLoop, req: pFS, path: cstring, cb: FsProc): cint{. +proc lstat*(loop: PLoop, req: PFS, path: cstring, cb: FsProc): cint{. importc: "uv_fs_lstat", header: "uv.h".} -proc link*(loop: PLoop, req: pFS, path: cstring, new_path: cstring, cb: FsProc): cint{. +proc link*(loop: PLoop, req: PFS, path: cstring, new_path: cstring, cb: FsProc): cint{. importc: "uv_fs_link", header: "uv.h".} -proc symlink*(loop: PLoop, req: pFS, path: cstring, new_path: cstring, flags: cint, cb: FsProc): cint{. +proc symlink*(loop: PLoop, req: PFS, path: cstring, new_path: cstring, flags: cint, cb: FsProc): cint{. importc: "uv_fs_symlink", header: "uv.h".} -proc readlink*(loop: PLoop, req: pFS, path: cstring, cb: FsProc): cint{. +proc readlink*(loop: PLoop, req: PFS, path: cstring, cb: FsProc): cint{. importc: "uv_fs_readlink", header: "uv.h".} -proc fchmod*(loop: PLoop, req: pFS, file: TFile, mode: cint, cb: FsProc): cint{. +proc fchmod*(loop: PLoop, req: PFS, file: TFile, mode: cint, cb: FsProc): cint{. importc: "uv_fs_fchmod", header: "uv.h".} -proc chown*(loop: PLoop, req: pFS, path: cstring, uid: cint, gid: cint, cb: FsProc): cint{. +proc chown*(loop: PLoop, req: PFS, path: cstring, uid: cint, gid: cint, cb: FsProc): cint{. importc: "uv_fs_chown", header: "uv.h".} -proc fchown*(loop: PLoop, req: pFS, file: TFile, uid: cint, gid: cint, cb: FsProc): cint{. +proc fchown*(loop: PLoop, req: PFS, file: TFile, uid: cint, gid: cint, cb: FsProc): cint{. importc: "uv_fs_fchown", header: "uv.h".} -proc event_init*(loop: PLoop, handle: PFsEvent, filename: cstring, cb: FsEventProc): cint{. +proc event_init*(loop: PLoop, handle: PFSEvent, filename: cstring, cb: FsEventProc): cint{. importc: "uv_fs_event_init", header: "uv.h".} proc ip4_addr*(ip: cstring, port: cint): TSockAddrIn{. diff --git a/tools/nimweb.nim b/tools/nimweb.nim index a98a27a13..24ade58fc 100644 --- a/tools/nimweb.nim +++ b/tools/nimweb.nim @@ -35,7 +35,7 @@ proc initConfigData(c: var TConfigData) = c.pdf = @[] c.infile = "" c.outdir = "" - c.nimArgs = "--hint[Conf]:off " + c.nimArgs = "--hint[Conf]:off --hint[Path]:off --hint[Processing]:off " c.authors = "" c.projectTitle = "" c.projectName = "" diff --git a/web/babelpkglist.nim b/web/babelpkglist.nim index 5da7d60a9..aeea57a0d 100644 --- a/web/babelpkglist.nim +++ b/web/babelpkglist.nim @@ -10,7 +10,7 @@ proc decodeContent(content: string): string = if line != "": result.add decode(line) -proc contains(x: seq[PJSonNode], s: string): bool = +proc contains(x: seq[JSonNode], s: string): bool = for i in x: assert i.kind == JString if i.str == s: return true @@ -20,7 +20,7 @@ proc processContent(content: string) = assert jsonDoc.kind == JArray var jsonArr = jsonDoc.elems - jsonArr.sort do (x, y: PJsonNode) -> int: + jsonArr.sort do (x, y: JsonNode) -> int: strutils.cmpIgnoreCase(x["name"].str, y["name"].str) var diff --git a/web/nim.ini b/web/nim.ini index 1bf75e209..d0867ca4e 100644 --- a/web/nim.ini +++ b/web/nim.ini @@ -36,7 +36,7 @@ UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson.""" [Documentation] -doc: "endb;intern;apis;lib;manual;tut1;tut2;nimc;overview;filters" +doc: "endb;intern;apis;lib;manual.txt;tut1;tut2;nimc;overview;filters" doc: "tools;niminst;nimgrep;gc;estp;idetools;docgen;koch;backends.txt" pdf: "manual;lib;tut1;tut2;nimc;niminst;gc" srcdoc2: "system.nim"