mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-21 12:10:26 +02:00
Micro-optimization to delimiter?
* module/ice-9/read.scm (read): Make sure we hit the "case" optimization.
This commit is contained in:
parent
b6df67fe06
commit
5cd28ae0ac
1 changed files with 5 additions and 4 deletions
|
@ -182,10 +182,11 @@
|
||||||
(take-until first (lambda (ch) (not (pred ch)))))
|
(take-until first (lambda (ch) (not (pred ch)))))
|
||||||
|
|
||||||
(define (delimiter? ch)
|
(define (delimiter? ch)
|
||||||
(or (memv ch '(#\( #\) #\; #\"
|
(case ch
|
||||||
#\space #\return #\ff #\newline #\tab))
|
((#\( #\) #\; #\" #\space #\return #\ff #\newline #\tab) #t)
|
||||||
(and (memv ch '(#\[ #\])) (or (square-brackets?) (curly-infix?)))
|
((#\[ #\]) (or (square-brackets?) (curly-infix?)))
|
||||||
(and (memv ch '(#\{ #\})) (curly-infix?))))
|
((#\{ #\}) (curly-infix?))
|
||||||
|
(else #f)))
|
||||||
|
|
||||||
(define (read-token ch)
|
(define (read-token ch)
|
||||||
(take-until ch delimiter?))
|
(take-until ch delimiter?))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue