Remove debug printlns

This commit is contained in:
Scott Richmond 2023-05-20 14:25:13 -04:00
parent 0fe85cf2ed
commit ae8f72d3b4
2 changed files with 9 additions and 4 deletions

5
src/ludus/compile.clj Normal file
View File

@ -0,0 +1,5 @@
(ns ludus.compile
(:require
[ludus.grammar :as g]
[ludus.parser-new :as p]
[ludus.scanner :as s]))

View File

@ -28,7 +28,7 @@
(defn apply-kw-parser [kw tokens]
(let [token (first tokens)]
(if (= kw (:type token)) (println "Matched " kw))
;(if (= kw (:type token)) (println "Matched " kw))
(if (= kw (:type token))
{:status :ok
:type kw
@ -39,16 +39,16 @@
(defn apply-fn-parser [parser tokens]
(let [rule (:rule parser) name (:name parser) result (rule tokens)]
(if (pass? result) (println "Matched " (:name parser)))
;(if (pass? result) (println "Matched " (:name parser)))
result))
(defn apply-parser [parser tokens]
(println "Applying parser " (? (:name parser) parser))
;(println "Applying parser " (? (:name parser) parser))
(let [result (cond
(keyword? parser) (apply-kw-parser parser tokens)
(:rule parser) (apply-fn-parser parser tokens)
:else (throw (Exception. "`apply-parser` requires a parser")))]
(println "Parser result " (? (:name parser) parser) (:status result))
;(println "Parser result " (? (:name parser) parser) (:status result))
result
))