doc updates
This commit is contained in:
parent
d1bbe16459
commit
5d97c1df86
|
|
@ -71,7 +71,7 @@ utils/local_install.sh
|
|||
|
||||
### TODO
|
||||
- add test for >>> (range 1.5 (inc 5.5)) => (1.500000 2.500000 3.500000 4.500000 5.500000)
|
||||
- better formating of help
|
||||
- ml_utils.cpp add all commands into const std::vector<std::string> commands
|
||||
- unify -f and -run options
|
||||
- add debug support, at least call stack
|
||||
- multiline editing (see kilocpp editor)
|
||||
|
|
|
|||
16
debug.lsp
16
debug.lsp
|
|
@ -1,11 +1,15 @@
|
|||
|
||||
(defn concat-lists (seq1 seq2)
|
||||
(do (def l seq1)
|
||||
(dotimes i (len seq2)
|
||||
(set! l (push l (index seq2 i))))
|
||||
))
|
||||
(doc::man "string-regex-list")
|
||||
(doc::man "string-split")
|
||||
(doc::man "string-trim")
|
||||
|
||||
(print (concat-lists '(1 2 3) '(4 5 6)))
|
||||
;; (defn concat-lists (seq1 seq2)
|
||||
;; (do (def l seq1)
|
||||
;; (dotimes i (len seq2)
|
||||
;; (set! l (push l (index seq2 i))))
|
||||
;; ))
|
||||
|
||||
;; (print (concat-lists '(1 2 3) '(4 5 6)))
|
||||
;; (1 2 3 4 5 6)
|
||||
|
||||
; pridat example
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@
|
|||
|`(string-pad str len char rpad_lpad)`|Pad string from start or to end with char to length||String manipulation|
|
||||
|`(string-lpad str len char)`|Pad string from start with char to length len|`>>> (string-lpad "0" 10 "x") => "xxxxxxxxx0"`|String manipulation|
|
||||
|`(string-rpad str len char)`|Pad string from righ with char to length len|`>>> (string-rpad "0" 10 "x") => "0xxxxxxxxx"`|String manipulation|
|
||||
|`(string-split str separator)`|Splits string into list by regexp|`>>> (string-split "split me by space" "\s+") => ("split" "me" "by" "space")`|
|
||||
|`(string-split str separator)`|Splits string into list by regexp|`>>> (string-split "split me by space" "\s+") => ("split" "me" "by" "space")`|String manipulation|
|
||||
|`(string-rltrim str len RKRRKR)`|Removes " \n\r\t" from the begininfg or end or both ends of str||Regex|
|
||||
|`(string-ltrim str)`|Removes " \n\r\t" from the begininfg of str||String manipulation|
|
||||
|`(string-rtrim str)`|Removes " \n\r\t" from the end of str||String manipulation|
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
(defn doc::print (entry)
|
||||
(do (print (term-green (doc::strip-backticks (second entry))) "-" (third entry))
|
||||
; (print (last entry) "\n") ; doc section
|
||||
(if (> (string-len (fourth entry)) 2)
|
||||
(do (def examp (doc::strip-backticks (fourth entry)))
|
||||
(if (> (string-len (fourth entry)) 2) ; example
|
||||
(for example (string-regex-list (fourth entry) "(`.*?`)" "token")
|
||||
(def examp (doc::strip-backticks (first example)))
|
||||
(def pos (string-find examp "=>" 0))
|
||||
(if (and pos (> pos 0))
|
||||
(print (term-magenta
|
||||
|
|
|
|||
Loading…
Reference in New Issue