all repos — min @ 780ed061a9fc8ccfcd83aa61dbbc99a0bacb1850

A small but practical concatenative programming language.

Fixed search symbol.
h3rald h3rald@h3rald.com
Fri, 12 Mar 2021 19:58:19 +0100
commit

780ed061a9fc8ccfcd83aa61dbbc99a0bacb1850

parent

b508adcfdbc7fdb42db5b3ca6af971d8c657a65e

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

jump to
M min.ymlmin.yml

@@ -2,4 +2,4 @@ author: Fabio Cevasco

description: A tiny concatenative programming language and shell. id: 38026834 name: min -version: 0.34.0+version: 0.34.1
M minpkg/lib/min_str.nimminpkg/lib/min_str.nim

@@ -152,6 +152,9 @@ let str = vals[1]

let m = str.strVal.find(reg) var res = newSeq[MinValue](0) if m.isNone: + res.add "".newVal + for i in 0..reg.captureCount-1: + res.add "".newVal i.push res.newVal return let matches = m.get.captures
M next-release.mdnext-release.md

@@ -1,12 +1,3 @@

-### Breaking Changes +### Fixes -* No longer distributing lite and mini variants. -* Removed **regex** and **=~** symbols, use **search**, **replace**, **search-all**, **replace-apply** instead. -* Regular expressions are PCRE compliant. -* Renamed **match** into **match?**. -* The **split** operator now takes a PCRE as a separator. - -### New features - -* Now including statically-linked PCRE v8.44 library used for regular expression support. -* Upgraded OpenSSL to v1.1.1j. +* Fixed **search** symbol to always return a quotation containing the same number of elements (1 + number of captures). If no matches are found, the quotation contains empty strings.
M site/contents/reference-str.mdsite/contents/reference-str.md

@@ -127,6 +127,7 @@ > Returns a quotation containing the first occurrence of {{s2}} within {{s1}}. Note that:

> > * The first element of {{q}} is the matching substring. > * Other elements (if any) contain captured substrings. +> * If no matches are found, the quotation contains empty strings. > > > %tip% > > Tip
M site/settings.jsonsite/settings.json

@@ -6,5 +6,5 @@ "rules": "rules.min",

"temp": "temp", "templates": "templates", "title": "min language", - "version": "0.34.0" + "version": "0.34.1" }