diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-09-07 01:53:09 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-09-07 01:53:09 +0200 |
commit | ad9db5cb1aab17d12bc0ed20a1ed0548e351b3db (patch) | |
tree | be7af65d131263d1fd619a4e656a1205a871739b /compiler/syntaxes.nim | |
parent | 92863c0e75d32bffb0d7af15310e04cca7da9d3a (diff) | |
download | Nim-ad9db5cb1aab17d12bc0ed20a1ed0548e351b3db.tar.gz |
compiler refactoring; use typesafe path handing; docgen: render symbols between modules
Diffstat (limited to 'compiler/syntaxes.nim')
-rw-r--r-- | compiler/syntaxes.nim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/syntaxes.nim b/compiler/syntaxes.nim index 069f65eee..b5fcee7b1 100644 --- a/compiler/syntaxes.nim +++ b/compiler/syntaxes.nim @@ -11,7 +11,7 @@ import strutils, llstream, ast, astalgo, idents, lexer, options, msgs, parser, - filters, filter_tmpl, renderer, lineinfos + filters, filter_tmpl, renderer, lineinfos, pathutils type TFilterKind* = enum @@ -58,7 +58,7 @@ proc containsShebang(s: string, i: int): bool = while j < s.len and s[j] in Whitespace: inc(j) result = s[j] == '/' -proc parsePipe(filename: string, inputStream: PLLStream; cache: IdentCache; +proc parsePipe(filename: AbsoluteFile, inputStream: PLLStream; cache: IdentCache; config: ConfigRef): PNode = result = newNode(nkEmpty) var s = llStreamOpen(filename, fmRead) @@ -100,7 +100,7 @@ proc getCallee(conf: ConfigRef; n: PNode): PIdent = else: localError(conf, n.info, "invalid filter: " & renderTree(n)) -proc applyFilter(p: var TParsers, n: PNode, filename: string, +proc applyFilter(p: var TParsers, n: PNode, filename: AbsoluteFile, stdin: PLLStream): PLLStream = var ident = getCallee(p.config, n) var f = getFilter(ident) @@ -121,7 +121,7 @@ proc applyFilter(p: var TParsers, n: PNode, filename: string, msgWriteln(p.config, result.s) rawMessage(p.config, hintCodeEnd, []) -proc evalPipe(p: var TParsers, n: PNode, filename: string, +proc evalPipe(p: var TParsers, n: PNode, filename: AbsoluteFile, start: PLLStream): PLLStream = assert p.config != nil result = start @@ -161,8 +161,8 @@ proc parseFile*(fileIdx: FileIndex; cache: IdentCache; config: ConfigRef): PNode p: TParsers f: File let filename = toFullPathConsiderDirty(config, fileIdx) - if not open(f, filename): - rawMessage(config, errGenerated, "cannot open file: " & filename) + if not open(f, filename.string): + rawMessage(config, errGenerated, "cannot open file: " & filename.string) return openParsers(p, fileIdx, llStreamOpen(f), cache, config) result = parseAll(p) |