|
|
@ -7,9 +7,9 @@
|
|
|
|
(with-pattern
|
|
|
|
(with-pattern
|
|
|
|
([((b-line NUM STMT ...) ...) #'(LINE ...)]
|
|
|
|
([((b-line NUM STMT ...) ...) #'(LINE ...)]
|
|
|
|
[(LINE-FUNC ...) (prefix-id "line-" #'(NUM ...))]
|
|
|
|
[(LINE-FUNC ...) (prefix-id "line-" #'(NUM ...))]
|
|
|
|
[(VAR-NAME ...) (find-unique-var-names #'(LINE ...))])
|
|
|
|
[(VAR-ID ...) (find-unique-var-ids #'(LINE ...))])
|
|
|
|
#'(#%module-begin
|
|
|
|
#'(#%module-begin
|
|
|
|
(define VAR-NAME 0) ...
|
|
|
|
(define VAR-ID 0) ...
|
|
|
|
LINE ...
|
|
|
|
LINE ...
|
|
|
|
(define line-table
|
|
|
|
(define line-table
|
|
|
|
(apply hasheqv (append (list NUM LINE-FUNC) ...)))
|
|
|
|
(apply hasheqv (append (list NUM LINE-FUNC) ...)))
|
|
|
@ -17,10 +17,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
(begin-for-syntax
|
|
|
|
(begin-for-syntax
|
|
|
|
(require racket/list)
|
|
|
|
(require racket/list)
|
|
|
|
(define (find-unique-var-names stx)
|
|
|
|
(define (find-unique-var-ids line-stxs)
|
|
|
|
(remove-duplicates
|
|
|
|
(remove-duplicates
|
|
|
|
(for/list ([var-stx (in-list (syntax-flatten stx))]
|
|
|
|
(for/list ([stx (in-list (syntax-flatten line-stxs))]
|
|
|
|
#:when (syntax-property var-stx 'b-id))
|
|
|
|
#:when (syntax-property stx 'b-id))
|
|
|
|
var-stx)
|
|
|
|
stx)
|
|
|
|
#:key syntax->datum)))
|
|
|
|
#:key syntax->datum)))
|
|
|
|
|
|
|
|
|
|
|
|