parser: major refinement of error handling

This commit is contained in:
2023-09-18 01:07:28 -07:00
parent 5610326eda
commit 7cb3e02b21
20 changed files with 170 additions and 80 deletions

View File

@ -13,6 +13,7 @@ dependencies {
application {
applicationName = "pork"
mainClass.set("gay.pizza.pork.tool.MainKt")
applicationDefaultJvmArgs += "-XstartOnFirstThread"
}
for (task in arrayOf(tasks.shadowDistTar, tasks.shadowDistZip, tasks.shadowJar)) {

View File

@ -12,7 +12,7 @@ class TokenizeCommand : CliktCommand(help = "Tokenize Compilation Unit", name =
val tool = FileTool(PlatformFsProvider.resolve(path))
val tokenStream = tool.tokenize()
for (token in tokenStream.tokens) {
println("${token.start} ${token.type.name} '${sanitize(token.text)}'")
println("${token.sourceIndex.index} ${token.type.name} '${sanitize(token.text)}'")
}
}