|
|
@ -141,6 +141,10 @@
|
|
|
|
#f)))
|
|
|
|
#f)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#|
|
|
|
|
|
|
|
|
MB: The next three functions control the appearance of the generated parse tree.
|
|
|
|
|
|
|
|
|#
|
|
|
|
|
|
|
|
|
|
|
|
;; We create a syntax using read-syntax; by definition, it should have the
|
|
|
|
;; We create a syntax using read-syntax; by definition, it should have the
|
|
|
|
;; original? property set to #t, which we then copy over to syntaxes constructed
|
|
|
|
;; original? property set to #t, which we then copy over to syntaxes constructed
|
|
|
|
;; with atomic-datum->syntax and rule-components->syntax.
|
|
|
|
;; with atomic-datum->syntax and rule-components->syntax.
|
|
|
@ -152,7 +156,7 @@
|
|
|
|
;; Helper that does the ugly work in wrapping a datum into a syntax
|
|
|
|
;; Helper that does the ugly work in wrapping a datum into a syntax
|
|
|
|
;; with source location.
|
|
|
|
;; with source location.
|
|
|
|
(define (atomic-datum->syntax d start-pos end-pos)
|
|
|
|
(define (atomic-datum->syntax d start-pos end-pos)
|
|
|
|
(datum->syntax #f d (positions->srcloc start-pos end-pos) stx-with-original?-property))
|
|
|
|
(syntax-property (datum->syntax #f d (positions->srcloc start-pos end-pos) stx-with-original?-property) 'foo 'atom))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -161,10 +165,10 @@
|
|
|
|
;; The location information of the rule spans that of its components.
|
|
|
|
;; The location information of the rule spans that of its components.
|
|
|
|
(define (rule-components->syntax rule-name/false #:srcloc [srcloc #f] . components)
|
|
|
|
(define (rule-components->syntax rule-name/false #:srcloc [srcloc #f] . components)
|
|
|
|
(define flattened-components (apply append components))
|
|
|
|
(define flattened-components (apply append components))
|
|
|
|
(datum->syntax #f
|
|
|
|
(syntax-property (datum->syntax #f
|
|
|
|
(apply append
|
|
|
|
(apply append
|
|
|
|
(list
|
|
|
|
(list
|
|
|
|
(datum->syntax #f rule-name/false srcloc stx-with-original?-property))
|
|
|
|
(syntax-property (datum->syntax #f rule-name/false srcloc stx-with-original?-property) 'foo 'rule-name))
|
|
|
|
components)
|
|
|
|
components)
|
|
|
|
srcloc
|
|
|
|
srcloc
|
|
|
|
stx-with-original?-property))
|
|
|
|
stx-with-original?-property) 'foo 'whole-rule))
|
|
|
|