chiark / gitweb /
src/: Split the frontend out into its own separate system.
[sod] / src / parser / parser-test.lisp
index f25961ed2cd68747556c7afd286d5ccca3f03253..6718d5cf082c709db97bb7e6b76f716d477639dd 100644 (file)
@@ -400,10 +400,13 @@   (defun test-parse-expr (string)
                                       (seq (#\&) and)
                                       (seq (#\|) or)))
                            (token (or (seq (#\() lp)
+                                      (seq (#\[) lb)
                                       (seq (#\-) neg)
                                       (seq (#\!) not)))
                            (token (or (seq (#\!) fact)
-                                      (when nestedp (seq (#\)) rp))))))
+                                      (when nestedp
+                                        (or (seq (#\)) rp)
+                                            (seq (#\]) rb)))))))
                   (next (or :any (t :eof))))
               (cons value next))))))
 
@@ -425,7 +428,6 @@ (def-test-method test-expression-parser ((test test-parser) :run nil)
   (assert-expr-parse "1 ** 2 ** 3" '((** 1 (** 2 3)) . :eof) t t)
   (assert-expr-parse "1 + 2) * 3" '((+ 1 2) . #\)) t t)
   (assert-expr-parse "1 + 2 * 3" '((+ 1 (* 2 3)) . :eof) t t)
-
   (assert-expr-parse "! 1 + 2 = 3 | 6 - 3 /= 12/6"
                     '((or (not (= (+ 1 2) 3))
                           (/= (- 6 3) (/ 12 6)))