Compare commits
2 Commits
70b6a1dcd7
...
8b0954b8ec
Author | SHA1 | Date | |
---|---|---|---|
|
8b0954b8ec | ||
|
4547c0747d |
|
@ -858,7 +858,7 @@
|
|||
(expect parser :pkg) (advance parser)
|
||||
(def name (-> parser pkg-name (get :data)))
|
||||
(expect parser :lbrace) (advance parser)
|
||||
(accept-many parser ;terminators)
|
||||
(while (separates? parser) (advance parser))
|
||||
(def data @[])
|
||||
(while (not (check parser :rbrace))
|
||||
(when (check parser :eof)
|
||||
|
@ -875,9 +875,9 @@
|
|||
(def value (word-only parser))
|
||||
(def key (keyword (value :data)))
|
||||
(def kw-ast {:type :keyword :data key :token origin})
|
||||
(array/push data {:type :pair :data [key value] :token origin}))
|
||||
(array/push data {:type :pair :data [kw-ast value] :token origin}))
|
||||
(panic parser "expected pkg term"))
|
||||
(terminator parser))
|
||||
(separators parser))
|
||||
(advance parser)
|
||||
@{:type :pkg :data data :token origin :name name})
|
||||
([err] err)))
|
||||
|
@ -1113,15 +1113,15 @@
|
|||
)
|
||||
|
||||
|
||||
# (do
|
||||
(comment
|
||||
(do
|
||||
# (comment
|
||||
(def source `
|
||||
Foo :bar :Baz
|
||||
pkg Foo {foo, bar, :baz 42}
|
||||
`)
|
||||
(def scanned (s/scan source))
|
||||
(print "\n***NEW PARSE***\n")
|
||||
(def a-parser (new-parser scanned))
|
||||
(def parsed (expr a-parser))
|
||||
(def parsed (toplevel a-parser))
|
||||
|
||||
# (print (pp-ast parsed))
|
||||
# (pp scanned)
|
||||
|
|
Loading…
Reference in New Issue
Block a user