Add function in parser for checking if a word is reserved

This commit is contained in:
Sasha Koshka 2024-04-02 02:59:11 -04:00
parent 08eedaf74d
commit 423f3ba22f

13
parser/fspl/reserved.go Normal file
View File

@ -0,0 +1,13 @@
package fsplParser
func IsReserved (identifier string) bool {
switch identifier {
case "true", "false", "nil",
"if", "match", "switch",
"loop", "for",
"then", "in",
"break", "return":
return true
default: return false
}
}