License
BSD-3-Clause
CDM source location tracking.
This module provides the CdmLocation struct for tracking the source position of CDM nodes during parsing and for error reporting.
Source location information for CDM nodes.
CdmLocation tracks where a node originated in source text, enabling accurate error messages and roundtrip fidelity.
auto loc = CdmLocation.at(10, 5, "config.json");
assert(loc.isKnown);
assert(loc.toString() == "config.json:10:5");
auto unknown = CdmLocation.unknown();
assert(!unknown.isKnown);
assert(unknown.toString() == "<unknown location>");string sourceuint lineuint columnsize_t offsetsize_t lengthbool isKnown() const pure nothrow @nogc @safeReturns true if this location is known (has valid line/column).CdmLocation at(uint line, uint column, string source = "") pure nothrow @nogc @safeCreates a location at the specified line and column.