macro-stepper: track syntax-local-value and syntax-track-origin (not done)
original commit: dbdf00c5f713ab5eaed70b8e6d35f32b2349aa5c
This commit is contained in:
parent
4e3fc8fc99
commit
2d29222912
|
@ -39,6 +39,8 @@
|
|||
(define-struct local-lift-require (req expr mexpr) #:transparent)
|
||||
(define-struct local-lift-provide (prov) #:transparent)
|
||||
(define-struct local-bind (names ?1 renames bindrhs) #:transparent)
|
||||
(define-struct local-value (name ?1 resolves bound?) #:transparent)
|
||||
(define-struct track-origin (before after) #:transparent)
|
||||
(define-struct local-remark (contents) #:transparent)
|
||||
;; contents : (listof (U string syntax))
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
enter-check exit-check
|
||||
local-post exit-local exit-local/expr
|
||||
local-bind enter-bind exit-bind
|
||||
local-value-result
|
||||
phase-up module-body
|
||||
renames-lambda
|
||||
renames-case-lambda
|
||||
|
@ -201,6 +202,10 @@
|
|||
(make local-bind $1 $2 $3 #f)]
|
||||
[(local-bind rename-list (? BindSyntaxes))
|
||||
(make local-bind $1 #f $2 $3)]
|
||||
[(track-origin)
|
||||
(make track-origin (car $1) (cdr $1))]
|
||||
[(local-value ! Resolves local-value-result)
|
||||
(make local-value $1 $2 $3 $4)]
|
||||
[(local-remark)
|
||||
(make local-remark $1)]
|
||||
[(local-artificial-step)
|
||||
|
|
|
@ -61,6 +61,10 @@
|
|||
|
||||
local-remark ; (listof (U string syntax))
|
||||
local-artificial-step ; (list syntax syntax syntax syntax)
|
||||
|
||||
track-origin ; (cons stx stx)
|
||||
local-value ; identifier
|
||||
local-value-result ; boolean
|
||||
))
|
||||
|
||||
(define-tokens renames-tokens
|
||||
|
@ -175,8 +179,10 @@
|
|||
(149 prim-varref)
|
||||
(150 lift-require ,token-lift-require)
|
||||
(151 lift-provide ,token-lift-provide)
|
||||
(155 prim-#%stratified-body)
|
||||
))
|
||||
(152 track-origin ,token-track-origin)
|
||||
(153 local-value ,token-local-value)
|
||||
(154 local-value-result ,token-local-value-result)
|
||||
(155 prim-#%stratified-body)))
|
||||
|
||||
(define (signal->symbol sig)
|
||||
(if (symbol? sig)
|
||||
|
|
|
@ -454,6 +454,15 @@
|
|||
;; FIXME: use renames
|
||||
[#:binders names]
|
||||
[#:when bindrhs => (BindSyntaxes bindrhs)]]]
|
||||
[(struct track-origin (before after))
|
||||
[R [#:set-syntax before]
|
||||
[#:pattern ?form]
|
||||
[#:rename ?form after 'track-origin]]]
|
||||
[(struct local-value (name ?1 resolves bound?))
|
||||
[R [! ?1]
|
||||
;; [#:learn (list name)]
|
||||
;; Add remark step?
|
||||
]]
|
||||
[(struct local-remark (contents))
|
||||
(R [#:reductions (list (walk/talk 'remark contents))])]))
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
(splice-module-lifts . "Splice lifted module declarations")
|
||||
|
||||
(remark . "Macro made a remark")
|
||||
(track-origin . "Macro called syntax-track-origin")
|
||||
|
||||
(error . "Error")))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user