diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2026-06-01 12:47:06 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-06-04 06:59:14 +0000 |
| commit | ab2bc7e9e1ca8999f2641032852c706c9d0bc6dd (patch) | |
| tree | c8b50ac442d780843c71a553076e5fb1ce8a2357 /lib/rdoc/tokenstream.rb | |
| parent | 9f6cb11797881151b155f720e805d1bf4ac4aaa4 (diff) | |
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 'lib/rdoc/tokenstream.rb')
0 files changed, 0 insertions, 0 deletions
