syntax: Add a "syntax" word property for tracking which words are defined with SYNTAX: as opposed to generated syntax words.
parent
352e5de16a
commit
0a7bfd3635
|
|
@ -23,8 +23,16 @@ IN: bootstrap.syntax
|
|||
: define-delimiter ( name -- )
|
||||
"syntax" lookup-word t "delimiter" set-word-prop ;
|
||||
|
||||
! Keep track of words defined by SYNTAX: as opposed to words
|
||||
! merely generated by define-syntax.
|
||||
: mark-top-level-syntax ( word -- word )
|
||||
dup t "syntax" set-word-prop ;
|
||||
|
||||
: define-core-syntax ( name quot -- )
|
||||
[ dup "syntax" lookup-word [ ] [ no-word-error ] ?if ] dip
|
||||
[
|
||||
dup "syntax" lookup-word [ ] [ no-word-error ] ?if
|
||||
mark-top-level-syntax
|
||||
] dip
|
||||
define-syntax ;
|
||||
|
||||
[
|
||||
|
|
@ -114,7 +122,9 @@ IN: bootstrap.syntax
|
|||
"deprecated" [ last-word make-deprecated ] define-core-syntax
|
||||
|
||||
"SYNTAX:" [
|
||||
scan-new-word parse-definition define-syntax
|
||||
scan-new-word
|
||||
mark-top-level-syntax
|
||||
parse-definition define-syntax
|
||||
] define-core-syntax
|
||||
|
||||
"BUILTIN:" [
|
||||
|
|
|
|||
Loading…
Reference in New Issue