File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -33,3 +33,32 @@ func GetCelEnv(environment map[string]any) []cel.EnvOption {
33
33
34
34
return opts
35
35
}
36
+
37
+ // The following identifiers are reserved to allow easier embedding of CEL into a host language.
38
+ //
39
+ // Reference: https://github.com/google/cel-spec/blob/master/doc/langdef.md
40
+ var celKeywords = map [string ]struct {}{
41
+ "as" : {},
42
+ "break" : {},
43
+ "const" : {},
44
+ "continue" : {},
45
+ "else" : {},
46
+ "for" : {},
47
+ "function" : {},
48
+ "if" : {},
49
+ "import" : {},
50
+ "let" : {},
51
+ "loop" : {},
52
+ "namespace" : {},
53
+ "package" : {},
54
+ "return" : {},
55
+ "var" : {},
56
+ "void" : {},
57
+ "while" : {},
58
+ }
59
+
60
+ // IsCelKeyword returns true if the given key is a reserved word in Cel
61
+ func IsCelKeyword (key string ) bool {
62
+ _ , ok := celKeywords [key ]
63
+ return ok
64
+ }
You can’t perform that action at this time.
0 commit comments