More satsifying Stream fixes

This commit is contained in:
2021-04-05 20:28:21 -06:00
parent cc76199a72
commit ff2c5f77d4
3 changed files with 21 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
(set pp (or pp (new Map<String,String>)))
(when (stream.isEmpty) (return pp))
(let [key (stream.expect "passport key" (lambda [] (stream.takeUntilAndDrop ":")))
value (stream.expect "passport value" (lambda [] (stream.takeUntilOneOf [" " #|"\n"|#])))]
value (stream.expect "passport value" (lambda [] (stream.takeUntilOneOf [" " "\n"] true)))]
(dictSet pp key value))
(if (= #|"\n\n"|# (try (stream.expect "paragraph break" (lambda [] (stream.peekChars 2))) (catch [e] "")))
(begin (stream.dropWhitespace) pp)