fix s:contains-string? bug

FossilOrigin-Name: 5309d39780b2f303628aa656ea9c3d3f44c42bd4b78abb1941d357e1f13a365a
This commit is contained in:
crc 2020-03-03 00:23:11 +00:00
parent ff9f76ea13
commit f6a164ff17
3 changed files with 535 additions and 533 deletions

View file

@ -900,11 +900,12 @@ a given substring is in a string.
~~~ ~~~
{{ {{
:extract dup-pair here swap copy here over + #0 swap store ; 'Str var
:check &extract dip [ &n:inc dip ] dip here s:hash over eq? ; :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 ; :mask rot rot [ [ swap &or dip ] dip ] dip ;
:location rot rot [ [ swap [ over n:zero? and ] dip swap [ nip dup ] if ] 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--- ---reveal---
:s:contains-string? (ss-f) :s:contains-string? (ss-f)
[ setup [ check mask ] times ] buffer:preserve drop-pair drop ; [ setup [ check mask ] times ] buffer:preserve drop-pair drop ;

BIN
ngaImage

Binary file not shown.

File diff suppressed because it is too large Load diff