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

@ -110,14 +110,18 @@ func (lexer *LexingOperation) tokenizeSymbolBeginning () (err error) {
file.ErrorKindWarn)
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