Commit Graph

12 Commits

Author SHA1 Message Date
Alex Hokanson
4e2c88698e add the ability to have custom mappings of type values 2016-09-12 12:40:53 -04:00
Benjamin Pflanz
d79b636dff Use idiomatic error messaging and variable naming, and don't make unnecessary changes. 2016-05-11 12:02:21 -04:00
Benjamin Pflanz
b89a8c9df8 Correct imports and variable naming. 2016-05-03 18:50:41 -04:00
Benjamin Pflanz
7fbe89f60d Use static parsing instead of requiring a binary.
Using go/parser requires a built binary of the code to be enum'ed to
exist. This leads to two problems:
  1. The binary may be very out of date with the code, for example, when
  pulling into an existing repo that was last built locally some time
  ago, running jsonenums on newly added files will fail;
  2. If the binary has never been built, but the code already expects
  the output of jsonenums, it will be impossible to generate the enums,
  making it impossible to build the binary.

In response to a similar issue, Alan Donovan of the Go team suggested
that instead generating tools should be using (the not-yet stable)
x/tools/go/loader package to parse the actual Go code itself rather than
the compilation output: https://github.com/golang/go/issues/11415

This change uses the suggested approach to break the bootstrapping
dependency cycle.
2016-04-21 21:31:47 -04:00
pebers
fb3be6d28a Need to update these paths too. 2016-04-21 09:25:22 -04:00
Francesc Campoy
36bac1a5f6 Merge pull request #8 from neurodrone/master
Correct jsonenums go-generate example run
2015-07-15 10:29:57 -07:00
Vaibhav Bhembre
95e85aea50 Correct jsonenums go-generate example run 2015-06-07 22:16:57 -04:00
Daved
c55a706513 Added prefix flag, and updated file name output. Changed parser
package's ParsePackage to take prefix and updated related skip
conditional.  Also updated args in call to ParsePackage within
server. Last paragraph of main package comment was updated, along
with the second to last paragraph of readme.
2015-04-23 09:50:48 -07:00
Daved
a9a20fa77c Corrected minor typo in last paragraph of package main comment. 2015-04-23 09:24:46 -07:00
Francesc Campoy
62c6805a74 moving the parser to a reusable package
Change-Id: Ic684b209c2179e357febdf48f068906058506500
2015-02-03 06:01:04 +00:00
Francesc Campoy
5cd7ec204a support of decoding for Stringers 2015-01-31 12:21:55 +01:00
Francesc Campoy
66a9dd356f initial commit 2015-01-29 11:35:15 +01:00