Example #1
0
        public override Opcode LoadOpcode(BinaryReader reader)
        {
            Opcode leftSide = this.Interpreter.Step(reader);

            if (leftSide is not OpcodeDEFSTRING defstring)
            {
                throw new DogmaMachineException("OpcodeUE (user error) must specify a exception name to throw");
            }

            this.LeftSide = defstring;

            return(this);
        }
Example #2
0
        public override Opcode LoadOpcode(BinaryReader reader)
        {
            Opcode message = this.Interpreter.Step(reader);

            // the previous opcode should be a DEFSTRING which is the error message to send to the user
            if (message is not OpcodeDEFSTRING defstring)
            {
                throw new DogmaMachineException("The previous opcode is not a string");
            }

            this.ErrorMessage = defstring;

            return(this);
        }