MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / skip_value

Method skip_value

compiler/src/modules/packages/manifest.rs:166–190  ·  view source on GitHub ↗

Skip a string or string-keyed object, forgives future keys. Numeric, array, bool values surface as errors so typos don't pass silently. */

(&mut self)

Source from the content-addressed store, hash-verified

164
165 /* Skip a string or string-keyed object, forgives future keys. Numeric, array, bool values surface as errors so typos don't pass silently. */
166 fn skip_value(&mut self) -> Result<(), String> {
167 match self.peek() {
168 Some(b'"') => { let _ = self.read_string()?; Ok(()) }
169 Some(b'{') => {
170 self.pos += 1;
171 self.skip_ws();
172 if self.peek() == Some(b'}') { self.pos += 1; return Ok(()); }
173 loop {
174 self.skip_ws();
175 let _ = self.read_string()?;
176 self.skip_ws();
177 self.expect(b':', "expected ':' in nested object")?;
178 self.skip_ws();
179 self.skip_value()?;
180 self.skip_ws();
181 match self.peek() {
182 Some(b',') => { self.pos += 1; continue; }
183 Some(b'}') => { self.pos += 1; return Ok(()); }
184 _ => return Err(s!("expected ',' or '}' in nested object")),
185 }
186 }
187 }
188 _ => Err(s!("unsupported value in packages.json (only strings / string-objects)")),
189 }
190 }
191}

Callers 1

parse_manifestFunction · 0.80

Calls 4

peekMethod · 0.45
read_stringMethod · 0.45
skip_wsMethod · 0.45
expectMethod · 0.45

Tested by

no test coverage detected