Clean up parse-tuple

This commit is contained in:
Scott Richmond 2022-02-21 13:46:41 -05:00
parent e6b204a54a
commit 61b25ca22d

View File

@ -139,9 +139,7 @@
members [] members []
current_member nil current_member nil
] ]
(let [ (let [curr (current parser)]
curr (current parser)
]
(case (token-type parser) (case (token-type parser)
::token/rparen (let [ms (add-member members current_member)] ::token/rparen (let [ms (add-member members current_member)]
(assoc (advance parser) ::ast (assoc (advance parser) ::ast
@ -161,12 +159,7 @@
(panic origin "Unterminated tuple" ::token/eof) (panic origin "Unterminated tuple" ::token/eof)
(let [parsed (parse-expr parser)] (let [parsed (parse-expr parser)]
(recur parsed members (::ast parsed)) (recur parsed members (::ast parsed)))))))
)
)
)
)
)
(defn- parse-list [parser] (defn- parse-list [parser]
(loop [parser (advance parser) (loop [parser (advance parser)