Vladislav Rassokhin
2b0eb1f52c
Support multiline string literals in HCL only in HIL fragments
2016-11-24 22:59:50 +03:00
Mitchell Hashimoto
7cb7455c28
Merge pull request #170 from hashicorp/b-null
...
hcl: error if we scan a null char before end of input text
2016-11-21 18:11:24 -08:00
Mitchell Hashimoto
d02cd46b72
hcl: error if we scan a null char before end of input text
...
This was allowing very strange input to be allowed through to Terraform
since some encryped output will contain null characters (such as from
git crypt).
2016-11-21 18:09:54 -08:00
Mitchell Hashimoto
c3e054bfd4
Merge pull request #169 from jMarkP/duplicate-unit-test
...
Remove duplicate unit test
2016-11-12 15:52:43 -08:00
Mark Pim
fb052f74db
Remove duplicate unit test
2016-11-12 19:14:56 +00:00
Mitchell Hashimoto
3d702911d9
Merge pull request #166 from hashicorp/b-comment-indent
...
hcl/printer: multiline comments shouldn't indent lines 2+
2016-11-09 14:51:35 -08:00
Mitchell Hashimoto
be7f043b9a
hcl/printer: multiline comments shouldn't indent lines 2+
2016-11-09 14:49:37 -08:00
Mitchell Hashimoto
973f376f0e
Merge pull request #150 from hashicorp/b-escape-interp
...
[DO NOT MERGE YET] hcl: don't escape ANYTHING in ${}, let lower layer handle it
2016-11-08 16:00:27 -08:00
Mitchell Hashimoto
f74cf82815
Merge pull request #165 from hashicorp/b-string-fmt
...
hcl/printer: multiline strings don't indent lines 2+
2016-11-03 18:42:59 -07:00
Mitchell Hashimoto
9235fed8ea
hcl/printer: multiline strings don't indent lines 2+
...
Fixes https://github.com/hashicorp/terraform/issues/9859
For strings that have more than one line, we should not indent the
follow-up lines.
2016-11-03 18:41:17 -07:00
Mitchell Hashimoto
6e968a3fcd
Merge pull request #163 from hashicorp/sethvargo/failing_fmt
...
Add failing format example
2016-11-01 11:00:25 -07:00
Mitchell Hashimoto
8038a0f2f9
hcl/printer: proper spacing between comments (see test case)
2016-11-01 10:59:20 -07:00
Seth Vargo
a51830c4c6
Add just comment version
2016-10-31 12:04:45 -04:00
Seth Vargo
29ca4441dd
Add failing format example
2016-10-31 11:59:07 -04:00
Mitchell Hashimoto
8fa153c5b4
Merge pull request #160 from hashicorp/b-json-empty-list
...
json/parser: empty list value should not flatten
2016-10-28 19:32:40 -04:00
Mitchell Hashimoto
c03d57b578
json/parser: empty list value should not flatten
...
Fixes https://github.com/hashicorp/terraform/issues/8886
While parsing JSON, an empty list value would be assumed to be a
non-existent list of objects, and would be removed from the result. This
may have never been the correct behavior but always worked okay because
we previously didn't support lists as first class types.
With the support of lists, we need to actually return the empty list as
the type. If we return nothing, then projects like Terraform will think
that the value was never set, which is false.
2016-10-25 10:44:39 -07:00
Mitchell Hashimoto
99ce73d4fe
Merge pull request #159 from hashicorp/b-obj-parse
...
hcl/parser: cleaner error handling for objects with empty keys #158
2016-10-19 10:07:01 -07:00
Mitchell Hashimoto
57bf849243
hcl/parser: cleaner error handling for objects with empty keys #158
...
The way that the contents of an object (objectList()) was parsed before
was weirdly implicit in expecting RBRACE as the ending token. This makes
that expectation explicit, which fixes a parse error that could occur
with an object that ends in an empty assign to an RBRACE.
Before this, the parser would accept this as expected behavior because
the object "ended" since the unexpected token was an RBRACE.
2016-10-18 17:36:39 -07:00
Mitchell Hashimoto
6f5bfed9a0
Merge pull request #149 from Acconut/fix-missing-assign
...
json/parser: set Assign property when parsing object item
2016-10-08 15:35:57 +08:00
Mitchell Hashimoto
06a327dabb
Merge pull request #157 from hashicorp/b-comment-array
...
hcl/{parser,printer}: track and print lead comments for list items
2016-10-08 15:07:57 +08:00
Mitchell Hashimoto
f3182500c1
hcl/printer: fix some edge cases around ending with a lead comment
2016-10-08 15:06:49 +08:00
Mitchell Hashimoto
26fb5a83d4
hcl/printer: print lead comments for lists properly
2016-10-08 14:47:58 +08:00
Mitchell Hashimoto
8d4635e72c
hcl/parser: literal elements in a list can have a lead comment
2016-10-08 14:40:39 +08:00
Mitchell Hashimoto
7d7bae6bc1
hcl/parser: line comment tests for list items
2016-10-08 14:33:53 +08:00
Seth Vargo
d89a50c879
Merge pull request #155 from hashicorp/sethvargo/it
...
Add issue template
2016-10-08 11:47:34 +08:00
Mitchell Hashimoto
0296f28f71
Merge pull request #156 from hashicorp/b-bare-newlines
...
hcl/printer: file with only comments formats properly
2016-10-08 11:46:21 +08:00
Seth Vargo
69969c2a20
Only test master
2016-10-08 11:45:51 +08:00
Seth Vargo
6aead19b62
Add issue template
2016-10-08 11:43:23 +08:00
Mitchell Hashimoto
16dda36a23
hcl/printer: file with only comments formats properly
2016-10-08 11:42:34 +08:00
Mitchell Hashimoto
3c8ec494b1
hcl/printer: clean up some files, add subtests to testing printer
2016-10-08 11:42:01 +08:00
James Bardin
ef8133da8c
Merge pull request #152 from hashicorp/jbardin/undecoded
...
missing fields when decoding JSON
2016-09-16 09:01:00 -04:00
James Bardin
0bcadf025b
install test deps in appveyor
2016-09-16 08:54:14 -04:00
James Bardin
88422edf64
Update Makefile with new deps, go1.7 in travis
2016-09-16 08:54:14 -04:00
James Bardin
bdd93440d8
Simplify the code to expand objects
...
Now that we know only individual items in a slice need to be expanded,
we can simplify the code flow to expand the ast in place while decoding.
2016-09-16 08:54:06 -04:00
James Bardin
769aa72436
Added more tests for decoding JSON->maps
...
Make TestDecode_flattenedJSON table driven to add more test cases as
reproduced in terraform.
2016-09-16 08:53:45 -04:00
James Bardin
d3228f113d
Unflatten single objects from a list
...
A single json object with nested objects is flattened by the json parser
to a list of objects sharing the parent key. If we're decoding into
struct this was likely a mistake, and we need to re-expand the ast.
2016-09-15 09:28:16 -04:00
James Bardin
77eac88c9f
Simplify the failing test
...
Remove a level of nesting and separate the passing and failing cases.
2016-09-14 12:47:17 -04:00
James Bardin
6502ffef22
Add failing test for missing fields when decoding
...
A JSON object with a single entry containing a single object fails to
decode.
2016-09-13 17:50:57 -04:00
Mitchell Hashimoto
62ebf9354f
hcl: don't escape ANYTHING in ${}, let lower layer handle it
2016-09-09 19:56:15 -06:00
Marius
28370ddc98
json/parser: set Assign property when parsing object item
2016-09-05 21:46:43 +02:00
Mitchell Hashimoto
99df0eb941
Test that #121 doesn't happen
2016-09-02 09:52:19 -07:00
James Nugent
7a6c44ace5
Merge pull request #147 from hashicorp/revert-121-filter-skip-nil-item
...
Revert "Skip a nil item during filtering"
2016-09-02 11:48:36 -05:00
James Nugent
e3d360614a
Revert "Skip a nil item during filtering"
2016-09-02 09:48:18 -07:00
Tim
ef28deed85
Added hcl to json example for nested objects ( #36 )
...
It was unclear how nested object example in hcl would map to json.
README now updated to include an example of the son equivalent
to a hcl nested object.
2016-09-02 11:46:43 -05:00
James Nugent
9edfb078e1
Merge pull request #121 from hashicorp/filter-skip-nil-item
...
Skip nil items during filtering
2016-09-02 11:32:56 -05:00
Mitchell Hashimoto
2fd69cb0a5
json: interpolations have to be escaped
...
At some point we ignored the " in interpolations. We do this for HCL and
it is correct but this is invalid JSON syntax and for JSON we've always
had the stance that we have to escape them.
2016-09-02 11:31:47 -05:00
James Nugent
05be7a778d
Merge pull request #146 from hashicorp/b-comment
...
hcl/scanner: single line '//' commments verify second '/'
2016-09-02 11:27:27 -05:00
Mitchell Hashimoto
9250907631
hcl/scanner: single line '//' commments verify second '/'
...
The way the scanner works '/ foo' was actually valid comment syntax.
This obviously is not what we want. This modifies the scanner to verify
that '//' comments in fact have the second '/'.
2016-09-01 19:50:55 -07:00
Mitchell Hashimoto
baeb59c710
hcl/parser: test case for error in "10kb"
...
https://github.com/hashicorp/terraform/issues/3287#issuecomment-195779840
2016-08-22 14:41:45 -07:00
Mitchell Hashimoto
bc40da04e8
Merge pull request #143 from hashicorp/b-invalid-object-value
...
Fix panic when decoding invalid value structure into struct
2016-08-22 12:37:30 -04:00