|
|
@ -3,12 +3,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
(define #'(introduce-scope _color . _parents)
|
|
|
|
(define #'(introduce-scope _color . _parents)
|
|
|
|
(with-syntax ([color #'_color]
|
|
|
|
(with-syntax ([color #'_color]
|
|
|
|
[color-string (format "~a" (syntax->datum #'_color))]
|
|
|
|
[color-string (format-string "~a" #'_color)]
|
|
|
|
[color:define (format-id #f "~a:define" #'_color)]
|
|
|
|
[color:define (suffix-id #'_color ":define")]
|
|
|
|
[color:id (format-id #f "~a:id" #'_color)]
|
|
|
|
[color:id (suffix-id #'_color ":id")]
|
|
|
|
[color-binding-id (format-id #f "~a-binding-id" #'_color)]
|
|
|
|
[color-binding-id (suffix-id #'_color "-binding-id")]
|
|
|
|
[color-binding-form (format-id #f "~a-binding-form" #'_color)]
|
|
|
|
[color-binding-form (suffix-id #'_color "-binding-form")]
|
|
|
|
[color-id (format-id #f "~a-id" #'_color)]
|
|
|
|
[color-id (suffix-id #'_color "-id")]
|
|
|
|
[module-name (generate-temporary)]
|
|
|
|
[module-name (generate-temporary)]
|
|
|
|
[parents (if (pair? (syntax->list #'_parents))
|
|
|
|
[parents (if (pair? (syntax->list #'_parents))
|
|
|
|
(car (syntax->list #'_parents))
|
|
|
|
(car (syntax->list #'_parents))
|
|
|
@ -16,19 +16,19 @@
|
|
|
|
(replace-context #'_color
|
|
|
|
(replace-context #'_color
|
|
|
|
#'(begin
|
|
|
|
#'(begin
|
|
|
|
(module module-name br
|
|
|
|
(module module-name br
|
|
|
|
(require (for-syntax br/datum br/syntax))
|
|
|
|
(require (for-syntax br/datum br/scope))
|
|
|
|
(provide (for-syntax (all-defined-out)) (all-defined-out))
|
|
|
|
(provide (for-syntax (all-defined-out)) (all-defined-out))
|
|
|
|
|
|
|
|
|
|
|
|
(begin-for-syntax
|
|
|
|
(begin-for-syntax
|
|
|
|
(define-scope color parents))
|
|
|
|
(define-scope color parents))
|
|
|
|
|
|
|
|
|
|
|
|
(define #'(color:define _id-in _expr)
|
|
|
|
(define #'(color:define _id-in _expr)
|
|
|
|
(with-syntax* ([color:id (shared-syntax (format-datum "~a:~a" color-string #'_id-in))]
|
|
|
|
(inject-syntax* ([#'color:id (shared-syntax (prefix-id color-string ":" #'_id-in))]
|
|
|
|
[color-binding-id (color-binding-form #'_id-in)]
|
|
|
|
[#'color-binding-id (color-binding-form #'_id-in)]
|
|
|
|
[color-id (color #'color-binding-id)])
|
|
|
|
[#'color-id (color #'color-binding-id)])
|
|
|
|
#'(begin
|
|
|
|
#'(begin
|
|
|
|
(define color-binding-id _expr)
|
|
|
|
(define color-binding-id _expr)
|
|
|
|
(define-syntax color:id
|
|
|
|
(define-syntax color:id
|
|
|
|
(syntax-id-rules ()
|
|
|
|
(syntax-id-rules ()
|
|
|
|
[_ color-id]))))))
|
|
|
|
[_ color-id]))))))
|
|
|
|
(require 'module-name)))))
|
|
|
|
(require 'module-name)))))
|
|
|
|