Expand description
Faithful Rust port of Hermes’ JSONParser (include/hermes/Parser/JSONParser.h,
lib/Parser/JSONParser.cpp): the JSON value model, the uniquing/hidden-class
JSONFactory, and the recursive-descent JSONParser over JSLexer.
Re-exports§
pub use factory::JSONFactory;pub use factory::Prop;pub use parser::JSONParser;
Modules§
- factory
- JSONFactory: owns the arena, uniques strings/numbers, shares hidden classes.
- parser
- JSONParser: recursive-descent parser driving JSLexer.
Structs§
- Array
View - Borrowed view over an array (JSONParser.h:458
JSONArray). - JSON
Hidden Class - A descriptor with a sorted list of names; objects of the same shape share one
(JSONParser.h:180
JSONHiddenClass).keysare sorted by string content. - JSON
Shared Value - Port of
JSONSharedValue(JSONParser.h:704-726). Pairs a JSON value reference with theRc<Bump>arena that backs it so the caller can own both without worrying about arena lifetime. C++ usesconst JSONValue*+shared_ptr<const Allocator>; here the raw pointer is lifetime-erased to'staticand re-tied inget()via one encapsulatedunsafederef. - Object
View - Borrowed view over an object (JSONParser.h:239
JSONObject). Grown in B3 with name lookups + iteration.
Enums§
- JSON
Kind - Port of
JSONKind(JSONParser.h:36). - JSON
Value - The base type for all JSON values (JSONParser.h:49).
&'a JSONValue<'a>IS the C++JSONValue*: nodes live in abumpaloarena; the variant replaces the kind tag + LLVM RTTI; arena identity gives pointer equality.
Functions§
- kind_
to_ string - Port of
JSONKindToString(JSONParser.cpp:21).