From 5769e8362a96671b4dc857a88e5c08454f2b0e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Fri, 29 Mar 2024 18:55:22 +0100 Subject: [PATCH] Remove conflicting module with macro-debugger/emit, fix dynamic-require of protected symbol? --- qi-lib/flow/core/compiler.rkt | 1 - qi-lib/flow/core/debug.rkt | 20 -------------------- qi-lib/flow/core/passes.rkt | 12 +++++++++--- 3 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 qi-lib/flow/core/debug.rkt diff --git a/qi-lib/flow/core/compiler.rkt b/qi-lib/flow/core/compiler.rkt index 964da3b4..9a6c936f 100644 --- a/qi-lib/flow/core/compiler.rkt +++ b/qi-lib/flow/core/compiler.rkt @@ -9,7 +9,6 @@ "syntax.rkt" "../aux-syntax.rkt" "strategy.rkt" - "debug.rkt" "private/form-property.rkt") "impl.rkt" "passes.rkt" diff --git a/qi-lib/flow/core/debug.rkt b/qi-lib/flow/core/debug.rkt deleted file mode 100644 index 8c3f7c65..00000000 --- a/qi-lib/flow/core/debug.rkt +++ /dev/null @@ -1,20 +0,0 @@ -#lang racket/base - -(provide define-qi-expansion-step) - -(require macro-debugger/emit) - -;; These macros emit expansion "events" that allow the macro -;; stepper to report stages in the expansion of an expression, -;; giving us visibility into this process for debugging purposes. -;; Note that this currently does not distinguish substeps -;; of a parent expansion step. -(define (qi-expansion-step name stx0 stx1) - (emit-local-step stx0 stx1 #:id name) - stx1) - -(define-syntax-rule (define-qi-expansion-step (name stx0) - body ...) - (define (name stx0) - (let ([stx1 (let () body ...)]) - (qi-expansion-step (quote-syntax name) stx0 stx1)))) diff --git a/qi-lib/flow/core/passes.rkt b/qi-lib/flow/core/passes.rkt index acc2be42..5b820528 100644 --- a/qi-lib/flow/core/passes.rkt +++ b/qi-lib/flow/core/passes.rkt @@ -1,14 +1,20 @@ #lang racket/base (require (for-syntax racket/base - (for-syntax racket/base racket/syntax) - macro-debugger/emit)) + (for-syntax racket/base racket/syntax))) (provide (for-syntax define-and-register-pass run-passes)) (begin-for-syntax + (define my-emit-local-step + (with-handlers ((exn? (lambda (ex) + (make-keyword-procedure + (lambda (kws kw-args . rest) + (void)))))) + (dynamic-require 'macro-debugger/emit 'emit-local-step))) + ;; Could be a list but for future extensibility a custom struct is ;; probably a better idea. (struct passdef (name prio parser) #:transparent) @@ -43,7 +49,7 @@ (for/fold ([stx stx]) ([pass (in-list (unbox registered-passes))]) (define stx1 ((passdef-parser pass) stx)) - (emit-local-step stx stx1 #:id (passdef-name pass)) + (my-emit-local-step stx stx1 #:id (passdef-name pass)) stx1)) )