x-hgg-x
f1ba6388fb
Fix inline table loading errors ( #381 )
...
Fixes #379 #380
2020-05-04 13:13:55 -04:00
Allen
d05497900e
Forbid adding keys to exist inline table ( #378 )
2020-05-04 13:06:37 -04:00
Allen
947ab3f90a
add test for trailing comma in inline table ( #366 )
...
Fixes #359
2020-04-24 21:43:46 -04:00
Riya John
24d4446802
Add float to test case to check leading zeroes in exponent parts ( #363 )
...
* add float to test case to check leading zeroes in exponent parts
* add testcase for query pkg
2020-04-21 22:45:49 -04:00
Allen
a12e102214
Fix multiline + non-primitive commenting ( #336 )
...
Fixes #216
2020-03-16 22:51:47 -04:00
Allen
3503483c73
Fix unexpected token type in inline table ( #334 )
...
Fixes #321
2020-03-10 13:39:48 -04:00
Thomas Pelletier
a89a075e1b
Test for accidental newlines ( #319 )
2019-10-25 14:44:53 -04:00
Thomas Pelletier
8a362ad712
Short-date support ( #298 )
2019-10-25 13:21:44 -04:00
Jonathan Lloyd
bef0f57967
Fix key parsing in line tables ( #311 )
...
A bug was reported that indicated that inline tables did not fully support bare keys:
$ echo 'foo = { -bar => "buz"}' | ./tomljson
(1, 9): unexpected token type in inline table: Error
$ echo 'foo = { "whatever" = "buz"}' | ./tomljson
(1, 10): unexpected token type in inline table: String
echo 'foo = { _no = "buz"}' | ./tomljson
(1, 9): unexpected token type in inline table: Error
This change makes a couple of tweaks to to allow for all key variants in inline tables
Fixes : #282
2019-10-20 20:36:14 -04:00
Marcin Białoń
095a905e04
Allow space to separate date and time ( #300 )
...
Fixes #231
2019-09-19 10:45:53 -07:00
Thomas Pelletier
e1803f96f6
Support dotted-keys ( #260 )
...
Implement dotted keys as sequence of bare and quoted keys. Introduced in
TOML 0.5.0.
Fixes #230
2019-03-04 22:35:03 -08:00
xiehuc
78b76feda6
Fix integer keys in inline tables ( #239 )
...
Fixes #224
2018-09-22 11:02:51 -07:00
Thomas Pelletier
acdc450948
Fix backward incompatibility for Set* methods ( #213 )
...
Patch #185 introduced a backward incompatibility by changing the arguments
of the `Set*` methods on `Tree`.
This change restores the arguments to what they previous were, and
introduces `SetWithComment` and `SetPathWithComment` to perform the same
action.
2018-01-18 14:54:55 -08:00
Jelte Fennema
778c285afa
Add support for special float values (inf and nan) ( #210 )
2018-01-18 14:10:55 -08:00
Kazuyoshi Kato
4874e8477b
Fix parsing of single quoted keys ( #201 )
...
Patch #193 doesn't work correctly because that must be handled by the
lexer, and `parseKey()` must not handle escape sequences.
Ref #61
2018-01-18 13:52:12 -08:00
Thomas Pelletier
861c4734ac
Support for hex, oct, and bin integers ( #205 )
...
Add support for non-decimal integers. At the time of writing, this is an
unreleased backward-compatible feature of TOML:
```
Non-negative integer values may also be expressed in hexadecimal, octal, or
binary. In these formats, leading zeros are allowed (after the prefix). Hex
values are case insensitive. Underscores are allowed between digits (but
not between the prefix and the value).
# hexadecimal with prefix `0x`
hex1 = 0xDEADBEEF
hex2 = 0xdeadbeef
hex3 = 0xdead_beef
# octal with prefix `0o`
oct1 = 0o01234567
oct2 = 0o755 # useful for Unix file permissions
# binary with prefix `0b`
bin1 = 0b11010110
```
Fixes #204
2017-12-22 12:24:26 +01:00
Thomas Pelletier
b8b5e76965
Add Encoder opt to emit arrays on multiple lines ( #203 )
...
A new Encoder option emits arrays with more than one line on multiple lines.
This is off by default and toggled with `ArraysWithOneElementPerLine`.
For example:
```
A = [1,2,3]
```
Becomes:
```
A = [
1,
2,
3
]
```
Fixes #200
2017-12-18 14:57:16 +01:00
Yvonnick Esnault
690dbc9ee7
Comment annotation for Marshal ( #185 )
2017-10-01 15:05:24 -07:00
Thomas Pelletier
685a1f1cb7
Rename TomlTree to Tree ( #159 )
...
Avoid stutter.
Fixes #55
2017-05-10 17:53:23 -07:00
tro3
25e50242f6
Fix TestMissingFile on Windows ( #148 )
...
Closing #147
2017-03-21 15:10:48 +01:00
Thomas Pelletier
fee7787d3f
Rework tree from map ( #139 )
...
* Make TreeFromMap reflect to construct tree
* Fix wording of invalid value type in writeTo
Fixes #138 , #139 , #134
⚠️ TreeFromMap signature changed to `TreeFromMap(map[string]interface{}) (*TomlTree, error)`
2017-03-14 13:16:40 -07:00
Thomas Pelletier
7e6e4b1314
Rewrite TomlTree encoding ( #133 )
...
* Rewrite `TomlTree` encoding
* Introduce `TomlTree.WriteTo`
2017-03-02 09:17:06 -08:00
Thomas Pelletier
a1f048ba24
Make ToString() return an error instead of panic ( #117 )
...
Fixes #100
2017-01-15 18:49:11 -08:00
Thomas Pelletier
439fbba1f8
Make lexComment jump back to the previous state ( #122 )
...
When a comment appears in an rvalue, the lexer needs to jump back to
lexRValue, not to lexVoid.
Fixes #120 .
2016-12-29 19:51:04 +01:00
Christopher Mancini
017119f7a7
Use a single line for slice encoding ( #119 )
2016-12-13 15:20:06 +01:00
Thomas Pelletier
ce7be745f0
Rename group to table ( #115 )
...
* Rename Group to Table Fixes #45
* Change fmt.Errorf to errors.new for simple strings
2016-12-03 12:32:16 +01:00
Cameron Moore
45932ad32d
Handle nil, map[string]string, and map[interface{}]interface{} input ( #103 )
...
* Handle map[string]string and map[interface{}]interface{} input
* Handle nil values
Fixes #99
2016-09-20 09:07:15 +02:00
Cameron Moore
67b7b944a8
Support all numeric type conversions ( #102 )
...
Fixes #101
2016-09-20 09:04:39 +02:00
Thomas Pelletier
31055c2ff0
Allow empty quoted keys ( #97 )
2016-09-06 22:25:57 +02:00
Cameron Moore
0599275eb9
Simplify redundant types in literals ( #95 )
...
Using `gofmt -s`
2016-08-23 09:45:54 +02:00
Thomas Pelletier
64ff1ea4d5
Don't hang when reading an invalid rvalue ( #77 )
...
Fixes #76
2016-06-30 16:21:25 +02:00
Thomas Pelletier
8d9c606c69
Improve test coverage ( #66 )
2016-04-22 14:26:15 +02:00
Thomas Pelletier
288bc57940
Better logging for parser tests ( #65 )
...
* Better logging for parser tests
* Add spew to tests deps list
2016-04-22 11:01:31 +02:00
Thomas Pelletier
d6a90e60ed
Fix #52 : query matcher doesn't handle arrays tables
...
Also improve coverage of query matcher.
2016-03-16 09:56:04 -07:00
Thomas Pelletier
2df083520a
Fix support for CRLF line ending
2016-02-19 14:12:13 +01:00
Thomas Pelletier
f963bc320f
Generic input
...
Fixes #47
2016-01-31 16:54:40 +01:00
Thomas Pelletier
6d743bb19f
Improve error checking on number parsing
2015-12-01 14:38:33 +01:00
Thomas Pelletier
a6c6ad1f5f
Don't crash when assigning group array to array
2015-12-01 13:56:31 +01:00
Thomas Pelletier
7d69e5a5c5
Tests for erroneous inline tables
2015-09-09 17:40:27 +01:00
Thomas Pelletier
07d0c2e4d3
Merge branch 'master' into pelletier/inline-tables
2015-09-09 17:35:03 +01:00
Thomas Pelletier
6b9002d8f9
Harden tests for bad arrays
2015-09-09 17:33:28 +01:00
Thomas Pelletier
5753e884d0
Fix floating points with underscores
2015-09-09 17:17:08 +01:00
Thomas Pelletier
821a80e635
Add removed test
2015-09-09 17:01:05 +01:00
Thomas Pelletier
dd4c4ffc2b
Implement inline tables
2015-09-09 16:56:18 +01:00
Thomas Pelletier
f58048cec0
Merge pull request #39 from pelletier/pelletier/integers_underscores
...
Accept underscores in integers
2015-07-17 16:54:19 -07:00
Thomas Pelletier
894e775e38
Accept spaces in keys
2015-07-16 23:04:13 -07:00
Thomas Pelletier
8e75093380
Accept underscores in integers
2015-07-16 22:07:16 -07:00
Thomas Pelletier
9defd66d3c
Parse datetimes in UTC
2015-07-15 10:58:08 -07:00
Thomas Pelletier
36e1197190
Test datetimes differently
2015-07-15 08:17:28 -07:00
Thomas Pelletier
16a681db2a
Allow numbers in keys parsing
2015-07-14 19:56:28 -07:00