File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -821,8 +821,6 @@ function parse_number_or_date_start(l::Parser)
821
821
ate && return parse_int (l, contains_underscore)
822
822
elseif accept (l, isdigit)
823
823
return parse_local_time (l)
824
- elseif peek (l) != = ' .'
825
- return ParserError (ErrLeadingZeroNotAllowedInteger)
826
824
end
827
825
end
828
826
Original file line number Diff line number Diff line change @@ -65,8 +65,6 @@ format.
65
65
``` jldoctest
66
66
julia> using TOML
67
67
68
- julia> fname = tempname();
69
-
70
68
julia> data = Dict(
71
69
"names" => ["Julia", "Julio"],
72
70
"age" => [10, 20],
@@ -75,6 +73,17 @@ julia> data = Dict(
75
73
julia> TOML.print(data)
76
74
names = ["Julia", "Julio"]
77
75
age = [10, 20]
76
+
77
+ julia> fname = tempname();
78
+
79
+ julia> open(fname, "w") do io
80
+ TOML.print(io, data)
81
+ end
82
+
83
+ julia> TOML.parsefile(fname)
84
+ Dict{String, Any} with 2 entries:
85
+ "names" => ["Julia", "Julio"]
86
+ "age" => [10, 20]
78
87
```
79
88
80
89
Keys can be sorted according to some value
Original file line number Diff line number Diff line change 39
39
@test testval (" 1.0e0" , 1.0 )
40
40
@test testval (" 1.0e+0" , 1.0 )
41
41
@test testval (" 1.0e-0" , 1.0 )
42
+ @test testval (" 0e-3" , 0.0 )
42
43
@test testval (" 1.001e-0" , 1.001 )
43
44
@test testval (" 2e10" , 2e10 )
44
45
@test testval (" 2e+10" , 2e10 )
53
54
@test testval (" +1_000" , 1000 |> Int64)
54
55
@test testval (" -1_000" , - 1000 |> Int64)
55
56
56
- @test failval (" 0_" , Internals. ErrLeadingZeroNotAllowedInteger )
57
- @test failval (" 0__0" , Internals. ErrLeadingZeroNotAllowedInteger )
57
+ @test failval (" 0_" , Internals. ErrUnderscoreNotSurroundedByDigits )
58
+ @test failval (" 0__0" , Internals. ErrUnderscoreNotSurroundedByDigits )
58
59
@test failval (" __0" , Internals. ErrUnexpectedStartOfValue)
59
60
@test failval (" 1_0_" , Internals. ErrTrailingUnderscoreNumber)
60
61
@test failval (" 1_0__0" , Internals. ErrUnderscoreNotSurroundedByDigits)
You can’t perform that action at this time.
0 commit comments