# more at https://github.com/sogaiu/margaret/tree/master/examples
(peg/match ~{:main (replace (some :header-line)
,(fn [& captures]
(table ;captures)))
:header-line (sequence (capture :header-name) ":"
:s+
(capture :header-value) :crlf)
:header-name (to ":")
:header-value (to :crlf)
:crlf "\r\n"}
(string "Content-Type: text/plain\r\n"
"Content-Length: 1024\r\n"))
# => @[@{"Content-Length" "1024" "Content-Type" "text/plain"}]