Clean up parse-tuple
This commit is contained in:
parent
e6b204a54a
commit
61b25ca22d
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user