diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 132e09988d..a3e6859447 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -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:" [