From e60ab58187c7b8851f7eceb32789f993f6008dcb Mon Sep 17 00:00:00 2001 From: joshvera Date: Thu, 12 Nov 2015 13:25:35 -0500 Subject: [PATCH] maybe increment line and column here? --- src/runtime/lexer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/runtime/lexer.c b/src/runtime/lexer.c index e2b67610..5fda417d 100644 --- a/src/runtime/lexer.c +++ b/src/runtime/lexer.c @@ -68,6 +68,13 @@ static bool ts_lexer__advance(TSLexer *self, TSStateId state) { if (self->lookahead_size) { self->current_position.bytes += self->lookahead_size; self->current_position.chars += 1; + + if (self->lookahead == '\n') { + self->current_source_info.line += 1; + self->current_source_info.column = 0; + } else { + self->current_source_info.column += 1; + } } if (self->current_position.bytes >= self->chunk_start + self->chunk_size)