Skip to content

z_ui2_json2: replace 70-line skip_node workaround with WA2 (envelope …#22

Open
alexey-arseniev wants to merge 2 commits into
mainfrom
fix/skip-node-wa2
Open

z_ui2_json2: replace 70-line skip_node workaround with WA2 (envelope …#22
alexey-arseniev wants to merge 2 commits into
mainfrom
fix/skip-node-wa2

Conversation

@alexey-arseniev

Copy link
Copy Markdown
Contributor

Wrap the writer in a temporary envelope object, call skip_node, then strip the {"name": prefix and trailing } via string arithmetic (off = strlen(name) + 4, len - 1).

  • locals_imp: read_json_to_string reduced from 70 lines to 15 using WA2
  • testclasses: add SKIP_NODE_NAMED_MEMBER test (WA2 + direct unnamed root)
  • faq.md: line-ending normalization (no content change)

skip_node( writer ) fails when the reader is positioned on a named node.
Workaround: wrap in a temporary envelope object, call skip_node, then
strip the {"name": prefix and trailing } via string arithmetic.

Replaces the previous 70-line manual tree-walker with 15 lines.
Adds unit test SKIP_NODE_NAMED_MEMBER covering named and unnamed nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant