|
|
@ -12,14 +12,18 @@
|
|
|
|
(find-property 'b-import-name #'(LINE ...))]
|
|
|
|
(find-property 'b-import-name #'(LINE ...))]
|
|
|
|
[(EXPORT-NAME ...)
|
|
|
|
[(EXPORT-NAME ...)
|
|
|
|
(find-property 'b-export-name #'(LINE ...))]
|
|
|
|
(find-property 'b-export-name #'(LINE ...))]
|
|
|
|
[((SHELL-ID SHELL-VAL) ...) (handle-shell caller-stx)])
|
|
|
|
[((SHELL-ID SHELL-VAL) ...)
|
|
|
|
|
|
|
|
(make-shell-ids-and-values caller-stx)]
|
|
|
|
|
|
|
|
[(UNIQUE-ID ...)
|
|
|
|
|
|
|
|
(unique-ids
|
|
|
|
|
|
|
|
(syntax->list #'(VAR-ID ... SHELL-ID ...)))])
|
|
|
|
#'(#%module-begin
|
|
|
|
#'(#%module-begin
|
|
|
|
(module configure-runtime br
|
|
|
|
(module configure-runtime br
|
|
|
|
(require basic-demo-3/setup)
|
|
|
|
(require basic-demo-3/setup)
|
|
|
|
(do-setup!))
|
|
|
|
(do-setup!))
|
|
|
|
(require IMPORT-NAME) ...
|
|
|
|
(require IMPORT-NAME) ...
|
|
|
|
(provide EXPORT-NAME ...)
|
|
|
|
(provide EXPORT-NAME ...)
|
|
|
|
(define VAR-ID 0) ...
|
|
|
|
(define UNIQUE-ID 0) ...
|
|
|
|
(set! SHELL-ID SHELL-VAL) ...
|
|
|
|
(set! SHELL-ID SHELL-VAL) ...
|
|
|
|
LINE ...
|
|
|
|
LINE ...
|
|
|
|
(define line-table
|
|
|
|
(define line-table
|
|
|
@ -30,17 +34,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
(begin-for-syntax
|
|
|
|
(begin-for-syntax
|
|
|
|
(require racket/list)
|
|
|
|
(require racket/list)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (unique-ids stxs)
|
|
|
|
|
|
|
|
(remove-duplicates stxs #:key syntax->datum))
|
|
|
|
|
|
|
|
|
|
|
|
(define (find-property which line-stxs)
|
|
|
|
(define (find-property which line-stxs)
|
|
|
|
(remove-duplicates
|
|
|
|
(unique-ids
|
|
|
|
(for/list ([stx (in-list (stx-flatten line-stxs))]
|
|
|
|
(for/list ([stx (in-list (stx-flatten line-stxs))]
|
|
|
|
#:when (syntax-property stx which))
|
|
|
|
#:when (syntax-property stx which))
|
|
|
|
stx)
|
|
|
|
stx)))
|
|
|
|
#:key syntax->datum))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (handle-shell ctxt)
|
|
|
|
(define (make-shell-ids-and-values ctxt)
|
|
|
|
(for/list
|
|
|
|
(for/list ([idx (in-naturals)]
|
|
|
|
([(val idx)
|
|
|
|
[val (current-command-line-arguments)])
|
|
|
|
(in-indexed (current-command-line-arguments))])
|
|
|
|
(with-pattern
|
|
|
|
(list (suffix-id #'arg idx #:context ctxt)
|
|
|
|
([SHELL-ID (suffix-id #'arg idx #:context ctxt)]
|
|
|
|
(or (string->number val) val)))))
|
|
|
|
[SHELL-VALUE (or (string->number val) val)])
|
|
|
|
|
|
|
|
#'(SHELL-ID SHELL-VALUE)))))
|
|
|
|
|
|
|
|
|
|
|
|