Commit Graph

90 Commits

Author SHA1 Message Date
Mitchell Hashimoto
338eebdbf7 test for decoding structures within lists 2015-11-07 16:48:38 -08:00
Mitchell Hashimoto
e3ed2553ca json: pass to clean up objcet lists 2015-11-07 16:34:47 -08:00
Mitchell Hashimoto
60534579be json: magic flatten step to make things more HCL-like 2015-11-07 16:00:02 -08:00
Mitchell Hashimoto
e370e34aeb down to one failing test 2015-11-07 00:12:04 -08:00
Mitchell Hashimoto
5486421143 hcl: multi-line comments aren't allowed to terminate with EOF 2015-06-23 21:38:11 -07:00
Mitchell Hashimoto
681623f4e1 hcl: don't allow nested comments
This copies C's behavior and disallows nested block comments. It ignores
a new /* within an existing block comment and ends at the first */
2015-06-23 21:34:40 -07:00
Mitchell Hashimoto
e51eabcdf8 parse floats 1.02 properly [GH-19] 2014-11-12 21:29:07 -08:00
Mitchell Hashimoto
88ef419bd9 Properly decode \\n 2014-11-12 21:12:45 -08:00
Mitchell Hashimoto
764b0ad3c0 Allow escaping quotes in HCL string [GH-14] 2014-10-10 16:07:25 -07:00
Mitchell Hashimoto
09d7815762 fix a crash if a non-pointer is given to Decode
/cc @sethvargo
2014-10-09 20:57:50 -07:00
Mitchell Hashimoto
cd87a48c3c decode strings to ints 2014-09-30 22:29:21 -07:00
Mitchell Hashimoto
a0a5d2873e hcl: identifiers can have '-' 2014-08-28 17:03:42 -07:00
Mitchell Hashimoto
71e25b33f0 Fix broken parsing case 2014-08-28 16:56:08 -07:00
Sebastien Binet
8438e17f49 all: first stab to full scientific notation support 2014-08-22 10:34:03 +02:00
Mitchell Hashimoto
26239b8eab hcl: support heredocs [GH-6] 2014-08-21 14:54:13 -07:00
Mitchell Hashimoto
8a779f6e41 json: support \n 2014-08-21 14:42:02 -07:00
Mitchell Hashimoto
f65d314d58 hcl: support variable interpolations for compat with libucl 2014-08-21 14:38:45 -07:00
Mitchell Hashimoto
c6802d3070 Actually decode list of objects properly in JSON 2014-08-21 14:02:29 -07:00
Mitchell Hashimoto
65159dc252 Don't double-nest lists of objects 2014-08-21 13:32:31 -07:00
Mitchell Hashimoto
b9f494b747 hcl: support scientific notation 2014-08-21 11:29:33 -07:00
Mitchell Hashimoto
e868ca02fd Support decoding floats, scientific notation for JSON [GH-5] 2014-08-21 11:22:37 -07:00
Mitchell Hashimoto
b699557f16 Decode into proper arrays of things, add many test cases
/cc @armon - This changes how Consul has to define its structure. Ping
me tomorrow to learn more, but going to leave it here for reference too:

The Consul case (there is a test case) never worked even with go-libucl,
because there is an ambiguity of whether you want the inner children or
the array of outer elements (the slice in the Policy struct).

I've added a new modifier you can specify with a tag called "expand"
which will tell hcl to expand the value to its children for decoding.
You can see me use it in the test case which verifies that the Consul
ACLs parse.
2014-08-17 23:50:44 -07:00
Mitchell Hashimoto
21b17881bd Fix infinite loop in decodeMap 2014-08-11 21:49:12 -07:00
Mitchell Hashimoto
99d585c297 Tests pass. 2014-08-11 20:58:20 -07:00
Mitchell Hashimoto
61e6b8179b decoding maps works 2014-08-11 16:38:36 -07:00
Mitchell Hashimoto
a4f0365393 Failing test 2014-08-11 14:19:35 -07:00
Mitchell Hashimoto
0b07544203 convert types for type aliases 2014-08-08 16:07:08 -07:00
Mitchell Hashimoto
437eb0d851 decode JSON equally 2014-08-08 15:58:34 -07:00
Mitchell Hashimoto
95d9b2e530 Decoding into a slice with a non-list should make list 2014-08-08 14:59:28 -07:00
Mitchell Hashimoto
ae8e4f9b5e Decode into pointers 2014-08-03 17:17:17 -07:00
Mitchell Hashimoto
daed1fd01d decoder can decode into structures 2014-08-03 14:06:18 -07:00
Mitchell Hashimoto
96e92c5213 Decode into flat structures for objects 2014-08-03 13:09:08 -07:00
Mitchell Hashimoto
1bffcd38ba structure2 test 2014-08-02 22:18:39 -07:00
Mitchell Hashimoto
dec60315c8 update decoder to be better interface-aware 2014-08-02 22:12:51 -07:00
Mitchell Hashimoto
c3506acf01 decode more complex structs 2014-08-02 22:05:21 -07:00
Mitchell Hashimoto
8e81ec8b57 Decoder expands exact objects into lists 2014-08-02 21:29:59 -07:00
Mitchell Hashimoto
efca695ce4 Add tests for equality in JSON and HCL 2014-08-02 20:48:36 -07:00
Mitchell Hashimoto
bbf6292cbe Passing tests 2014-08-02 20:40:41 -07:00
Mitchell Hashimoto
b2ba9e7b3e Decode structures 2014-08-02 16:07:54 -07:00
Mitchell Hashimoto
59e0ca9d5a Start the decoder 2014-08-02 15:44:45 -07:00