diff --git a/source/optims/constantFolding.ts b/source/optims/constantFolding.ts index 5f6cfcc..41cf150 100644 --- a/source/optims/constantFolding.ts +++ b/source/optims/constantFolding.ts @@ -159,7 +159,8 @@ function isFoldable( rule: RuleNode | undefined, contextRules: Set, ): boolean { - if (!rule) { + // We need to keep empty rules as they are used as namespace. + if (!rule || isEmptyRule(rule)) { return false }