Value encodes and writes a constant.Value into the element bitstream.
(val constant.Value)
| 342 | // Value encodes and writes a constant.Value into the element |
| 343 | // bitstream. |
| 344 | func (w *Encoder) Value(val constant.Value) { |
| 345 | w.Sync(SyncValue) |
| 346 | if w.Bool(val.Kind() == constant.Complex) { |
| 347 | w.scalar(constant.Real(val)) |
| 348 | w.scalar(constant.Imag(val)) |
| 349 | } else { |
| 350 | w.scalar(val) |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | func (w *Encoder) scalar(val constant.Value) { |
| 355 | switch v := constant.Val(val).(type) { |