diff --git a/tests/parser-test-files/bad-files/parse-and.1.coal b/tests/parser-test-files/bad-files/parse-and.1.coal deleted file mode 100644 index a79ab84ca..000000000 --- a/tests/parser-test-files/bad-files/parse-and.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse And -(package test-package) - -(define x (and)) diff --git a/tests/parser-test-files/bad-files/parse-and.1.error b/tests/parser-test-files/bad-files/parse-and.1.error deleted file mode 100644 index 0fca86690..000000000 --- a/tests/parser-test-files/bad-files/parse-and.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed and expression - --> test:4:15 - | - 4 | (define x (and)) - | ^ expected one or more arguments diff --git a/tests/parser-test-files/bad-files/parse-attribute.1.coal b/tests/parser-test-files/bad-files/parse-attribute.1.coal deleted file mode 100644 index 74fca3eee..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Attribute -(package test-package) - -(repr :enum) diff --git a/tests/parser-test-files/bad-files/parse-attribute.1.error b/tests/parser-test-files/bad-files/parse-attribute.1.error deleted file mode 100644 index 7ce00bc24..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Orphan attribute - --> test:4:0 - | - 4 | (repr :enum) - | ^^^^^^^^^^^^ attribute must be attached to another form diff --git a/tests/parser-test-files/bad-files/parse-attribute.2.coal b/tests/parser-test-files/bad-files/parse-attribute.2.coal deleted file mode 100644 index d4200e2f9..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.2.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Attribute -(package test-package) - -(monomorphize 5) -(define x 5) diff --git a/tests/parser-test-files/bad-files/parse-attribute.2.error b/tests/parser-test-files/bad-files/parse-attribute.2.error deleted file mode 100644 index bb425a1fc..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed monomophize attribute - --> test:4:0 - | - 4 | (monomorphize 5) - | ^^^^^^^^^^^^^^^^ unexpected form diff --git a/tests/parser-test-files/bad-files/parse-attribute.3.coal b/tests/parser-test-files/bad-files/parse-attribute.3.coal deleted file mode 100644 index 405da3fac..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.3.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Attribute -(package test-package) - -(repr (:enum)) -(define-type T) diff --git a/tests/parser-test-files/bad-files/parse-attribute.3.error b/tests/parser-test-files/bad-files/parse-attribute.3.error deleted file mode 100644 index a02dce4ef..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.3.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid type variable - --> test:4:6 - | - 4 | (repr (:enum)) - | ^^^^^^^ expected keyword symbol diff --git a/tests/parser-test-files/bad-files/parse-attribute.4.coal b/tests/parser-test-files/bad-files/parse-attribute.4.coal deleted file mode 100644 index 53df71cff..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.4.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Attribute -(package test-package) - -(repr :enum 5) -(define-type T) diff --git a/tests/parser-test-files/bad-files/parse-attribute.4.error b/tests/parser-test-files/bad-files/parse-attribute.4.error deleted file mode 100644 index 122aa1749..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.4.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed repr attribute - --> test:4:12 - | - 4 | (repr :enum 5) - | ^ unexpected form diff --git a/tests/parser-test-files/bad-files/parse-attribute.5.coal b/tests/parser-test-files/bad-files/parse-attribute.5.coal deleted file mode 100644 index 3a84e48bb..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.5.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Attribute -(package test-package) - -(repr :native) -(define-type T) diff --git a/tests/parser-test-files/bad-files/parse-attribute.5.error b/tests/parser-test-files/bad-files/parse-attribute.5.error deleted file mode 100644 index 5301a59d1..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.5.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed repr :native attribute - --> test:4:14 - | - 4 | (repr :native) - | ^ expected a lisp type diff --git a/tests/parser-test-files/bad-files/parse-attribute.6.coal b/tests/parser-test-files/bad-files/parse-attribute.6.coal deleted file mode 100644 index 6f39086d2..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.6.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Attribute -(package test-package) - -(repr :native :native :native) -(define-type T) diff --git a/tests/parser-test-files/bad-files/parse-attribute.6.error b/tests/parser-test-files/bad-files/parse-attribute.6.error deleted file mode 100644 index fc60d20ed..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.6.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed repr :native attribute - --> test:4:6 - | - 4 | (repr :native :native :native) - | ^^^^^^^ unexpected form diff --git a/tests/parser-test-files/bad-files/parse-attribute.7.coal b/tests/parser-test-files/bad-files/parse-attribute.7.coal deleted file mode 100644 index b8b9d40d2..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.7.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Attribute -(package test-package) - -(repr :hello) -(define-type T) diff --git a/tests/parser-test-files/bad-files/parse-attribute.7.error b/tests/parser-test-files/bad-files/parse-attribute.7.error deleted file mode 100644 index 196615a49..000000000 --- a/tests/parser-test-files/bad-files/parse-attribute.7.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Unknown repr attribute - --> test:4:6 - | - 4 | (repr :hello) - | ^^^^^^ expected one of :lisp, :transparent, :enum, or :native diff --git a/tests/parser-test-files/bad-files/parse-body.1.coal b/tests/parser-test-files/bad-files/parse-body.1.coal deleted file mode 100644 index e91cc1d24..000000000 --- a/tests/parser-test-files/bad-files/parse-body.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Expression -(package test-package) - -(define x (progn)) diff --git a/tests/parser-test-files/bad-files/parse-body.1.error b/tests/parser-test-files/bad-files/parse-body.1.error deleted file mode 100644 index d7fbada1b..000000000 --- a/tests/parser-test-files/bad-files/parse-body.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed function - --> test:4:17 - | - 4 | (define x (progn)) - | ^ expected body diff --git a/tests/parser-test-files/bad-files/parse-body.2.coal b/tests/parser-test-files/bad-files/parse-body.2.coal deleted file mode 100644 index 0d149fe1d..000000000 --- a/tests/parser-test-files/bad-files/parse-body.2.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Expression -(package test-package) - -(define x (progn 1 2 . 3)) diff --git a/tests/parser-test-files/bad-files/parse-body.2.error b/tests/parser-test-files/bad-files/parse-body.2.error deleted file mode 100644 index 6e51066fa..000000000 --- a/tests/parser-test-files/bad-files/parse-body.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed expression - --> test:4:10 - | - 4 | (define x (progn 1 2 . 3)) - | ^^^^^^^^^^^^^^^ unexpected dotted list diff --git a/tests/parser-test-files/bad-files/parse-body.3.coal b/tests/parser-test-files/bad-files/parse-body.3.coal deleted file mode 100644 index 5907f042f..000000000 --- a/tests/parser-test-files/bad-files/parse-body.3.coal +++ /dev/null @@ -1,7 +0,0 @@ -;; BAD: Parse Body -(package test-package) - -(define x - (progn - (let x = 5 . 5) - x)) diff --git a/tests/parser-test-files/bad-files/parse-body.3.error b/tests/parser-test-files/bad-files/parse-body.3.error deleted file mode 100644 index 2bc67686e..000000000 --- a/tests/parser-test-files/bad-files/parse-body.3.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed body expression - --> test:6:4 - | - 6 | (let x = 5 . 5) - | ^^^^^^^^^^^^^^^ unexpected dotted list diff --git a/tests/parser-test-files/bad-files/parse-body.4.coal b/tests/parser-test-files/bad-files/parse-body.4.coal deleted file mode 100644 index 066417df4..000000000 --- a/tests/parser-test-files/bad-files/parse-body.4.coal +++ /dev/null @@ -1,6 +0,0 @@ -;; BAD: Parse Body -(package test-package) - -(define x - (progn - (let x = 5))) diff --git a/tests/parser-test-files/bad-files/parse-body.4.error b/tests/parser-test-files/bad-files/parse-body.4.error deleted file mode 100644 index bf637cf9a..000000000 --- a/tests/parser-test-files/bad-files/parse-body.4.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed body expression - --> test:6:4 - | - 6 | (let x = 5))) - | ^^^^^^^^^^^ body forms cannot be terminated by a shorthand let diff --git a/tests/parser-test-files/bad-files/parse-body.5.coal b/tests/parser-test-files/bad-files/parse-body.5.coal deleted file mode 100644 index 9b4a32b01..000000000 --- a/tests/parser-test-files/bad-files/parse-body.5.coal +++ /dev/null @@ -1,7 +0,0 @@ -;; BAD: Parse Body -(package test-package) - -(define x - (progn - (let x = 1 2) - x)) diff --git a/tests/parser-test-files/bad-files/parse-body.5.error b/tests/parser-test-files/bad-files/parse-body.5.error deleted file mode 100644 index 15baf7ced..000000000 --- a/tests/parser-test-files/bad-files/parse-body.5.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed shorthand let - --> test:6:15 - | - 6 | (let x = 1 2) - | ^ unexpected trailing form diff --git a/tests/parser-test-files/bad-files/parse-break.1.coal b/tests/parser-test-files/bad-files/parse-break.1.coal deleted file mode 100644 index 9fecf977d..000000000 --- a/tests/parser-test-files/bad-files/parse-break.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse-Break -(package test-parser) - -(define f (break)) diff --git a/tests/parser-test-files/bad-files/parse-break.1.error b/tests/parser-test-files/bad-files/parse-break.1.error deleted file mode 100644 index 4d6e432be..000000000 --- a/tests/parser-test-files/bad-files/parse-break.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid break - --> test:4:10 - | - 4 | (define f (break)) - | ^^^^^^^ break does not appear in an enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-break.2.coal b/tests/parser-test-files/bad-files/parse-break.2.coal deleted file mode 100644 index 82c05600b..000000000 --- a/tests/parser-test-files/bad-files/parse-break.2.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse-Break -(package test-parser) - -(define f - (while :x True (break :y))) diff --git a/tests/parser-test-files/bad-files/parse-break.2.error b/tests/parser-test-files/bad-files/parse-break.2.error deleted file mode 100644 index b42fdb65d..000000000 --- a/tests/parser-test-files/bad-files/parse-break.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid label in break - --> test:5:24 - | - 5 | (while :x True (break :y))) - | ^^ label not found in any enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-break.3.coal b/tests/parser-test-files/bad-files/parse-break.3.coal deleted file mode 100644 index 65b86ef74..000000000 --- a/tests/parser-test-files/bad-files/parse-break.3.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse-Break -(package test-parser) - -(define f - (while :x True (return (fn () (break :x))))) diff --git a/tests/parser-test-files/bad-files/parse-break.3.error b/tests/parser-test-files/bad-files/parse-break.3.error deleted file mode 100644 index c22e47211..000000000 --- a/tests/parser-test-files/bad-files/parse-break.3.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid label in break - --> test:5:39 - | - 5 | (while :x True (return (fn () (break :x))))) - | ^^ label not found in any enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-break.4.coal b/tests/parser-test-files/bad-files/parse-break.4.coal deleted file mode 100644 index 7971d3344..000000000 --- a/tests/parser-test-files/bad-files/parse-break.4.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse-Break -(package test-parser) - -(define f - (while True (return (fn () (break))))) diff --git a/tests/parser-test-files/bad-files/parse-break.4.error b/tests/parser-test-files/bad-files/parse-break.4.error deleted file mode 100644 index 4cf934125..000000000 --- a/tests/parser-test-files/bad-files/parse-break.4.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid break - --> test:5:29 - | - 5 | (while True (return (fn () (break))))) - | ^^^^^^^ break does not appear in an enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-cond.1.coal b/tests/parser-test-files/bad-files/parse-cond.1.coal deleted file mode 100644 index 5ebd5a826..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Cond -(package test-package) - -(define x (cond)) diff --git a/tests/parser-test-files/bad-files/parse-cond.1.error b/tests/parser-test-files/bad-files/parse-cond.1.error deleted file mode 100644 index 18358d46f..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed cond expression - --> test:4:16 - | - 4 | (define x (cond)) - | ^ expected one or more clauses diff --git a/tests/parser-test-files/bad-files/parse-cond.2.coal b/tests/parser-test-files/bad-files/parse-cond.2.coal deleted file mode 100644 index 05f75ad28..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.2.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Cond -(package test-package) - -(define x (cond 1)) diff --git a/tests/parser-test-files/bad-files/parse-cond.2.error b/tests/parser-test-files/bad-files/parse-cond.2.error deleted file mode 100644 index fc69770ff..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed cond clause - --> test:4:16 - | - 4 | (define x (cond 1)) - | ^ expected list diff --git a/tests/parser-test-files/bad-files/parse-cond.3.coal b/tests/parser-test-files/bad-files/parse-cond.3.coal deleted file mode 100644 index 1dd33943c..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.3.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Cond -(package test-package) - -(define x (cond (1 2 . 3))) diff --git a/tests/parser-test-files/bad-files/parse-cond.3.error b/tests/parser-test-files/bad-files/parse-cond.3.error deleted file mode 100644 index 522a6fad7..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.3.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed cond clause - --> test:4:16 - | - 4 | (define x (cond (1 2 . 3))) - | ^^^^^^^^^ unexpected dotted list diff --git a/tests/parser-test-files/bad-files/parse-cond.4.coal b/tests/parser-test-files/bad-files/parse-cond.4.coal deleted file mode 100644 index 2cc68d7e5..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.4.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Cond -(package test-package) - -(define x (cond (y))) diff --git a/tests/parser-test-files/bad-files/parse-cond.4.error b/tests/parser-test-files/bad-files/parse-cond.4.error deleted file mode 100644 index 56b43e41e..000000000 --- a/tests/parser-test-files/bad-files/parse-cond.4.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed function - --> test:4:19 - | - 4 | (define x (cond (y))) - | ^ expected body diff --git a/tests/parser-test-files/bad-files/parse-continue.1.coal b/tests/parser-test-files/bad-files/parse-continue.1.coal deleted file mode 100644 index cf49c3fcf..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Continue -(package test-parser) - -(define f (continue)) diff --git a/tests/parser-test-files/bad-files/parse-continue.1.error b/tests/parser-test-files/bad-files/parse-continue.1.error deleted file mode 100644 index c4951ebba..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid continue - --> test:4:10 - | - 4 | (define f (continue)) - | ^^^^^^^^^^ continue does not appear in an enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-continue.2.coal b/tests/parser-test-files/bad-files/parse-continue.2.coal deleted file mode 100644 index dd3587c75..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.2.coal +++ /dev/null @@ -1,6 +0,0 @@ -;; BAD: Parse Continue -(package test-parser) - -(define f - (loop :foo - (continue notakeyword))) diff --git a/tests/parser-test-files/bad-files/parse-continue.2.error b/tests/parser-test-files/bad-files/parse-continue.2.error deleted file mode 100644 index a16d44f77..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid argument in continue - --> test:6:4 - | - 6 | (continue notakeyword))) - | ^^^^^^^^^^^^^^^^^^^^^^ expected a keyword diff --git a/tests/parser-test-files/bad-files/parse-continue.3.coal b/tests/parser-test-files/bad-files/parse-continue.3.coal deleted file mode 100644 index 57e593aaf..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.3.coal +++ /dev/null @@ -1,6 +0,0 @@ -;; BAD: Parse Continue -(package test-parser) - -(define f - (loop :foo - (continue :not-foo))) diff --git a/tests/parser-test-files/bad-files/parse-continue.3.error b/tests/parser-test-files/bad-files/parse-continue.3.error deleted file mode 100644 index 1cdcd0038..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.3.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid label in continue - --> test:6:14 - | - 6 | (continue :not-foo))) - | ^^^^^^^^ label not found in any enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-continue.4.coal b/tests/parser-test-files/bad-files/parse-continue.4.coal deleted file mode 100644 index 5c9fc9562..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.4.coal +++ /dev/null @@ -1,7 +0,0 @@ -;; BAD: Parse Continue -(package test-parser) - -(define f - (loop - (let ((continuer (fn () (continue)))) - (continuer)))) diff --git a/tests/parser-test-files/bad-files/parse-continue.4.error b/tests/parser-test-files/bad-files/parse-continue.4.error deleted file mode 100644 index f8b54027c..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.4.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid continue - --> test:6:28 - | - 6 | (let ((continuer (fn () (continue)))) - | ^^^^^^^^^^ continue does not appear in an enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-continue.5.coal b/tests/parser-test-files/bad-files/parse-continue.5.coal deleted file mode 100644 index a8cf5a06f..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.5.coal +++ /dev/null @@ -1,8 +0,0 @@ -;; BAD: Parse Continue -(package test-parser) - -(define f - (loop :blech - (let ((continuer (fn () (continue :blech)))) - (continuer)))) - diff --git a/tests/parser-test-files/bad-files/parse-continue.5.error b/tests/parser-test-files/bad-files/parse-continue.5.error deleted file mode 100644 index 4d88669f7..000000000 --- a/tests/parser-test-files/bad-files/parse-continue.5.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid label in continue - --> test:6:42 - | - 6 | (let ((continuer (fn () (continue :blech)))) - | ^^^^^^ label not found in any enclosing loop diff --git a/tests/parser-test-files/bad-files/parse-declare.1.coal b/tests/parser-test-files/bad-files/parse-declare.1.coal deleted file mode 100644 index 26606d9a0..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Invalid Declare -(package test-package) - -(declare) diff --git a/tests/parser-test-files/bad-files/parse-declare.1.error b/tests/parser-test-files/bad-files/parse-declare.1.error deleted file mode 100644 index 3db003698..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed declaration - --> test:4:0 - | - 4 | (declare) - | ^^^^^^^^^ expected body diff --git a/tests/parser-test-files/bad-files/parse-declare.2.coal b/tests/parser-test-files/bad-files/parse-declare.2.coal deleted file mode 100644 index d77ae48ae..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.2.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Declare -(package test-package) - -(declare x) diff --git a/tests/parser-test-files/bad-files/parse-declare.2.error b/tests/parser-test-files/bad-files/parse-declare.2.error deleted file mode 100644 index b8f871f8f..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed declaration - --> test:4:0 - | - 4 | (declare x) - | ^^^^^^^^^^^ expected declared type diff --git a/tests/parser-test-files/bad-files/parse-declare.3.coal b/tests/parser-test-files/bad-files/parse-declare.3.coal deleted file mode 100644 index dc36f72ac..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.3.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Declare -(package test-package) - -(declare x (T -> T) z) diff --git a/tests/parser-test-files/bad-files/parse-declare.3.error b/tests/parser-test-files/bad-files/parse-declare.3.error deleted file mode 100644 index 2223b8ec7..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.3.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed declaration - --> test:4:20 - | - 4 | (declare x (T -> T) z) - | ^ unexpected trailing form diff --git a/tests/parser-test-files/bad-files/parse-declare.4.coal b/tests/parser-test-files/bad-files/parse-declare.4.coal deleted file mode 100644 index 4e687049c..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.4.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Declare -(package test-package) - -(declare "x" 5) diff --git a/tests/parser-test-files/bad-files/parse-declare.4.error b/tests/parser-test-files/bad-files/parse-declare.4.error deleted file mode 100644 index 640e2bcd3..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.4.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed declaration - --> test:4:9 - | - 4 | (declare "x" 5) - | ^^^ expected symbol diff --git a/tests/parser-test-files/bad-files/parse-declare.5.coal b/tests/parser-test-files/bad-files/parse-declare.5.coal deleted file mode 100644 index 3927da2ae..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.5.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Declare -(package test-package) - -(repr :enum) -(declare x T) diff --git a/tests/parser-test-files/bad-files/parse-declare.5.error b/tests/parser-test-files/bad-files/parse-declare.5.error deleted file mode 100644 index 5ad0ac517..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.5.error +++ /dev/null @@ -1,7 +0,0 @@ -error: Invalid target for repr attribute - --> test:4:0 - | - 4 | (repr :enum) - | ^^^^^^^^^^^^ repr must be attached to a define-type - 5 | (declare x T) - | ------------- when parsing declare diff --git a/tests/parser-test-files/bad-files/parse-declare.6.coal b/tests/parser-test-files/bad-files/parse-declare.6.coal deleted file mode 100644 index 0cc337354..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.6.coal +++ /dev/null @@ -1,6 +0,0 @@ -;; BAD: Parse Declare -(package test-pacakage) - -(monomorphize) -(monomorphize) -(declare f T) diff --git a/tests/parser-test-files/bad-files/parse-declare.6.error b/tests/parser-test-files/bad-files/parse-declare.6.error deleted file mode 100644 index a1366fc1d..000000000 --- a/tests/parser-test-files/bad-files/parse-declare.6.error +++ /dev/null @@ -1,9 +0,0 @@ -error: Duplicate monomorphize attribute - --> test:5:0 - | - 4 | (monomorphize) - | -------------- previous attribute here - 5 | (monomorphize) - | ^^^^^^^^^^^^^^ monomorphize attribute here - 6 | (declare f T) - | ------------- when parsing declare diff --git a/tests/parser-test-files/bad-files/parse-let.1.coal b/tests/parser-test-files/bad-files/parse-let.1.coal deleted file mode 100644 index 391e5a78c..000000000 --- a/tests/parser-test-files/bad-files/parse-let.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define f (let)) diff --git a/tests/parser-test-files/bad-files/parse-let.1.error b/tests/parser-test-files/bad-files/parse-let.1.error deleted file mode 100644 index 041fc68cd..000000000 --- a/tests/parser-test-files/bad-files/parse-let.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed let - --> test:4:15 - | - 4 | (define f (let)) - | ^ expected let binding list diff --git a/tests/parser-test-files/bad-files/parse-let.2.coal b/tests/parser-test-files/bad-files/parse-let.2.coal deleted file mode 100644 index 7e8d3474e..000000000 --- a/tests/parser-test-files/bad-files/parse-let.2.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define f (let ())) diff --git a/tests/parser-test-files/bad-files/parse-let.2.error b/tests/parser-test-files/bad-files/parse-let.2.error deleted file mode 100644 index 7abe7f95c..000000000 --- a/tests/parser-test-files/bad-files/parse-let.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed let - --> test:4:18 - | - 4 | (define f (let ())) - | ^ expected let body diff --git a/tests/parser-test-files/bad-files/parse-let.3.coal b/tests/parser-test-files/bad-files/parse-let.3.coal deleted file mode 100644 index 13b0a7ecb..000000000 --- a/tests/parser-test-files/bad-files/parse-let.3.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define f (let x 5)) diff --git a/tests/parser-test-files/bad-files/parse-let.3.error b/tests/parser-test-files/bad-files/parse-let.3.error deleted file mode 100644 index 261ad5992..000000000 --- a/tests/parser-test-files/bad-files/parse-let.3.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed let - --> test:4:15 - | - 4 | (define f (let x 5)) - | ^ expected binding list diff --git a/tests/parser-test-files/bad-files/parse-let.4.coal b/tests/parser-test-files/bad-files/parse-let.4.coal deleted file mode 100644 index 6fe68a7da..000000000 --- a/tests/parser-test-files/bad-files/parse-let.4.coal +++ /dev/null @@ -1,6 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define x - (let ((y 2 . 3)) - (* 2 y))) diff --git a/tests/parser-test-files/bad-files/parse-let.4.error b/tests/parser-test-files/bad-files/parse-let.4.error deleted file mode 100644 index ead89f916..000000000 --- a/tests/parser-test-files/bad-files/parse-let.4.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed let binding - --> test:5:8 - | - 5 | (let ((y 2 . 3)) - | ^^^^^^^^^ unexpected dotted list diff --git a/tests/parser-test-files/bad-files/parse-let.5.coal b/tests/parser-test-files/bad-files/parse-let.5.coal deleted file mode 100644 index 459555d93..000000000 --- a/tests/parser-test-files/bad-files/parse-let.5.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define f - (let ((x)) 5)) diff --git a/tests/parser-test-files/bad-files/parse-let.5.error b/tests/parser-test-files/bad-files/parse-let.5.error deleted file mode 100644 index 96f660ee6..000000000 --- a/tests/parser-test-files/bad-files/parse-let.5.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed let binding - --> test:5:10 - | - 5 | (let ((x)) 5)) - | ^ let bindings must have a value diff --git a/tests/parser-test-files/bad-files/parse-let.6.coal b/tests/parser-test-files/bad-files/parse-let.6.coal deleted file mode 100644 index 65e2f2ff2..000000000 --- a/tests/parser-test-files/bad-files/parse-let.6.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define f - (let (x) 5)) diff --git a/tests/parser-test-files/bad-files/parse-let.6.error b/tests/parser-test-files/bad-files/parse-let.6.error deleted file mode 100644 index e70b4d7d3..000000000 --- a/tests/parser-test-files/bad-files/parse-let.6.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed let binding - --> test:5:8 - | - 5 | (let (x) 5)) - | ^ expected list diff --git a/tests/parser-test-files/bad-files/parse-let.7.coal b/tests/parser-test-files/bad-files/parse-let.7.coal deleted file mode 100644 index 0c8820f20..000000000 --- a/tests/parser-test-files/bad-files/parse-let.7.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define f - (let ((x y z)) 5)) diff --git a/tests/parser-test-files/bad-files/parse-let.7.error b/tests/parser-test-files/bad-files/parse-let.7.error deleted file mode 100644 index 86b6aecb0..000000000 --- a/tests/parser-test-files/bad-files/parse-let.7.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed let binding - --> test:5:13 - | - 5 | (let ((x y z)) 5)) - | ^ unexpected trailing form diff --git a/tests/parser-test-files/bad-files/parse-let.8.coal b/tests/parser-test-files/bad-files/parse-let.8.coal deleted file mode 100644 index 75850cbbd..000000000 --- a/tests/parser-test-files/bad-files/parse-let.8.coal +++ /dev/null @@ -1,6 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define x - (let ((declare x (T -> T) 5)) - "x")) diff --git a/tests/parser-test-files/bad-files/parse-let.8.error b/tests/parser-test-files/bad-files/parse-let.8.error deleted file mode 100644 index 7679dcacf..000000000 --- a/tests/parser-test-files/bad-files/parse-let.8.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed declare - --> test:5:28 - | - 5 | (let ((declare x (T -> T) 5)) - | ^ unexpected form diff --git a/tests/parser-test-files/bad-files/parse-let.9.coal b/tests/parser-test-files/bad-files/parse-let.9.coal deleted file mode 100644 index 9f6a6c3fb..000000000 --- a/tests/parser-test-files/bad-files/parse-let.9.coal +++ /dev/null @@ -1,6 +0,0 @@ -;; BAD: Parse Let -(package test-package) - -(define x - (let ((declare 5 (T -> T))) - "x")) diff --git a/tests/parser-test-files/bad-files/parse-let.9.error b/tests/parser-test-files/bad-files/parse-let.9.error deleted file mode 100644 index cdbc14517..000000000 --- a/tests/parser-test-files/bad-files/parse-let.9.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid variable - --> test:5:17 - | - 5 | (let ((declare 5 (T -> T))) - | ^ expected identifier diff --git a/tests/parser-test-files/bad-files/parse-toplevel.1.coal b/tests/parser-test-files/bad-files/parse-toplevel.1.coal deleted file mode 100644 index 4c5c9f4c2..000000000 --- a/tests/parser-test-files/bad-files/parse-toplevel.1.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Toplevel -(package test-package) - -((define) x 5) diff --git a/tests/parser-test-files/bad-files/parse-toplevel.1.error b/tests/parser-test-files/bad-files/parse-toplevel.1.error deleted file mode 100644 index 14c6e0a49..000000000 --- a/tests/parser-test-files/bad-files/parse-toplevel.1.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Malformed toplevel form - --> test:4:1 - | - 4 | ((define) x 5) - | ^^^^^^^^ unexpected list diff --git a/tests/parser-test-files/bad-files/parse-toplevel.2.coal b/tests/parser-test-files/bad-files/parse-toplevel.2.coal deleted file mode 100644 index 267b1bdba..000000000 --- a/tests/parser-test-files/bad-files/parse-toplevel.2.coal +++ /dev/null @@ -1,4 +0,0 @@ -;; BAD: Parse Toplevel -(package test-package) - -(unknown) diff --git a/tests/parser-test-files/bad-files/parse-toplevel.2.error b/tests/parser-test-files/bad-files/parse-toplevel.2.error deleted file mode 100644 index b33564990..000000000 --- a/tests/parser-test-files/bad-files/parse-toplevel.2.error +++ /dev/null @@ -1,5 +0,0 @@ -error: Invalid toplevel form - --> test:4:1 - | - 4 | (unknown) - | ^^^^^^^ unknown toplevel form diff --git a/tests/parser-test-files/good-files/parse-break.coal b/tests/parser-test-files/good-files/parse-break.coal deleted file mode 100644 index 3333bd726..000000000 --- a/tests/parser-test-files/good-files/parse-break.coal +++ /dev/null @@ -1,30 +0,0 @@ -;; GOOD: Parse Break -(package test-package) - -(define f - (loop - (break))) - -(define g - (for x in "hello" - (break))) - -(define h - (while true - (break))) - -(define k - (while-let (Some x) = (get-next) - (break))) - -(define m - (loop :alabel (break))) - -(define n - (loop :alabel - (break :alabel))) - - -(define o - (while :somelabel true - (break :somelabel))) diff --git a/tests/parser-test-files/good-files/parse-continue.coal b/tests/parser-test-files/good-files/parse-continue.coal deleted file mode 100644 index 8644f4f37..000000000 --- a/tests/parser-test-files/good-files/parse-continue.coal +++ /dev/null @@ -1,29 +0,0 @@ -;; GOOD: Parse Continue -(package test-package) - -(define f - (loop - (continue))) - -(define g - (for x in "hello" - (continue))) - -(define h - (while true - (continue))) - -(define k - (while-let (Some x) = (get-next) - (continue))) -(define m - (loop :alabel (continue))) - -(define n - (loop :alabel - (continue :alabel))) - -(define o - (while :somelabel true - (loop :anotherlabel - (continue :somelabel)))) diff --git a/tests/parser-test-files/good-files/parse-let.coal b/tests/parser-test-files/good-files/parse-let.coal deleted file mode 100644 index 7035cf1ea..000000000 --- a/tests/parser-test-files/good-files/parse-let.coal +++ /dev/null @@ -1,10 +0,0 @@ -;; GOOD: Parse Let -(package test-package) - -(define x - (let ((y 5)) - y)) - -(define x - (let () - 5)) diff --git a/tests/parser-test-files/good-files/parse-toplevel.coal b/tests/parser-test-files/good-files/parse-toplevel.coal deleted file mode 100644 index 5e7e5b0af..000000000 --- a/tests/parser-test-files/good-files/parse-toplevel.coal +++ /dev/null @@ -1,5 +0,0 @@ -;; GOOD: Parse Toplevel -(package test-package) - -(monomorphize) -(declare x T) diff --git a/tests/parser-test-files/parse-and.txt b/tests/parser-test-files/parse-and.txt new file mode 100644 index 000000000..cc829a612 --- /dev/null +++ b/tests/parser-test-files/parse-and.txt @@ -0,0 +1,15 @@ +================================================================================ +Malformed and expression +================================================================================ + +(package test-package) + +(define x (and)) + +-------------------------------------------------------------------------------- + +error: Malformed and expression + --> test:3:15 + | + 3 | (define x (and)) + | ^ expected one or more arguments diff --git a/tests/parser-test-files/parse-attribute.txt b/tests/parser-test-files/parse-attribute.txt new file mode 100644 index 000000000..57344d899 --- /dev/null +++ b/tests/parser-test-files/parse-attribute.txt @@ -0,0 +1,117 @@ +================================================================================ +Orphan attribute +================================================================================ + +(package test-package) + +(repr :enum) + +-------------------------------------------------------------------------------- + +error: Orphan attribute + --> test:3:0 + | + 3 | (repr :enum) + | ^^^^^^^^^^^^ attribute must be attached to another form + +================================================================================ +Malformed monomophize attribute +================================================================================ + +(package test-package) + +(monomorphize 5) +(define x 5) + +-------------------------------------------------------------------------------- + +error: Malformed monomophize attribute + --> test:3:0 + | + 3 | (monomorphize 5) + | ^^^^^^^^^^^^^^^^ unexpected form + +================================================================================ +Invalid type variable +================================================================================ + +(package test-package) + +(repr (:enum)) +(define-type T) + +-------------------------------------------------------------------------------- + +error: Invalid type variable + --> test:3:6 + | + 3 | (repr (:enum)) + | ^^^^^^^ expected keyword symbol + +================================================================================ +Malformed repr attribute +================================================================================ + +(package test-package) + +(repr :enum 5) +(define-type T) + +-------------------------------------------------------------------------------- + +error: Malformed repr attribute + --> test:3:12 + | + 3 | (repr :enum 5) + | ^ unexpected form + +================================================================================ +Malformed repr :native attribute +================================================================================ + +(package test-package) + +(repr :native) +(define-type T) + +-------------------------------------------------------------------------------- + +error: Malformed repr :native attribute + --> test:3:14 + | + 3 | (repr :native) + | ^ expected a lisp type + +================================================================================ +Malformed repr :native attribute +================================================================================ + +(package test-package) + +(repr :native :native :native) +(define-type T) + +-------------------------------------------------------------------------------- + +error: Malformed repr :native attribute + --> test:3:6 + | + 3 | (repr :native :native :native) + | ^^^^^^^ unexpected form + +================================================================================ +Unknown repr attribute +================================================================================ + +(package test-package) + +(repr :hello) +(define-type T) + +-------------------------------------------------------------------------------- + +error: Unknown repr attribute + --> test:3:6 + | + 3 | (repr :hello) + | ^^^^^^ expected one of :lisp, :transparent, :enum, or :native diff --git a/tests/parser-test-files/parse-body.txt b/tests/parser-test-files/parse-body.txt new file mode 100644 index 000000000..07aa97b72 --- /dev/null +++ b/tests/parser-test-files/parse-body.txt @@ -0,0 +1,87 @@ +================================================================================ +Malformed function +================================================================================ + +(package test-package) + +(define x (progn)) + +-------------------------------------------------------------------------------- + +error: Malformed function + --> test:3:17 + | + 3 | (define x (progn)) + | ^ expected body + +================================================================================ +Malformed expression +================================================================================ + +(package test-package) + +(define x (progn 1 2 . 3)) + +-------------------------------------------------------------------------------- + +error: Malformed expression + --> test:3:10 + | + 3 | (define x (progn 1 2 . 3)) + | ^^^^^^^^^^^^^^^ unexpected dotted list + +================================================================================ +Malformed body expression +================================================================================ + +(package test-package) + +(define x + (progn + (let x = 5 . 5) + x)) + +-------------------------------------------------------------------------------- + +error: Malformed body expression + --> test:5:4 + | + 5 | (let x = 5 . 5) + | ^^^^^^^^^^^^^^^ unexpected dotted list + +================================================================================ +Malformed body expression +================================================================================ + +(package test-package) + +(define x + (progn + (let x = 5))) + +-------------------------------------------------------------------------------- + +error: Malformed body expression + --> test:5:4 + | + 5 | (let x = 5))) + | ^^^^^^^^^^^ body forms cannot be terminated by a shorthand let + +================================================================================ +Malformed shorthand let +================================================================================ + +(package test-package) + +(define x + (progn + (let x = 1 2) + x)) + +-------------------------------------------------------------------------------- + +error: Malformed shorthand let + --> test:5:15 + | + 5 | (let x = 1 2) + | ^ unexpected trailing form diff --git a/tests/parser-test-files/parse-break.txt b/tests/parser-test-files/parse-break.txt new file mode 100644 index 000000000..04ec2e5cb --- /dev/null +++ b/tests/parser-test-files/parse-break.txt @@ -0,0 +1,140 @@ +================================================================================ +Parse break +================================================================================ + +(package coalton-unit-tests) + +(define f + (loop + (break))) + +================================================================================ +Parse break +================================================================================ + +(package coalton-unit-tests) + +(define f + (for x in "hello" + (break))) + +================================================================================ +Parse break +================================================================================ + +(package coalton-unit-tests) + +(define f + (while true + (break))) + +================================================================================ +Parse break: in while-let +================================================================================ + +(package coalton-unit-tests/parse-break + (import coalton-prelude + (coalton-library/cell as cell) + (coalton-library/iterator as iter))) + +(define (f) + (let ((iter (iter:up-to 10))) + (while-let + (Some n) = (iter:next! iter) + (break)))) + +================================================================================ +Parse break +================================================================================ + +(package coalton-unit-tests) + +(define f + (loop :alabel (break))) + +================================================================================ +Parse break +================================================================================ + +(package coalton-unit-tests) + +(define f + (loop :alabel + (break :alabel))) + +================================================================================ +Parse break +================================================================================ + +(package coalton-unit-tests) + +(define f + (while :somelabel true + (break :somelabel))) + +================================================================================ +Invalid break +================================================================================ + +(package test-parser) + +(define f (break)) + +-------------------------------------------------------------------------------- + +error: Invalid break + --> test:3:10 + | + 3 | (define f (break)) + | ^^^^^^^ break does not appear in an enclosing loop + +================================================================================ +Invalid label in break +================================================================================ + +(package test-parser) + +(define f + (while :x True (break :y))) + +-------------------------------------------------------------------------------- + +error: Invalid label in break + --> test:4:24 + | + 4 | (while :x True (break :y))) + | ^^ label not found in any enclosing loop + +================================================================================ +Invalid label in break +================================================================================ + +(package test-parser) + +(define f + (while :x True (return (fn () (break :x))))) + +-------------------------------------------------------------------------------- + +error: Invalid label in break + --> test:4:39 + | + 4 | (while :x True (return (fn () (break :x))))) + | ^^ label not found in any enclosing loop + +================================================================================ +Invalid break +================================================================================ + +(package test-parser) + +(define f + (while True (return (fn () (break))))) + +-------------------------------------------------------------------------------- + +error: Invalid break + --> test:4:29 + | + 4 | (while True (return (fn () (break))))) + | ^^^^^^^ break does not appear in an enclosing loop diff --git a/tests/parser-test-files/parse-cond.txt b/tests/parser-test-files/parse-cond.txt new file mode 100644 index 000000000..98eca9c7e --- /dev/null +++ b/tests/parser-test-files/parse-cond.txt @@ -0,0 +1,63 @@ +================================================================================ +Malformed cond expression +================================================================================ + +(package test-package) + +(define x (cond)) + +-------------------------------------------------------------------------------- + +error: Malformed cond expression + --> test:3:16 + | + 3 | (define x (cond)) + | ^ expected one or more clauses + +================================================================================ +Malformed cond clause +================================================================================ + +(package test-package) + +(define x (cond 1)) + +-------------------------------------------------------------------------------- + +error: Malformed cond clause + --> test:3:16 + | + 3 | (define x (cond 1)) + | ^ expected list + +================================================================================ +Malformed cond clause +================================================================================ + +(package test-package) + +(define x (cond (1 2 . 3))) + +-------------------------------------------------------------------------------- + +error: Malformed cond clause + --> test:3:16 + | + 3 | (define x (cond (1 2 . 3))) + | ^^^^^^^^^ unexpected dotted list + +================================================================================ +Malformed function +================================================================================ + +(package test-package) + +(define x (cond (y))) + +-------------------------------------------------------------------------------- + +error: Malformed function + --> test:3:19 + | + 3 | (define x (cond (y))) + | ^ expected body diff --git a/tests/parser-test-files/parse-continue.txt b/tests/parser-test-files/parse-continue.txt new file mode 100644 index 000000000..0edaf4aae --- /dev/null +++ b/tests/parser-test-files/parse-continue.txt @@ -0,0 +1,164 @@ +================================================================================ +1 Parse continue +================================================================================ + +(package coalton-unit-tests) + +(define (f) + (loop + (continue))) + +================================================================================ +2 Parse continue +================================================================================ + +(package coalton-unit-tests) + +(define (f) + (for x in "hello" + (continue))) + +================================================================================ +Parse continue +================================================================================ + +(package coalton-unit-tests) + +(define (f) + (while true + (continue))) + +================================================================================ +Parse continue +================================================================================ + +(package coalton-unit-tests/parse-continue + (import coalton-prelude + (coalton-library/iterator as iter))) + +(define (f) + (let ((iter (iter:up-to 10))) + (while-let + (Some n) = (iter:next! iter) + (continue)))) + +================================================================================ +Parse continue +================================================================================ + +(package coalton-unit-tests) + +(define (f) + (loop :alabel (continue))) + +================================================================================ +Parse continue +================================================================================ + +(package coalton-unit-tests) + +(define (f) + (loop :alabel + (continue :alabel))) + +================================================================================ +Parse continue +================================================================================ + +(package coalton-unit-tests) + +(define (f) + (while :somelabel true + (loop :anotherlabel + (continue :somelabel)))) + +================================================================================ +Invalid continue +================================================================================ + +(package test-parser) + +(define f (continue)) + +-------------------------------------------------------------------------------- + +error: Invalid continue + --> test:3:10 + | + 3 | (define f (continue)) + | ^^^^^^^^^^ continue does not appear in an enclosing loop + +================================================================================ +Invalid argument in continue +================================================================================ + +(package test-parser) + +(define f + (loop :foo + (continue notakeyword))) + +-------------------------------------------------------------------------------- + +error: Invalid argument in continue + --> test:5:4 + | + 5 | (continue notakeyword))) + | ^^^^^^^^^^^^^^^^^^^^^^ expected a keyword + +================================================================================ +Invalid label in continue +================================================================================ + +(package test-parser) + +(define f + (loop :foo + (continue :not-foo))) + +-------------------------------------------------------------------------------- + +error: Invalid label in continue + --> test:5:14 + | + 5 | (continue :not-foo))) + | ^^^^^^^^ label not found in any enclosing loop + +================================================================================ +Invalid continue +================================================================================ + +(package test-parser) + +(define f + (loop + (let ((continuer (fn () (continue)))) + (continuer)))) + +-------------------------------------------------------------------------------- + +error: Invalid continue + --> test:5:28 + | + 5 | (let ((continuer (fn () (continue)))) + | ^^^^^^^^^^ continue does not appear in an enclosing loop + +================================================================================ +Invalid label in continue +================================================================================ + +(package test-parser) + +(define f + (loop :blech + (let ((continuer (fn () (continue :blech)))) + (continuer)))) + + +-------------------------------------------------------------------------------- + +error: Invalid label in continue + --> test:5:42 + | + 5 | (let ((continuer (fn () (continue :blech)))) + | ^^^^^^ label not found in any enclosing loop diff --git a/tests/parser-test-files/parse-declare.txt b/tests/parser-test-files/parse-declare.txt new file mode 100644 index 000000000..fd92c6e74 --- /dev/null +++ b/tests/parser-test-files/parse-declare.txt @@ -0,0 +1,104 @@ +================================================================================ +Malformed declaration +================================================================================ + +(package test-package) + +(declare) + +-------------------------------------------------------------------------------- + +error: Malformed declaration + --> test:3:0 + | + 3 | (declare) + | ^^^^^^^^^ expected body + +================================================================================ +Malformed declaration +================================================================================ + +(package test-package) + +(declare x) + +-------------------------------------------------------------------------------- + +error: Malformed declaration + --> test:3:0 + | + 3 | (declare x) + | ^^^^^^^^^^^ expected declared type + +================================================================================ +Malformed declaration +================================================================================ + +(package test-package) + +(declare x (T -> T) z) + +-------------------------------------------------------------------------------- + +error: Malformed declaration + --> test:3:20 + | + 3 | (declare x (T -> T) z) + | ^ unexpected trailing form + +================================================================================ +Malformed declaration +================================================================================ + +(package test-package) + +(declare "x" 5) + +-------------------------------------------------------------------------------- + +error: Malformed declaration + --> test:3:9 + | + 3 | (declare "x" 5) + | ^^^ expected symbol + +================================================================================ +Invalid target for repr attribute +================================================================================ + +(package test-package) + +(repr :enum) +(declare x T) + +-------------------------------------------------------------------------------- + +error: Invalid target for repr attribute + --> test:3:0 + | + 3 | (repr :enum) + | ^^^^^^^^^^^^ repr must be attached to a define-type + 4 | (declare x T) + | ------------- when parsing declare + +================================================================================ +Duplicate monomorphize attribute +================================================================================ + +(package test-pacakage) + +(monomorphize) +(monomorphize) +(declare f T) + +-------------------------------------------------------------------------------- + +error: Duplicate monomorphize attribute + --> test:4:0 + | + 3 | (monomorphize) + | -------------- previous attribute here + 4 | (monomorphize) + | ^^^^^^^^^^^^^^ monomorphize attribute here + 5 | (declare f T) + | ------------- when parsing declare diff --git a/tests/parser-test-files/parse-let.txt b/tests/parser-test-files/parse-let.txt new file mode 100644 index 000000000..c6e50dd1c --- /dev/null +++ b/tests/parser-test-files/parse-let.txt @@ -0,0 +1,172 @@ +================================================================================ +Parse let +================================================================================ + +(package coalton-unit-tests) + +(define x + (let ((y 5)) + y)) + +================================================================================ +Parse let +================================================================================ + +(package coalton-unit-tests) + +(define x + (let () + 5)) + +================================================================================ +Malformed let +================================================================================ + +(package test-package) + +(define f (let)) + +-------------------------------------------------------------------------------- + +error: Malformed let + --> test:3:15 + | + 3 | (define f (let)) + | ^ expected let binding list + +================================================================================ +Malformed let +================================================================================ + +(package test-package) + +(define f (let ())) + +-------------------------------------------------------------------------------- + +error: Malformed let + --> test:3:18 + | + 3 | (define f (let ())) + | ^ expected let body + +================================================================================ +Malformed let +================================================================================ + +(package test-package) + +(define f (let x 5)) + +-------------------------------------------------------------------------------- + +error: Malformed let + --> test:3:15 + | + 3 | (define f (let x 5)) + | ^ expected binding list + +================================================================================ +Malformed let binding +================================================================================ + +(package test-package) + +(define x + (let ((y 2 . 3)) + (* 2 y))) + +-------------------------------------------------------------------------------- + +error: Malformed let binding + --> test:4:8 + | + 4 | (let ((y 2 . 3)) + | ^^^^^^^^^ unexpected dotted list + +================================================================================ +Malformed let binding +================================================================================ + +(package test-package) + +(define f + (let ((x)) 5)) + +-------------------------------------------------------------------------------- + +error: Malformed let binding + --> test:4:10 + | + 4 | (let ((x)) 5)) + | ^ let bindings must have a value + +================================================================================ +Malformed let binding +================================================================================ + +(package test-package) + +(define f + (let (x) 5)) + +-------------------------------------------------------------------------------- + +error: Malformed let binding + --> test:4:8 + | + 4 | (let (x) 5)) + | ^ expected list + +================================================================================ +Malformed let binding +================================================================================ + +(package test-package) + +(define f + (let ((x y z)) 5)) + +-------------------------------------------------------------------------------- + +error: Malformed let binding + --> test:4:13 + | + 4 | (let ((x y z)) 5)) + | ^ unexpected trailing form + +================================================================================ +Malformed declare +================================================================================ + +(package test-package) + +(define x + (let ((declare x (T -> T) 5)) + "x")) + +-------------------------------------------------------------------------------- + +error: Malformed declare + --> test:4:28 + | + 4 | (let ((declare x (T -> T) 5)) + | ^ unexpected form + +================================================================================ +Invalid variable +================================================================================ + +(package test-package) + +(define x + (let ((declare 5 (T -> T))) + "x")) + +-------------------------------------------------------------------------------- + +error: Invalid variable + --> test:4:17 + | + 4 | (let ((declare 5 (T -> T))) + | ^ expected identifier diff --git a/tests/parser-test-files/parse-toplevel.txt b/tests/parser-test-files/parse-toplevel.txt new file mode 100644 index 000000000..db7332feb --- /dev/null +++ b/tests/parser-test-files/parse-toplevel.txt @@ -0,0 +1,41 @@ +================================================================================ +Parse toplevel +================================================================================ + +(package coalton-unit-tests) + +(monomorphize) +(declare x UFix) +(define x 2) + +================================================================================ +Malformed toplevel form +================================================================================ + +(package test-package) + +((define) x 5) + +-------------------------------------------------------------------------------- + +error: Malformed toplevel form + --> test:3:1 + | + 3 | ((define) x 5) + | ^^^^^^^^ unexpected list + +================================================================================ +Invalid toplevel form +================================================================================ + +(package test-package) + +(unknown) + +-------------------------------------------------------------------------------- + +error: Invalid toplevel form + --> test:3:1 + | + 3 | (unknown) + | ^^^^^^^ unknown toplevel form diff --git a/tests/parser-tests.lisp b/tests/parser-tests.lisp index 7719fb41a..d339823d6 100644 --- a/tests/parser-tests.lisp +++ b/tests/parser-tests.lisp @@ -42,6 +42,15 @@ (run-test-file "tests/parser-test-files/lisp-toplevel.txt")) (run-test-file "tests/parser-test-files/lisp-toplevel-forbid.txt") (run-test-file "tests/parser-test-files/package.txt") + (run-test-file "tests/parser-test-files/parse-and.txt") + (run-test-file "tests/parser-test-files/parse-attribute.txt") + (run-test-file "tests/parser-test-files/parse-body.txt") + (run-test-file "tests/parser-test-files/parse-break.txt") + (run-test-file "tests/parser-test-files/parse-cond.txt") + (run-test-file "tests/parser-test-files/parse-continue.txt") + (run-test-file "tests/parser-test-files/parse-declare.txt") + (run-test-file "tests/parser-test-files/parse-let.txt") + (run-test-file "tests/parser-test-files/parse-toplevel.txt") (run-test-file "tests/parser-test-files/hashtable.txt") (run-test-file "tests/parser-test-files/fundeps.txt") (run-test-file "tests/parser-test-files/recursive-let.txt")