Commit Graph

1203 Commits

Author SHA1 Message Date
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
513e04c400 hcl: use stringer to generate string values for ValueType 2015-01-15 15:12:25 -08:00
Mitchell Hashimoto
3c3a30a1e5 Use go generate to generate parsers 2015-01-15 15:11:14 -08:00
Ryan Uber
e37b5bd61b Merge pull request #26 from amalaviy/go-multierror
Modified to import go-multierror rather than terraform
2014-12-29 12:01:23 -08:00
Atin Malaviya
98bdeedb2c Missed one more go-multierror 2014-12-24 18:34:28 -05:00
Atin Malaviya
5f50053914 Modified to import github.com/hashicorp/go-multierror rather than terraform's multierror. 2014-12-24 17:49:50 -05:00
Mitchell Hashimoto
256bb51ed8 hcl: support "." in identifier 2014-12-17 11:39:45 -08:00
Mitchell Hashimoto
2c88e7ea6e json: true, false, null lex [GH-22] 2014-11-21 10:59:12 -08: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
ab2c4c3120 hcl: complex keys can be set using strings 2014-11-12 21:08:08 -08:00
Seth Vargo
96d5b40433 Merge pull request #17 from ceh/fix-format-errors
decoder: fix format error due to invalid argument (byte to string)
2014-11-02 09:28:30 -05:00
Emil Hessman
bfbcde0237 decoder: fix format error due to invalid argument (byte to string) 2014-11-02 12:57:26 +01:00
Mitchell Hashimoto
0998ab58fc Merge pull request #16 from hartzler/typo
fixup comment typo
2014-10-16 07:54:55 -07:00
Matt Hartzler
f41fb6a9c4 fixup comment typo 2014-10-16 09:53:03 -05:00
Mitchell Hashimoto
25719dbfed Update README.md 2014-10-15 20:29:50 -07: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
6606366746 hcl: trailing comma support in HCL 2014-09-30 14:58:50 -07:00
Mitchell Hashimoto
b00a1b045d Empty files are HCL 2014-09-15 09:40:47 -07:00
Mitchell Hashimoto
3fc289c4d2 hcl: test parsing an empty file 2014-09-15 09:38:43 -07:00
Mitchell Hashimoto
86d22484a4 hcl: can parse empty file with just a comment 2014-09-14 19:59:36 -07:00
Mitchell Hashimoto
9b5d9eb9b0 hcl: fix scenario where infinite loop happens 2014-09-07 16:18:56 -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
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
Mitchell Hashimoto
11de47961f Merge pull request #7 from gonuts/dev/complete-scientific-notation
all: first stab at full scientific notation support
2014-08-22 12:24:02 -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
2b53be2ffe Update README 2014-08-21 11:29:54 -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
0cb0fcb714 Merge pull request #1 from kaleworsley/patch-1
`continue` -> `contain`
2014-08-12 17:48:49 -07:00
Kale Worsley
601de91d2d continue -> contain. 2014-08-13 12:39:04 +12:00
Mitchell Hashimoto
21b17881bd Fix infinite loop in decodeMap 2014-08-11 21:49:12 -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
61e6b8179b decoding maps works 2014-08-11 16:38:36 -07:00
Mitchell Hashimoto
f340e2e557 compiles, all tests failing 2014-08-11 16:33:28 -07:00
Mitchell Hashimoto
e704c5b624 json: parses 2014-08-11 16:23:28 -07:00
Mitchell Hashimoto
a3b46cc5d6 hcl: use new Object structure 2014-08-11 16:13:24 -07:00
Mitchell Hashimoto
a4f0365393 Failing test 2014-08-11 14:19:35 -07:00