From: John Benediktsson Date: Mon, 18 Mar 2019 17:42:40 +0000 (-0700) Subject: Revert "regexp: fix take-until to handle escapes at the end of a regexp." X-Git-Tag: 0.99~3896 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=b3bcf537cc360d0ba892391e48b50c704ec6b101 Revert "regexp: fix take-until to handle escapes at the end of a regexp." This reverts commit 2136abc1d64705805c5274337a799077f4b317e4. --- diff --git a/basis/regexp/regexp.factor b/basis/regexp/regexp.factor index c31571c718..19d2d8710b 100644 --- a/basis/regexp/regexp.factor +++ b/basis/regexp/regexp.factor @@ -200,11 +200,10 @@ PRIVATE> : take-until ( lexer -- string ) dup skip-blank [ dupd [ - [ [ "\\/" member? ] find-from ] keep swap [ - CHAR: \ = [ [ 2 + ] dip t ] [ f ] if - ] [ - "Unterminated regexp" throw - ] if* + [ CHAR: / -rot index-from ] keep + over [ "Unterminated regexp" throw ] unless + 2dup [ 1 - ] dip nth CHAR: \\ = + [ [ [ 1 + ] dip ] when ] keep ] loop over [ subseq ] dip 1 + ] change-lexer-column ;