summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authordef <dennis@felsin9.de>2015-02-28 23:35:35 +0100
committerdef <dennis@felsin9.de>2015-02-28 23:35:35 +0100
commitc37e8035ea7915c1ebe6ba8d5872673dff27ab2c (patch)
tree2ef348681befd917987c42fa836f82f48e50d5b5 /compiler
parent6894ac7c0a91c56b41d2eee57551a697c48a1d63 (diff)
downloadNim-c37e8035ea7915c1ebe6ba8d5872673dff27ab2c.tar.gz
When compiling from stdin write binary to stdinfile
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main.nim2
-rw-r--r--compiler/nim.nim2
-rw-r--r--compiler/passes.nim2
3 files changed, 4 insertions, 2 deletions
diff --git a/compiler/main.nim b/compiler/main.nim
index 42a782c02..f7592a891 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -62,7 +62,7 @@ proc commandCompileToC =
   compileProject()
   cgenWriteModules()
   if gCmd != cmdRun:
-    extccomp.callCCompiler(changeFileExt(gProjectFull, ""))
+    extccomp.callCCompiler(if gProjectName == "-": "stdinfile" else: changeFileExt(gProjectFull, ""))
 
   if isServing:
     # caas will keep track only of the compilation commands
diff --git a/compiler/nim.nim b/compiler/nim.nim
index 215f1986e..b8ba2c6da 100644
--- a/compiler/nim.nim
+++ b/compiler/nim.nim
@@ -61,6 +61,8 @@ 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:
diff --git a/compiler/passes.nim b/compiler/passes.nim
index f8cbceca5..96088bd88 100644
--- a/compiler/passes.nim
+++ b/compiler/passes.nim
@@ -171,7 +171,7 @@ proc processModule(module: PSym, stream: PLLStream, rd: PRodReader) =
     if stream == nil: 
       let filename = fileIdx.toFullPathConsiderDirty
       if module.name.s == "-":
-        module.name.s = "stdinFile"
+        module.name.s = "stdinfile"
         s = llStreamOpen(stdin)
       else:
         s = llStreamOpen(filename, fmRead)