Operator allows to replace a binary operator with a function.
(operator string, fn ...string)
| 42 | |
| 43 | // Operator allows to replace a binary operator with a function. |
| 44 | func Operator(operator string, fn ...string) Option { |
| 45 | return func(c *conf.Config) { |
| 46 | p := &patcher.OperatorOverloading{ |
| 47 | Operator: operator, |
| 48 | Overloads: fn, |
| 49 | Env: &c.Env, |
| 50 | Functions: c.Functions, |
| 51 | NtCache: &c.NtCache, |
| 52 | } |
| 53 | c.Visitors = append(c.Visitors, p) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // ConstExpr defines func expression as constant. If all argument to this function is constants, |
| 58 | // then it can be replaced by result of this func call on compile step. |
no outgoing calls
searching dependent graphs…