modern: Allow foo\ words

modern-harvey2
Doug Coleman 2017-08-26 14:48:02 -05:00
parent 147ae66ab5
commit f561911211
2 changed files with 6 additions and 6 deletions

View File

@ -277,7 +277,7 @@ ERROR: mismatched-terminator n string slice ;
drop
dup "\\" sequence= [ read-backslash ] [ merge-slice-til-whitespace ] if
] [
(lex-factor)
over "\\" tail? [ drop read-backslash ] [ (lex-factor) ] if
] if
] [
(lex-factor)

View File

@ -82,14 +82,14 @@ ERROR: unexpected-end n string ;
f string f f
] 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
n n' string ?<slice>
ch ; inline
: 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 )
n [
@ -147,13 +147,13 @@ ERROR: unexpected-end n string ;
: slice-before ( slice -- slice' )
[ drop 0 ] [ from>> ] [ seq>> ] tri <slice> ;
: ?nth' ( n/f string/f -- obj/f )
over [ ?nth ] [ 2drop f ] if ;
: (?nth) ( n/f string/f -- obj/f )
over [ (?nth) ] [ 2drop f ] if ;
:: 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' )
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'
] [
"omg" throw