mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +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)))))
|
||||
|
||||
(define (delimiter? ch)
|
||||
(or (memv ch '(#\( #\) #\; #\"
|
||||
#\space #\return #\ff #\newline #\tab))
|
||||
(and (memv ch '(#\[ #\])) (or (square-brackets?) (curly-infix?)))
|
||||
(and (memv ch '(#\{ #\})) (curly-infix?))))
|
||||
(case ch
|
||||
((#\( #\) #\; #\" #\space #\return #\ff #\newline #\tab) #t)
|
||||
((#\[ #\]) (or (square-brackets?) (curly-infix?)))
|
||||
((#\{ #\}) (curly-infix?))
|
||||
(else #f)))
|
||||
|
||||
(define (read-token ch)
|
||||
(take-until ch delimiter?))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue