veyron2/vdl: Better codegen for enum and oneof.

Refactored gen.go into separate files and added specific
tests for type and const codegen.

Const codegen isn't supported yet for any, oneof, nilable or
typeval types.  That support is a bit trickier and will be
added later.

Also fixed a couple of bugs in the enum selector logic and
added some tests; previously the vdl compiler would crash
for the following vdl snippet:

  type Foo enum{A;B;C}
  const X = Foo   // slice out-of-range panic
  const Y = Foo.A // enum selector off-by-one failure

Change-Id: I9324b1877b7d704f0f2b6834afe567cd4c46e157
4 files changed
tree: 15541000ce58d64462d68ea6c0da32d2e60e5032
  1. examples/
  2. jni/
  3. lib/
  4. profiles/
  5. runtimes/
  6. security/
  7. services/
  8. tools/