Commit Graph

68 Commits

Author SHA1 Message Date
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
Thomas Pelletier 9f36448571 Basic keys parsing 2015-07-14 16:33:33 -07:00
Thomas Pelletier a8327d781a Specifiy timezone name 2015-04-23 15:42:25 -07:00
eanderton 1f3d0e03c3 Changes to support #29 - Support multi-line literal strings
* Added error output to test_program.go
* Added multi-line literal string support to lexer
* Added multi-line string supprt to lexer
* Added unit-test for new string support
* Modified test.sh to take an optional parameter to run an individual BurntSushi test suite.
* Fixed formatting
2015-02-26 18:03:30 -05:00
Thomas Pelletier 4b47f52cb0 Fixes #31 : Use RFC 3339 for datetimes 2014-12-06 15:00:24 +01:00
Thomas Pelletier 2f2f28631b Fixes #32 : Ensure keys are correctly parsed 2014-12-06 14:16:42 +01:00
Thomas Pelletier 543444f747 Fixes #30: Implement exp notation in floats 2014-12-06 13:56:27 +01:00
eanderton d9e8f54d1c gofmt pass 2014-09-12 22:50:39 -04:00
eanderton 081f3db916 Final Toml-Path Solution
* Refactored type names and file names to mesh with existing TOML library more closely
* Added QueryResult structure that provides values and position data
* Added Query() method to TomlTree type
* Tests, tests, and more tests
* Fixed bug where positions returned from some tables were invalid
* Added test case for bug patch

The bugfix was an interesting case. Position information wasn't being
set in cases where createPath was called.  So table names like [foo.bar]
would result in table 'foo' having no position.
2014-09-12 22:32:15 -04:00
eanderton 2811a1a3c9 Added QueryResult and patched bugs
QueryResult now stores result items and position data, which aligns more
strongly with the rest of the library features than a plain
[]interface[}.  The design of the parser_test unittest was revised to
use array/map/scalar serialization (like match_test), since Go 1.3
redesigned maps to randomly order their keys. Since naive comparisons of
map data is now no longer possible, the unittest now sorts map
keys:value combinations.

* Patched a bug where getPosition("") was returning an invalid Position
* Revised parser_test to use serialization for comparisons for Go 1.3
2014-09-09 22:31:41 -04:00
eanderton 7c63fff960 Added Position Support to TomlTree
TomlDocument provides an optional TOML processing path where position
informaiton is stored alongside a TomlTree.
* Added Position struct
* Revised TomlTree to contain position data
* Added tomlValue to bind positions to values
* Revised parser to emit position data
* Revised token to use new Position struct
* Added tests for new functionality
* Bugfixed table array duplicate key handling
* Applied gofmt to all code
2014-08-26 21:00:41 -04:00
Thomas Pelletier 65684e6bb0 Fixes #20 : Creation of subgroup in table arrays 2014-08-14 10:12:39 +02:00
eanderton aa194b5c41 Revised error message in parser test 2014-08-06 20:30:30 -04:00
eanderton 14e2d94bdd Added missing test entry 2014-08-06 20:28:44 -04:00
eanderton 1f8a8cbc06 Added error context for parsing of subtrees 2014-08-06 08:20:53 -04:00
eanderton 6db660fed5 Revised error formatting, fixed tests 2014-08-06 08:15:05 -04:00
eanderton 7d9a3c25bd Revised error reporting 2014-08-06 07:34:01 -04:00
eanderton c9ea292f59 Additional formatting 2014-07-07 21:08:57 -04:00
eanderton c8b5633273 Group array support; ToString() support 2014-07-07 20:48:29 -04:00