Revert "syntax: make it so PRIMITIVE: verifies primitives"
This reverts commit 200ea70cffc4bdc74a97e4981442161f64cdbaa3.db4
parent
a08ba5103a
commit
981862f35e
|
@ -8,7 +8,7 @@ generic.standard generic.hook generic.math generic.parser classes
|
||||||
io.pathnames vocabs vocabs.parser classes.parser classes.union
|
io.pathnames vocabs vocabs.parser classes.parser classes.union
|
||||||
classes.intersection classes.mixin classes.predicate
|
classes.intersection classes.mixin classes.predicate
|
||||||
classes.singleton classes.tuple.parser compiler.units
|
classes.singleton classes.tuple.parser compiler.units
|
||||||
combinators effects effects.parser slots hash-sets source-files ;
|
combinators effects.parser slots hash-sets source-files ;
|
||||||
IN: bootstrap.syntax
|
IN: bootstrap.syntax
|
||||||
|
|
||||||
! These words are defined as a top-level form, instead of with
|
! These words are defined as a top-level form, instead of with
|
||||||
|
@ -26,15 +26,11 @@ IN: bootstrap.syntax
|
||||||
[ dup "syntax" lookup [ ] [ no-word-error ] ?if ] dip
|
[ dup "syntax" lookup [ ] [ no-word-error ] ?if ] dip
|
||||||
define-syntax ;
|
define-syntax ;
|
||||||
|
|
||||||
: verify-primitive ( word vocab effect -- )
|
|
||||||
[ lookup ] dip [ swap stack-effect effect= ] curry [ f ] if*
|
|
||||||
[ "Primitive definition is not correct" throw ] unless ;
|
|
||||||
|
|
||||||
[
|
[
|
||||||
{ "]" "}" ";" ">>" } [ define-delimiter ] each
|
{ "]" "}" ";" ">>" } [ define-delimiter ] each
|
||||||
|
|
||||||
"PRIMITIVE:" [
|
"PRIMITIVE:" [
|
||||||
scan-token current-vocab scan-object verify-primitive
|
"Primitive definition is not supported" throw
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
"CS{" [
|
"CS{" [
|
||||||
|
|
Loading…
Reference in New Issue