Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json: fix non streamlined json emitter #281

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
json: fix non streamlined json emitter
When the non streamline editer is about to write an element, if uses
a dedicated function which deals with indentation and decorations,
so when calling start_array or start_object we call it as if it was a
first level of object to avoid passing through the indentation and
decoration part which has been added recently to fix streamlined
emitter.
  • Loading branch information
bapt committed Feb 3, 2024
commit da7aacb3d46fbc206ec6f2431f503eed843a3039
4 changes: 2 additions & 2 deletions src/ucl_emitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,11 @@ ucl_emitter_common_elt (struct ucl_emitter_context *ctx,
ucl_emitter_finish_object (ctx, obj, compact, !print_key);
break;
case UCL_OBJECT:
ucl_emitter_common_start_object (ctx, obj, false, print_key, compact);
ucl_emitter_common_start_object (ctx, obj, true, print_key, compact);
ucl_emitter_common_end_object (ctx, obj, compact);
break;
case UCL_ARRAY:
ucl_emitter_common_start_array (ctx, obj, false, print_key, compact);
ucl_emitter_common_start_array (ctx, obj, true, print_key, compact);
ucl_emitter_common_end_array (ctx, obj, compact);
break;
case UCL_USERDATA:
Expand Down
Loading