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
|
|
@ -38,7 +38,11 @@ proc handleCmdLine() =
|
|||
else:
|
||||
# Process command line arguments:
|
||||
processCmdLine(passCmd1, "")
|
||||
if gProjectName != "":
|
||||
if gProjectName == "-":
|
||||
gProjectName = "stdinfile"
|
||||
gProjectFull = "stdinfile"
|
||||
gProjectPath = getCurrentDir()
|
||||
elif gProjectName != "":
|
||||
try:
|
||||
gProjectFull = canonicalizePath(gProjectName)
|
||||
except OSError:
|
||||
|
|
@ -61,8 +65,6 @@ proc handleCmdLine() =
|
|||
if gCmd == cmdRun:
|
||||
tccgen.run(commands.arguments)
|
||||
if optRun in gGlobalOptions:
|
||||
if gProjectName == "-":
|
||||
gProjectFull = "stdinfile"
|
||||
if gCmd == cmdCompileToJS:
|
||||
var ex: string
|
||||
if options.outFile.len > 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue