]> gitweb.factorcode.org Git - factor.git/commitdiff
regexp: fixing the name collision for ^.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Dec 2020 15:26:08 +0000 (07:26 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Dec 2020 15:26:08 +0000 (07:26 -0800)
basis/regexp/classes/classes.factor
basis/regexp/compiler/compiler.factor
basis/regexp/nfa/nfa.factor
basis/regexp/parser/parser.factor

index c3ff7410f051e2e6d3386a5f5b73e5937212a9d1..780ba37f938d63474a10e08ece67148627d95254 100644 (file)
@@ -12,7 +12,7 @@ ascii-class punctuation-class java-printable-class blank-class
 control-character-class hex-digit-class java-blank-class c-identifier-class
 unmatchable-class terminator-class word-boundary-class ;
 
-SINGLETONS: beginning-of-input ^ end-of-input $ end-of-file
+SINGLETONS: beginning-of-input ^crlf end-of-input $crlf end-of-file
 ^unix $unix word-break ;
 
 TUPLE: range-class { from read-only } { to read-only } ;
index 274b9a579799a4f091ebd18bd26ba6e18b75455c..f4fff592ecea35370d9a7653b4212ec9e1e469e9 100644 (file)
@@ -30,10 +30,10 @@ M: end-of-file question>quot
         } 2&&
     ] ;
 
-M: $ question>quot
+M: $crlf question>quot
     drop [ { [ length = ] [ ?nth "\r\n" member? ] } 2|| ] ;
 
-M: ^ question>quot
+M: ^crlf question>quot
     drop [ { [ drop zero? ] [ [ 1 - ] dip ?nth "\r\n" member? ] } 2|| ] ;
 
 M: $unix question>quot
index 2cc276d75644511a4758678ebb741453c937fc1c..ea4671e8833415f07639a5da3c14d984063d15e7 100644 (file)
@@ -63,10 +63,10 @@ M: object modify-epsilon ;
         drop [ unix-lines option? ] 2dip swap ?
     ] [ 2nip ] if ;
 
-M: $ modify-epsilon
+M: $crlf modify-epsilon
     $unix end-of-input line-option ;
 
-M: ^ modify-epsilon
+M: ^crlf modify-epsilon
     ^unix beginning-of-input line-option ;
 
 M: tagged-epsilon nfa-node
index f28aa61c39c57d394ef4502a9f6141969bd80b83..28b99cfb094a3aad14c09a8cfb6f6276b1a2224c 100644 (file)
@@ -148,8 +148,8 @@ Escape = "p{" CharacterInBracket*:s "}" => [[ s name>class <primitive-class> ]]
 EscapeSequence = "\\" Escape:e => [[ e ]]
 
 Character = EscapeSequence
-          | "$" => [[ $ <tagged-epsilon> ]]
-          | "^" => [[ ^ <tagged-epsilon> ]]
+          | "$" => [[ $crlf <tagged-epsilon> ]]
+          | "^" => [[ ^crlf <tagged-epsilon> ]]
           | . ?[ allowed-char? ]?
 
 AnyRangeCharacter = !("&&"|"||"|"--"|"~~") (EscapeSequence | .)