Compare commits

..

No commits in common. "8b0954b8ec91af6892e6dca23c19de12fdb9fe19" and "70b6a1dcd73bfe7d2dbe5ebd090b25bc132b439f" have entirely different histories.

View File

@ -858,7 +858,7 @@
(expect parser :pkg) (advance parser) (expect parser :pkg) (advance parser)
(def name (-> parser pkg-name (get :data))) (def name (-> parser pkg-name (get :data)))
(expect parser :lbrace) (advance parser) (expect parser :lbrace) (advance parser)
(while (separates? parser) (advance parser)) (accept-many parser ;terminators)
(def data @[]) (def data @[])
(while (not (check parser :rbrace)) (while (not (check parser :rbrace))
(when (check parser :eof) (when (check parser :eof)
@ -875,9 +875,9 @@
(def value (word-only parser)) (def value (word-only parser))
(def key (keyword (value :data))) (def key (keyword (value :data)))
(def kw-ast {:type :keyword :data key :token origin}) (def kw-ast {:type :keyword :data key :token origin})
(array/push data {:type :pair :data [kw-ast value] :token origin})) (array/push data {:type :pair :data [key value] :token origin}))
(panic parser "expected pkg term")) (panic parser "expected pkg term"))
(separators parser)) (terminator parser))
(advance parser) (advance parser)
@{:type :pkg :data data :token origin :name name}) @{:type :pkg :data data :token origin :name name})
([err] err))) ([err] err)))
@ -1113,15 +1113,15 @@
) )
(do # (do
# (comment (comment
(def source ` (def source `
pkg Foo {foo, bar, :baz 42} Foo :bar :Baz
`) `)
(def scanned (s/scan source)) (def scanned (s/scan source))
(print "\n***NEW PARSE***\n") (print "\n***NEW PARSE***\n")
(def a-parser (new-parser scanned)) (def a-parser (new-parser scanned))
(def parsed (toplevel a-parser)) (def parsed (expr a-parser))
# (print (pp-ast parsed)) # (print (pp-ast parsed))
# (pp scanned) # (pp scanned)