diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-24 17:36:45 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-24 17:36:50 -0700 |
| commit | d7e297844c88022cf10ebeb14759a8df7dd539c4 (patch) | |
| tree | f6ff3310c6708ef351cea0efcd1791a2eb41a502 /nomsu.moon | |
| parent | f7a9d1fc6b2ccd95f2f8df49f99073a6d2be9bb8 (diff) | |
Fixed stdin handling.
Diffstat (limited to 'nomsu.moon')
| -rwxr-xr-x | nomsu.moon | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -110,6 +110,9 @@ FILE_CACHE = setmetatable {}, { run = -> input_files = {} for f in *file_queue + if f == 'stdin' + input_files[f] = true + continue unless Files.exists(f) error("Could not find: '#{f}'") for _,filename in Files.walk(f) @@ -127,11 +130,7 @@ run = -> get_file_and_source = (filename)-> local file, source - if filename == 'stdin' - file = io.read("*a") - Files.spoof('stdin', file) - source = Source('stdin', 1, #file) - elseif filename\match("%.nom$") + if filename == 'stdin' or filename\match("%.nom$") file = Files.read(filename) if not file error("File does not exist: #{filename}", 0) |
