MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / enter_container

Method enter_container

src/parser.rs:91–103  ·  view source on GitHub ↗

Increments depth and checks the nesting limit.

(&mut self)

Source from the content-addressed store, hash-verified

89
90 /// Increments depth and checks the nesting limit.
91 pub fn enter_container(&mut self) -> Result<(), ParseError> {
92 self.depth += 1;
93 if self.depth > 512 {
94 self.depth -= 1;
95 Err(
96 self
97 .scanner
98 .create_error_for_current_token(ParseErrorKind::NestingDepthExceeded),
99 )
100 } else {
101 Ok(())
102 }
103 }
104
105 /// Decrements depth.
106 pub fn exit_container(&mut self) {

Callers 5

parse_objectFunction · 0.80
parse_arrayFunction · 0.80
deserialize_tokenFunction · 0.80
tuple_variantMethod · 0.80
struct_variantMethod · 0.80

Calls 1

Tested by

no test coverage detected