fix s:contains-string? bug
FossilOrigin-Name: 5309d39780b2f303628aa656ea9c3d3f44c42bd4b78abb1941d357e1f13a365a
This commit is contained in:
parent
ff9f76ea13
commit
f6a164ff17
3 changed files with 535 additions and 533 deletions
|
@ -900,11 +900,12 @@ a given substring is in a string.
|
|||
|
||||
~~~
|
||||
{{
|
||||
:extract dup-pair here swap copy here over + #0 swap store ;
|
||||
:check &extract dip [ &n:inc dip ] dip here s:hash over eq? ;
|
||||
'Str var
|
||||
:extract dup-pair @Str swap copy @str over + #0 swap store ;
|
||||
:check &extract dip [ &n:inc dip ] dip @Str s:hash over eq? ;
|
||||
:mask rot rot [ [ swap &or dip ] dip ] dip ;
|
||||
:location rot rot [ [ swap [ over n:zero? and ] dip swap [ nip dup ] if ] dip ] dip ;
|
||||
:setup #0 rot rot &s:length &s:hash bi s:empty buffer:set [ over s:length ] dip swap ;
|
||||
:setup s:empty !Str #0 rot rot &s:length &s:hash bi s:empty buffer:set [ over s:length ] dip swap ;
|
||||
---reveal---
|
||||
:s:contains-string? (ss-f)
|
||||
[ setup [ check mask ] times ] buffer:preserve drop-pair drop ;
|
||||
|
|
BIN
ngaImage
BIN
ngaImage
Binary file not shown.
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue