all repos — min @ ad8ec5bbf998336ef72c61980511a856aa9e7865

A small but practical concatenative programming language.

Removed ! and & symbols and !, &, %, / sigils.
h3rald h3rald@h3rald.com
Mon, 10 Jun 2024 17:30:04 +0200
commit

ad8ec5bbf998336ef72c61980511a856aa9e7865

parent

e9300d1f4174cd97a4cf6505897870c1f3f82441

M minpkg/core/interpreter.nimminpkg/core/interpreter.nim

@@ -271,7 +271,7 @@ i.trace.add val

let symbol = val.symVal if symbol == "return": raise MinReturnException(msg: "return symbol found") - if not symbol.contains('.') and i.scope.hasSymbol(symbol): + if i.scope.hasSymbol(symbol): i.apply i.scope.getSymbol(symbol), symbol else: # Check if symbol ends with ! (auto-popping)
M minpkg/lib/min_dict.nimminpkg/lib/min_dict.nim

@@ -91,10 +91,4 @@ def.symbol("dtype") do (i: In):

let vals = i.expect("dict") i.push vals[0].objType.newVal - def.sigil("/") do (i: In): - i.pushSym("dget") - - def.sigil("%") do (i: In): - i.pushSym("dset") - def.finalize("dict")
M minpkg/lib/min_str.nimminpkg/lib/min_str.nim

@@ -330,7 +330,7 @@ def.symbol("from-dec") do (i: In):

let vals = i.expect("'sym") i.push parseInt(vals[0].getString).newVal - def.symbol("%%") do (i: In): + def.symbol("%") do (i: In): i.pushSym("interpolate") def.symbol("=%") do (i: In):
M minpkg/lib/min_sys.nimminpkg/lib/min_sys.nim

@@ -158,20 +158,8 @@

def.symbol("$") do (i: In): i.pushSym("get-env") - def.symbol("!") do (i: In): - i.pushSym("system") - - def.symbol("&") do (i: In): - i.pushSym("run") - def.sigil("$") do (i: In): i.pushSym("get-env") - - def.sigil("!") do (i: In): - i.pushSym("system") - - def.sigil("&") do (i: In): - i.pushSym("run") def.symbol("unzip") do (i: In): let vals = i.expect("'sym", "'sym")
M next-release.mdnext-release.md

@@ -3,6 +3,12 @@

- User-defined symbols can no longer contain dots (`.`). - The symbol `invoke` and the `*` sigil have been removed in favor of symbol dot notation. - The `.` and `..` symbols have been renamed to `pwd` and `parent-dir` respectively. +- The `!` symbol has been removed. Use `system` instead. +- The `!` sigil has been removed. Use `system` instead. +- The `&` symbol has been removed. Use `run` instead. +- The `&` sigil has been removed. Use `run` instead. +- The `/` sigil has been removed. Use `dget` or symbol dot notation instead. +- The `%` sigil has been removed. Use `dset` or symbol dot notation instead. ### New Features
M site/contents/reference-dict.mdsite/contents/reference-dict.md

@@ -4,10 +4,6 @@ title: "dict Module"

