staging-violation ( word -- * )
Factor documentation > Factor handbook > The language > Parsing words
Prev:SYNTAX:
Next:Reading ahead


Vocabulary
parser

Inputs and outputs
worda word


Word description
Throws a staging-violation error.

Error description
Thrown by the parser if a parsing word is used in the same compilation unit as where it was defined; see Compilation units.

Notes
One possible workaround is to use the << word to execute code at parse time. However, executing words defined in the same source file at parse time is still prohibited.

Definition
IN: parser

TUPLE: staging-violation { word read-only } ;


USING: kernel ;

IN: parser

: staging-violation ( word -- * )
\ staging-violation boa throw ;


Methods
USING: kernel parser summary ;

M: staging-violation summary
drop
"A parsing word cannot be used in the same file it is defined in."
;