modern: Allow foo\ words
parent
147ae66ab5
commit
f561911211
|
@ -277,7 +277,7 @@ ERROR: mismatched-terminator n string slice ;
|
||||||
drop
|
drop
|
||||||
dup "\\" sequence= [ read-backslash ] [ merge-slice-til-whitespace ] if
|
dup "\\" sequence= [ read-backslash ] [ merge-slice-til-whitespace ] if
|
||||||
] [
|
] [
|
||||||
(lex-factor)
|
over "\\" tail? [ drop read-backslash ] [ (lex-factor) ] if
|
||||||
] if
|
] if
|
||||||
] [
|
] [
|
||||||
(lex-factor)
|
(lex-factor)
|
||||||
|
|
|
@ -82,14 +82,14 @@ ERROR: unexpected-end n string ;
|
||||||
f string f f
|
f string f f
|
||||||
] if ; inline
|
] if ; inline
|
||||||
|
|
||||||
:: slice-until' ( n string quot -- n' string slice/f ch/f )
|
:: (slice-until) ( n string quot -- n' string slice/f ch/f )
|
||||||
n string quot find-from :> ( n' ch )
|
n string quot find-from :> ( n' ch )
|
||||||
n' string
|
n' string
|
||||||
n n' string ?<slice>
|
n n' string ?<slice>
|
||||||
ch ; inline
|
ch ; inline
|
||||||
|
|
||||||
: slice-until ( n string quot -- n' string slice/f )
|
: slice-until ( n string quot -- n' string slice/f )
|
||||||
slice-until' drop ; inline
|
(slice-until) drop ; inline
|
||||||
|
|
||||||
:: slice-til-not-whitespace ( n string -- n' string slice/f ch/f )
|
:: slice-til-not-whitespace ( n string -- n' string slice/f ch/f )
|
||||||
n [
|
n [
|
||||||
|
@ -147,13 +147,13 @@ ERROR: unexpected-end n string ;
|
||||||
: slice-before ( slice -- slice' )
|
: slice-before ( slice -- slice' )
|
||||||
[ drop 0 ] [ from>> ] [ seq>> ] tri <slice> ;
|
[ drop 0 ] [ from>> ] [ seq>> ] tri <slice> ;
|
||||||
|
|
||||||
: ?nth' ( n/f string/f -- obj/f )
|
: (?nth) ( n/f string/f -- obj/f )
|
||||||
over [ ?nth ] [ 2drop f ] if ;
|
over [ (?nth) ] [ 2drop f ] if ;
|
||||||
|
|
||||||
:: merge-slice-til-eol-slash' ( n string slice -- n' string slice/f ch/f )
|
:: merge-slice-til-eol-slash' ( n string slice -- n' string slice/f ch/f )
|
||||||
n string merge-slice-til-eol-slash'' :> ( n' string' slice' ch' )
|
n string merge-slice-til-eol-slash'' :> ( n' string' slice' ch' )
|
||||||
ch' char: \\ = [
|
ch' char: \\ = [
|
||||||
n' 1 + string' ?nth' "\r\n" member? [
|
n' 1 + string' (?nth) "\r\n" member? [
|
||||||
n' 2 + string' slice slice' span-slices merge-slice-til-eol-slash'
|
n' 2 + string' slice slice' span-slices merge-slice-til-eol-slash'
|
||||||
] [
|
] [
|
||||||
"omg" throw
|
"omg" throw
|
||||||
|
|
Loading…
Reference in New Issue