summary refs log tree commit diff stats
path: root/compiler/syntaxes.nim
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2018-09-14 18:34:56 -0500
committerGanesh Viswanathan <dev@genotrance.com>2018-09-14 18:34:56 -0500
commit80520eef3cce0b3145dedc71a6652429adb9cc9e (patch)
treed64725d2749cb82bfef997bbbdb443cc4827de6d /compiler/syntaxes.nim
parente07a256f74b9e89e49287c8a21c1334af43e27c2 (diff)
parentb9dc486db15bb1b4b6f3cef7626733b904d377f7 (diff)
downloadNim-80520eef3cce0b3145dedc71a6652429adb9cc9e.tar.gz
Merge remote-tracking branch 'upstream/devel' into test-6483
Diffstat (limited to 'compiler/syntaxes.nim')
-rw-r--r--compiler/syntaxes.nim12
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)