16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 15:09:19 +02:00

Add v6 node-class markers (Stage 2 foundation for progressive loading)

Each top-level node is wrapped in a marker carrying its class (infrastructure vs
visual) and byte span, so the reader can serve or skip a whole node per load pass
without knowing its terminator token. The bake recognizes nodes by the "node"
keyword + type token (map type->terminator confirmed against the deserializers)
and classifies them; the writer buffers a node's entries and emits the marker.
The reader gains a pass selector (all / infrastructure / visual) and skips nodes
not in the pass by advancing past their byte span.

This is the foundation only: the default pass is "all", so loading is identical
to v5 (markers are transparent) -- verified by loading td.scn to the same point.
The eager/visual split is wired up by the upcoming loader/driver integration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
maj00r
2026-06-22 20:09:09 +02:00
parent 8a91559895
commit c337866c58
4 changed files with 190 additions and 29 deletions

View File

@@ -192,6 +192,13 @@ class cParser //: public std::stringstream
// standalone/parallel bake: capture this file only, collect its include filenames
bool m_bakeonly { false };
std::vector<std::string> m_bakeincludes;
// v6 node-marker tracking during bake (wrap each top-level node for pass selection)
bool m_bakenode_active { false };
int m_bakenode_count { 0 }; // entries captured since "node" (1=node,...,5=type)
bool m_bakenode_visual { false };
std::string m_bakenode_end; // terminator token; empty until type classified
// flushes a node still open at end-of-file (or unknown type), so its buffer is written
void bakeFinishNode();
};