Use `append-map` where possible

remotes/jackfirth/master
Jack Firth 3 years ago
parent e9bb15e9d5
commit 8e87b541e1

@ -27,9 +27,9 @@
[(repeatR? r)
(get-char-groups (repeatR-re r) found-negation)]
[(orR? r)
(apply append (map (λ (x) (get-char-groups x found-negation)) (orR-res r)))]
(append-map (λ (x) (get-char-groups x found-negation)) (orR-res r))]
[(andR? r)
(apply append (map (λ (x) (get-char-groups x found-negation)) (andR-res r)))]
(append-map (λ (x) (get-char-groups x found-negation)) (andR-res r))]
[(negR? r)
(if found-negation
(get-char-groups (negR-re r) #t)
@ -197,8 +197,7 @@
[(null? st) '()]
[else
(loc:partition (map char-setR-chars
(apply append (map (λ (x) (get-char-groups (car x) #f))
(state-spec (car st))))))]))
(append-map (λ (x) (get-char-groups (car x) #f)) (state-spec (car st)))))]))
(test-block ((c (make-cache))
(c->i char->integer)

@ -88,7 +88,7 @@
(define (get-term-list term-group-names)
(remove-duplicates
(cons (datum->syntax #f 'error)
(apply append (map get-terms-from-def term-group-names)))))
(append-map get-terms-from-def term-group-names))))
(define (parse-input term-defs start ends prec-decls prods src-pos)
(define start-syms (map syntax-e start))

@ -69,7 +69,7 @@
;; return the list of all (B -> beta . nt gamma) such that (B -> beta nt gamma) in prod-list
;; and gamma =>* epsilon
(define (prod-list->items-for-include g prod-list nt)
(apply append (map (λ (prod) (prod->items-for-include g prod nt)) prod-list)))
(append-map (λ (prod) (prod->items-for-include g prod nt)) prod-list))
;; comput-includes: lr0-automaton * grammar -> (trans-key -> trans-key list)
(define (compute-includes a g)

Loading…
Cancel
Save