Merge branch 'ast' into parser

This commit is contained in:
2025-02-01 20:47:05 +00:00
6 changed files with 28 additions and 37 deletions

View File

@@ -12,22 +12,19 @@ object lexer {
),
symbolDesc = SymbolDesc.plain.copy(
hardKeywords = Set(
"begin", "end", "is", "skip", "if", "then", "else", "fi", "while", "do",
"done", "read", "free", "return", "exit", "print", "println", "true",
"false", "int", "bool", "char", "string", "pair", "newpair", "fst",
"snd", "call", "chr", "ord", "len", "null"
"begin", "end", "is", "skip", "if", "then", "else", "fi", "while", "do", "done", "read",
"free", "return", "exit", "print", "println", "true", "false", "int", "bool", "char",
"string", "pair", "newpair", "fst", "snd", "call", "chr", "ord", "len", "null"
),
hardOperators = Set(
"+", "-", "*", "/", "%", ">", "<", ">=", "<=", "==", "!=", "&&", "||",
"!"
"+", "-", "*", "/", "%", ">", "<", ">=", "<=", "==", "!=", "&&", "||", "!"
)
),
spaceDesc = SpaceDesc.plain.copy(
lineCommentStart = "#"
),
textDesc = TextDesc.plain.copy(
graphicCharacter =
Basic(c => c >= ' ' && c != '\\' && c != '\'' && c != '"'),
graphicCharacter = Basic(c => c >= ' ' && c != '\\' && c != '\'' && c != '"'),
escapeSequences = EscapeDesc.plain.copy(
literals = Set('\\', '"', '\''),
mapping = Map(