19 lines
428 B
Forth
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 ;
|