feat(journal): var stuff
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
import type { VarDeclaration, TagModifier } from "./declare-parser";
|
||||
import { evaluateExpression } from "./variable-expression";
|
||||
import { evaluateExpression, exprValueToString } from "./variable-expression";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Types
|
||||
@@ -349,7 +349,7 @@ export function computeInitialValues(
|
||||
},
|
||||
});
|
||||
|
||||
const rawValue = String(result.value);
|
||||
const rawValue = exprValueToString(result.value);
|
||||
baseValues.set(key, rawValue);
|
||||
|
||||
// Check if this is a tagmap value — if so, activate matching modifiers
|
||||
@@ -422,7 +422,13 @@ function applyTagMapActivations(
|
||||
},
|
||||
});
|
||||
|
||||
const value = evalResult.value;
|
||||
// Modifier expressions must evaluate to a number
|
||||
if (evalResult.value.kind !== "number") {
|
||||
throw new Error(
|
||||
`Modifier expression "${mod.expression}" must evaluate to a number`,
|
||||
);
|
||||
}
|
||||
const value = evalResult.value.value;
|
||||
const targetIsTagMap = isTagMapValue(baseValues.get(mod.target));
|
||||
|
||||
if (targetIsTagMap) {
|
||||
@@ -571,7 +577,7 @@ function reevaluateDependents(
|
||||
},
|
||||
});
|
||||
|
||||
const rawValue = String(result.value);
|
||||
const rawValue = exprValueToString(result.value);
|
||||
|
||||
// Check for tagmap transition on this declared variable
|
||||
const oldCombined = getCombined(key, fallback);
|
||||
|
||||
Reference in New Issue
Block a user