syntax: Add a "syntax" word property for tracking which words are defined with SYNTAX: as opposed to generated syntax words.

db4
Doug Coleman 2015-06-29 18:45:16 -07:00
parent 352e5de16a
commit 0a7bfd3635
1 changed files with 12 additions and 2 deletions

View File

@ -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:" [