fix dict parsing

This commit is contained in:
Scott Richmond 2024-05-19 20:18:22 -04:00
parent 010b584ef1
commit e767c319b1

View File

@ -411,7 +411,7 @@
:token origin}) :token origin})
{:type :pair :data [key value] :token origin}) {:type :pair :data [key value] :token origin})
:keyword (do :keyword (do
(def key (capture kw parser)) (def key (capture kw-only parser))
(def value (capture nonbinding parser)) (def value (capture nonbinding parser))
{:type :pair :data [key value] :token origin}) {:type :pair :data [key value] :token origin})
(try (panic parser (string "expected dict term, got " (type origin))) ([e] e)) (try (panic parser (string "expected dict term, got " (type origin))) ([e] e))
@ -507,7 +507,7 @@
(def key {:type :keyword :data (keyword name) :token origin}) (def key {:type :keyword :data (keyword name) :token origin})
{:type :pair :data [key word] :token origin}) {:type :pair :data [key word] :token origin})
:keyword (do :keyword (do
(def key (capture kw parser)) (def key (capture kw-only parser))
(def value (capture pattern parser)) (def value (capture pattern parser))
{:type :pair :data [key value] :token origin}) {:type :pair :data [key value] :token origin})
(try (panic parser (string "expected dict term, got " (type origin))) ([e] e)) (try (panic parser (string "expected dict term, got " (type origin))) ([e] e))