macro-debugger: fix parser for local-actions in mod pass 2
original commit: 6b02b507a95245be5f43e6a583adfe419dadb1c6
This commit is contained in:
parent
3385d5bc0d
commit
f7ba1647ae
|
@ -201,12 +201,12 @@
|
||||||
(recur head prim)]
|
(recur head prim)]
|
||||||
[(mod:splice head rename ?1 tail)
|
[(mod:splice head rename ?1 tail)
|
||||||
(recur head)]
|
(recur head)]
|
||||||
[(mod:lift head renames tail)
|
[(mod:lift head locals renames tail)
|
||||||
(recur head)]
|
(recur head locals)]
|
||||||
[(mod:lift-end tail)
|
[(mod:lift-end tail)
|
||||||
(void)]
|
(void)]
|
||||||
[(mod:cons head)
|
[(mod:cons head locals)
|
||||||
(recur head)]
|
(recur head locals)]
|
||||||
[(mod:skip)
|
[(mod:skip)
|
||||||
(void)]
|
(void)]
|
||||||
;; Shouldn't occur in module expansion.
|
;; Shouldn't occur in module expansion.
|
||||||
|
|
|
@ -181,9 +181,9 @@
|
||||||
(define-struct modrule () #:transparent)
|
(define-struct modrule () #:transparent)
|
||||||
(define-struct (mod:prim modrule) (head rename prim) #:transparent)
|
(define-struct (mod:prim modrule) (head rename prim) #:transparent)
|
||||||
(define-struct (mod:splice modrule) (head rename ?1 tail) #:transparent)
|
(define-struct (mod:splice modrule) (head rename ?1 tail) #:transparent)
|
||||||
(define-struct (mod:lift modrule) (head renames tail) #:transparent)
|
(define-struct (mod:lift modrule) (head locals renames tail) #:transparent)
|
||||||
(define-struct (mod:lift-end modrule) (tail) #:transparent)
|
(define-struct (mod:lift-end modrule) (tail) #:transparent)
|
||||||
(define-struct (mod:cons modrule) (head) #:transparent)
|
(define-struct (mod:cons modrule) (head locals) #:transparent)
|
||||||
(define-struct (mod:skip modrule) () #:transparent)
|
(define-struct (mod:skip modrule) () #:transparent)
|
||||||
|
|
||||||
;; A ModPrim is either #f or one of the following PRule variants:
|
;; A ModPrim is either #f or one of the following PRule variants:
|
||||||
|
|
|
@ -324,7 +324,7 @@
|
||||||
[(EE rename-one ! splice)
|
[(EE rename-one ! splice)
|
||||||
(make mod:splice $1 $2 $3 $4)]
|
(make mod:splice $1 $2 $3 $4)]
|
||||||
[(EE rename-list module-lift-loop)
|
[(EE rename-list module-lift-loop)
|
||||||
(make mod:lift $1 $2 $3)])
|
(make mod:lift $1 null $2 $3)])
|
||||||
|
|
||||||
(ModulePass1/Prim
|
(ModulePass1/Prim
|
||||||
(#:args e1)
|
(#:args e1)
|
||||||
|
@ -354,11 +354,14 @@
|
||||||
[()
|
[()
|
||||||
(make mod:skip)]
|
(make mod:skip)]
|
||||||
;; normal: expand completely
|
;; normal: expand completely
|
||||||
[((? EE))
|
[((? EE) (? Eval))
|
||||||
(make mod:cons $1)]
|
;; after expansion, may compile => may eval letstx rhss again!
|
||||||
|
;; need to include those evals too (for errors, etc)
|
||||||
|
(make mod:cons $1 $2)]
|
||||||
;; catch lifts
|
;; catch lifts
|
||||||
[(EE module-lift-loop)
|
[(EE Eval module-lift-loop)
|
||||||
(make mod:lift $1 #f $2)])
|
;; same as above: after expansion, may compile => may eval
|
||||||
|
(make mod:lift $1 $2 #f $3)])
|
||||||
|
|
||||||
(ModulePass3
|
(ModulePass3
|
||||||
(#:skipped null)
|
(#:skipped null)
|
||||||
|
|
|
@ -669,7 +669,7 @@
|
||||||
[#:step 'splice-module (stx->list (stx-cdr begin-form))]
|
[#:step 'splice-module (stx->list (stx-cdr begin-form))]
|
||||||
[#:rename ?forms tail]
|
[#:rename ?forms tail]
|
||||||
[ModulePass ?forms rest])]
|
[ModulePass ?forms rest])]
|
||||||
[(cons (Wrap mod:lift (head renames stxs)) rest)
|
[(cons (Wrap mod:lift (head locals renames stxs)) rest)
|
||||||
(R [#:pattern (?firstL . ?rest)]
|
(R [#:pattern (?firstL . ?rest)]
|
||||||
;; renames has form (head-e2 . ?rest)
|
;; renames has form (head-e2 . ?rest)
|
||||||
;; stxs has form (lifted ...),
|
;; stxs has form (lifted ...),
|
||||||
|
@ -678,6 +678,7 @@
|
||||||
(visible-lift-stxs null))
|
(visible-lift-stxs null))
|
||||||
[#:pass1]
|
[#:pass1]
|
||||||
[Expr ?firstL head]
|
[Expr ?firstL head]
|
||||||
|
[LocalActions ?firstL locals]
|
||||||
[#:do (when (pair? (available-lift-stxs))
|
[#:do (when (pair? (available-lift-stxs))
|
||||||
(lift-error 'mod:lift "available lifts left over"))]
|
(lift-error 'mod:lift "available lifts left over"))]
|
||||||
[#:let visible-lifts (visible-lift-stxs)]
|
[#:let visible-lifts (visible-lift-stxs)]
|
||||||
|
@ -701,9 +702,10 @@
|
||||||
[(cons (Wrap mod:skip ()) rest)
|
[(cons (Wrap mod:skip ()) rest)
|
||||||
(R [#:pattern (?firstS . ?rest)]
|
(R [#:pattern (?firstS . ?rest)]
|
||||||
[ModulePass ?rest rest])]
|
[ModulePass ?rest rest])]
|
||||||
[(cons (Wrap mod:cons (head)) rest)
|
[(cons (Wrap mod:cons (head locals)) rest)
|
||||||
(R [#:pattern (?firstC . ?rest)]
|
(R [#:pattern (?firstC . ?rest)]
|
||||||
[Expr ?firstC head]
|
[Expr ?firstC head]
|
||||||
|
[LocalActions ?firstC locals]
|
||||||
[ModulePass ?rest rest])]))
|
[ModulePass ?rest rest])]))
|
||||||
|
|
||||||
;; Lifts
|
;; Lifts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user