----- {@ _defs_.md || 0 @} -{#sig||/||dget#} - -{#sig||%||dset#} - {#op||ddup||{{d1}}||{{d2}}|| Returns a copy of {{d1}}. #}
M site/contents/reference-sys.mdsite/contents/reference-sys.md

@@ -8,14 +8,6 @@ {#sig||$||get-env#}

{#alias||$||get-env#} -{#sig||!||system#} - -{#alias||!||system#} - -{#sig||&||run#} - -{#alias||&||run#} - {#op||admin?||{{none}}||{{b}}|| Returns {{t}} if the program is being run with administrative privileges. #}
M tasks/build.mintasks/build.min

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

-#!/usr/bin/env min "_helpers" require :helpers 'helpers import ( symbol cz ('sym :stage 'sym :variant 'sym :target-os ==>) ( true :pack-result (stage "^(release-nopack|dev)$" match?) (false @pack-result) when "-d:release" :d-stage (stage "dev" ==) ("-d:dev" @d-stage) when " " :d-variant "min" :o-variant (variant length 0 >) ( "-d:$# " (variant) =% @d-variant "$#min" (variant) =% @o-variant ) when "nim" required "Building $# - $# (x64)" (o-variant target-os) =% notice! "" :musl "musl-gcc" which :musl-gcc (musl-gcc length 0 >) ("--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc" @musl) when "nim c $# -d:ssl -d:useOpenSsl3 $# --opt:size --cpu:amd64 --os:$# $#-o:$# min" (d-stage musl target-os d-variant o-variant) =% puts ! pop (pack-result) ( {} target-os %os config /version %version o-variant %exe pack ) when ) ) :: ;; Builds and packs a min executable. #| Tasks |# ( symbol guide (==>) ( "hastyscribe" required "Building - guide" notice! "hastyscribe Min_DeveloperGuide.md --field/version=$#" (version) =% !! "cp Min_DeveloperGuide.htm site/output/guide.dev.html" !! ) ) :: ;; Builds the developer guide. ( symbol site (==>) ( "hastysite" required "Building - site" notice! "cd site && hastysite build && cd .." !! ) ) :: ;; Builds the min site. ( symbol pack (dict :vdata ==>) ( vdata /exe :exe (vdata /os "windows" ==) ("$#.exe" (exe) =% @exe) when "$exe:_v$version:_$os:_x64.zip" :fn fn vdata dpairs % ":" "" replace @fn "Compressing: $#" (fn) =% notice! (exe) => fn zip ) ) :: ;; Compresses a min executable. ( symbol vim (==>) ( config /version :min-version "tasks/data/min.vim" fread :template timestamp "dd MMM YYYY" tformat :date min-symbols ("||" !=) filter " " join :symbols "min.vim" :out-file "Building - min.vim" notice! template ("date" date "version" min-version "symbols" symbols) =% out-file fwrite ) ) :: ;; Generates the min.vim file. ( symbol docs (==>) ( guide site ) ) :: ;; Generate the min development guide and site. ( symbol dev (==>) ("dev" "" os cz) ) :: ;; Builds min (dev version) on the current OS. ( symbol default (==>) ("release-nopack" "" os cz) ) :: ;; Builds min on the current OS. ( symbol linux (==>) ("" "" "linux" cz) ) :: ;; Builds min for Linux. ( symbol macosx (==>) ("" "" "macosx" cz) ) :: ;; Builds min for macOS. ( symbol windows (==>) ("" "" "windows" cz) ) :: ;; Builds min for Windows. +#!/usr/bin/env min "_helpers" require :helpers 'helpers import ( symbol cz ('sym :stage 'sym :variant 'sym :target-os ==>) ( true :pack-result (stage "^(release-nopack|dev)$" match?) (false @pack-result) when "-d:release" :d-stage (stage "dev" ==) ("-d:dev" @d-stage) when " " :d-variant "min" :o-variant (variant length 0 >) ( "-d:$# " (variant) =% @d-variant "$#min" (variant) =% @o-variant ) when "nim" required "Building $# - $# (x64)" (o-variant target-os) =% notice! "" :musl "musl-gcc" which :musl-gcc (musl-gcc length 0 >) ("--gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc" @musl) when "nim c $# -d:ssl -d:useOpenSsl3 $# --opt:size --cpu:amd64 --os:$# $#-o:$# min" (d-stage musl target-os d-variant o-variant) =% puts system pop (pack-result) ( {} target-os "os" dset config "version" dget "version" dset o-variant "exe" dset pack ) when ) ) :: ;; Builds and packs a min executable. #|| Tasks ||# ( symbol guide (==>) ( "hastyscribe" required "Building - guide" notice! "hastyscribe Min_DeveloperGuide.md --field/version=$#" (version) =% !! "cp Min_DeveloperGuide.htm site/output/guide.dev.html" !! ) ) :: ;; Builds the developer guide. ( symbol site (==>) ( "hastysite" required "Building - site" notice! "cd site && hastysite build && cd .." !! ) ) :: ;; Builds the min site. ( symbol pack (dict :vdata ==>) ( vdata "exe" dget :exe (vdata "os" dget "windows" ==) ("$#.exe" (exe) =% @exe) when "$exe:_v$version:_$os:_x64.zip" :fn fn vdata dpairs % ":" "" replace @fn "Compressing: $#" (fn) =% notice! (exe) => fn zip ) ) :: ;; Compresses a min executable. ( symbol vim (==>) ( config "version" dget :min-version "tasks/data/min.vim" fread :template timestamp "dd MMM YYYY" tformat :date min-symbols ("||" !=) filter " " join :symbols "min.vim" :out-file "Building - min.vim" notice! template ("date" date "version" min-version "symbols" symbols) =% out-file fwrite ) ) :: ;; Generates the min.vim file. ( symbol docs (==>) ( guide site ) ) :: ;; Generate the min development guide and site. ( symbol dev (==>) ("dev" "" os cz) ) :: ;; Builds min (dev version) on the current OS. ( symbol default (==>) ("release-nopack" "" os cz) ) :: ;; Builds min on the current OS. ( symbol linux (==>) ("" "" "linux" cz) ) :: ;; Builds min for Linux. ( symbol macosx (==>) ("" "" "macosx" cz) ) :: ;; Builds min for macOS. ( symbol windows (==>) ("" "" "windows" cz) ) :: ;; Builds min for Windows.
M tasks/clean.mintasks/clean.min

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

-#!/usr/bin/env min #| Tasks |# ( symbol default (==>) ( "Cleaning up build files" notice! . ls ("(/(mini|lite)?min|\.(htm|zip|exe))$" match?) filter :files files 'rm foreach "Done." notice! ) ) :: ;; Deletes min build files +#!/usr/bin/env min #| Tasks |# ( symbol default (==>) ( "Cleaning up build files" notice! pwd ls ("(/(mini|lite)?min|\\.(htm|zip|exe))$" match?) filter :files files 'rm foreach "Done." notice! ) ) :: ;; Deletes min build files
M tasks/github.mintasks/github.min

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

-#!/usr/bin/env min "_helpers" require :helpers 'helpers import "next-release.md" fread escape :release-body "tasks/data/draft-release.json" fread :draft-release-template config /version :min-version env /github-token :token draft-release-template ("version" min-version "body" release-body) =% :draft-release-body {} "application/vnd.github.v3+json" %Accept "token $#" (token) =% %Authorization :headers ( symbol handle-errors (dict :response ==>) ( response to-json "response.json" fwrite response /status :status (status 300 >) ( response /body from-json :body body /message :message status string @status "Error $#: $#" (status message) =% error status int exit ) when ) ) :: ;; Handles HTTP errors. ( symbol gh-req (dict :data ==> dict|quot :result) ( data /endpoint :endpoint "api" :subdomain (data 'subdomain dhas?) (data /subdomain @subdomain) when "https://$#.github.com/repos/h3rald/min$#" (subdomain endpoint) =% :url {} url %url data /method %method (data 'headers dhas?) (data /headers %headers) (headers %headers) if (data 'body dhas?) (data /body %body) when request :response response /status :status response /body :body response handle-errors (body length 0 >) (body from-json) ({}) if @result ) ) :: ;; Execute a request using the Github API. ( symbol get-assets (dict :data ==> quot :result) ( data /id :id {} "/releases/$#/assets" (id) =% %endpoint "GET" %method gh-req @result ) ) :: ;; Retrieve the assets from an existing Github release. ( symbol delete-assets (dict :config ==>) ( config get-assets :assets config /id :id assets (/id) map :assets-ids assets-ids ( :asset {} "/releases/assets/$#" (asset) =% %endpoint "DELETE" %method gh-req pop ) foreach ) ) :: ;; Delete all assets from an existing Github release. #| Tasks |# ( symbol draft (==>) ( {} "/releases" %endpoint "POST" %method draft-release-body %body gh-req /id string :id ; Save Release ID to min.yml config id %id to-yaml "min.yml" fwrite "Draft release v$# ($#) created successfully" (min-version id) =% notice! ) ) :: ;; Creates a new draft release on Github. ( symbol update (==>) ( config /id :id {} "/releases/$#" (id) =% %endpoint "PATCH" %method draft-release-body %body gh-req /id string :id "Draft release v$# ($#) updated successfully" (min-version id) =% notice! ) ) :: ;; Updates the text of the current draft Github release. ( symbol assets (==>) ( config get-assets =assets assets size :total "are" :verb (total 1 ==) ("is" @verb) when "There $# $# assets in release v$#" (verb total min-version) =% notice! assets (/name () cons "- $#" swap % notice!) foreach ) ) :: ;; Retrieve a list of all the assets of the current draft Github release. ( symbol upload (==>) ( config /id :id config delete-assets . ls ("\.zip$" match?) filter ( filename :file "Uploading: $#" (file) =% notice! file fread :body headers "application/zip" %Content-Type :asset-headers {} "/releases/$#/assets?name=$#" (id file) =% %endpoint asset-headers %headers "uploads" %subdomain "POST" %method body %body gh-req pop ) foreach ) ) :: ;; Uploads all assets to the current draft Github release, deleting any existing asset. +#!/usr/bin/env min "_helpers" require :helpers 'helpers import "next-release.md" fread escape :release-body "tasks/data/draft-release.json" fread :draft-release-template config "version" dget :min-version env "github-token" dget :token draft-release-template ("version" min-version "body" release-body) =% :draft-release-body {} "application/vnd.github.v3+json" "Accept" dset "token $#" (token) =% "Authorization" dset :headers ( symbol handle-errors (dict :response ==>) ( response to-json "response.json" fwrite response "status" dget :status (status 300 >) ( response "body" dget from-json :body body "message" dget :message status string @status "Error $#: $#" (status message) =% error status int exit ) when ) ) :: ;; Handles HTTP errors. ( symbol gh-req (dict :data ==> dict|quot :result) ( data "endpoint" dget :endpoint "api" :subdomain (data 'subdomain dhas?) (data "subdomain" dget @subdomain) when "https://$#.github.com/repos/h3rald/min$#" (subdomain endpoint) =% :url {} url "url" dset data "method" dget "method" dset (data 'headers dhas?) (data "headers" dget "headers" dset) (headers "headers" dset) if (data 'body dhas?) (data "body" dget "body" dset) when request :response response "status" dget :status response "body" dget :body response handle-errors (body length 0 >) (body from-json) ({}) if @result ) ) :: ;; Execute a request using the Github API. ( symbol get-assets (dict :data ==> quot :result) ( data "id" dget :id {} "/releases/$#/assets" (id) =% "endpoint" dset "GET" "method" dset gh-req @result ) ) :: ;; Retrieve the assets from an existing Github release. ( symbol delete-assets (dict :config ==>) ( config get-assets :assets config "id" dget :id assets ("id" dget) map :assets-ids assets-ids ( :asset {} "/releases/assets/$#" (asset) =% "endpoint" dset "DELETE" "method" dset gh-req pop ) foreach ) ) :: ;; Delete all assets from an existing Github release. #|| Tasks ||# ( symbol draft (==>) ( {} "/releases" "endpoint" dset "POST" "method" dset draft-release-body "body" dset gh-req "id" dget string :id ;; Save Release ID to min.yml config id "id" dset to-yaml "min.yml" fwrite "Draft release v$# ($#) created successfully" (min-version id) =% notice! ) ) :: ;; Creates a new draft release on Github. ( symbol update (==>) ( config "id" dget :id {} "/releases/$#" (id) =% "endpoint" dset "PATCH" "method" dset draft-release-body "body" dset gh-req "id" dget string :id "Draft release v$# ($#) updated successfully" (min-version id) =% notice! ) ) :: ;; Updates the text of the current draft Github release. ( symbol assets (==>) ( config get-assets =assets assets size :total "are" :verb (total 1 ==) ("is" @verb) when "There $# $# assets in release v$#" (verb total min-version) =% notice! assets ("name" dget () cons "- $#" swap % notice!) foreach ) ) :: ;; Retrieve a list of all the assets of the current draft Github release. ( symbol upload (==>) ( config "id" dget :id config delete-assets pwd ls ("\\.zip$" match?) filter ( filename :file "Uploading: $#" (file) =% notice! file fread :body headers "application/zip" "Content-Type" dset :asset-headers {} "/releases/$#/assets?name=$#" (id file) =% "endpoint" dset asset-headers "headers" dset "uploads" "subdomain" dset "POST" "method" dset body "body" dset gh-req pop ) foreach ) ) :: ;; Uploads all assets to the current draft Github release, deleting any existing asset.
M tasks/h3rald.mintasks/h3rald.min

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

-#!/usr/bin/env min "_helpers" require :helpers 'helpers import config /version :min-version "Min_DeveloperGuide.htm" :guide-file "../h3rald/assets/min/" guide-file suffix :h3rald-guide "../h3rald/contents/min.md" :h3rald-min-md "version:\s+\d+\.\d+\.\d+" :min-v-reg "version: $#" (min-version) =% :min-v-rep ( symbol update (==>) ( "Updating min Developer Guide and project on H3RALD.com..." notice! guide-file h3rald-guide cp h3rald-min-md fread min-v-reg min-v-rep replace :updated-contents updated-contents h3rald-min-md fwrite "Done." notice! ) ) :: ;; Updates the min Developer Guide and project page on H3RALD.com ( symbol build (==>) ( "git" required "hastysite" required "Pulling content and rebuilding H3RALD.com web site..." notice! ; Assuming min and h3rald are siblings .. cd "h3rald" cd "git pull" !! "hastysite build" !! .. cd "min" cd ) ) :: ;; Builds H3RALD.com web site +#!/usr/bin/env min "_helpers" require :helpers 'helpers import config "version" dget :min-version "Min_DeveloperGuide.htm" :guide-file "../h3rald/assets/min/" guide-file suffix :h3rald-guide "../h3rald/contents/min.md" :h3rald-min-md "version:\\s+\\d+\\.\\d+\\.\\d+" :min-v-reg "version: $#" (min-version) =% :min-v-rep ( symbol update (==>) ( "Updating min Developer Guide and project on H3RALD.com..." notice! guide-file h3rald-guide cp h3rald-min-md fread min-v-reg min-v-rep replace :updated-contents updated-contents h3rald-min-md fwrite "Done." notice! ) ) :: ;; Updates the min Developer Guide and project page on H3RALD.com ( symbol build (==>) ( "git" required "hastysite" required "Pulling content and rebuilding H3RALD.com web site..." notice! ;; Assuming min and h3rald are siblings parent-dir cd "h3rald" cd "git pull" !! "hastysite build" !! parent-dir cd "min" cd ) ) :: ;; Builds H3RALD.com web site
M tasks/help.mintasks/help.min

@@ -1,155 +1,1 @@

-"tasks/data/doc-snippets.json" fread from-json :snippets -"site/contents" ls ("reference-" match?) filter :src-files -"(?sm)\{#op\|\|([^|]+)\|\|([^|]+)\|\|([^|]+)\|\|(.+?)#\}" :op-regex -"(?sm)\{#sig\|\|([^|]+)\|\|([^#]+)#\}" :sig-regex -"(?sm)\{#alias\|\|([^|]+)\|\|([^#]+)#\}" :alias-regex -"(?sm)\{\{([^}]+)\}\}" :snippet-regex -"(?sm)\>( \>)*" :block-regex -"(?sm)%([^%]+)%" :title-regex -"(?sm)\{@[^@]+@\}" :incl-regex -"(?sm)`([^`]+)`" :code-regex - -( - symbol fix-name - (str :s ==> str :result) - ( - s - "&excl;" (pop "!") replace-apply - "&quot;" (pop "\"") replace-apply - "&#124;" (pop "|") replace-apply - "\[" (pop "") replace-apply - "\]" (pop "") replace-apply - "\(class:kwd\)" (pop "") replace-apply - "&gt;" (pop ">") replace-apply - "&lt;" (pop "<") replace-apply - "&apos;" (pop "'") replace-apply - "&ast;" (pop "*") replace-apply - @result - ) -) :: -;; Fixes names with special characters -( - symbol process-block-markup - (str :s ==> str :result) - ( - s - block-regex (pop "") replace-apply - title-regex (pop "") replace-apply - incl-regex (pop "") replace-apply - code-regex (1 get) replace-apply - @result - ) -) :: -;; Simplify block-level markup - -( - symbol process-snippets - (str :s ==> str :result) - ( - s snippet-regex ( - 1 get :id - snippets id dget - ) replace-apply @result - ) -) :: -;; Resolves documentation snippets. - -( - symbol process - (str :s ==> str :result) - ( - s process-snippets process-block-markup strip @result - ) -) :: -;; Processes documentation snippets and markup. - -( - symbol process-op - (quot :matches ==> dict :data) - ( - {} - matches 1 get process fix-name %name - matches 2 get process fix-name :input - matches 3 get process fix-name :output - "$# ==> $#" (input output) =% %signature - matches 4 get process %description - "symbol" %kind - @data - ) -) :: -;; Processes operator reference documentation. - -( - symbol process-alias - (quot :matches ==> dict :data) - ( - {} - matches 1 get process fix-name %name - matches 2 get :ref - "See $#" (ref) =% %description - "symbol" %kind - @data - ) -) :: -;; Processes alias reference documentation. - -( - symbol process-sig - (quot :matches ==> dict :data) - ( - {} - matches 1 get process fix-name %name - matches 2 get :ref - "See $#" (ref) =% %description - "sigil" %kind - @data - ) -) :: -;; Processes sigil reference documentation. - -( - symbol default - (==>) - ( - {} :ref-dict - {} :op-dict - {} :sig-dict - src-files ( - :file - file "reference-([a-z]+)\.md" search 1 get :mod-id - "Processing: $#" (mod-id) =% notice! - file fread :contents - contents op-regex search-all ( - process-op :op - op /name :op-name - op mod-id 'module dset @op - op-dict - op op-name dset - @op-dict - ) foreach - contents alias-regex search-all ( - process-alias :alias - alias /name :alias-name - alias mod-id 'module dset @alias - op-dict - alias alias-name dset - @op-dict - ) foreach - contents sig-regex search-all ( - process-sig :sig - sig /name :sig-name - sig mod-id 'module dset @sig - sig-dict - sig sig-name dset - @sig-dict - ) foreach - ref-dict - op-dict %operators - sig-dict %sigils - @ref-dict - ) foreach - "Writing help.json" notice! - ref-dict to-json "help.json" fwrite - ) -) :: -;; Builds the reference help JSON sources. +"tasks/data/doc-snippets.json" fread from-json :snippets "site/contents" ls ("reference-" match?) filter :src-files "(?sm)\\{#op\\|\\|([^|]+)\\|\\|([^|]+)\\|\\|([^|]+)\\|\\|(.+?)#\\}" :op-regex "(?sm)\\{#sig\\|\\|([^|]+)\\|\\|([^#]+)#\\}" :sig-regex "(?sm)\\{#alias\\|\\|([^|]+)\\|\\|([^#]+)#\\}" :alias-regex "(?sm)\\{\\{([^}]+)\\}\\}" :snippet-regex "(?sm)\\>( \\>)*" :block-regex "(?sm)%([^%]+)%" :title-regex "(?sm)\\{@[^@]+@\\}" :incl-regex "(?sm)`([^`]+)`" :code-regex ( symbol fix-name (str :s ==> str :result) ( s "&excl;" (pop "!") replace-apply "&quot;" (pop "\"") replace-apply "&#124;" (pop "|") replace-apply "\\[" (pop "") replace-apply "\\]" (pop "") replace-apply "\\(class:kwd\\)" (pop "") replace-apply "&gt;" (pop ">") replace-apply "&lt;" (pop "<") replace-apply "&apos;" (pop "'") replace-apply "&ast;" (pop "*") replace-apply @result ) ) :: ;; Fixes names with special characters ( symbol process-block-markup (str :s ==> str :result) ( s block-regex (pop "") replace-apply title-regex (pop "") replace-apply incl-regex (pop "") replace-apply code-regex (1 get) replace-apply @result ) ) :: ;; Simplify block-level markup ( symbol process-snippets (str :s ==> str :result) ( s snippet-regex ( 1 get :id snippets id dget ) replace-apply @result ) ) :: ;; Resolves documentation snippets. ( symbol process (str :s ==> str :result) ( s process-snippets process-block-markup strip @result ) ) :: ;; Processes documentation snippets and markup. ( symbol process-op (quot :matches ==> dict :data) ( {} matches 1 get process fix-name "name" dset matches 2 get process fix-name :input matches 3 get process fix-name :output "$# ==> $#" (input output) =% "signature" dset matches 4 get process "description" dset "symbol" "kind" dset @data ) ) :: ;; Processes operator reference documentation. ( symbol process-alias (quot :matches ==> dict :data) ( {} matches 1 get process fix-name "name" dset matches 2 get :ref "See $#" (ref) =% "description" dset "symbol" "kind" dset @data ) ) :: ;; Processes alias reference documentation. ( symbol process-sig (quot :matches ==> dict :data) ( {} matches 1 get process fix-name "name" dset matches 2 get :ref "See $#" (ref) =% "description" dset "sigil" "kind" dset @data ) ) :: ;; Processes sigil reference documentation. ( symbol default (==>) ( {} :ref-dict {} :op-dict {} :sig-dict src-files ( :file file "reference-([a-z]+)\\.md" search 1 get :mod-id "Processing: $#" (mod-id) =% notice! file fread :contents contents op-regex search-all ( process-op :op op "name" dget :op-name op mod-id 'module dset @op op-dict op op-name dset @op-dict ) foreach contents alias-regex search-all ( process-alias :alias alias "name" dget :alias-name alias mod-id 'module dset @alias op-dict alias alias-name dset @op-dict ) foreach contents sig-regex search-all ( process-sig :sig sig "name" dget :sig-name sig mod-id 'module dset @sig sig-dict sig sig-name dset @sig-dict ) foreach ref-dict op-dict "operators" dset sig-dict "sigils" dset @ref-dict ) foreach "Writing help.json" notice! ref-dict to-json "help.json" fwrite ) ) :: ;; Builds the reference help JSON sources.
M tasks/release.mintasks/release.min

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

-#!/usr/bin/env min "build" require :build "github" require :github #| Tasks |# ( symbol default (==>) ( *build/guide *build/site *build/vim *build/windows *build/linux *build/macosx *github/update *github/upload ) ) :: ;; Builds min executables and updates the current draft Github release. +#!/usr/bin/env min "build" require :build "github" require :github #| Tasks |# ( symbol default (==>) ( build.guide build.site build.vim build.windows build.linux build.macosx github.update github.upload ) ) :: ;; Builds min executables and updates the current draft Github release.
M tasks/version.mintasks/version.min

@@ -5,7 +5,7 @@ "min.nimble" :nimble-cfg

"site/settings.json" :json-site-cfg yaml-cfg fread from-yaml :config -config /version :old-version +config "version" dget :old-version nimble-cfg fread :nimble-data

@@ -13,7 +13,7 @@ (

symbol update-yaml-config ('sym :new-version ==>) ( - config new-version %version @config + config new-version "version" dset @config config to-yaml yaml-cfg fwrite ) ) ::

@@ -24,7 +24,7 @@ symbol update-site-config

('sym :new-version ==>) ( json-site-cfg fread from-json :site-config - site-config new-version %version @site-config + site-config new-version "version" dset @site-config site-config to-json json-site-cfg fwrite ) ) ::

@@ -34,7 +34,7 @@ (

symbol update-nimble-config ('sym :new-version ==>) ( - "(version\s+=\s*)([^\s]+)(\s*)" :version-regexp + "(version\\s+=\\s*)([^\\s]+)(\\s*)" :version-regexp nimble-data version-regexp (dup 1 get :start 3 get :end "$#\"$#\"$#" (start new-version end) =%) replace-apply @nimble-data nimble-data nimble-cfg fwrite

@@ -42,7 +42,7 @@ )

) :: ;; Updates the version in the nimble file to new-version. -#| Tasks |# +#|| Tasks ||# ( symbol set
M tests/dict.mintests/dict.min

@@ -9,9 +9,9 @@ ({1 :a 2 :b 3 :c} dictionary?) test.assert

({1 :a 2 :b 3 :c} 'b dget 2 ==) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) test.assert + ({1 :a 2 :b 3 :c} :dict1 dict1 5 'b dset 7 "d" dset :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 newdict != and) test.assert - ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 %d :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) test.assert + ({1 :a 2 :b 3 :c} :dict1 dict1 ddup 5 'b dset 7 "d" dset :newdict newdict {1 :a 5 :b 3 :c 7 :d} == dict1 {1 :a 2 :b 3 :c} == and) test.assert ({1 :a 2 :b 3 :c} :dict1 dict1 'b ddel {1 :a 3 :c} ==) test.assert

@@ -25,11 +25,11 @@ ({} dtype "" ==) test.assert

({1 :a 2 :b 3 :c 4 :d} ("b" "c") dpick {2 :b 3 :c} ==) test.assert - (2 2 {+ :plus} /plus 4 ==) test.assert + (2 2 {+ :plus} "plus" dget 4 ==) test.assert - (2 {(2 3 +) :sum} /sum -> + 7 ==) test.assert + (2 {(2 3 +) :sum} "sum" dget -> + 7 ==) test.assert - ({a :test} "test" dget-raw /str "a" ==) test.assert + ({a :test} "test" dget-raw "str" dget "a" ==) test.assert ({} 'aaa 'test dset-sym {aaa :test} ==) test.assert

@@ -38,9 +38,9 @@ {} :archives

({"a" :a 2 :b} {"aa" :a 4 :b} {"aaa" :a 6 :b}) ( :article - article /a :code + article "a" dget :code {} - code %code + code "code" dset :archive archives archive code dset @archives ) foreach
M tests/dstore.mintests/dstore.min

@@ -9,8 +9,8 @@ (

"dstore.json" dsread :ds ds "tests" {} - 1 %test1 - 2 %test2 + 1 "test1" dset + 2 "test2" dset dspost dswrite "tests" (pop true) dsquery size 1 == ) test.assert

@@ -19,16 +19,16 @@ (

"dstore.json" dsread :ds ds "tests/aaa" {} - 1 %test1 - 3 %test3 + 1 "test1" dset + 3 "test3" dset dsput dswrite - "tests" (/test1 1 ==) dsquery size 2 == + "tests" ("test1" dget 1 ==) dsquery size 2 == ) test.assert ( "dstore.json" dsread :ds ds "tests/aaa" dsdelete - "tests" (/id "aaa" ==) dsquery size 0 == + "tests" ("id" dget "aaa" ==) dsquery size 0 == ) test.assert "dstore.json" rm
M tests/global.mintests/global.min

@@ -87,7 +87,7 @@

( ( ({"TestError" :error "Test Message" :message} raise) - (/error) + ("error" dget) ) try "TestError" ==) test.assert (

@@ -129,7 +129,7 @@ ) test.assert

(time scope-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) test.assert - (sys scope-sigils ("!" "$" "&") ==) test.assert + (sys scope-sigils ("$") ==) test.assert ({3 :a 5 :b} scope-symbols ("a" "b") ==) test.assert

@@ -170,8 +170,8 @@ ("3.678" float 3.678 ==) test.assert

( {1 :a 2 :b 3 :c} ( - (dup /a succ succ %a) - (dup /b succ %b) + (dup "a" dget succ succ "a" dset) + (dup "b" dget succ "b" dset) ) tap {3 :a 3 :b 3 :c} == ) test.assert

@@ -179,8 +179,8 @@

( {} :data data ( - 1 %a - 2 %b + 1 "a" dset + 2 "b" dset ) tap {1 :a 2 :b} == ) test.assert

@@ -266,7 +266,7 @@ ;; (:n ((n integer?) (n 0 >)) &&) 'natural typeclass

( typeclass natural (int :n ==> bool :out) - (((n integer?) (n 0 >)) && @out) + (((n integer?) (n 0 >)) "&" run @out) ) :: ("typeclass:natural" defined-symbol?) test.assert (

@@ -293,7 +293,7 @@ constructor test-c

(str :in ==> dict :out) ( {} - in %test + in "test" dset @out ) ) ::
M tests/http.mintests/http.min

@@ -6,53 +6,53 @@

"postman-echo.com" :host "https://$1" (host) => % :url - ("$1/get" (url) => % get-content from-json /headers /user-agent "min http-module/$1" (version) => % ==) test.assert + ("$1/get" (url) => % get-content from-json "headers" dget "user-agent" dget "min http-module/$1" (version) => % ==) test.assert - ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json /args /test "Hello!" ==) test.assert + ("$1/get?test=Hello!" (url) => % "tests/test1.json" :file file download file fread from-json "args" dget "test" dget "Hello!" ==) test.assert "tests/test1.json" rm ( {} ( - ("$1/get" (url) => % %url) - ("GET" %method) - ({"it-it" :Accept-Language} %headers) + ("$1/get" (url) => % "url" dset) + ("GET" "method" dset) + ({"it-it" :Accept-Language} "headers" dset) (request) - ) tap /body from-json /headers /accept-language "it-it" == + ) tap "body" dget from-json "headers" dget "accept-language" dget "it-it" == ) test.assert ( {} ( - ("$1/put" (url) => % %url) - ("PUT" %method) - ({} to-json %body) + ("$1/put" (url) => % "url" dset) + ("PUT" "method" dset) + ({} to-json "body" dset) (request) - ) tap /body from-json /data {} == + ) tap "body" dget from-json "data" dget {} == ) test.assert ( {} ( - ("$1/post" (url) => % %url) - ("POST" %method) - ({"post" :test} to-json %body) + ("$1/post" (url) => % "url" dset) + ("POST" "method" dset) + ({"post" :test} to-json "body" dset) (request) - ) tap /headers /content-type "^application/json" match? + ) tap "headers" dget "content-type" dget "^application/json" match? ) test.assert ( {} ( - ("$1/patch" (url) => % %url) - ("PATCH" %method) - ({} to-json %body) + ("$1/patch" (url) => % "url" dset) + ("PATCH" "method" dset) + ({} to-json "body" dset) (request) - ) tap /body from-json /data {} == + ) tap "body" dget from-json "data" dget {} == ) test.assert ( {} ( - ("$1/delete" (url) => % %url) - ("DELETE" %method) + ("$1/delete" (url) => % "url" dset) + ("DELETE" "method" dset) (request) - ) tap /body from-json /url "https://$1/delete" (host) => % == + ) tap "body" dget from-json "url" dget "https?:\/\/$1\/delete" (host) => % match? ) test.assert test.report
M tests/seq.mintests/seq.min

@@ -17,7 +17,7 @@ (0 (1 2 3) prepend (0 1 2 3) ==) test.assert

((1 2 3 4) 2 get 3 ==) test.assert - ((a b c) 1 get-raw /type "sym" ==) test.assert + ((a b c) 1 get-raw "type" dget "sym" ==) test.assert ((1 2 3 4) 222 2 set (1 2 222 4) ==) test.assert
M tests/sys.mintests/sys.min

@@ -30,7 +30,7 @@

("systest" cd pwd "systest" match?) test.assert parent-dir cd - ("./min -v" & 'output dget "\\." match?) test.assert + ("./min -v" run 'output dget "\\." match?) test.assert ("PATH" env?) test.assert

@@ -63,7 +63,7 @@ parent-dir cd

("systest" rmdir pwd ls (pwd "systest") => "/" join in? false ==) test.assert - ([ls] &ls /output ==) test.assert + ([ls] "ls" run "output" dget ==) test.assert test.report clear-stack
M tests/xml.mintests/xml.min

@@ -4,29 +4,29 @@

"xml" test.describe - ("test" xentity /text "test" ==) test.assert + ("test" xentity "text" dget "test" ==) test.assert - ("test" xcomment /text "test" ==) test.assert + ("test" xcomment "text" dget "test" ==) test.assert - ("test" xtext /text "test" ==) test.assert + ("test" xtext "text" dget "test" ==) test.assert - ("test" xcdata /text "test" ==) test.assert + ("test" xcdata "text" dget "test" ==) test.assert - ("test" xelement /tag "test" ==) test.assert + ("test" xelement "tag" dget "test" ==) test.assert ( "test" xelement :xnode - xnode {"a" :attr1} %attributes @xnode + xnode {"a" :attr1} "attributes" dset @xnode "a1" xelement :child "text..." xtext :text - xnode (child text) => %children @xnode + xnode (child text) => "children" dset @xnode xnode to-xml "<test attr1=\"a\"><a1 />text...</test>" == ) test.assert ( "<ul><li class='test'>yes</li><li class='test'>...</li><li>no</li></ul>" from-xml :xnode xnode "li.test" xquery - /children first /text "yes" == + "children" dget first "text" dget "yes" == ) test.assert (