summaryrefslogtreecommitdiff
path: root/prism/util/pm_state_stack.c
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2026-06-01 12:47:06 -0400
committergit <svn-admin@ruby-lang.org>2026-06-04 06:59:14 +0000
commitab2bc7e9e1ca8999f2641032852c706c9d0bc6dd (patch)
treec8b50ac442d780843c71a553076e5fb1ce8a2357 /prism/util/pm_state_stack.c
parent9f6cb11797881151b155f720e805d1bf4ac4aaa4 (diff)
[ruby/json] Make the JSON parse loop iterativeHEADmaster
As opposed to a recursive loop. We do this by keeping a stack of frames (very similar to how the stack of values was already stored). Each frame represents the state of a container. Since there are only 2 in JSON, it doesn't have to get too complex. Each frame in the iterative parser now holds an enum describing its "phase", in order to support suspending parsing. For performance to be on par with the previous implementation, we directly jump to the proper handler in most cases. `JSON_ParserState.stack` was renamed into `.value_stack`, as with the introduction of the frames stack, the naming became confusing. https://github.com/ruby/json/commit/a760d9ae9b Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
Diffstat (limited to 'prism/util/pm_state_stack.c')
0 files changed, 0 insertions, 0 deletions