implicitMultiplyRule
function implicitMultiplyRule(priority?, canStart?): NormalizerRule;Defined in: packages/engine/src/normalizer/BuiltinNormalizerRules.ts:72
Creates a normalization rule that inserts an implicit multiplication operator between adjacent tokens where multiplication is implied.
When it fires
Section titled “When it fires”Inserts a STAR token between:
NUMBER IDENT(e.g., “2 x” → “2 * x”)RPAREN IDENT(e.g., “(x+1)y” → “(x+1) * y”)NUMBER LPAREN(e.g., “2(x+1)” → “2 * (x+1)”)NUMBER PI/NUMBER E(e.g., “2π” → “2 * π”)
When it doesn’t fire
Section titled “When it doesn’t fire”- When the following identifier starts a multi-word phrase (checked against PHRASE_START_WORDS)
- When the following token is not an identifier or parenthesized expression
Priority
Section titled “Priority”Default priority is 50, below phrase fusion so phrases match first.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
priority | number | 50 | Rule priority (default 50) |
canStart? | (word) => boolean | undefined | - |
Returns
Section titled “Returns”A NormalizerRule that inserts implicit multiply operators