Constant represents a constant symbol and other structures (e.g. pair, list map, struct).
| 255 | |
| 256 | // Constant represents a constant symbol and other structures (e.g. pair, list map, struct). |
| 257 | type Constant struct { |
| 258 | // The (runtime) type of this constant. |
| 259 | Type ConstantType |
| 260 | |
| 261 | // If Type \in {StringType, BytesType}, the data itself. |
| 262 | // Otherwise, a string representation. |
| 263 | Symbol string |
| 264 | |
| 265 | // For NumberType, the number value (int64 or the bytes of a float64). |
| 266 | // For other types it contains a hash code of the value. |
| 267 | NumValue int64 |
| 268 | |
| 269 | // For a pair constant, the first component. |
| 270 | // For a list constant, the head of the list. |
| 271 | // For a map constant, the first map entry. |
| 272 | // For a struct constant, the first field. |
| 273 | fst *Constant |
| 274 | |
| 275 | // For a pair constant, the second component |
| 276 | // For a list constant, the tail of the list. |
| 277 | // For a map constant, the tail of the entries. |
| 278 | // For a struct constant, the tail of the fields. |
| 279 | snd *Constant |
| 280 | } |
| 281 | |
| 282 | // Name constructs a new name constant while checking that constant symbol starts with a '/' and |
| 283 | // does not contain empty parts. |
nothing calls this directly
no outgoing calls
no test coverage detected