needs tests/harness comp/oberon comp/oberon/ast testbegin obtok$ :~ ['] .ast capture #s[]= ; : ast" [rcompile] " ast< read; ~ ; : designator" [rcompile] " designator< read; ~ ; \test lit ast"(lit 0000002a)" 42; ast"(lit cafe1234)" 0CAFE1234H; \test char ast"(char 78)" 78X; ast"(char fa)" 0FAX; ast"(char 41)" 'A'; \test ident ast"(ident foo)" foo; ast"(ident CAFE1234H)" CAFE1234H; ast"(ident FAX)" FAX; \test ident. \ "DUSK" is an auto-created module ast"(ident. DUSK foo)" DUSK.foo; \test ` ast"(funcall (` allot@))" `allot@ (); \test prefix unary ast"(neg (ident a))" -a; ast"(~ (ident a))" ~a; ast"(ident a)" +a; \ yup, a "+" prefix does nothing ast"(~ (ident a))" ~(a); \test postfix unary ast"(^ (ident a))" a^; \test . ast"(. b (ident a))" a.b; \test [] ast"([] (ident a) (+ (ident b) (ident c)))" a[b+c]; \test binops ast"(+ (ident a) (ident b))" a+b; \test binops priority ast"(+ (* (ident a) (ident b)) (ident c))" a*b+c; ast"(+ (ident a) (* (ident b) (ident c)))" a+b*c; ast"(* (+ (ident a) (ident b)) (ident c))" (a+b)*c; ast"(* (ident a) (+ (ident b) (ident c)))" a*(b+c); ast"(+ (* (ident a) (ident b)) (/ (ident c) (ident d)))" a*b+c/d; ast"(< (+ (ident a) (* (ident b) (ident c))) (ident d))" a+b*c