diff --git a/core/lexer/lexer.factor b/core/lexer/lexer.factor index d44624f815..7ffde33f1c 100644 --- a/core/lexer/lexer.factor +++ b/core/lexer/lexer.factor @@ -134,16 +134,22 @@ DEFER: parse-token nip ] if ; +! TODO: combinations of prefix: \$#_: +! suffix: \_: + : unescape-token ( string -- string' ) dup length 1 = [ "\\" ?head drop ] unless ; +: unhashtag-token ( string -- string' ) + dup length 1 = [ "#" ?head [ drop f ] when ] unless ; + : unescape-tokens ( seq -- seq' ) [ unescape-token ] map ; : parse-token ( lexer -- str/f ) dup parse-raw [ skip-comments ] [ drop f ] if* ; -: ?scan-token ( -- str/f ) lexer get parse-token unescape-token ; +: ?scan-token ( -- str/f ) lexer get parse-token unescape-token unhashtag-token ; PREDICATE: unexpected-eof < unexpected got>> not ;