pull/10/head
Matthew Butterick 8 years ago
parent f7eedcef6f
commit c3b8660e1f

@ -13,9 +13,7 @@
[(EXPORT-NAME ...) [(EXPORT-NAME ...)
(find-property 'b-export-name #'(LINE ...))] (find-property 'b-export-name #'(LINE ...))]
[((SHELL-ID SHELL-IDX) ...) [((SHELL-ID SHELL-IDX) ...)
(for/list ([idx (in-range 10)]) (make-shell-ids-and-idxs caller-stx)]
(list (suffix-id #'arg idx #:context caller-stx)
idx))]
[(UNIQUE-ID ...) [(UNIQUE-ID ...)
(unique-ids (unique-ids
(syntax->list #'(VAR-ID ... SHELL-ID ...)))]) (syntax->list #'(VAR-ID ... SHELL-ID ...)))])
@ -36,9 +34,10 @@
(void (run line-table)))))) (void (run line-table))))))
(define (get-clarg clargs idx) (define (get-clarg clargs idx)
(with-handlers ([exn:fail? (λ (exn) 0)]) (if (<= (vector-length clargs) idx)
(let ([val (vector-ref clargs idx)]) 0
(or (string->number val) val)))) (let ([val (vector-ref clargs idx)])
(or (string->number val) val))))
(begin-for-syntax (begin-for-syntax
(require racket/list) (require racket/list)
@ -50,5 +49,10 @@
(unique-ids (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)))
(define (make-shell-ids-and-idxs ctxt)
(define arg-count 10)
(for/list ([idx (in-range arg-count)])
(list (suffix-id #'arg idx #:context ctxt) idx))))

Loading…
Cancel
Save