refactor: style fixes in lexer and parser

This commit is contained in:
Guy C
2025-02-07 11:23:18 +00:00
parent ee1ea6c63b
commit 8583a815a8
2 changed files with 13 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ val errConfig = new ErrorConfig {
"false" -> Label("boolean literal"),
"true" -> Label("boolean literal"),
"=" -> Label("assignment"),
"[" -> Label("array index"),
"[" -> Label("array index")
)
}
object lexer {
@@ -88,7 +88,7 @@ object lexer {
(lexer.nonlexeme.character.ascii).map(c => s"character literal \'$c\'"),
lexer.nonlexeme.string.ascii.map(s => s"string literal \"$s\""),
// lexer.nonlexeme.symbol("()").as("function call, bruh use keyword 'call' to call functions"),
character.whitespace.map(_ => ""),
character.whitespace.map(_ => "")
) ++ desc.symbolDesc.hardKeywords.map { k =>
lexer.nonlexeme.symbol(k).as(s"keyword $k")
}