From d330a72a4565353bd3ad54ade0580d53cd9d5a5d Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 14 Sep 2014 11:34:06 +0200 Subject: [PATCH] fixes documentation generator --- compiler/msgs.nim | 2 +- compiler/options.nim | 5 +++-- compiler/pretty.nim | 6 +++++- compiler/vm.nim | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 622c643599..da2fe122d4 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -442,7 +442,7 @@ type TNoteKinds* = set[TNoteKind] TFileInfo*{.final.} = object - fullPath*: string # This is a canonical full filesystem path + fullPath: string # This is a canonical full filesystem path projPath*: string # This is relative to the project's root shortName*: string # short name of the module quotedName*: PRope # cached quoted short name for codegen diff --git a/compiler/options.nim b/compiler/options.nim index 69067b7c41..9d7df2f2bc 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -188,8 +188,9 @@ proc getPrefixDir*(): string = result = splitPath(getAppDir()).head proc canonicalizePath*(path: string): string = - result = path.expandFilename - when not FileSystemCaseSensitive: result = result.toLower + #result = path.expandFilename + when not FileSystemCaseSensitive: result = path.toLower + else: result = path proc shortenDir*(dir: string): string = ## returns the interesting part of a dir diff --git a/compiler/pretty.nim b/compiler/pretty.nim index 9f2074a0b2..ec93223095 100644 --- a/compiler/pretty.nim +++ b/compiler/pretty.nim @@ -110,7 +110,7 @@ template styleCheckDef*(info: TLineInfo; s: PSym) = template styleCheckDef*(s: PSym) = styleCheckDef(s.info, s, s.kind) -proc styleCheckUse*(info: TLineInfo; s: PSym) = +proc styleCheckUseImpl(info: TLineInfo; s: PSym) = if info.fileIndex < 0: return # we simply convert it to what it looks like in the definition # for consistency @@ -138,3 +138,7 @@ proc styleCheckUse*(info: TLineInfo; s: PSym) = system.shallowCopy(gSourceFiles[info.fileIndex].lines[info.line-1], x) gSourceFiles[info.fileIndex].dirty = true #if newName == "File": writeStackTrace() + +template styleCheckUse*(info: TLineInfo; s: PSym) = + when defined(nimfix): + if gStyleCheck != StyleCheck.None: styleCheckUseImpl(info, s) diff --git a/compiler/vm.nim b/compiler/vm.nim index 5ef4576ecc..f74f2e0d70 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1135,14 +1135,14 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = of opcParseExprToAst: decodeB(rkNode) # c.debug[pc].line.int - countLines(regs[rb].strVal) ? - let ast = parseString(regs[rb].node.strVal, c.debug[pc].toFilename, + let ast = parseString(regs[rb].node.strVal, c.debug[pc].toFullPath, c.debug[pc].line.int) if sonsLen(ast) != 1: globalError(c.debug[pc], errExprExpected, "multiple statements") regs[ra].node = ast.sons[0] of opcParseStmtToAst: decodeB(rkNode) - let ast = parseString(regs[rb].node.strVal, c.debug[pc].toFilename, + let ast = parseString(regs[rb].node.strVal, c.debug[pc].toFullPath, c.debug[pc].line.int) regs[ra].node = ast of opcCallSite: