X-Git-Url: https://ocean-lang.org/code/?a=blobdiff_plain;f=csrc%2Fscanner.mdc;h=fa27a89524a85d4eeb9a16019558e61a993afb5f;hb=c040191336b755321af667a0251b97782d8eed71;hp=84eaf4af60f427d7f7f90adc7753833b786894b1;hpb=edb6ad84004330f82b5b4d3c96e47c77c80e9b3f;p=ocean diff --git a/csrc/scanner.mdc b/csrc/scanner.mdc index 84eaf4a..fa27a89 100644 --- a/csrc/scanner.mdc +++ b/csrc/scanner.mdc @@ -934,6 +934,7 @@ a flag that tells us whether or not we need to strip. int offset; int line; int col; + int strip_offset; ###### internal functions @@ -973,6 +974,7 @@ a flag that tells us whether or not we need to strip. return WEOF; state->line = state->node->line_no; state->col = do_strip(state); + state->strip_offset = state->offset; } ## before get_char @@ -1126,7 +1128,7 @@ differently there. 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) @@ -1210,6 +1212,7 @@ As well as getting tokens, we need to be able to create the state->node = code; state->line = code->line_no; state->col = do_strip(state); + state->strip_offset = state->offset; state->conf = conf; return state; }