pkg: teach gen.go about go/types
This cuts about 30 lines of code, since logic like toValue is obsolete.
We also no longer need to deal with irrelevant bits of the syntax tree.
I'm leaving a TODO about polishing up the use of strings in the future.
For now, this is enough to unblock the use of more complex constants,
since the previous code with toValue was too simple.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Idb6edb844359a9936a719f42ed788e6704f961f8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/557328
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>