all repos — min @ d9bcad939ed29aea8a521e3115c47374de7d83c5

A small but practical concatenative programming language.

Fixes
h3rald h3rald@h3rald.com
Fri, 25 Dec 2020 12:43:17 +0100
commit

d9bcad939ed29aea8a521e3115c47374de7d83c5

parent

8c28c71690c0bf6842022b1b9977051bb542db9d

2 files changed, 16 insertions(+), 14 deletions(-)

jump to
M core/interpreter.nimcore/interpreter.nim

@@ -2,6 +2,7 @@ import

streams, strutils, sequtils, + os, critbits, algorithm when defined(mini):

@@ -9,7 +10,6 @@ import

minilogger else: import - os, base64, logging import

@@ -343,20 +343,22 @@

proc initCompiledFile*(i: In, files: seq[string]): seq[string] {.discardable, extern:"min_exported_symbol_$1".} = result = newSeq[string](0) result.add "import min" - if files.len > 0 or ASSETPATH != "": + if files.len > 0 or (ASSETPATH != "" and not defined(mini)): result.add "import critbits" - if ASSETPATH != "": - result.add "import base64" + when not defined(mini): + if ASSETPATH != "": + result.add "import base64" result.add "MINCOMPILED = true" result.add "var i = newMinInterpreter(\"$#\")" % i.filename result.add "i.stdLib()" - if ASSETPATH != "": - for f in walkDirRec(ASSETPATH): - var file = f.replace("\\", "/") - logging.notice("- Including: $#" % file) - let ef = file.readFile.encode - let asset = "COMPILEDASSETS[\"$#\"] = \"$#\".decode" % [file, ef] - result.add asset + when not defined(mini): + if ASSETPATH != "": + for f in walkDirRec(ASSETPATH): + var file = f.replace("\\", "/") + logging.notice("- Including: $#" % file) + let ef = file.readFile.encode + let asset = "COMPILEDASSETS[\"$#\"] = \"$#\".decode" % [file, ef] + result.add asset proc eval*(i: In, s: string, name="<eval>", parseOnly=false): MinValue {.discardable, extern:"min_exported_symbol_$1".}= var i2 = i.copy(name)
M min.vimmin.vim

@@ -1,8 +1,8 @@

" Vim syntax file " Language: min " Maintainer: Fabio Cevasco -" Last Change: 19 Dec 2020 -" Version: 0.25.0 +" Last Change: 25 Dec 2020 +" Version: 0.26.0 if exists("b:current_syntax") finish

@@ -11,7 +11,7 @@

setl iskeyword=@,36-39,+,-,*,.,/,:,~,!,48-57,60-65,94-95,192-255 setl iskeyword+=^ -syntax keyword minDefaultSymbol ! !! != # $ % & ' * + - -> -inf . .. / : < <= = =% == => =~ > >< >= >> @ ROOT ^ accept acos aes all? and any? append apply apply-interpolate args asin ask atan atime bind bool boolean? call capitalize case cd ceil chmod choose chr clear clear-stack cleave close column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug decode define define-sigil defined-sigil? defined? delete delete-sigil dequote dequote-and dequote-or dget dhas? dict dictionary? dip dir? dirname div dkeys download dpairs dpick drop dset dtype dup dvalues e encode env? error escape eval even? exists? exit expect fappend fatal file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-yaml fs fsize fstats ftype fwrite get get-content get-env get-stack getchr gets hardlink harvest hidden? http id if import in? indent indexof inf infix-dequote info insert int integer? interpolate io join keep last length linrec listen lite? ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match math md4 md5 mini? mkdir mod module mtime mv nan net newline nip not notice now num number? odd? opts or ord os over parse partition password pi pick pop pow pred prefix prefix-dequote prepend print print! prompt publish put-env putchr puts puts! quit quotation? quote quote-bind quote-define quote-map r2g raise random randomize raw-args read recv recv-line reduce regex reject remove remove-symbol repeat replace request rest reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal seal-sigil search semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack set-type sha1 sha224 sha256 sha384 sha512 shorten sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server stop-server str string string? strip substr succ suffix sum swap swons symbols symlink symlink? sys system system! take tan tanh tap tap! tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-yaml trunc try type type? unless unmapkey unseal unseal-sigil unzip uppercase version warn when which while with xor zip +syntax keyword minDefaultSymbol ! !! != # $ % & ' * + - -> -inf . .. / : < <= = =% == => =~ > >< >= >> @ ROOT ^ accept acos all? and any? append apply apply-interpolate args asin ask atan atime bind bool boolean? call capitalize case cd ceil chmod choose chr clear clear-stack cleave close column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug decode decode-url define define-sigil defined-sigil? defined? delete delete-sigil dequote dequote-and dequote-or dget dhas? dict dictionary? dip dir? dirname div dkeys download dpairs dpick drop dsdelete dset dsget dshas? dsinit dspost dsput dsquery dsread dstore dswrite dtype dup dvalues e encode encode-url env? error escape eval even? exists? exit expect fappend fatal file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-yaml fs fsize fstats ftype fwrite get get-content get-env get-stack getchr gets hardlink harvest hidden? http id if import in? indent indexof inf infix-dequote info insert int integer? interpolate invoke io join keep last length linrec listen lite? ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match math mini? mkdir mod module mtime mv nan net newline nip not notice now num number? odd? opts or ord os over parse parse-url partition password pi pick pop pow pred prefix prefix-dequote prepend print print! prompt publish put-env putchr puts puts! quit quotation? quote quote-bind quote-define quote-map r2g raise random randomize raw-args read recv recv-line reduce regex reject remove remove-symbol repeat replace request require rest reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal seal-sigil search semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack set-type shorten sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server stop-server str string string? strip substr succ suffix sum swap swons symbols symlink symlink? sys system system! take tan tanh tap tap! tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-yaml trunc try type type? unless unmapkey unseal unseal-sigil unzip uppercase version warn when which while with xor zip syntax match minDefaultSigil ;\<[/:@'~!?$%&=<>#^*#+]; contained syntax match minQuote ;\<['];