From: NeilBrown Date: Tue, 3 Jun 2014 11:16:58 +0000 (+1000) Subject: scanner: make sure parsing finishes properly when no final end-of-line. X-Git-Tag: workingparser~49 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=699b1a9f70dca7b86373ec5b11597beb1ea4da68 scanner: make sure parsing finishes properly when no final end-of-line. If the last node doesn't end with an end-of-line, we still need to produce all delayed tokens. Signed-off-by: NeilBrown --- diff --git a/csrc/scanner.mdc b/csrc/scanner.mdc index 37b336f..05df51d 100644 --- a/csrc/scanner.mdc +++ b/csrc/scanner.mdc @@ -830,6 +830,11 @@ tokens will continue to return the same end-of-file token. ###### white space if (ch == WEOF) { + if (state->col) { + state->col = 0; + state->check_indent = 1; + continue; + } tk.num = TK_eof; return tk; }