Indentation tokens now carry their indentation level
They are no longer stored in sequence
This commit is contained in:
parent
471eb863f4
commit
ee9fa3a766
@ -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
|
||||
|
Reference in New Issue
Block a user