Use gProjectIsStdin instead
This commit is contained in:
parent
def61c9fcd
commit
2613110015
3 changed files with 3 additions and 1 deletions
|
|
@ -148,7 +148,7 @@ proc compileModule*(fileIdx: int32, flags: TSymFlags): PSym =
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
result.id = getID()
|
result.id = getID()
|
||||||
if sfMainModule in flags and gProjectName == "-":
|
if sfMainModule in flags and gProjectIsStdin:
|
||||||
processModule(result, llStreamOpen(stdin), rd)
|
processModule(result, llStreamOpen(stdin), rd)
|
||||||
else:
|
else:
|
||||||
processModule(result, nil, rd)
|
processModule(result, nil, rd)
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ proc handleCmdLine() =
|
||||||
gProjectName = "stdinfile"
|
gProjectName = "stdinfile"
|
||||||
gProjectFull = "stdinfile"
|
gProjectFull = "stdinfile"
|
||||||
gProjectPath = getCurrentDir()
|
gProjectPath = getCurrentDir()
|
||||||
|
gProjectIsStdin = true
|
||||||
elif gProjectName != "":
|
elif gProjectName != "":
|
||||||
try:
|
try:
|
||||||
gProjectFull = canonicalizePath(gProjectName)
|
gProjectFull = canonicalizePath(gProjectName)
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,7 @@ var
|
||||||
gProjectName* = "" # holds a name like 'nimrod'
|
gProjectName* = "" # holds a name like 'nimrod'
|
||||||
gProjectPath* = "" # holds a path like /home/alice/projects/nimrod/compiler/
|
gProjectPath* = "" # holds a path like /home/alice/projects/nimrod/compiler/
|
||||||
gProjectFull* = "" # projectPath/projectName
|
gProjectFull* = "" # projectPath/projectName
|
||||||
|
gProjectIsStdin* = false # whether we're compiling from stdin
|
||||||
gProjectMainIdx*: int32 # the canonical path id of the main module
|
gProjectMainIdx*: int32 # the canonical path id of the main module
|
||||||
nimcacheDir* = ""
|
nimcacheDir* = ""
|
||||||
command* = "" # the main command (e.g. cc, check, scan, etc)
|
command* = "" # the main command (e.g. cc, check, scan, etc)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue