Skip to content

Handle escaped quotes while parsing JSON - #10

Closed
dajiaohuang wants to merge 1 commit into
ajweeks:masterfrom
dajiaohuang:fix/jsonparser-escaped-quotes
Closed

dajiaohuang wants to merge 1 commit into
ajweeks:masterfrom
dajiaohuang:fix/jsonparser-escaped-quotes

Conversation

@dajiaohuang

Copy link
Copy Markdown

What changed

JSONParser toggled its in-string state for every quote, including escaped quotes. A valid string containing \" could therefore expose an embedded // as a comment and braces as JSON structure. Quote handling now accounts for preceding backslash parity when stripping comments, finding string boundaries, and matching brackets. Added a synthetic regression case with escaped quotes, a comment marker, and a closing brace inside the value.

Validation and scope

  • git diff --check passed.
  • The regression was added to the internal FlexTest suite but was not run locally: no C++ compiler/build tools (clang++, g++, cl, cmake, or ninja) are available. CI was not queried or awaited.
  • No game/assets or submodules were checked out; no game or service was started. The sparse partial checkout contains only engine source/headers and root documentation.

@ajweeks

ajweeks commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Hi, thanks for the contribution! I think a recent refactor I did in 5fbd07 actually fixed this though, so I'll close for now. Let me know if there are remaining issues.

@ajweeks ajweeks closed this Oct 26, 2026
@dajiaohuang

Copy link
Copy Markdown
Author

Thanks for the follow-up. I checked the current master parser: escaped characters are skipped while locating string boundaries, comment stripping preserves escaped characters inside strings, and bracket matching accounts for escapes. I do not see a remaining issue from the reported escaped-quote case, so the closure is fine.

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.

2 participants