philhofer/msgp — pull request #32 by philhofer (2014-11-19 23:40:35+00:00)
Title: Shim2

**Work-in-progress** feature request for #31.

This PR is a major overhaul of `/parse`, partly because I anticipate we will want to add more preprocessor directives in the future.

So, right now, there are two recognized "directives:"
##### shim
```go
//msgp:shim MyEnum as:string using:(MyEnum).String/myenumStr

type MyEnum uint8

func (m MyEnum) String() { /* */ }

func myEnumStr(s string) MyEnum { /* */ }
```
`shim` uses a pair of conversion functions to convert one type to another in the generated code. Among other things, this allows for Go's `const`/`iota` blocks to be turned into strings during encoding.

##### ignore
```go
//msgp:ignore TypeA TypeB TypeC
```
`ignore` just tells the generator not to generate code for the named types.