Skip to content

Commit

Permalink
Merge pull request #136 from emqx/load_empty_object
Browse files Browse the repository at this point in the history
fix(parser): load empty object failed
  • Loading branch information
zmstone authored Sep 13, 2021
2 parents c73e02e + a1db88b commit f72dc97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/hocon_parser.yrl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Terminals
include key required.

Rootsymbol hocon.
hocon -> '{' endobj : make_object(0, []).
hocon -> '{' fields endobj : make_object(0, '$2').
hocon -> fields : make_object(0, '$1').

Expand Down
2 changes: 2 additions & 0 deletions test/hocon_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ commas_test_() ->
, ?_assertError(_, binary("a={b=1,c=2,,}"))
, ?_assertError(_, binary("a={,b=1,c=2}"))
, ?_assertError(_, binary("a={b=1,,c=2}"))
, ?_assertEqual(#{}, binary(""))
, ?_assertEqual(#{}, binary("{}"))
].

trailing_comma_test_() ->
Expand Down

0 comments on commit f72dc97

Please sign in to comment.