parser: fix integer literals

This commit is contained in:
alex committed 2023-09-12 00:46:09 -04:00
1 parent 1b363dcf56
commit f64a54fa06
4 files changed
+16 -8

No files matched your search

@@ -13,11 +13,11 @@ class Parser(source: PeekableSource<Token>, val attribution: NodeAttribution) {
} else {
val integer = it.text.toIntOrNull()
if (integer != null) {
IntegerLiteral(integer)
return@expect IntegerLiteral(integer)
}
val long = it.text.toLongOrNull()
if (long != null) {
LongLiteral(long)
return@expect LongLiteral(long)
}
throw ParseError("Illegal integer value")
}