3 * A file full of terribleness, to check error reporting and recovery.
5 * (c) 2019 Straylight/Edgeware
8 /* The reference file for this test isn't intended to be normative: it's fine
9 * if things are reordered, or messages are rephrased. But it's good to know
10 * when these things change, and besides this approach is way easier than the
18 lisp ;this is actually a comment
19 (format t ";; Hello from Lisp!~%")
20 /* and this is the statement terminator */;
23 (define-pluggable-parser module test (scanner pset)
25 (declare (ignore pset))
26 (with-parser-context (token-scanner-context :scanner scanner)
27 (parse (seq ("demo" (string (must :string)) (nil (must #\;)))
28 (format t ";; DEMO ~S~%" string)))));
31 code c: user ( not like this '' 'xyz' );
38 void wrong.frob() { ... }
43 int filler, y(), .z[45], q;
44 int wrong.fizzbuzz(int n) extern;
45 wtf.y = 19, wrong.z = 69, x.= r;
46 int (*bogon)(const char *) { return strlen(p); }
49 class Fail: SodObject { void badkw(?int x) extern; void ebw(?) extern; }
50 class Unlikely: Fail { void fail.badkw(?double y) extern; }
51 class Whoops: Fail { void fail.badkw(?int y) extern; }
52 class Arrgh: Unlikely, Whoops {
53 void fail.badkw(?double x) extern;
54 void fail.ebw(?) extern;
57 [nick = join] class JSuper: SodObject { }
58 [nick = sub] class LSub: JSuper { }
59 [nick = sub] class RSub: JSuper { }
60 [nick = join] class BadNicks: LSub, RSub { }
61 class Super: SodObject { }
63 class Right: Super { }
64 class Join: Left, Right { }
65 class Nioj: Right, Left { }
66 class Splinch: Join, SodObject, Nioj { }
67 [link = Super] class Hopeless: Wrong { }
70 class MyClass: SodClass {
75 class MyOtherClass: SodClass { }
77 [metaclass = MyClass, link = SodObject]
78 class MyObject: SodObject {
79 class myclass.foo = 42;
82 [metaclass = MyOtherClass] class MyOtherObject: SodObject { }
83 class WhichMetaClass: MyObject, MyOtherObject { }
87 class hopeful: dismissed