factor: escape some char: `

locals-and-roots
Doug Coleman 2016-06-24 00:57:27 -07:00
parent cdcf744924
commit c6c031574a
2 changed files with 4 additions and 4 deletions

View File

@ -566,8 +566,8 @@ CONSTANT: factor-lexing-rules {
! What a lexer body looks like, produced by make-lexer
! : lex ( n/f string -- n'/f string literal )
! "!`\\\"[{(\s\r\n" slice-til-either {
! { char: ! [ read-exclamation ] }
! { char: ` [ read-backtick ] }
! { char: \! [ read-exclamation ] }
! { char: \` [ read-backtick ] }
! { char: \ [ read-backslash ] }
! { char: \" [ read-string ] }
! { char: \[ [ read-bracket ] }

View File

@ -13,7 +13,7 @@ PRIVATE<
"\\`" "`" replace ;
: unescaped-backtick? ( ch1 ch2 -- ? )
[ char: \ = not ] [ char: ` = ] bi* and ; inline
[ char: \ = not ] [ char: \` = ] bi* and ; inline
: (find-escaped-backtick) ( string -- n/f )
2 clump [ first2 unescaped-backtick? ] find drop [ 1 + ] [ f ] if* ;
@ -45,7 +45,7 @@ DEFER: name/values
":`" over subseq? [ (name=value) ] [ f swap ] if ;
: name/values ( string -- remain terms )
[ dup { [ empty? not ] [ first char: ` = not ] } 1&& ]
[ dup { [ empty? not ] [ first char: \` = not ] } 1&& ]
[ name=value ] produce assoc-combine ;
: parse-txon ( string -- objects )