1
0
mirror of https://git.lain.church/emil/moontalk.git synced 2025-05-24 04:16:44 +00:00
2024-02-17 18:26:14 +00:00

19 lines
428 B
Forth

require libs/parser/parser.4th
create motd-parser PARSER_SIZE allot
create motd-line-delim 10 c,
: (motd-delim) ( -- str )
motd-line-delim 1 ;
variable (append-xt)
: (append) ( str -- )
(append-xt) @ execute ;
: parse-motd ( motd-str append-line-xt -- )
(append-xt) ! motd-parser new-parser
BEGIN
parser-mark (motd-delim) parser>>string
WHILE
parser-extract (append)
(motd-delim) nip parser>>
REPEAT ;