regexp: rename $ and ^

locals-and-roots
Doug Coleman 2016-06-25 16:56:28 -07:00
parent 5f7c522414
commit c52788d3ef
4 changed files with 7 additions and 7 deletions

View 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 begin-anchor end-of-input end-anchor end-of-file
^unix $unix word-break ;
TUPLE: range-class { from read-only } { to read-only } ;

View File

@ -30,10 +30,10 @@ M: end-of-file question>quot
} 2&&
] ;
M: $ question>quot
M: end-anchor question>quot
drop [ { [ length = ] [ ?nth "\r\n" member? ] } 2|| ] ;
M: ^ question>quot
M: begin-anchor question>quot
drop [ { [ drop zero? ] [ [ 1 - ] dip ?nth "\r\n" member? ] } 2|| ] ;
M: $unix question>quot

View File

@ -63,10 +63,10 @@ M: object modify-epsilon ;
drop [ unix-lines option? ] 2dip swap ?
] [ 2nip ] if ;
M: $ modify-epsilon
M: end-anchor modify-epsilon
$unix end-of-input line-option ;
M: ^ modify-epsilon
M: begin-anchor modify-epsilon
^unix beginning-of-input line-option ;
M: tagged-epsilon nfa-node

View File

@ -146,8 +146,8 @@ Escape = "p{" CharacterInBracket*:s "}" => [[ s name>class <primitive-class> ]]
EscapeSequence = "\\" Escape:e => [[ e ]]
Character = EscapeSequence
| "$" => [[ $ <tagged-epsilon> ]]
| "^" => [[ ^ <tagged-epsilon> ]]
| "$" => [[ end-anchor <tagged-epsilon> ]]
| "^" => [[ begin-anchor <tagged-epsilon> ]]
| . ?[ allowed-char? ]?
AnyRangeCharacter = !("&&"|"||"|"--"|"~~") (EscapeSequence | .)