formatter: handle multi-quoted expressions

This commit is contained in:
Tyler Wilding
2024-05-25 13:25:39 -04:00
parent e67a3ea4c3
commit 005fd46a96
5 changed files with 99 additions and 21 deletions
+2 -2
View File
@@ -154,7 +154,7 @@
'readwrite (or 'rw) means both
#f means neither, turning this into a fancy macro around rlet."
`(rlet (,@(apply (lambda (x) `(,x :class vf)) regs))
,@(if (or (eq? rw 'read) (eq? rw 'readwrite) (eq? rw 'rw)) (apply (lambda (y) `(load-vf ,y)) regs) '())
,@(if (or (eq? rw ''read) (eq? rw ''readwrite) (eq? rw ''rw)) (apply (lambda (y) `(load-vf ,y)) regs) '())
,@body
;; this will mess up the return value!
,@(if (or (eq? rw 'write) (eq? rw 'readwrite) (eq? rw 'rw)) (apply (lambda (y) `(save-vf ,y)) regs) '())))
,@(if (or (eq? rw ''write) (eq? rw ''readwrite) (eq? rw ''rw)) (apply (lambda (y) `(save-vf ,y)) regs) '())))
+3 -3
View File
@@ -197,13 +197,13 @@
(defmacro dm-lambda-boolean-flag (val)
"helper macro for making boolean buttons that don't just access symbols directly"
`(lambda (arg (msg debug-menu-msg))
`,(lambda (arg (msg debug-menu-msg))
(if (= msg (debug-menu-msg press)) (not! ,val))
,val))
(defmacro dm-lambda-int-var (val)
"helper macro for making int buttons"
`(lambda (arg (msg debug-menu-msg) (newval int))
`,(lambda (arg (msg debug-menu-msg) (newval int))
(cond
((= msg (debug-menu-msg press)) (set! ,val newval))
(else ,val))))
@@ -217,7 +217,7 @@
(defmacro dm-lambda-meters-var (val)
"helper macro for making meters buttons"
`(lambda (arg (msg debug-menu-msg) (newval float))
`,(lambda (arg (msg debug-menu-msg) (newval float))
(cond
((= msg (debug-menu-msg press)) (set! ,val (meters newval)))
(else (* (1/ METER_LENGTH) ,val)))))