James Bardin
86950618a5
Don't automatically convert to CRLF in AppVeyor
...
We have test files with both types of line endings, leave them as they
are for tests.
2016-12-01 12:09:33 -05:00
Mitchell Hashimoto
37ab263305
Merge pull request #174 from kron4eg/decode-int
...
Try to use SetInt in case if possible
2016-12-01 09:17:04 -05:00
Artiom Diomin
e6cd87d208
Try to use SetInt in case if possible
...
Allows to decode aliased int types, like time.Duration
2016-12-01 16:15:23 +02:00
Mitchell Hashimoto
ae25c981c1
hcl/scanner: test \r\n endings
2016-11-30 19:39:16 -05:00
Mitchell Hashimoto
b97feebd3d
Merge pull request #172 from hashicorp/b-println
...
hcl/parser: don't print "illegal"
2016-11-30 12:58:18 -08:00
Mitchell Hashimoto
6000b27b60
hcl/parser: don't print "illegal"
...
We shouldn't output any text during parsing, that's just strange!
token.ILLEGAL happens when the scanner has an error. This error is
recorded in `scerr` during parsing which is eventually returned out.
Therefore, we handle the error properly. We can simply return a backup
error here in case we don't (scanner errors are checked first).
2016-11-30 12:55:04 -08:00
Mitchell Hashimoto
5550aaba78
Merge pull request #139 from VladRassokhin/multiline-string
...
Support EOL in string literals only in HIL fragments
2016-11-29 10:26:28 -08:00
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