zpl_toolchain_jsonc_strip 0.1.0

Shared JSONC comment stripping utility for zpl-toolchain
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.78 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • trevordcampbell/zpl-toolchain
    12 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • trevordcampbell

zpl_toolchain_jsonc_strip

Shared JSONC comment stripping utility used by multiple build-time tooling paths.

Purpose

Provides a single strip_jsonc() implementation to prevent drift between:

  • crates/spec-compiler
  • crates/diagnostics build script

Guarantees

  • strips // line comments
  • strips /* ... */ block comments
  • preserves string literals and escaped characters
  • UTF-8 safe (operates on chars, not raw bytes)

Usage

use zpl_toolchain_jsonc_strip::strip_jsonc;

let stripped = strip_jsonc(r#"{ "a": 1, /* comment */ "b": 2 }"#);