fix struct/c and struct/dc for new syntax arming of struct ids

This commit is contained in:
Matthew Flatt 2019-02-25 13:10:08 -07:00
parent 29d71e719b
commit 84837f4330

View File

@ -1071,6 +1071,10 @@
(values info #'id all-clauses))]))
(define-for-syntax (disarm stx)
(syntax-disarm stx (variable-reference->module-declaration-inspector
(#%variable-reference))))
;; name->sel-id : identifier syntax -> identifier
;; returns the identifier for the selector, where the 'id'
;; argument is either an identifier or a #'(id #:parent id)
@ -1078,7 +1082,7 @@
(define-for-syntax (name->sel-id struct-id id)
(define (combine struct-id id)
(datum->syntax
id
(disarm id)
(string->symbol
(format "~a-~a"
(syntax-e struct-id)
@ -1096,7 +1100,7 @@
(define-for-syntax (name->mut-id stx struct-id id)
(define (combine struct-id id)
(datum->syntax
id
(disarm id)
(string->symbol
(format "set-~a-~a!"
(syntax-e struct-id)
@ -1565,7 +1569,7 @@
(regexp (format "^~a-" (regexp-quote (symbol->string (syntax-e struct-id))))))
(define field-name
(datum->syntax
sel
(disarm sel)
(string->symbol (regexp-replace strip-reg
(symbol->string (syntax-e sel))
""))))