From: NeilBrown Date: Sun, 21 Jul 2013 07:52:39 +0000 (+1000) Subject: scanner: initialise token state properly. X-Git-Tag: draftparser~8 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=3f095c04cdef1e545350a03648c7439eec38fea0 scanner: initialise token state properly. We need to call do_strip() at the start to ensure the correct col and indent is used for the first token. Signed-off-by: NeilBrown --- diff --git a/csrc/scanner.mdc b/csrc/scanner.mdc index 57f9e21..6dda848 100644 --- a/csrc/scanner.mdc +++ b/csrc/scanner.mdc @@ -1107,7 +1107,9 @@ As well as getting tokens, we need to be able to create the memset(state, 0, sizeof(*state)); state->node = code; state->line = code->line_no; + state->col = code->indent; state->conf = conf; + do_strip(state); return state; } void token_close(struct token_state *state)