Table of Contents

Class ModalCarrySyntax

Namespace
Hi.NcParsers.PostLogicSyntaxs
Assembly
HiMech.dll

Per-block modal-section carry. For each key in TrackedKeys, if the current block has no section for that key, deep-clone the same section from the immediately previous block (which is itself guaranteed to carry it because every block is processed by this syntax) and set AddedByKey = AddedByValue inside the cloned section. Lets every block stand alone with its full modal context, so downstream readers (cache-file dumps, semantics, UI jumping to a single block) do not need EnumerateBack() to resolve modal state.

This replaces the earlier CacheSyntax design (which sampled every Pace blocks). The legacy CacheSyntax XName is still recognised on load for backward compatibility with previously-saved project files.

public class ModalCarrySyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
ModalCarrySyntax
Implements
Inherited Members
Extension Methods

Constructors

ModalCarrySyntax()

public ModalCarrySyntax()

ModalCarrySyntax(XElement)

public ModalCarrySyntax(XElement src)

Parameters

src XElement

Fields

AddedByValue

Value written under AddedByKey on each section this syntax deep-clones from the previous block. Mirrors AddedByValue's role for its own synthesis — both let cache-file readers distinguish post-Logic / Inspection stage injections from LogicSyntaxs-stage authored values (the latter have no AddedByKey).

public const string AddedByValue = "ModalCarry"

Field Value

string

Properties

Default

public static ModalCarrySyntax Default { get; }

Property Value

ModalCarrySyntax

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

TrackedKeys

Section keys to carry. Order-insensitive; duplicates ignored.

public List<string> TrackedKeys { get; set; }

Property Value

List<string>

XName

public static string XName { get; }

Property Value

string

Methods

Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)

Build syntax arrangement into the syntaxPieceNode in-place.

public void Build(LazyLinkedListNode<SyntaxPiece> node, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)

Parameters

node LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if true, the extended file creation is suppressed.

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.