regexp: fix take-until to handle escapes at the end of a regexp.
this worked: R\ //.\ this didn't: R\ //\windows-drag
parent
a3d5e3ffcb
commit
2136abc1d6
|
@ -200,10 +200,11 @@ PRIVATE>
|
||||||
: take-until ( lexer -- string )
|
: take-until ( lexer -- string )
|
||||||
dup skip-blank [
|
dup skip-blank [
|
||||||
dupd [
|
dupd [
|
||||||
[ CHAR: / -rot index-from ] keep
|
[ [ "\\/" member? ] find-from ] keep swap [
|
||||||
over [ "Unterminated regexp" throw ] unless
|
CHAR: \ = [ [ 2 + ] dip t ] [ f ] if
|
||||||
2dup [ 1 - ] dip nth CHAR: \\ =
|
] [
|
||||||
[ [ [ 1 + ] dip ] when ] keep
|
"Unterminated regexp" throw
|
||||||
|
] if*
|
||||||
] loop over [ subseq ] dip 1 +
|
] loop over [ subseq ] dip 1 +
|
||||||
] change-lexer-column ;
|
] change-lexer-column ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue