Commit Graph

125 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto
982cf1ff35 hcl: stop number if whitespace
/cc @sbinet - The issue was in the lexer. It was seeing:

1.2e-10
e =

As:

1.2e-10e
2014-08-22 12:29:30 -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
f65d314d58 hcl: support variable interpolations for compat with libucl 2014-08-21 14:38:45 -07:00
Mitchell Hashimoto
b9f494b747 hcl: support scientific notation 2014-08-21 11:29:33 -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
1a9d040ea4 Support Elem on lists 2014-08-11 21:33:44 -07:00
Mitchell Hashimoto
bf89042e7b hcl: Elem on nil should return nil 2014-08-11 21:11:00 -07:00
Mitchell Hashimoto
99d585c297 Tests pass. 2014-08-11 20:58:20 -07:00
Mitchell Hashimoto
719a177dba decoding structs a bit 2014-08-11 16:51:52 -07:00
Mitchell Hashimoto
a3b46cc5d6 hcl: use new Object structure 2014-08-11 16:13:24 -07:00
Mitchell Hashimoto
61bd5db85c Fix consul test case 2014-08-08 15:16:42 -07:00
Mitchell Hashimoto
a9d6287a6e hcl: support empty lists 2014-08-04 22:45:47 -07:00
Mitchell Hashimoto
0d84234df1 hcl: support booleans 2014-08-04 22:23:11 -07:00
Mitchell Hashimoto
398c583f25 hcl,json: fix list and object ordering 2014-08-04 21:53:39 -07:00
Mitchell Hashimoto
33c2953c5b hcl: set the key 2014-08-04 09:27:50 -07:00
Mitchell Hashimoto
481bfbf3c0 hcl: continue to simplify hcl ast 2014-08-03 22:02:57 -07:00
Mitchell Hashimoto
783acc2aa1 ObjectNodes can only have assignments 2014-08-03 21:56:50 -07:00
Mitchell Hashimoto
8c0a6c555f hcl: negative numbers and floats 2014-08-03 17:33:29 -07:00
Mitchell Hashimoto
42dabeb54f hcl: remove the tests for AST structure 2014-08-03 13:43:34 -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
Mitchell Hashimoto
d5f339015f hcl package for hcl parsing 2014-08-02 11:41:10 -07:00