Last active
November 28, 2020 19:55
-
-
Save kuribas/271da3669b7791d6e713d70fd9c641ca to your computer and use it in GitHub Desktop.
effects in scheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define string-parser | |
(let* ((escaped-char (effect (run parse-char #\\) | |
(run any-char))) | |
(string-char (alternative (none-of '(#\" #\\)) | |
escaped-char)) | |
(parse-quote (parse-char #\"))) | |
(effect | |
(let* ((_ (run parse-quote)) | |
(chars (run many string-char)) | |
(_ (run parse-quote))) | |
(apply string chars))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment