Clean up stdin file reading of compiler.
Uses "stdinfile" as the module identifier now, which prevents problems with - colliding with the minus operator. This fixes #2422 and #2702.
This commit is contained in:
parent
1c0bbcff5a
commit
def61c9fcd
4 changed files with 23 additions and 22 deletions
|
|
@ -170,11 +170,7 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) =
|
|||
openPasses(a, module)
|
||||
if stream == nil:
|
||||
let filename = fileIdx.toFullPathConsiderDirty
|
||||
if module.name.s == "-":
|
||||
module.name.s = "stdinfile"
|
||||
s = llStreamOpen(stdin)
|
||||
else:
|
||||
s = llStreamOpen(filename, fmRead)
|
||||
s = llStreamOpen(filename, fmRead)
|
||||
if s == nil:
|
||||
rawMessage(errCannotOpenFile, filename)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue