Created
June 6, 2021 08:27
-
-
Save sogaiu/8ae759e1affcf588f6113b1f503a2d92 to your computer and use it in GitHub Desktop.
janet peg peg/match struct example
This file contains 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
(first | |
(peg/match ~(cmt (sequence (capture "hello") | |
(some (set " ,")) | |
(capture "world")) | |
,(fn [cap1 cap2] | |
{:greeting cap1 :name cap2})) | |
"hello, world")) | |
# => {:greeting "hello" :name "world"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment