Skip to content

Commit 47e744f

Browse files
committed
refactor: use pratt-parser in truth-infix macro
1 parent 1668e64 commit 47e744f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/truth-table.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,11 @@ a tautology."
203203
"A easy way to generate a truth table"
204204
`(print-truth-table (quote ,exp)))
205205

206-
;; TODO: implement a pratt parser
207-
(defmacro truth-infix (exp)
206+
207+
(defmacro truth-infix (&rest exp)
208208
"A easy and infix way of EXP generate a truth table.
209209
Ex.: (truth-infix (p ^ q)) "
210-
`(print-truth-table (infix-to-prefix (quote , exp))))
210+
`(print-truth-table (parse-logic (format nil "~a" (quote ,exp)))))
211211

212212

213213
(defun main ()

0 commit comments

Comments
 (0)