Indentation tokens now carry their indentation level

They are no longer stored in sequence
This commit is contained in:
Sasha Koshka 2022-08-11 12:53:20 -05:00
parent 471eb863f4
commit ee9fa3a766

View File

@ -111,13 +111,17 @@ func (lexer *LexingOperation) tokenizeSymbolBeginning () (err error) {
break
}
indentLevel := 0
for lexer.char == '\t' {
lexer.addToken (Token {
kind: TokenKindIndent,
})
indentLevel ++
err = lexer.nextRune()
if err != nil { return }
}
lexer.addToken (Token {
kind: TokenKindIndent,
value: indentLevel,
})
case '\n':
// line break
lastLineEmpty := true