Implemented clear screen.
h3rald h3rald@h3rald.com
Thu, 01 Sep 2016 21:15:16 +0200
3 files changed,
9 insertions(+),
27 deletions(-)
M
lib/min_lang.nim
→
lib/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.nim
→
lib/min_str.nim
@@ -6,8 +6,6 @@ ../core/interpreter,
../core/utils, ../core/regex - - proc str_module*(i: In) = i.define("str")
M
vendor/linenoise.nim
→
vendor/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*()