factor: allow SYNTAX: to have escaped names.
parent
153239ada6
commit
cb92c8c448
|
@ -108,12 +108,18 @@ ERROR: staging-violation word ;
|
|||
V{ } clone swap execute-parsing first
|
||||
] when ;
|
||||
|
||||
: scan-parsing-word ( -- word )
|
||||
! Allows HELP: \ { ... ; and SYNTAX: \ { ... ;
|
||||
: scan-escaped-word-string ( -- string )
|
||||
?scan-token dup "\\" = [
|
||||
drop scan-word
|
||||
] [
|
||||
parse-word
|
||||
] if ;
|
||||
drop ?scan-token
|
||||
] when ;
|
||||
|
||||
: scan-escaped-word ( -- word )
|
||||
scan-escaped-word-string parse-word ;
|
||||
|
||||
: scan-new-escaped ( -- word )
|
||||
scan-escaped-word-string check-word-name
|
||||
create-word-in dup reset-generic ;
|
||||
|
||||
ERROR: classoid-expected object ;
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ in: bootstrap.syntax
|
|||
"@deprecated" [ last-word make-deprecated ] define-core-syntax
|
||||
|
||||
"SYNTAX:" [
|
||||
scan-new-word
|
||||
scan-new-escaped
|
||||
mark-top-level-syntax
|
||||
parse-definition define-syntax
|
||||
] define-core-syntax
|
||||
|
|
|
@ -55,4 +55,4 @@ ERROR: bad-storage-string string reason ;
|
|||
: n>money ( n -- string )
|
||||
3 10 { "" "K" "M" "B" "T" } reduce-magnitude ;
|
||||
|
||||
SYNTAX: STORAGE: scan-token storage>n suffix! ;
|
||||
SYNTAX: \ STORAGE: scan-token storage>n suffix! ;
|
||||
|
|
|
@ -5,7 +5,7 @@ help.topics kernel math parser sequences vocabs.parser words ;
|
|||
in: help.syntax
|
||||
|
||||
SYNTAX: HELP:
|
||||
scan-parsing-word bootstrap-word
|
||||
scan-escaped-word bootstrap-word
|
||||
[ >link save-location ]
|
||||
[ [ \ ; parse-until >array ] dip set-word-help ]
|
||||
bi ;
|
||||
|
|
Loading…
Reference in New Issue