You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Supersedes the parser part of #492 (see the behavior audit there). Depends on #600 (lookup fix)
Decision
__ctrlFlow(enable=false) becomes a hard parse skip: the class instantiated (or aliased, or
extended) with this annotation is not parsed at all — no ancestors, no elements; childInputs is
empty as a consequence. Rationale: today's implementation only prunes reachability (the inputs
reference lists) but still eagerly loads and recursively walks the dead-ended type
(parser.ts:893, 935-938; 704-705). Once modelica-json fixes the gap where classes aliased by short
classes get no JSON output, medium packages would be walked into and severely impact parse time —
the skip is what keeps them out. Parse time is expected to decrease relative to today.
Library-side contract (MBL refactoring, tracked separately): __ctrlFlow(enable=false) must not be
used on declarations whose parameters are referenced in expressions ctrl-flow must evaluate
(enable annotations, configuration bindings).
Parser implementation
Lazy skip, not a blacklist: skip means "don't trigger loading from this declaration site". A
class dead-ended at one site but instantiated live elsewhere (e.g. Configuration records: dead in
the model, live in the Data record) must still be parsed and resolvable through the global store.
Constructor ordering (with Fix potential unbounded file/type lookup #600 item 3): parse the annotation from the raw definition and set deadEndbefore any typeStore.get. Today all three load first: Component :829 vs :879, ShortClass :503 (no deadEnd wiring at all), Extend :1033/:1055 around :1050.
Implement for ShortClass (bug in Fix parser logic for __ctrlFlow.enable and Dialog.enable annotations #492): requires also parsing the description annotation in
the non-replaceable path (today only initializeReplaceable populates this.annotation, and only
with a constraining clause). Note MediumAir = Buildings.Media.Air carries the annotation and is
silently ignored today.
Guard the lazy re-entry points, or the skip is illusory: Component.getInputs
(typeStore.get at :893, unconditional recursion at :935-938) and getChildElements's getInputs({}, false) filter (:678-680) would still trigger the load on first traversal.
Note: parser.ts:1050 is Extend, not Enumeration; Enumeration never parses annotations —
no wiring needed there.
Diagnostic: correctness now rests on a library convention the parser can't verify locally, so parseTemplateJSON should warn when an enable expression or binding operand fails to resolve
into a skipped scope — turns a misplaced annotation in MBL into a build diagnostic instead of a
silently-null enable in the UI.
Regression test: a class referenced only through dead-end instantiations produces no entries;
verify nothing external (e.g. datAll) resolves into it.
Supersedes the parser part of #492 (see the behavior audit there). Depends on #600 (lookup fix)
Decision
__ctrlFlow(enable=false)becomes a hard parse skip: the class instantiated (or aliased, orextended) with this annotation is not parsed at all — no ancestors, no elements;
childInputsisempty as a consequence. Rationale: today's implementation only prunes reachability (the
inputsreference lists) but still eagerly loads and recursively walks the dead-ended type
(parser.ts:893, 935-938; 704-705). Once modelica-json fixes the gap where classes aliased by short
classes get no JSON output, medium packages would be walked into and severely impact parse time —
the skip is what keeps them out. Parse time is expected to decrease relative to today.
Library-side contract (MBL refactoring, tracked separately):
__ctrlFlow(enable=false)must not beused on declarations whose parameters are referenced in expressions ctrl-flow must evaluate
(
enableannotations, configuration bindings).Parser implementation
class dead-ended at one site but instantiated live elsewhere (e.g. Configuration records: dead in
the model, live in the Data record) must still be parsed and resolvable through the global store.
deadEndbefore anytypeStore.get. Today all three load first:Component:829 vs :879,ShortClass:503 (no deadEnd wiring at all),Extend:1033/:1055 around :1050.ShortClass(bug in Fix parser logic for__ctrlFlow.enableandDialog.enableannotations #492): requires also parsing the description annotation inthe non-replaceable path (today only
initializeReplaceablepopulatesthis.annotation, and onlywith a constraining clause). Note
MediumAir = Buildings.Media.Aircarries the annotation and issilently ignored today.
Component.getInputs(typeStore.get at :893, unconditional recursion at :935-938) and
getChildElements'sgetInputs({}, false)filter (:678-680) would still trigger the load on first traversal.Extend, notEnumeration;Enumerationnever parses annotations —no wiring needed there.
parseTemplateJSONshould warn when anenableexpression or binding operand fails to resolveinto a skipped scope — turns a misplaced annotation in MBL into a build diagnostic instead of a
silently-null
enablein the UI.verify nothing external (e.g.
datAll) resolves into it.