Skip comments, the dumb solution.
This commit is contained in:
parent
2a099298f0
commit
584ddaf705
|
@ -446,6 +446,10 @@
|
|||
(parse-then (accept ::token/newline ast))
|
||||
))
|
||||
|
||||
(defn- parse-match-clause [parser])
|
||||
|
||||
(defn- parse-match [parser])
|
||||
|
||||
(defn- parse-expr
|
||||
([parser] (parse-expr parser sync-on))
|
||||
([parser sync-on] (let [token (current parser)]
|
||||
|
@ -482,6 +486,10 @@
|
|||
::token/let (parse-let parser)
|
||||
|
||||
::token/if (parse-if parser)
|
||||
|
||||
::token/match (parse-match parser)
|
||||
|
||||
::token/comment (advance parser)
|
||||
|
||||
::token/error (panic parser (:message token) sync-on)
|
||||
|
||||
|
@ -504,7 +512,11 @@
|
|||
|
||||
(do
|
||||
(def pp pp/pprint)
|
||||
(def source "#{:a :b, :c :d}")
|
||||
(def source "
|
||||
(1
|
||||
2
|
||||
&three
|
||||
3)")
|
||||
(def lexed (scanner/scan source))
|
||||
(def tokens (:tokens lexed))
|
||||
(def p (parser tokens))
|
||||
|
|
|
@ -208,9 +208,10 @@
|
|||
comm (str char)]
|
||||
(let [char (current-char scanner)]
|
||||
(if (= \newline char)
|
||||
(if (s/starts-with? comm "&&&")
|
||||
(add-token (update scanner ::line inc) ::token/docstring)
|
||||
(add-token (update scanner ::line inc) ::token/comment))
|
||||
(update scanner ::line inc)
|
||||
;;(if (s/starts-with? comm "&&&")
|
||||
;;(add-token (update scanner ::line inc) ::token/docstring)
|
||||
;;(add-token (update scanner ::line inc) ::token/comment))
|
||||
(recur (advance scanner) (str comm char))))))
|
||||
|
||||
(defn- scan-token [scanner]
|
||||
|
|
Loading…
Reference in New Issue
Block a user