From e110bac51afba22338e370faebeae547e8fce503 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 22 Nov 2008 16:50:40 -0600 Subject: [PATCH] better parsing of constants --- basis/regexp/parser/parser.factor | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/basis/regexp/parser/parser.factor b/basis/regexp/parser/parser.factor index b5022c602e..6a1d40c573 100644 --- a/basis/regexp/parser/parser.factor +++ b/basis/regexp/parser/parser.factor @@ -288,28 +288,9 @@ ERROR: bad-escaped-literals seq ; first|concatenation ] if-empty ; -ERROR: unrecognized-escape char ; - : parse-escaped ( -- obj ) read1 { - { CHAR: \ [ CHAR: \ ] } - { CHAR: / [ CHAR: / ] } - { CHAR: ^ [ CHAR: ^ ] } - { CHAR: $ [ CHAR: $ ] } - { CHAR: - [ CHAR: - ] } - { CHAR: { [ CHAR: { ] } - { CHAR: } [ CHAR: } ] } - { CHAR: [ [ CHAR: [ ] } - { CHAR: ] [ CHAR: ] ] } - { CHAR: ( [ CHAR: ( ] } - { CHAR: ) [ CHAR: ) ] } - { CHAR: @ [ CHAR: @ ] } - { CHAR: * [ CHAR: * ] } - { CHAR: + [ CHAR: + ] } - { CHAR: ? [ CHAR: ? ] } - { CHAR: . [ CHAR: . ] } - { CHAR: : [ CHAR: : ] } { CHAR: t [ CHAR: \t ] } { CHAR: n [ CHAR: \n ] } { CHAR: r [ CHAR: \r ] } @@ -349,7 +330,7 @@ ERROR: unrecognized-escape char ; ! { CHAR: 9 [ CHAR: 9 ] } { CHAR: Q [ parse-escaped-literals ] } - [ unrecognized-escape ] + [ ] } case ; : handle-escape ( -- ) parse-escaped push-stack ;