Add function in parser for checking if a word is reserved
This commit is contained in:
parent
08eedaf74d
commit
423f3ba22f
13
parser/fspl/reserved.go
Normal file
13
parser/fspl/reserved.go
Normal 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
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user