diff --git a/compiler/commands.nim b/compiler/commands.nim index 616e50507..f26d1d6c7 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -395,7 +395,9 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) = of "linedir": processOnOffSwitch({optLineDir}, arg, pass, info) of "assertions", "a": processOnOffSwitch({optAssert}, arg, pass, info) of "deadcodeelim": processOnOffSwitchG({optDeadCodeElim}, arg, pass, info) - of "threads": processOnOffSwitchG({optThreads}, arg, pass, info) + of "threads": + processOnOffSwitchG({optThreads}, arg, pass, info) + if optThreads in gGlobalOptions: incl(gNotes, warnGcUnsafe) of "tlsemulation": processOnOffSwitchG({optTlsEmulation}, arg, pass, info) of "taintmode": processOnOffSwitchG({optTaintMode}, arg, pass, info) of "implicitstatic": diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 273fcb7f3..8bd0bb490 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -383,6 +383,8 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) = var seeSrcRope: PRope = nil let docItemSeeSrc = getConfigVar("doc.item.seesrc") if docItemSeeSrc.len > 0 and options.docSeeSrcUrl.len > 0: + # XXX toFilename doesn't really work. We need to ensure that this keeps + # returning a relative path. let urlRope = ropeFormatNamedVars(options.docSeeSrcUrl, ["path", "line"], [n.info.toFilename.toRope, toRope($n.info.line)]) dispA(seeSrcRope, "$1", "", [ropeFormatNamedVars(docItemSeeSrc, diff --git a/compiler/importer.nim b/compiler/importer.nim index 159dfa6a5..b9fd552bf 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -92,7 +92,7 @@ proc rawImportSymbol(c: PContext, s: PSym) = if s.kind == skConverter: addConverter(c, s) if hasPattern(s): addPattern(c, s) -proc importSymbol(c: PContext, n: PNode, fromMod: PSym) = +proc importSymbol(c: PContext, n: PNode, fromMod: PSym) = let ident = lookups.considerQuotedIdent(n) let s = strTableGet(fromMod.tab, ident) if s == nil: @@ -155,10 +155,12 @@ proc importModuleAs(n: PNode, realModule: PSym): PSym = # some misguided guy will write 'import abc.foo as foo' ... result = createModuleAlias(realModule, n.sons[1].ident, n.sons[1].info) -proc myImportModule(c: PContext, n: PNode): PSym = +proc myImportModule(c: PContext, n: PNode): PSym = var f = checkModuleName(n) if f != InvalidFileIDX: result = importModuleAs(n, gImportModule(c.module, f)) + if result.info.fileIndex == n.info.fileIndex: + localError(n.info, errGenerated, "A module cannot import itself") if sfDeprecated in result.flags: message(n.info, warnDeprecated, result.name.s) diff --git a/compiler/nim.ini b/compiler/nim.ini index 6f3f663d9..d9e0dc037 100644 --- a/compiler/nim.ini +++ b/compiler/nim.ini @@ -1,3 +1,6 @@ +; This config file holds configuration information about the Nim compiler +; and project. + [Project] Name: "Nim" Version: "$version" @@ -34,11 +37,11 @@ Files: "config/nimdoc.cfg" Files: "config/nimdoc.tex.cfg" [Documentation] -Files: "doc/*.txt" -Files: "doc/*.html" -Files: "doc/*.cfg" -Files: "doc/*.pdf" -Files: "doc/*.ini" +; Files: "doc/*.html" +; Files: "doc/*.cfg" +; Files: "doc/*.pdf" +; Files: "doc/*.ini" +Files: "doc/overview.html" Start: "doc/overview.html" @@ -61,13 +64,9 @@ Files: "compiler/readme.txt" Files: "compiler/nim.ini" Files: "compiler/nim.nimrod.cfg" Files: "compiler/*.nim" -Files: "compiler/c2nim/*.nim" -Files: "compiler/c2nim/*.cfg" -Files: "compiler/pas2nim/*.nim" -Files: "compiler/pas2nim/*.cfg" - -Files: "build/empty.txt" -Files: "bin/empty.txt" +Files: "doc/*.txt" +Files: "compiler/nimfix/*.nim" +Files: "compiler/nimfix/*.cfg" [Lib] @@ -115,17 +114,21 @@ Files: "examples/*.tmpl" [Windows] Files: "bin/nim.exe" +Files: "bin/nim_debug.exe" Files: "bin/c2nim.exe" -Files: "bin/niminst.exe" Files: "bin/nimgrep.exe" Files: "dist/*.dll" Files: "koch.exe" -Files: "dist/mingw" +; Files: "dist/mingw" Files: "start.bat" BinPath: r"bin;dist\mingw\bin;dist" -InnoSetup: "Yes" +; Section | dir | zipFile | size hint (in KB) | url | exe start menu entry +Download: r"Documentation|doc|docs.zip|13824|http://nim-lang.org/download/docs-${version}.zip" +Download: r"C Compiler (MingW)|dist|mingw.zip|82944|http://nim-lang.org/download/${mingw}.zip" +Download: r"Aporia IDE|dist|aporia.zip|97997|http://nim-lang.org/download/aporia-0.1.3.zip|aporia\bin\aporia.exe" +; for now only NSIS supports optional downloads [UnixBin] Files: "bin/nim" @@ -140,6 +143,9 @@ UninstallScript: "yes" path = r"c:\Program Files (x86)\Inno Setup 5\iscc.exe" flags = "/Q" +[NSIS] +path = r"c:\Program Files (x86)\NSIS\makensis.exe" +flags = "/V0" [C_Compiler] path = r"" diff --git a/config/nimdoc.cfg b/config/nimdoc.cfg index dc241db50..975c7c06a 100644 --- a/config/nimdoc.cfg +++ b/config/nimdoc.cfg @@ -41,7 +41,6 @@ doc.item = """
$header