(name string)
| 74 | } |
| 75 | |
| 76 | func (c *Config) ConstExpr(name string) { |
| 77 | if c.EnvObject == nil { |
| 78 | panic("no environment is specified for ConstExpr()") |
| 79 | } |
| 80 | fn := reflect.ValueOf(runtime.Fetch(c.EnvObject, name)) |
| 81 | if fn.Kind() != reflect.Func { |
| 82 | panic(fmt.Errorf("const expression %q must be a function", name)) |
| 83 | } |
| 84 | c.ConstFns[name] = fn |
| 85 | } |
| 86 | |
| 87 | type Checker interface { |
| 88 | Check() |