mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-22 07:09:18 +02:00
Shortcut for word+ to avoid expensive char-set intersection.
This commit is contained in:
parent
ce3b1fcecf
commit
ecd450c4c3
1 changed files with 6 additions and 3 deletions
|
@ -498,6 +498,7 @@
|
|||
((alphanumeric alphanum alnum) char-set:letter+digit)
|
||||
((punctuation punct) char-set:punctuation)
|
||||
((graphic graph) char-set:graphic)
|
||||
((word-constituent) char-set:word-constituent)
|
||||
((whitespace white space) char-set:whitespace)
|
||||
((printing print) char-set:printing)
|
||||
((control cntrl) char-set:control)
|
||||
|
@ -707,9 +708,11 @@
|
|||
((word)
|
||||
(->rx `(: bow ,@(cdr sre) eow) flags next))
|
||||
((word+)
|
||||
(->rx `(word (+ ,(char-set-intersection
|
||||
char-set:word-constituent
|
||||
(sre->char-set `(or ,@(cdr sre)) flags))))
|
||||
(->rx `(word (+ ,(if (equal? '(any) (cdr sre))
|
||||
'word-constituent
|
||||
(char-set-intersection
|
||||
char-set:word-constituent
|
||||
(sre->char-set `(or ,@(cdr sre)) flags)))))
|
||||
flags
|
||||
next))
|
||||
((w/case)
|
||||
|
|
Loading…
Add table
Reference in a new issue