Current test for "at start of node" is broken for 2 reasons.
1/ it doesn't account for the node-indent chars that are stripped
off by do_strip()
2/ it check the ->offset *after* a character has been extracted,
it needs to check the offset from before, which is in ->prev_offset
Signed-off-by: NeilBrown <neil@brown.name>
int offset;
int line;
int col;
+ int strip_offset;
###### internal functions
return WEOF;
state->line = state->node->line_no;
state->col = do_strip(state);
+ state->strip_offset = state->offset;
}
## before get_char
static int at_son(struct token_state *state)
{
- return state->offset == 0;
+ return state->prev_offset <= state->strip_offset;
}
static int at_eon(struct token_state *state)
state->node = code;
state->line = code->line_no;
state->col = do_strip(state);
+ state->strip_offset = state->offset;
state->conf = conf;
return state;
}