lexer: Add char: \' support. Fix ch'\' support
parent
59f406b64e
commit
bd329c7497
|
@ -151,8 +151,14 @@ PREDICATE: unexpected-eof < unexpected got>> not ;
|
||||||
|
|
||||||
: strict-single-quote? ( string -- ? )
|
: strict-single-quote? ( string -- ? )
|
||||||
"'" split1
|
"'" split1
|
||||||
[ [ char: ' swap member? not ] [ drop t ] bi and ]
|
[ drop t ]
|
||||||
[ [ length 0 > ] [ "'" tail? not ] bi and ] bi* and ;
|
[
|
||||||
|
[ length 0 > ]
|
||||||
|
[
|
||||||
|
! ch'\'
|
||||||
|
[ "\\'" tail? ] [ "'" tail? not ] bi or
|
||||||
|
] bi and
|
||||||
|
] bi* and ;
|
||||||
|
|
||||||
: strict-lower-colon? ( string -- ? )
|
: strict-lower-colon? ( string -- ? )
|
||||||
[ char: \: = ] cut-tail
|
[ char: \: = ] cut-tail
|
||||||
|
|
|
@ -31,6 +31,7 @@ ERROR: bad-escape char ;
|
||||||
{ char: \] char: \] }
|
{ char: \] char: \] }
|
||||||
{ char: \} char: \} }
|
{ char: \} char: \} }
|
||||||
{ char: \) char: \) }
|
{ char: \) char: \) }
|
||||||
|
{ char: \' char: \' }
|
||||||
} ?at [ bad-escape ] unless ;
|
} ?at [ bad-escape ] unless ;
|
||||||
|
|
||||||
INITIALIZED-SYMBOL: name>char-hook [
|
INITIALIZED-SYMBOL: name>char-hook [
|
||||||
|
|
Loading…
Reference in New Issue