Revert "regexp: slightly more complicated tokenization to handle another case."
This reverts commit 9f0bce7622
.
windows-drag
parent
1ab1ef7f68
commit
6339558368
|
@ -197,27 +197,11 @@ PRIVATE>
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
:: (take-until) ( col line end -- col' line )
|
: take-until ( lexer -- string )
|
||||||
"\\" end suffix :> tokens
|
dup skip-blank [
|
||||||
col line [
|
|
||||||
[ [ tokens member? ] find-from ] keep swap [
|
|
||||||
CHAR: \ = [ [ 2 + ] dip t ] [ [ 1 + ] dip f ] if
|
|
||||||
] [
|
|
||||||
"Unterminated regexp" throw
|
|
||||||
] if*
|
|
||||||
] loop ;
|
|
||||||
|
|
||||||
:: take-until ( lexer -- string )
|
|
||||||
lexer skip-blank
|
|
||||||
lexer [
|
|
||||||
dupd [
|
dupd [
|
||||||
[ [ "[(\\/" member? ] find-from ] keep swap [
|
[ [ "\\/" member? ] find-from ] keep swap [
|
||||||
{
|
CHAR: \ = [ [ 2 + ] dip t ] [ f ] if
|
||||||
{ CHAR: [ [ CHAR: ] (take-until) t ] }
|
|
||||||
{ CHAR: ( [ CHAR: ) (take-until) t ] }
|
|
||||||
{ CHAR: \ [ [ 2 + ] dip t ] }
|
|
||||||
{ CHAR: / [ f ] }
|
|
||||||
} case
|
|
||||||
] [
|
] [
|
||||||
"Unterminated regexp" throw
|
"Unterminated regexp" throw
|
||||||
] if*
|
] if*
|
||||||
|
|
Loading…
Reference in New Issue