Expand description
Editing Yog Data text in place: patch changes a document to hold a
new value and keeps everything that didn’t change as it was — comments,
key order, number spelling, layout. What changed is written by
[format], the way Yog’s editors write a value.
Functions§
- format
valueas Yog’s editors write it at indentlevel(two spaces each): short lists of numbers and short objects of scalars on one line ("uv": [0, 0, 16, 16]), the rest one entry a line.- patch
textchanged to holdnext, the rest as it was. Maps and lists are edited entry by entry (a kept entry keeps the comments before it; a removed one takes them along). Text that doesn’t parse is written anew.- same
- Whether two values are the same, a number however it’s spelled (
1=1.0). - to_json
valueas compact JSON for a tool: maps in their order, strings as the source has them (a typed value’s text unread).