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
|`compute-engine.ts`| Registers the factory: `ComputeEngine._latexSyntaxFactory = () => new LatexSyntax()`|
131
+
|`abstract-boxed-expression.ts`|`.latex` / `.toLatex()` route through `engine._requireLatexSyntax()`|
132
+
|`serialize.ts`| Latex metadata conditional on `ce.latexSyntax` availability |
133
+
|`rules.ts`| Rule parsing constructs LatexSyntax via `ce._requireLatexSyntax().constructor`|
134
+
104
135
## Free Functions & Lazy Global Engine
105
136
106
137
Top-level free functions (`parse`, `simplify`, `evaluate`, `N`, `assign`) are exported from `index.ts` via `free-functions.ts`. They are backed by a lazily-instantiated global `ComputeEngine` accessible via `getDefaultEngine()`.
@@ -112,7 +143,10 @@ Top-level free functions (`parse`, `simplify`, `evaluate`, `N`, `assign`) are ex
112
143
-`assign(id, value)` / `assign({...})` — assign values in the global engine
113
144
-`getDefaultEngine()` — access the shared engine instance for configuration
114
145
115
-
The global engine is created on first call to any free function, using a dynamic `require('./index')` inside `getDefaultEngine()` to avoid circular dependency (since `index.ts` re-exports `free-functions.ts`).
146
+
The global engine is created on first call to any free function via a factory
147
+
registered by the entry point. The full entry point (`compute-engine.ts`)
148
+
registers a factory that includes `LatexSyntax`; the core entry point
0 commit comments