Repository navigation
Add optional rfl::SourceMap support to rfl::yaml::read and rfl::yaml::load - #45
Closed
clockblocker wants to merge 1 commit into
Closed
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
clockblocker
force-pushed
the
yaml-no-duplicate-keys
branch
from
November 25, 2026 11:39
002eeac to
0c3de12
Compare
clockblocker
force-pushed
the
yaml-source-map
branch
from
November 25, 2026 11:39
264b593 to
40e4829
Compare
clockblocker
force-pushed
the
yaml-no-duplicate-keys
branch
from
November 25, 2026 12:06
0c3de12 to
b9cb6df
Compare
clockblocker
force-pushed
the
yaml-source-map
branch
from
November 25, 2026 12:06
40e4829 to
c3fbf5b
Compare
clockblocker
changed the base branch from
yaml-no-duplicate-keys
to
wave-base-15
November 25, 2026 12:07
clockblocker
force-pushed
the
yaml-source-map
branch
from
November 25, 2026 12:08
c3fbf5b to
0c2a6f8
Compare
…:load Add an opt-in rfl::SourceMap type mapping ErrorDetail::PathSegment paths to rfl::SourceLocation entries (value and mapping key locations, plus find_nearest fallback to the deepest enclosing ancestor with exact = false). - Move the non-template SourceMap implementation out of the header into src/rfl/SourceMap.cpp (via Pimpl) and keep SourceMap.hpp out of the umbrella rfl.hpp header so non-YAML TUs pay no compile-time cost. - Replace raw node-index mutators with a bounds-safe SourceMap::Builder and opaque SourceMap::NodeId. - Expose RFL_API rfl::yaml::build_source_map(const YAML::Node&) in src/rfl/yaml/Reader.cpp, reusing Reader::ActiveNodeGuard for cycle safety. - Add SourceMap* overloads for rfl::yaml::read and rfl::yaml::load that clear the map up front and populate it on success.
clockblocker
force-pushed
the
wave-base-15
branch
from
November 25, 2026 12:10
b9cb6df to
e8c7337
Compare
clockblocker
force-pushed
the
yaml-source-map
branch
from
November 25, 2026 12:10
0c2a6f8 to
d45c23e
Compare
Owner
Author
|
Branch is preserved on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 4 of 4 (split from #40; stacked on #44).
Summary
rfl::SourceMaptype mappingErrorDetail::PathSegmentpaths to value/keyrfl::SourceLocationentries (plusfind_nearestfallback to the deepest enclosing ancestor withexact = false, including when a matched node itself has no recorded value location).SourceMapimplementation out-of-line insrc/rfl/SourceMap.cppvia Pimpl (no<map>in header) and keepsSourceMap.hppout of umbrellainclude/rfl.hppso non-YAML TUs pay no compile-time cost; all lookup methods andoperator==arenoexcept.SourceMap::Builder+ opaqueSourceMap::NodeId(checking for duplicate keys before pushing so no orphan nodes are ever allocated and duplicate subtrees are skipped cleanly).RFL_API rfl::yaml::build_source_map(const YAML::Node&)insrc/rfl/yaml/Reader.cppreusingReader::ActiveNodeGuard(recursing only into maps/sequences, never scalar leaves), and addsSourceMap*overloads onrfl::yaml::readandrfl::yaml::load.rfl::SourceMapindocs/content/supported_formats/yaml.mdand adds tests intests/yaml/test_source_map.cpp.Verification
-DREFLECTCPP_BUILD_SHARED=ON -DREFLECTCPP_JSON=ON -DREFLECTCPP_YAML=ON -DREFLECTCPP_STRICT_WARNINGS=ONwith-fvisibility=hidden): 631/631 passed.-DREFLECTCPP_USE_STD_EXPECTED) self-contained header and test compile checks passed.