commit faade53994a4853f4ac9e0a8bb09480f7ea7abcc parent 99ca3ede0d94ce6bce6dd618116f840c8d35d5e8 Author: Georges Dupéron <georges.duperon@gmail.com> Date: Mon, 5 Sep 2016 02:18:25 +0200 Do not forward "private" pattern variables (in our case, clause names are the only ones) Diffstat:
| M | private/parameters.rkt | | | 14 | +++++++++++--- |
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/private/parameters.rkt b/private/parameters.rkt @@ -7,7 +7,8 @@ eh-post-group eh-post-group! clause-counter - get-new-clause!)) + get-new-clause! + is-clause-id-sym?)) (define-syntax-rule (define-dynamic-accumulator-parameter parameter-name name!) (begin @@ -22,6 +23,13 @@ (define-dynamic-accumulator-parameter eh-post-accumulate eh-post-accumulate!) (define-dynamic-accumulator-parameter eh-post-group eh-post-group!) +;; This is a crude hack. +(define-for-syntax (is-clause-id-sym? id-sym) + (and (symbol? id-sym) + (regexp-match #px"^ -clause-.* $" (symbol->string id-sym)))) + (define-for-syntax clause-counter (make-parameter #f)) (define-for-syntax (get-new-clause!) - (string->symbol (format "clause~a" ((clause-counter))))) -\ No newline at end of file + (datum->syntax #'here + ;; keep the spaces, they allow us to recognize clauses later. + (string->symbol (format " -clause-~a " ((clause-counter)))))) +\ No newline at end of file