all repos — min @ 397de952a827327fc6fa21bde8dbc78ee6d5a502

A small but practical concatenative programming language.

Fixed executing programs from stdin.
h3rald h3rald@h3rald.com
Fri, 18 Dec 2020 20:32:38 +0100
commit

397de952a827327fc6fa21bde8dbc78ee6d5a502

parent

e935a28de37d136b6a44ee1841a09e606096ea85

3 files changed, 5 insertions(+), 13 deletions(-)

jump to
M min.nimmin.nim

@@ -300,16 +300,6 @@ else:

contents = fileLines.join("\n") minStream(newStringStream(contents), fn, op, main) -proc minFile*(file: File, filename="stdin", op = "interpret") = - var stream = newFileStream(filename) - if stream == nil: - when defined(mini): - minilogger.fatal("Cannot read from file: " & filename) - else: - logging.fatal("Cannot read from file: " & filename) - quit(3) - minStream(stream, filename, op) - when isMainModule: import

@@ -541,4 +531,4 @@ elif SIMPLEREPL:

minSimpleRepl() quit(0) else: - minFile stdin, "stdin", op + minStream newFileStream(stdin), "stdin", op
M next-release.mdnext-release.md

@@ -7,3 +7,4 @@ * Added **md4** symbol.

* Re-added the possibility to exclude OpenSSL by not defining the **ssl** flag. * Added **clear** symbol to clear the screen. * Added the **mapkey** and the **unmapkey** symbols to configure key mappings. +* Fixed execution of scripts from stdin (when running min with no parameters).
M site/contents/reference-io.mdsite/contents/reference-io.md

@@ -53,9 +53,10 @@ {#op||mapkey||{{q}} {{sl}}||{{null}}||

> Maps the named key/key combination {{sl}} to the quotation {{q}}, so that {{q}} is executed when key {{sl}} is pressed. > > > %note% -> > Note +> > Notes > > -> > At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported. +> > * At present, only the key names and sequences defined in the [nimline](https://h3rald.com/nimline/nimline.html) library are supported. +> > * The quotation will be executed by a copy of the min interpreter created when the mapping was defined. In other words, quotations executed by key bindings will not affect the current stack. > > > %sidebar% > > Example