feat(lexer): Scan empty string
This commit is contained in:
parent
4054ed5fce
commit
f72501fde2
5 changed files with 45 additions and 0 deletions
11
src/lexer/Lexer.kt
Normal file
11
src/lexer/Lexer.kt
Normal file
|
@ -0,0 +1,11 @@
|
|||
package lexer
|
||||
|
||||
class Lexer {
|
||||
fun scan(source: String): List<Token> {
|
||||
if (source.isEmpty()) {
|
||||
return listOf(Token(TokenType.EOF, LexerPosition(1, 1, 0)))
|
||||
}
|
||||
|
||||
return emptyList()
|
||||
}
|
||||
}
|
Reference in a new issue