Skip to main content

Crate hermes_support

Crate hermes_support 

Source
Expand description

Hermes compiler support library (Rust port).

Re-exports§

pub use heap_size::HeapSize;

Modules§

buffer
Source buffer primitives: a NUL-terminated byte buffer and a named wrapper.
deque
diag
Diagnostic types, handler trait, collecting handler, output options, and warning categories. Port of SourceErrorManager diagnostic infrastructure.
heap_size
json_emitter
Port of hermes::JSONEmitter (include/hermes/Support/JSONEmitter.{h,cpp}) plus the numberToString helper it relies on (lib/Support/Conversions.cpp).
line_index
Line-start index for a source buffer: maps byte offsets to 1-based (line, column) and back. Column is the byte distance from the line start, matching LLVH SourceMgr so that caret rendering is byte-compatible.
location
Offset-based source locations (Rust analog of llvh::SMLoc).
manager
SourceErrorManager: owns source buffers, resolves locations, and dispatches diagnostics. This module covers buffer registration, names, virtual buffers, source-URL storage, and the central diagnostic emit pipeline: handler storage, message counts, error limit, warning categories, and message buffering/coalescing. Port of hermes::SourceErrorManager.
persistent_scoped_map
Port of hermes::PersistentScopedMap (include/hermes/ADT/PersistentScopedMap.h): a scoped hash table similar to hermes::ScopedHashTable, but scopes can be retained and reactivated after they have been popped from the table.
render
Byte-compatible source-line + caret rendering. Port of SourceErrorManager::buildSourceAndCaretLine and printDiagnosticHelper.
utf8
WTF-8 / UTF-8 → UTF-16 codec helpers, faithfully copied from the subset of hermes_parser::utf8 (itself ported from include/hermes/Support/UTF8.h) that is needed by JSONEmitter and the forthcoming AST-dumper port.