Idorobots / spartan

A small Lisp dialect that serves me as a test bed for programming language features.
MIT License
13 stars 3 forks source link

&body and &application expanders can be called explicitly #191

Closed Idorobots closed 1 week ago

Idorobots commented 2 months ago
2 | (&application (display 23))
;; repl(2,1): Bad call syntax, expected at least one expression within the call:
;;   1 | 23
;;   2 | (&application (display 23))
;;     |  ^^^^^^^^^^^^
;;   3 | 
2 | (&yield-cont display 23)
;; repl(2,1): Undefined variable `&yield-cont`:
;;   1 | 23
;;   2 | (&yield-cont display 23)
;;     |  ^^^^^^^^^^^
;;   3 | 
2 | (&body 1 2 3)
.../compiler/errors.rkt(191,0): compiler-bug
.../expander/expander.rkt(15,0): expand
.../private/map.rkt(40,19): loop
.../private/map.rkt(40,19): loop
.../expander/syntax-forms.rkt(303,2): body-expander
.../compiler/errors.rkt(35,0): collect-errors
.../passes/macro-expander.rkt(22,8): #f
.../private/list.rkt(248,4): foldl
.../src/repl.rkt(254,6): run-laxed
?(?,?): body of '#%mzc:sprtn
;; Error: Likely a compiler bug! Invalid ast-body object #(struct:ast-node list (3 . 16) #f #f () () (#(struct:ast-node symbol (4 . 9) #f #f () () &body) #(struct:ast-node number (10 . 11) #f #f () () 1) #(struct:ast-node number (12 . 13) #f #f () () 2) #(struct:ast-node number (14 . 15) #f #f () () 3)))

All of the above should complain of undefined variables.