made 'koch web' work when current dir has a space in it
This commit is contained in:
parent
8637e47219
commit
d142824d65
3 changed files with 11 additions and 6 deletions
|
|
@ -42,17 +42,23 @@ proc compilerMsgHandler(filename: string, line, col: int,
|
||||||
of mwUnsupportedLanguage: k = warnLanguageXNotSupported
|
of mwUnsupportedLanguage: k = warnLanguageXNotSupported
|
||||||
globalError(newLineInfo(filename, line, col), k, arg)
|
globalError(newLineInfo(filename, line, col), k, arg)
|
||||||
|
|
||||||
|
proc docgenFindFile(s: string): string {.procvar.} =
|
||||||
|
result = options.findFile(s)
|
||||||
|
if result.len == 0:
|
||||||
|
result = getCurrentDir() / s
|
||||||
|
if not existsFile(result): result = ""
|
||||||
|
|
||||||
proc parseRst(text, filename: string,
|
proc parseRst(text, filename: string,
|
||||||
line, column: int, hasToc: var bool,
|
line, column: int, hasToc: var bool,
|
||||||
rstOptions: TRstParseOptions): PRstNode =
|
rstOptions: TRstParseOptions): PRstNode =
|
||||||
result = rstParse(text, filename, line, column, hasToc, rstOptions,
|
result = rstParse(text, filename, line, column, hasToc, rstOptions,
|
||||||
options.findFile, compilerMsgHandler)
|
docgenFindFile, compilerMsgHandler)
|
||||||
|
|
||||||
proc newDocumentor*(filename: string, config: PStringTable): PDoc =
|
proc newDocumentor*(filename: string, config: PStringTable): PDoc =
|
||||||
new(result)
|
new(result)
|
||||||
initRstGenerator(result[], (if gCmd != cmdRst2tex: outHtml else: outLatex),
|
initRstGenerator(result[], (if gCmd != cmdRst2tex: outHtml else: outLatex),
|
||||||
options.gConfigVars, filename, {roSupportRawDirective},
|
options.gConfigVars, filename, {roSupportRawDirective},
|
||||||
options.findFile, compilerMsgHandler)
|
docgenFindFile, compilerMsgHandler)
|
||||||
result.id = 100
|
result.id = 100
|
||||||
|
|
||||||
proc dispA(dest: var PRope, xml, tex: string, args: openArray[PRope]) =
|
proc dispA(dest: var PRope, xml, tex: string, args: openArray[PRope]) =
|
||||||
|
|
|
||||||
|
|
@ -857,7 +857,7 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
|
||||||
if a.kind != b.kind: return false
|
if a.kind != b.kind: return false
|
||||||
of dcEqOrDistinctOf:
|
of dcEqOrDistinctOf:
|
||||||
while a.kind == tyDistinct: a = a.sons[0]
|
while a.kind == tyDistinct: a = a.sons[0]
|
||||||
if a.kind != b.kind: return false
|
if a.kind != b.kind: return false
|
||||||
case a.kind
|
case a.kind
|
||||||
of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCString,
|
of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCString,
|
||||||
tyInt..tyBigNum, tyStmt, tyExpr:
|
tyInt..tyBigNum, tyStmt, tyExpr:
|
||||||
|
|
|
||||||
5
koch.nim
5
koch.nim
|
|
@ -104,9 +104,8 @@ proc install(args: string) =
|
||||||
exec("sh ./install.sh $#" % args)
|
exec("sh ./install.sh $#" % args)
|
||||||
|
|
||||||
proc web(args: string) =
|
proc web(args: string) =
|
||||||
exec(("$# cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" &
|
exec("$# cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" %
|
||||||
" --path:$#") % [findNim(), NimrodVersion,
|
[findNim(), NimrodVersion])
|
||||||
getCurrentDir().quoteIfContainsWhite])
|
|
||||||
|
|
||||||
# -------------- boot ---------------------------------------------------------
|
# -------------- boot ---------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue