Skip to main content

Module object_literal

Module object_literal 

Source
Expand description

Parser for { key: value } object literal syntax.

Two contracts live here, and the difference between them is the point: parse_object_literal reads one literal off the FRONT of its input and leaves the rest alone, while parse_object_literal_complete requires the literal to be the whole input and reports anything left over. A caller whose input is supposed to be the literal must use the strict form, or a clause the author wrote is discarded without anyone being told.

Re-exports§

pub use api::parse_object_literal;
pub use api::parse_object_literal_array;
pub use api::parse_object_literal_array_complete;
pub use api::parse_object_literal_complete;

Modules§

api
The public entry points: prefix parsing, strict whole-input parsing, and the leftover reporting that separates them.
scan
The recursive-descent scanner behind the object-literal entry points: whitespace, identifiers, strings, numbers, nested objects, and arrays.