~jpl8/lorthc3

bc50c03a12141cf8ff68aa0bc3eb42f619a39532 — jpl 1 year, 10 months ago 57cf1cb
Clean error
1 files changed, 11 insertions(+), 3 deletions(-)

M src/compiler.rs
M src/compiler.rs => src/compiler.rs +11 -3
@@ 535,7 535,15 @@ impl ForthCompiler {
        self.asm.label("error");
        let question = self.asm.reference_label("question");
        self.asm.load(R0, question);
        self.asm.out_char().out_char();
        self.out_char().out_char();
        self.asm
            .zero(R0)
            .add(R0, R0, AddMode::Immediate('\n' as Word));
        self.out_char();

        // Restart
        let start = self.asm.reference_label("start");
        self.asm.branch_unconditionally(start);

        self
    }


@@ 563,8 571,7 @@ impl ForthCompiler {
    }

    pub fn compile(&mut self) -> Result<&mut Self> {
        self.error()
            .start()
        self.start()
            .interpret_loop()
            .parse_words()
            .read_input()


@@ 574,6 581,7 @@ impl ForthCompiler {
            .load_intermediate_cells()
            // .print_tib()?
            .halt()
            .error()
            .assemble()?;

        // eprintln!("{:?}", self.asm.instructions);