Marcel van Lohuizen | d96ad3d | 2018-12-10 15:30:20 +0100 | [diff] [blame] | 1 | // Copyright 2018 The CUE Authors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package internal // import "cuelang.org/go/internal" |
| 16 | |
| 17 | // TODO: refactor packages as to make this package unnecessary. |
| 18 | |
| 19 | // DebugStr prints a syntax node. |
| 20 | var DebugStr func(x interface{}) string |
Marcel van Lohuizen | 17157ea | 2018-12-11 10:41:10 +0100 | [diff] [blame] | 21 | |
| 22 | // EvalExpr evaluates an expression within an existing struct value. |
| 23 | // Identifiers only resolve to values defined within the struct. |
| 24 | // |
| 25 | // Expressions may refer to builtin packages if they can be uniquely identified |
| 26 | // |
| 27 | // Both value and result are of type cue.Value, but are an interface to prevent |
| 28 | // cyclic dependencies. |
| 29 | // |
| 30 | // TODO: extract interface |
| 31 | var EvalExpr func(value, expr interface{}) (result interface{}) |