aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r--stdlib/source/lux.lux18
1 files changed, 11 insertions, 7 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index c6018398b..01064b829 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -2100,6 +2100,7 @@
(-> Char Text)
(let' [as-text (_lux_case x
#"\t" "\\t"
+ #"\v" "\\v"
#"\b" "\\b"
#"\n" "\\n"
#"\r" "\\r"
@@ -3222,13 +3223,14 @@
(#Some y)
(#Some y))))
-(def: (last-index-of part text)
- (-> Text Text (Maybe Nat))
- (_lux_proc ["text" "last-index"] [text part]))
+(do-template [<name> <proc> <start>]
+ [(def: (<name> part text)
+ (-> Text Text (Maybe Nat))
+ (_lux_proc ["text" <proc>] [text part <start>]))]
-(def: (index-of part text)
- (-> Text Text (Maybe Nat))
- (_lux_proc ["text" "index"] [text part]))
+ [index-of "index" +0]
+ [last-index-of "last-index" (_lux_proc ["text" "size"] [text])]
+ )
(def: (clip1 from text)
(-> Nat Text (Maybe Text))
@@ -3954,7 +3956,8 @@
[_ (#SymbolS "" m-name)]
(do Monad<Lux>
[m-name (clean-module m-name)]
- (wrap (list [m-name #None {#refer-defs #All #refer-open (list)}])))
+ (wrap (list [m-name #None {#refer-defs #All
+ #refer-open (list)}])))
(^ [_ (#FormS (list& [_ (#SymbolS "" m-name)] extra))])
(do Monad<Lux>
@@ -4863,6 +4866,7 @@
(-> Text Text)
(let [escaped (|> original
(replace "\t" "\\t")
+ (replace "\v" "\\v")
(replace "\b" "\\b")
(replace "\n" "\\n")
(replace "\r" "\\r")