Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions info.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"fancy-app"
"fmt"
"guard"
"macro-debugger-text-lib"
"rackunit-lib"
"rebellion"))

Expand Down
21 changes: 21 additions & 0 deletions private/expander.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#lang racket/base


(require macro-debugger/model/debug
racket/pretty
rebellion/type/record)


(define-record-type expansion-history (original expanded steps))
(define-record-type expansion-step (input output local-expansions))


(define (expand-with-history stx)
(define derivation-tree (trace stx expand))
(expansion-history #:original (node-z1 derivation-tree)
#:expanded (node-z2 derivation-tree)
#:steps (vector derivation-tree)))


(module+ main
(pretty-print (expand-with-history #'(module foo racket (lambda (x) (add1 x))))))