all repos — min @ 45c671a3c03219949c48701cbadae38f75da1e0d

A small but practical concatenative programming language.

Implemented clear screen.
h3rald h3rald@h3rald.com
Thu, 01 Sep 2016 21:15:16 +0200
commit

45c671a3c03219949c48701cbadae38f75da1e0d

parent

254a83cfaa4af6f704dee4db7d74ed1b3dff7088

3 files changed, 9 insertions(+), 27 deletions(-)

jump to
M lib/min_lang.nimlib/min_lang.nim

@@ -8,8 +8,8 @@ ../core/types,

../core/parser, ../core/interpreter, ../core/utils, - ../core/regex - + ../core/regex, + ../vendor/linenoise proc lang_module*(i: In) = i.scope

@@ -228,11 +228,11 @@ i.unquote("<try-finally>", final)

# Operations on the whole stack - .symbol("clear") do (i: In): + .symbol("clear-stack") do (i: In): while i.stack.len > 0: discard i.pop - .symbol("dump") do (i: In): + .symbol("dump-stack") do (i: In): echo i.dump .symbol("get-stack") do (i: In):

@@ -428,5 +428,8 @@ var d: MinValue

i.reqDictionary d i.push d i.push d.values + + .symbol("clear") do (i: In): + linenoiseClearScreen() .finalize()
M lib/min_str.nimlib/min_str.nim

@@ -6,8 +6,6 @@ ../core/interpreter,

../core/utils, ../core/regex - - proc str_module*(i: In) = i.define("str")
M vendor/linenoise.nimvendor/linenoise.nim

@@ -38,11 +38,6 @@ # caller owns the returned string and must eventually free() it.

# proc linenoise*(prompt: cstring): cstring # -# Activates password entry in future calls of linenoise(), i.e. user -# input will not be echoed back to the terminal during entry. -# -proc linenoiseSetHidden*(enable: cint) -# # Activates normal entry in future calls of linenoise(), i.e. user # input will again be echoed back to the terminal during entry. #

@@ -73,20 +68,6 @@ # of the given file. Returns 0 on success.

# proc linenoiseHistoryLoad*(filename: cstring): cint # -# Frees all history entries, clearing the history. -# -proc linenoiseHistoryFree*() -# -# Returns a pointer to the list of history entries, writing its -# length to *len if len is not NULL. The memory is owned by linenoise -# and must not be freed. -# -proc linenoiseHistory*(len: ptr cint): cstringArray +# Clears the screen. # -# Returns the number of display columns in the current terminal. -# -proc linenoiseColumns*(): cint -# -# Returns the number of display rows|lines in the current terminal. -# -proc linenoiseLines*(): cint +proc linenoiseClearScreen*()