TokensForValue returns a sequence of tokens that represents the given constant value. This function only supports types that are used by HCL. In particular, it does not support capsule types and will panic if given one. It is not possible to express an unknown value in source code, so this functio
(val cty.Value)
| 24 | // values. A caller can call the value's IsWhollyKnown method to verify that |
| 25 | // no unknown values are present before calling TokensForValue. |
| 26 | func TokensForValue(val cty.Value) Tokens { |
| 27 | toks := appendTokensForValue(val, nil) |
| 28 | format(toks) // fiddle with the SpacesBefore field to get canonical spacing |
| 29 | return toks |
| 30 | } |
| 31 | |
| 32 | // TokensForTraversal returns a sequence of tokens that represents the given |
| 33 | // traversal. |