]> ocean-lang.org Git - ocean/commitdiff
scanner: initialise token state properly.
authorNeilBrown <neilb@suse.de>
Sun, 21 Jul 2013 07:52:39 +0000 (17:52 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 21 Jul 2013 07:52:39 +0000 (17:52 +1000)
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 <neilb@suse.de>
csrc/scanner.mdc

index 57f9e21b0c4c916af6b9cda625bcdc444ef0ae0a..6dda84832c8931a0f9e7f33d5118680380d95fdf 100644 (file)
@@ -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)