Thomas Pelletier
84282bbfd3
Move parser code
2021-02-09 19:26:50 -05:00
Thomas Pelletier
0982fd5f1f
Check unhandled error
2021-02-09 19:23:45 -05:00
Thomas Pelletier
7dbf7554c4
Nested arrays
2021-02-09 19:23:10 -05:00
Thomas Pelletier
2790964270
Bool value
2021-02-08 20:44:23 -05:00
Thomas Pelletier
3488a91eff
Array values
2021-02-08 20:39:04 -05:00
Thomas Pelletier
0e8fd64203
Move tests out of the package
2021-02-08 09:18:42 -05:00
Thomas Pelletier
70d41bd750
Add more tests for unmarshal array tables
2021-02-08 09:16:26 -05:00
Thomas Pelletier
a197513ce7
Simple table array
2021-02-08 09:08:42 -05:00
Thomas Pelletier
bd8df24646
Parse tables
2021-02-07 18:30:33 -05:00
Thomas Pelletier
89052d60b4
Very beginning of unmarshaler + builder interface
2021-02-06 23:20:26 -05:00
Thomas Pelletier
9fa2fd413d
Implement inline tables
2021-02-06 09:33:20 -05:00
Thomas Pelletier
b1e11f82a9
Implement array values
2021-02-06 09:27:24 -05:00
Thomas Pelletier
165f65408d
Implement tables
2021-02-06 09:09:41 -05:00
Thomas Pelletier
540c2a7b59
Fix parsing bugs + boolean impl
2021-02-06 08:54:40 -05:00
Thomas Pelletier
a466f0ca79
Multiline literal strings
2021-02-06 08:01:38 -05:00
Thomas Pelletier
736a75748b
Multiline basic string parsing
2021-02-05 17:46:40 -05:00
Thomas Pelletier
ca12c0670d
wip parsing
2021-02-05 14:48:16 -05:00
Thomas Pelletier
0ee0fe7f7c
Trying the scanner approach
2021-02-04 10:14:11 -05:00
Thomas Pelletier
b123c357c5
Add tokens to Document
2021-02-02 20:54:20 -05:00
Thomas Pelletier
94ad175728
wip
2021-02-02 10:55:23 -05:00
Thomas Pelletier
1e8b0dc3c9
Rename to lexer and split in files
2021-02-02 08:28:30 -05:00
Thomas Pelletier
7300b6a97b
Array tables
2021-02-02 08:19:04 -05:00
Thomas Pelletier
aae4656c64
Standard Table
2021-02-01 22:03:53 -05:00
Thomas Pelletier
44f7a7aead
Inline tables
2021-02-01 21:41:34 -05:00
Thomas Pelletier
bac65cc530
Array implementation
2021-02-01 21:25:20 -05:00
Thomas Pelletier
91d7afbc0a
Parse rvalue string
2021-02-01 20:54:04 -05:00
Thomas Pelletier
7b4d82a939
Remove error handling for rune
2021-02-01 20:25:31 -05:00
Thomas Pelletier
2ab0f8c733
Default to use bytes instead of runes
...
benchmark old ns/op new ns/op delta
BenchmarkParseAll-8 3238 1941 -40.06%
2021-02-01 20:20:24 -05:00
Thomas Pelletier
b96c535061
Check for allocs
2021-02-01 19:25:07 -05:00
Thomas Pelletier
fd961100c1
Boolean values
2021-02-01 19:19:40 -05:00
Thomas Pelletier
1c7e9fe3af
Dotted keys
2021-02-01 19:07:51 -05:00
Thomas Pelletier
07aa85ea0b
Refactor to use parser state
2021-02-01 09:00:36 -05:00
Thomas Pelletier
d54ad15d16
Track ABNF file
2021-02-01 09:00:21 -05:00
Thomas Pelletier
abe1005d7a
wip: string parsing
2021-01-30 20:31:14 -05:00
Thomas Pelletier
b4bb91fc13
test
2021-01-30 09:07:55 -05:00
Vincent Serpoul
c9a09d8695
Provide Tree and treeValue public aliases ( #467 )
...
Provide public aliases for Tree and treeValue to give more
control when manipulating TOML documents. This is a stop-gap
measure until we redesign the interface in v2.
Fix #466
2021-01-29 08:31:09 -05:00
y-yagi
3430b0f086
Update docs to reference pkg.go.dev ( #465 )
2021-01-25 08:31:50 -05:00
Richard Patel
a713a3eccc
Improved default tag for durations ( #464 )
2021-01-21 16:47:51 -05:00
Thomas Pelletier
652b9f8232
Cleanup ( #462 )
...
* Remove feature request template
Those should now start in discussions
https://github.com/pelletier/go-toml/discussions
* Update lincese year
* ci: do not run coverage on master
It only makes sense to report it for diffs on pull requests.
2021-01-06 20:48:20 -05:00
Thomas Pelletier
ba1b12be14
Fix ToMap for tables in nested mixed-type arrays ( #461 )
...
Co-authored-by: Micah Stetson <micah@schoolsplp.com >
2021-01-06 20:34:25 -05:00
Stanisław Barzowski
2e01f733df
[README] There are 3 cli tools, not 2. ( #454 )
2020-11-24 13:14:26 -05:00
Micah Stetson
1bd9461acb
Fix ToMap for tables in mixed-type arrays ( #453 )
2020-11-14 21:15:35 -05:00
Thomas Pelletier
5b4e7e5dcc
Remove underscore regexps ( #448 )
...
* Remove underscore regexps
Fixes #440 .
```
benchmark old ns/op new ns/op delta
BenchmarkUnmarshalToml-8 269582 257032 -4.66%
benchmark old allocs new allocs delta
BenchmarkUnmarshalToml-8 2650 2650 +0.00%
benchmark old bytes new bytes delta
BenchmarkUnmarshalToml-8 127761 127030 -0.57%
```
2020-10-11 19:27:08 -04:00
Thomas Pelletier
b4905040a8
TOML 1.0.0-rc.3 ( #449 )
...
No spec change since 1.0.0-rc.1.
2020-10-11 16:12:23 -04:00
Thomas Pelletier
5c66c78bc5
Remove date regexp ( #447 )
...
* Remove date regexp
Hand-roll the date matching logic to avoid trying to match a regexp on
every integer.
```
benchmark old ns/op new ns/op delta
BenchmarkUnmarshalToml-8 293449 272134 -7.26%
benchmark old allocs new allocs delta
BenchmarkUnmarshalToml-8 2746 2650 -3.50%
benchmark old bytes new bytes delta
BenchmarkUnmarshalToml-8 133604 127548 -4.53%
```
* Remove fuzzit
The company has been acquired by GitLab and shutting down.
2020-10-11 15:31:33 -04:00
Allen
f9ba08244d
Do not allow T-prefix on local dates ( #446 )
...
Fixes #442
2020-10-09 10:55:11 -04:00
Thomas Pelletier
e6908614ee
toml.Unmarshaler supports leaf nodes ( #444 )
...
Fixes #437
2020-09-13 18:46:13 -04:00
Cameron Moore
a7448fe8de
Fix date lexer to only support 4-digit year ( #443 )
...
Fixes #441
2020-09-12 18:04:04 -04:00
Thomas Pelletier
65ca806488
Fix Unmarshaler call when value is missing ( #439 )
...
Fixes #431
v1.8.1
2020-09-12 14:42:04 -04:00
Cameron Moore
5c94d86029
Use strings.Builder in lexer ( #438 )
...
Replace all string building operations in the lexer with
strings.Builder. Doing so shows significant performance improvements.
BurntSushi still has a slight edge in CPU performance, but there's still
much work to do on memory performance.
name old time/op new time/op delta
ParseToml-2 311µs ± 0% 273µs ± 3% -12.29% (p=0.008 n=5+5)
UnmarshalToml-2 386µs ± 4% 349µs ± 3% -9.63% (p=0.008 n=5+5)
UnmarshalBurntSushiToml-2 368µs ± 8% 341µs ± 2% ~ (p=0.056 n=5+5)
name old alloc/op new alloc/op delta
ParseToml-2 132kB ± 0% 118kB ± 0% -11.07% (p=0.008 n=5+5)
UnmarshalToml-2 147kB ± 0% 133kB ± 0% -9.92% (p=0.008 n=5+5)
UnmarshalBurntSushiToml-2 82.6kB ± 0% 82.6kB ± 0% ~ (p=1.000 n=5+5)
name old allocs/op new allocs/op delta
ParseToml-2 3.19k ± 0% 1.91k ± 0% -40.19% (p=0.008 n=5+5)
UnmarshalToml-2 4.03k ± 0% 2.75k ± 0% -31.83% (p=0.008 n=5+5)
UnmarshalBurntSushiToml-2 1.73k ± 0% 1.73k ± 0% ~ (all equal)
Out of curiosity, I benchmarked the results of updating each function
along the way to see how each change effected the overall performance:
name \ time/op master lexKey lexLitStringAsString lexStringAsString
ParseToml-2 311µs ± 0% 299µs ± 1% 290µs ± 3% 273µs ± 3%
UnmarshalToml-2 386µs ± 4% 381µs ± 2% 364µs ± 2% 349µs ± 3%
UnmarshalBurntSushiToml-2 368µs ± 8% 341µs ± 2% 345µs ± 5% 341µs ± 2%
name \ alloc/op master lexKey lexLitStringAsString lexStringAsString
ParseToml-2 132kB ± 0% 132kB ± 0% 125kB ± 0% 118kB ± 0%
UnmarshalToml-2 147kB ± 0% 146kB ± 0% 140kB ± 0% 133kB ± 0%
UnmarshalBurntSushiToml-2 82.6kB ± 0% 82.6kB ± 0% 82.6kB ± 0% 82.6kB ± 0%
name \ allocs/op master lexKey lexLitStringAsString lexStringAsString
ParseToml-2 3.19k ± 0% 2.86k ± 0% 2.49k ± 0% 1.91k ± 0%
UnmarshalToml-2 4.03k ± 0% 3.70k ± 0% 3.33k ± 0% 2.75k ± 0%
UnmarshalBurntSushiToml-2 1.73k ± 0% 1.73k ± 0% 1.73k ± 0% 1.73k ± 0%
Benchmarks were run from the benchmark/ directory using:
go test -bench=.*Toml -benchmem -count=5 ./...
2020-09-12 12:01:32 -04:00