aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-06-05 16:44:36 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-06-05 16:44:43 -0700
commit2d88c68d712cb90f7e122465381899cd9f578e47 (patch)
tree19ed5297ee75226447cb28d875128231f9db75b2
parent42632e01b2a60a62ace78b1f0cd0a687534be70a (diff)
Fixed piping in file.
-rw-r--r--nomsu.lua4
-rwxr-xr-xnomsu.moon4
2 files changed, 6 insertions, 2 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 15484d4..bf644c4 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -1707,7 +1707,9 @@ OPTIONS
end
end
elseif input == STDIN then
- nomsu:run(io.input():read("*a"), compile_fn)
+ local file = io.input():read("*a")
+ FILE_CACHE.stdin = file
+ nomsu:run(Nomsu(Source('stdin', 1, #file), file), compile_fn)
else
nomsu:run_file(input, compile_fn)
end
diff --git a/nomsu.moon b/nomsu.moon
index edf0c47..b9ff559 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -1185,7 +1185,9 @@ OPTIONS
print_file\write(formatted, "\n")
print_file\flush!
elseif input == STDIN
- nomsu\run(io.input!\read("*a"), compile_fn)
+ file = io.input!\read("*a")
+ FILE_CACHE.stdin = file
+ nomsu\run(Nomsu(Source('stdin',1,#file), file), compile_fn)
else
nomsu\run_file(input, compile_fn)