@cortex-js/compute-engine 0.55.4 → 0.55.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compile.esm.js +137 -545
- package/dist/compile.min.esm.js +60 -430
- package/dist/compile.min.umd.cjs +66 -436
- package/dist/compile.umd.cjs +137 -545
- package/dist/compute-engine.esm.js +227 -563
- package/dist/compute-engine.min.esm.js +68 -437
- package/dist/compute-engine.min.umd.cjs +68 -437
- package/dist/compute-engine.umd.cjs +227 -563
- package/dist/core.esm.js +225 -562
- package/dist/core.min.esm.js +67 -436
- package/dist/core.min.umd.cjs +67 -436
- package/dist/core.umd.cjs +225 -562
- package/dist/interval.esm.js +136 -60
- package/dist/interval.min.esm.js +7 -7
- package/dist/interval.min.umd.cjs +7 -7
- package/dist/interval.umd.cjs +136 -60
- package/dist/latex-syntax.esm.js +219 -74
- package/dist/latex-syntax.min.esm.js +7 -6
- package/dist/latex-syntax.min.umd.cjs +7 -6
- package/dist/latex-syntax.umd.cjs +219 -74
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.umd.cjs +2 -2
- package/dist/math-json.umd.cjs +2 -2
- package/dist/numerics.esm.js +2 -2
- package/dist/numerics.min.esm.js +2 -2
- package/dist/numerics.min.umd.cjs +2 -2
- package/dist/numerics.umd.cjs +2 -2
- package/dist/types/big-decimal/big-decimal.d.ts +1 -1
- package/dist/types/big-decimal/index.d.ts +1 -1
- package/dist/types/big-decimal/transcendentals.d.ts +1 -1
- package/dist/types/big-decimal/utils.d.ts +1 -1
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/configuration-change.d.ts +1 -1
- package/dist/types/common/fuzzy-string-match.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/interruptible.d.ts +1 -1
- package/dist/types/common/one-of.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/type/ast-nodes.d.ts +1 -1
- package/dist/types/common/type/boxed-type.d.ts +1 -1
- package/dist/types/common/type/lexer.d.ts +1 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/parser.d.ts +1 -1
- package/dist/types/common/type/primitive.d.ts +1 -1
- package/dist/types/common/type/reduce.d.ts +1 -1
- package/dist/types/common/type/serialize.d.ts +1 -1
- package/dist/types/common/type/subtype.d.ts +1 -1
- package/dist/types/common/type/type-builder.d.ts +1 -1
- package/dist/types/common/type/types.d.ts +1 -1
- package/dist/types/common/type/utils.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compile.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/constants.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/inequality-bounds.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/init-lazy-refs.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/invisible-operator.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/pattern-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomial-degree.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/predicates.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve-linear-system.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/stochastic-equal.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/type-guards.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/collection-utils.d.ts +1 -1
- package/dist/types/compute-engine/compilation/base-compiler.d.ts +1 -1
- package/dist/types/compute-engine/compilation/compile-expression.d.ts +1 -1
- package/dist/types/compute-engine/compilation/constant-folding.d.ts +1 -1
- package/dist/types/compute-engine/compilation/glsl-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/gpu-target.d.ts +1 -47
- package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/python-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/types.d.ts +1 -48
- package/dist/types/compute-engine/compilation/wgsl-target.d.ts +1 -1
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/engine-assumptions.d.ts +1 -1
- package/dist/types/compute-engine/engine-cache.d.ts +1 -1
- package/dist/types/compute-engine/engine-common-symbols.d.ts +1 -1
- package/dist/types/compute-engine/engine-compilation-targets.d.ts +1 -1
- package/dist/types/compute-engine/engine-configuration-lifecycle.d.ts +1 -1
- package/dist/types/compute-engine/engine-declarations.d.ts +1 -1
- package/dist/types/compute-engine/engine-expression-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/engine-extension-contracts.d.ts +1 -1
- package/dist/types/compute-engine/engine-library-bootstrap.d.ts +1 -1
- package/dist/types/compute-engine/engine-numeric-configuration.d.ts +1 -1
- package/dist/types/compute-engine/engine-runtime-state.d.ts +1 -1
- package/dist/types/compute-engine/engine-scope.d.ts +1 -1
- package/dist/types/compute-engine/engine-sequences.d.ts +1 -1
- package/dist/types/compute-engine/engine-simplification-rules.d.ts +1 -1
- package/dist/types/compute-engine/engine-startup-coordinator.d.ts +1 -1
- package/dist/types/compute-engine/engine-type-resolver.d.ts +1 -1
- package/dist/types/compute-engine/engine-validation-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/free-functions.d.ts +1 -1
- package/dist/types/compute-engine/function-utils.d.ts +1 -1
- package/dist/types/compute-engine/global-types.d.ts +1 -1
- package/dist/types/compute-engine/index.d.ts +2 -1
- package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
- package/dist/types/compute-engine/interval/elementary.d.ts +1 -1
- package/dist/types/compute-engine/interval/index.d.ts +1 -1
- package/dist/types/compute-engine/interval/trigonometric.d.ts +1 -1
- package/dist/types/compute-engine/interval/types.d.ts +1 -1
- package/dist/types/compute-engine/interval/util.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/default-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-units.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/indexed-types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-dms.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +4 -2
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +1 -1
- package/dist/types/compute-engine/library/colors.d.ts +1 -1
- package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
- package/dist/types/compute-engine/library/complex.d.ts +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/fractals.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +1 -1
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic-analysis.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/quantity-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +1 -1
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/type-handlers.d.ts +1 -1
- package/dist/types/compute-engine/library/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/library/units.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
- package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
- package/dist/types/compute-engine/numerics/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +1 -1
- package/dist/types/compute-engine/numerics/statistics.d.ts +1 -1
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/oeis.d.ts +1 -1
- package/dist/types/compute-engine/sequence.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/antiderivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-cost.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/logic-utils.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-factorial.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-log.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-logic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-power.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensor-fields.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensors.d.ts +1 -1
- package/dist/types/compute-engine/types-definitions.d.ts +1 -1
- package/dist/types/compute-engine/types-engine.d.ts +1 -1
- package/dist/types/compute-engine/types-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-expression.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +2 -1
- package/dist/types/core.d.ts +1 -1
- package/dist/types/interval.d.ts +1 -1
- package/dist/types/latex-syntax.d.ts +2 -2
- package/dist/types/math-json/symbols.d.ts +1 -1
- package/dist/types/math-json/types.d.ts +1 -1
- package/dist/types/math-json/utils.d.ts +1 -1
- package/dist/types/math-json.d.ts +2 -2
- package/dist/types/numerics.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/compute-engine/compilation/fractal-orbit.d.ts +0 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** LatexSyntax 0.55.
|
|
1
|
+
/** LatexSyntax 0.55.6 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LatexSyntax = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var LatexSyntax = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -4787,10 +4787,6 @@ var LatexSyntax = (() => {
|
|
|
4787
4787
|
// Lagrange notation
|
|
4788
4788
|
{
|
|
4789
4789
|
name: "Derivative",
|
|
4790
|
-
// @todo: Leibniz notation: {% latex " \\frac{d^n}{dx^n} f(x)" %}
|
|
4791
|
-
// @todo: Euler modified notation: This notation is used by Mathematica. The Euler notation uses `D` instead of
|
|
4792
|
-
// `\partial`: `\partial_{x} f`, `\partial_{x,y} f`
|
|
4793
|
-
// Newton notation (\dot{v}, \ddot{v}) is implemented below
|
|
4794
4790
|
serialize: (serializer, expr) => {
|
|
4795
4791
|
const degree = machineValue(operand(expr, 2)) ?? 1;
|
|
4796
4792
|
const base = serializer.serialize(operand(expr, 1));
|
|
@@ -5828,14 +5824,18 @@ var LatexSyntax = (() => {
|
|
|
5828
5824
|
return ["Complement", lhs];
|
|
5829
5825
|
}
|
|
5830
5826
|
// precedence: 240,
|
|
5831
|
-
// @todo: serialize for the multiple argument case
|
|
5832
5827
|
},
|
|
5833
5828
|
{
|
|
5834
5829
|
name: "Complement",
|
|
5835
5830
|
latexTrigger: ["^", "<{>", "\\complement", "<}>"],
|
|
5836
|
-
kind: "postfix"
|
|
5831
|
+
kind: "postfix",
|
|
5837
5832
|
// precedence: 240,
|
|
5838
|
-
|
|
5833
|
+
serialize: (serializer, expr) => {
|
|
5834
|
+
return joinLatex([
|
|
5835
|
+
serializer.serialize(operand(expr, 1)),
|
|
5836
|
+
"^\\complement"
|
|
5837
|
+
]);
|
|
5838
|
+
}
|
|
5839
5839
|
},
|
|
5840
5840
|
{
|
|
5841
5841
|
name: "Intersection",
|
|
@@ -5922,7 +5922,6 @@ var LatexSyntax = (() => {
|
|
|
5922
5922
|
// commands like \rbrack a, b \rbrack which are unambiguous.
|
|
5923
5923
|
{
|
|
5924
5924
|
name: "Multiple",
|
|
5925
|
-
// @todo: parse
|
|
5926
5925
|
serialize: serializeSet
|
|
5927
5926
|
},
|
|
5928
5927
|
{
|
|
@@ -5931,14 +5930,28 @@ var LatexSyntax = (() => {
|
|
|
5931
5930
|
kind: "infix",
|
|
5932
5931
|
precedence: 350
|
|
5933
5932
|
},
|
|
5933
|
+
// \mid as a separator/operator (used in set-builder notation: {x \mid x > 0})
|
|
5934
|
+
// Low precedence so it binds loosely — everything on each side is parsed first
|
|
5935
|
+
{
|
|
5936
|
+
name: "Divides",
|
|
5937
|
+
latexTrigger: ["\\mid"],
|
|
5938
|
+
kind: "infix",
|
|
5939
|
+
precedence: 160
|
|
5940
|
+
},
|
|
5934
5941
|
{
|
|
5935
5942
|
name: "Set",
|
|
5936
5943
|
kind: "matchfix",
|
|
5937
5944
|
openTrigger: "{",
|
|
5938
5945
|
closeTrigger: "}",
|
|
5939
|
-
// @todo: the set syntax can also include conditions...
|
|
5940
5946
|
parse: (_parser, body) => {
|
|
5941
5947
|
if (isEmptySequence(body)) return "EmptySet";
|
|
5948
|
+
const h = operator(body);
|
|
5949
|
+
if (h === "Divides" || h === "Colon") {
|
|
5950
|
+
const expr = operand(body, 1);
|
|
5951
|
+
const condition = operand(body, 2);
|
|
5952
|
+
if (expr !== null && condition !== null)
|
|
5953
|
+
return ["Set", expr, ["Condition", condition]];
|
|
5954
|
+
}
|
|
5942
5955
|
if (operator(body) == "Delimiter" && stringValue(operand(body, 2)) === ",") {
|
|
5943
5956
|
body = operand(body, 1);
|
|
5944
5957
|
}
|
|
@@ -5946,6 +5959,17 @@ var LatexSyntax = (() => {
|
|
|
5946
5959
|
return ["Set", ...operands(body)];
|
|
5947
5960
|
},
|
|
5948
5961
|
serialize: (serializer, expr) => {
|
|
5962
|
+
if (nops(expr) === 2 && operator(operand(expr, 2)) === "Condition") {
|
|
5963
|
+
const condition = operand(expr, 2);
|
|
5964
|
+
return joinLatex([
|
|
5965
|
+
"\\lbrace",
|
|
5966
|
+
serializer.serialize(operand(expr, 1)),
|
|
5967
|
+
"\\mid",
|
|
5968
|
+
// Serialize the inner expression of the Condition wrapper
|
|
5969
|
+
serializer.serialize(operand(condition, 1)),
|
|
5970
|
+
"\\rbrace"
|
|
5971
|
+
]);
|
|
5972
|
+
}
|
|
5949
5973
|
return joinLatex([
|
|
5950
5974
|
"\\lbrace",
|
|
5951
5975
|
operands(expr).map((x) => serializer.serialize(x)).join(", "),
|
|
@@ -6112,23 +6136,6 @@ var LatexSyntax = (() => {
|
|
|
6112
6136
|
if (expr === null) return "";
|
|
6113
6137
|
const h = operator(expr);
|
|
6114
6138
|
if (!h) return "";
|
|
6115
|
-
if (h === "Set") {
|
|
6116
|
-
if (nops(expr) === 0) return "\\emptyset";
|
|
6117
|
-
if (nops(expr) === 2 && operator(operand(expr, 2)) === "Condition") {
|
|
6118
|
-
return joinLatex([
|
|
6119
|
-
"\\left\\lbrace",
|
|
6120
|
-
serializer.serialize(operand(expr, 1)),
|
|
6121
|
-
"\\middle\\mid",
|
|
6122
|
-
serializer.serialize(operand(expr, 2)),
|
|
6123
|
-
"\\right\\rbrace"
|
|
6124
|
-
]);
|
|
6125
|
-
}
|
|
6126
|
-
return joinLatex([
|
|
6127
|
-
"\\left\\lbrace",
|
|
6128
|
-
...operands(expr).map((x) => serializer.serialize(x) + " ,"),
|
|
6129
|
-
"\\right\\rbrace"
|
|
6130
|
-
]);
|
|
6131
|
-
}
|
|
6132
6139
|
if (h === "Multiple") {
|
|
6133
6140
|
}
|
|
6134
6141
|
if (h === "Range") {
|
|
@@ -7276,11 +7283,13 @@ var LatexSyntax = (() => {
|
|
|
7276
7283
|
if (!parser.match("_")) return null;
|
|
7277
7284
|
const base = parser.parseGroup();
|
|
7278
7285
|
if (operator(base) !== "To") return null;
|
|
7279
|
-
const expr = parser.
|
|
7286
|
+
const expr = parser.parseExpression({
|
|
7287
|
+
minPrec: MULTIPLICATION_PRECEDENCE
|
|
7288
|
+
});
|
|
7280
7289
|
if (!expr) return null;
|
|
7281
7290
|
return [
|
|
7282
7291
|
"Limit",
|
|
7283
|
-
["Function", expr
|
|
7292
|
+
["Function", expr, operand(base, 1)],
|
|
7284
7293
|
operand(base, 2)
|
|
7285
7294
|
];
|
|
7286
7295
|
},
|
|
@@ -9484,12 +9493,52 @@ var LatexSyntax = (() => {
|
|
|
9484
9493
|
];
|
|
9485
9494
|
|
|
9486
9495
|
// src/compute-engine/latex-syntax/dictionary/definitions-other.ts
|
|
9496
|
+
var TEX_UNITS = [
|
|
9497
|
+
"pt",
|
|
9498
|
+
"em",
|
|
9499
|
+
"mu",
|
|
9500
|
+
"ex",
|
|
9501
|
+
"mm",
|
|
9502
|
+
"cm",
|
|
9503
|
+
"in",
|
|
9504
|
+
"bp",
|
|
9505
|
+
"sp",
|
|
9506
|
+
"dd",
|
|
9507
|
+
"cc",
|
|
9508
|
+
"pc",
|
|
9509
|
+
"nc",
|
|
9510
|
+
"nd"
|
|
9511
|
+
];
|
|
9512
|
+
function skipTexDimension(parser) {
|
|
9513
|
+
parser.skipSpace();
|
|
9514
|
+
if (parser.peek === "-" || parser.peek === "+") parser.nextToken();
|
|
9515
|
+
while (/^[\d.]$/.test(parser.peek)) parser.nextToken();
|
|
9516
|
+
for (const unit of TEX_UNITS) {
|
|
9517
|
+
if (parser.matchAll([...unit])) return;
|
|
9518
|
+
}
|
|
9519
|
+
}
|
|
9487
9520
|
function parseSingleArg(cmd) {
|
|
9488
9521
|
return (parser) => {
|
|
9489
9522
|
const arg = parser.parseGroup();
|
|
9490
9523
|
return arg === null ? [cmd] : [cmd, arg];
|
|
9491
9524
|
};
|
|
9492
9525
|
}
|
|
9526
|
+
function parseMathStyleSwitch(mathStyle) {
|
|
9527
|
+
return (parser) => {
|
|
9528
|
+
const body = parser.parseExpression();
|
|
9529
|
+
if (body !== null && !isEmptySequence(body))
|
|
9530
|
+
return ["Annotated", body, { dict: { mathStyle } }];
|
|
9531
|
+
return "Nothing";
|
|
9532
|
+
};
|
|
9533
|
+
}
|
|
9534
|
+
function parseSizeSwitch(size) {
|
|
9535
|
+
return (parser) => {
|
|
9536
|
+
const body = parser.parseExpression();
|
|
9537
|
+
if (body !== null && !isEmptySequence(body))
|
|
9538
|
+
return ["Annotated", body, { dict: { size } }];
|
|
9539
|
+
return "Nothing";
|
|
9540
|
+
};
|
|
9541
|
+
}
|
|
9493
9542
|
var DEFINITIONS_OTHERS = [
|
|
9494
9543
|
{
|
|
9495
9544
|
name: "Overscript",
|
|
@@ -9729,80 +9778,71 @@ var LatexSyntax = (() => {
|
|
|
9729
9778
|
},
|
|
9730
9779
|
{
|
|
9731
9780
|
latexTrigger: ["\\displaystyle"],
|
|
9732
|
-
parse: (
|
|
9733
|
-
// @todo: parse as ['Annotated'...]
|
|
9781
|
+
parse: parseMathStyleSwitch("normal")
|
|
9734
9782
|
},
|
|
9735
9783
|
{
|
|
9736
9784
|
latexTrigger: ["\\textstyle"],
|
|
9737
|
-
parse: (
|
|
9738
|
-
// @todo: parse as ['Annotated'...]
|
|
9785
|
+
parse: parseMathStyleSwitch("compact")
|
|
9739
9786
|
},
|
|
9740
9787
|
{
|
|
9741
9788
|
latexTrigger: ["\\scriptstyle"],
|
|
9742
|
-
parse: (
|
|
9743
|
-
// @todo: parse as ['Annotated'...]
|
|
9789
|
+
parse: parseMathStyleSwitch("script")
|
|
9744
9790
|
},
|
|
9745
9791
|
{
|
|
9746
9792
|
latexTrigger: ["\\scriptscriptstyle"],
|
|
9747
|
-
parse: (
|
|
9748
|
-
// @todo: parse as ['Annotated'...]
|
|
9793
|
+
parse: parseMathStyleSwitch("scriptscript")
|
|
9749
9794
|
},
|
|
9750
9795
|
{
|
|
9751
9796
|
latexTrigger: ["\\color"],
|
|
9752
9797
|
parse: (parser) => {
|
|
9753
|
-
parser.
|
|
9798
|
+
const color = parser.parseStringGroup();
|
|
9799
|
+
if (color !== null) {
|
|
9800
|
+
const body = parser.parseExpression();
|
|
9801
|
+
if (body !== null && !isEmptySequence(body))
|
|
9802
|
+
return ["Annotated", body, { dict: { color } }];
|
|
9803
|
+
}
|
|
9754
9804
|
return "Nothing";
|
|
9755
9805
|
}
|
|
9756
9806
|
},
|
|
9757
9807
|
{
|
|
9758
9808
|
latexTrigger: ["\\tiny"],
|
|
9759
|
-
parse: ()
|
|
9760
|
-
// @todo: parse as ['Annotated'...]
|
|
9809
|
+
parse: parseSizeSwitch(1)
|
|
9761
9810
|
},
|
|
9762
9811
|
{
|
|
9763
9812
|
latexTrigger: ["\\scriptsize"],
|
|
9764
|
-
parse: ()
|
|
9765
|
-
// @todo: parse as ['Annotated'...]
|
|
9813
|
+
parse: parseSizeSwitch(2)
|
|
9766
9814
|
},
|
|
9767
9815
|
{
|
|
9768
9816
|
latexTrigger: ["\\footnotesize"],
|
|
9769
|
-
parse: ()
|
|
9770
|
-
// @todo: parse as ['Annotated'...]
|
|
9817
|
+
parse: parseSizeSwitch(3)
|
|
9771
9818
|
},
|
|
9772
9819
|
{
|
|
9773
9820
|
latexTrigger: ["\\small"],
|
|
9774
|
-
parse: ()
|
|
9775
|
-
// @todo: parse as ['Annotated'...]
|
|
9821
|
+
parse: parseSizeSwitch(4)
|
|
9776
9822
|
},
|
|
9777
9823
|
{
|
|
9778
9824
|
latexTrigger: ["\\normalsize"],
|
|
9779
|
-
parse: ()
|
|
9780
|
-
// @todo: parse as ['Annotated'...]
|
|
9825
|
+
parse: parseSizeSwitch(5)
|
|
9781
9826
|
},
|
|
9782
9827
|
{
|
|
9783
9828
|
latexTrigger: ["\\large"],
|
|
9784
|
-
parse: ()
|
|
9785
|
-
// @todo: parse as ['Annotated'...]
|
|
9829
|
+
parse: parseSizeSwitch(6)
|
|
9786
9830
|
},
|
|
9787
9831
|
{
|
|
9788
9832
|
latexTrigger: ["\\Large"],
|
|
9789
|
-
parse: ()
|
|
9790
|
-
// @todo: parse as ['Annotated'...]
|
|
9833
|
+
parse: parseSizeSwitch(7)
|
|
9791
9834
|
},
|
|
9792
9835
|
{
|
|
9793
9836
|
latexTrigger: ["\\LARGE"],
|
|
9794
|
-
parse: ()
|
|
9795
|
-
// @todo: parse as ['Annotated'...]
|
|
9837
|
+
parse: parseSizeSwitch(8)
|
|
9796
9838
|
},
|
|
9797
9839
|
{
|
|
9798
9840
|
latexTrigger: ["\\huge"],
|
|
9799
|
-
parse: ()
|
|
9800
|
-
// @todo: parse as ['Annotated'...]
|
|
9841
|
+
parse: parseSizeSwitch(9)
|
|
9801
9842
|
},
|
|
9802
9843
|
{
|
|
9803
9844
|
latexTrigger: ["\\Huge"],
|
|
9804
|
-
parse: ()
|
|
9805
|
-
// @todo: parse as ['Annotated'...]
|
|
9845
|
+
parse: parseSizeSwitch(10)
|
|
9806
9846
|
},
|
|
9807
9847
|
{
|
|
9808
9848
|
name: "Annotated",
|
|
@@ -9814,6 +9854,10 @@ var LatexSyntax = (() => {
|
|
|
9814
9854
|
result = joinLatex(["{\\displaystyle", result, "}"]);
|
|
9815
9855
|
else if (dict.dict.mathStyle === "compact")
|
|
9816
9856
|
result = joinLatex(["{\\textstyle", result, "}"]);
|
|
9857
|
+
else if (dict.dict.mathStyle === "script")
|
|
9858
|
+
result = joinLatex(["{\\scriptstyle", result, "}"]);
|
|
9859
|
+
else if (dict.dict.mathStyle === "scriptscript")
|
|
9860
|
+
result = joinLatex(["{\\scriptscriptstyle", result, "}"]);
|
|
9817
9861
|
const v = dict.dict.size;
|
|
9818
9862
|
if (v !== null && v >= 1 && v <= 10) {
|
|
9819
9863
|
result = joinLatex([
|
|
@@ -9901,6 +9945,28 @@ var LatexSyntax = (() => {
|
|
|
9901
9945
|
latexTrigger: ["\\enspace"],
|
|
9902
9946
|
parse: () => ["HorizontalSpacing", 9]
|
|
9903
9947
|
},
|
|
9948
|
+
{
|
|
9949
|
+
latexTrigger: ["\\hspace"],
|
|
9950
|
+
parse: (parser) => {
|
|
9951
|
+
if (parser.peek === "*") parser.nextToken();
|
|
9952
|
+
parser.parseStringGroup();
|
|
9953
|
+
return ["HorizontalSpacing", 0];
|
|
9954
|
+
}
|
|
9955
|
+
},
|
|
9956
|
+
{
|
|
9957
|
+
latexTrigger: ["\\hskip"],
|
|
9958
|
+
parse: (parser) => {
|
|
9959
|
+
skipTexDimension(parser);
|
|
9960
|
+
return ["HorizontalSpacing", 0];
|
|
9961
|
+
}
|
|
9962
|
+
},
|
|
9963
|
+
{
|
|
9964
|
+
latexTrigger: ["\\kern"],
|
|
9965
|
+
parse: (parser) => {
|
|
9966
|
+
skipTexDimension(parser);
|
|
9967
|
+
return ["HorizontalSpacing", 0];
|
|
9968
|
+
}
|
|
9969
|
+
},
|
|
9904
9970
|
{
|
|
9905
9971
|
latexTrigger: ["\\phantom"],
|
|
9906
9972
|
parse: (parser) => {
|
|
@@ -9951,7 +10017,17 @@ var LatexSyntax = (() => {
|
|
|
9951
10017
|
// `["HorizontalSpacing", expr, 'op'|'bin'|rel]` -> indicate a spacing around and expression, i.e. `\mathbin{x}`, etc...
|
|
9952
10018
|
serialize: (serializer, expr) => {
|
|
9953
10019
|
if (operand(expr, 2) !== null) {
|
|
9954
|
-
|
|
10020
|
+
const cls = stringValue(operand(expr, 2));
|
|
10021
|
+
const inner = serializer.serialize(operand(expr, 1));
|
|
10022
|
+
if (cls === "bin") return `\\mathbin{${inner}}`;
|
|
10023
|
+
if (cls === "op") return `\\mathop{${inner}}`;
|
|
10024
|
+
if (cls === "rel") return `\\mathrel{${inner}}`;
|
|
10025
|
+
if (cls === "ord") return `\\mathord{${inner}}`;
|
|
10026
|
+
if (cls === "open") return `\\mathopen{${inner}}`;
|
|
10027
|
+
if (cls === "close") return `\\mathclose{${inner}}`;
|
|
10028
|
+
if (cls === "punct") return `\\mathpunct{${inner}}`;
|
|
10029
|
+
if (cls === "inner") return `\\mathinner{${inner}}`;
|
|
10030
|
+
return inner;
|
|
9955
10031
|
}
|
|
9956
10032
|
const v = machineValue(operand(expr, 1));
|
|
9957
10033
|
if (v === null) return "";
|
|
@@ -10342,25 +10418,47 @@ var LatexSyntax = (() => {
|
|
|
10342
10418
|
result.arguments = entry.arguments;
|
|
10343
10419
|
return result;
|
|
10344
10420
|
}
|
|
10421
|
+
function serializeTabularBody(serializer, body) {
|
|
10422
|
+
if (!body) return "";
|
|
10423
|
+
if (operator(body) !== "List") return serializer.serialize(body);
|
|
10424
|
+
const rows = operands(body);
|
|
10425
|
+
if (rows.length === 0) return "";
|
|
10426
|
+
if (!rows.every((row) => operator(row) === "List"))
|
|
10427
|
+
return serializer.serialize(body);
|
|
10428
|
+
return rows.map(
|
|
10429
|
+
(row) => operands(row).map((cell) => serializer.serialize(cell)).join(" & ")
|
|
10430
|
+
).join(" \\\\\n");
|
|
10431
|
+
}
|
|
10345
10432
|
function makeSerializeHandler(entry, latexTrigger, idTrigger) {
|
|
10346
10433
|
if (typeof entry.serialize === "function") return entry.serialize;
|
|
10347
10434
|
const kind = entry["kind"] ?? "expression";
|
|
10348
10435
|
if (kind === "environment") {
|
|
10349
10436
|
const envName = entry["symbolTrigger"] ?? entry.name ?? "unknown";
|
|
10350
|
-
return (serializer, expr) =>
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10437
|
+
return (serializer, expr) => {
|
|
10438
|
+
const body = operand(expr, 1);
|
|
10439
|
+
return joinLatex([
|
|
10440
|
+
`\\begin{${envName}}`,
|
|
10441
|
+
serializeTabularBody(serializer, body),
|
|
10442
|
+
`\\end{${envName}}`
|
|
10443
|
+
]);
|
|
10444
|
+
};
|
|
10355
10445
|
}
|
|
10356
10446
|
if (isMatchfixEntry(entry)) {
|
|
10357
10447
|
const openDelim = typeof entry.openTrigger === "string" ? DEFAULT_DELIMITER[entry.openTrigger] : tokensToString(entry.openTrigger);
|
|
10358
10448
|
const closeDelim = typeof entry.closeTrigger === "string" ? DEFAULT_DELIMITER[entry.closeTrigger] : tokensToString(entry.closeTrigger);
|
|
10359
|
-
return (serializer, expr) =>
|
|
10360
|
-
|
|
10361
|
-
serializer.serialize(operand(expr, 1))
|
|
10362
|
-
|
|
10363
|
-
|
|
10449
|
+
return (serializer, expr) => {
|
|
10450
|
+
const style = serializer.groupStyle(expr, serializer.level + 1);
|
|
10451
|
+
const inner = serializer.serialize(operand(expr, 1));
|
|
10452
|
+
if (style === "scaled")
|
|
10453
|
+
return joinLatex([`\\left${openDelim}`, inner, `\\right${closeDelim}`]);
|
|
10454
|
+
if (style === "big")
|
|
10455
|
+
return joinLatex([
|
|
10456
|
+
`\\Bigl${openDelim}`,
|
|
10457
|
+
inner,
|
|
10458
|
+
`\\Bigr${closeDelim}`
|
|
10459
|
+
]);
|
|
10460
|
+
return joinLatex([openDelim, inner, closeDelim]);
|
|
10461
|
+
};
|
|
10364
10462
|
}
|
|
10365
10463
|
let latex = entry.serialize;
|
|
10366
10464
|
if (latex === void 0 && latexTrigger) latex = tokensToString(latexTrigger);
|
|
@@ -12623,6 +12721,16 @@ var LatexSyntax = (() => {
|
|
|
12623
12721
|
}
|
|
12624
12722
|
|
|
12625
12723
|
// src/compute-engine/latex-syntax/parse.ts
|
|
12724
|
+
var _symbolToUnicode = null;
|
|
12725
|
+
function getSymbolToUnicode() {
|
|
12726
|
+
if (!_symbolToUnicode) {
|
|
12727
|
+
_symbolToUnicode = /* @__PURE__ */ new Map();
|
|
12728
|
+
for (const [, latex, codepoint] of SYMBOLS) {
|
|
12729
|
+
_symbolToUnicode.set(latex, String.fromCodePoint(codepoint));
|
|
12730
|
+
}
|
|
12731
|
+
}
|
|
12732
|
+
return _symbolToUnicode;
|
|
12733
|
+
}
|
|
12626
12734
|
var DELIMITER_SHORTHAND2 = {
|
|
12627
12735
|
"(": ["\\lparen", "("],
|
|
12628
12736
|
")": ["\\rparen", ")"],
|
|
@@ -13070,6 +13178,35 @@ var LatexSyntax = (() => {
|
|
|
13070
13178
|
this.nextToken();
|
|
13071
13179
|
this.skipVisualSpace();
|
|
13072
13180
|
}
|
|
13181
|
+
if (this.match("\\hspace")) {
|
|
13182
|
+
this.match("*");
|
|
13183
|
+
this.parseStringGroup();
|
|
13184
|
+
this.skipVisualSpace();
|
|
13185
|
+
}
|
|
13186
|
+
if (this.match("\\hskip") || this.match("\\kern")) {
|
|
13187
|
+
this.skipSpace();
|
|
13188
|
+
this.match("-") || this.match("+");
|
|
13189
|
+
while (/^[\d.]$/.test(this.peek)) this.nextToken();
|
|
13190
|
+
for (const unit of [
|
|
13191
|
+
"pt",
|
|
13192
|
+
"em",
|
|
13193
|
+
"mu",
|
|
13194
|
+
"ex",
|
|
13195
|
+
"mm",
|
|
13196
|
+
"cm",
|
|
13197
|
+
"in",
|
|
13198
|
+
"bp",
|
|
13199
|
+
"sp",
|
|
13200
|
+
"dd",
|
|
13201
|
+
"cc",
|
|
13202
|
+
"pc",
|
|
13203
|
+
"nc",
|
|
13204
|
+
"nd"
|
|
13205
|
+
]) {
|
|
13206
|
+
if (this.matchAll([...unit])) break;
|
|
13207
|
+
}
|
|
13208
|
+
this.skipVisualSpace();
|
|
13209
|
+
}
|
|
13073
13210
|
this.skipSpace();
|
|
13074
13211
|
}
|
|
13075
13212
|
match(token) {
|
|
@@ -13407,7 +13544,8 @@ var LatexSyntax = (() => {
|
|
|
13407
13544
|
} else if (token === "<space>") {
|
|
13408
13545
|
result += " ";
|
|
13409
13546
|
} else if (token[0] === "\\") {
|
|
13410
|
-
|
|
13547
|
+
const unicode = getSymbolToUnicode().get(token);
|
|
13548
|
+
result += unicode ?? token;
|
|
13411
13549
|
} else {
|
|
13412
13550
|
result += token;
|
|
13413
13551
|
}
|
|
@@ -14767,7 +14905,7 @@ var LatexSyntax = (() => {
|
|
|
14767
14905
|
sansserif: (s) => `\\mathsf{${s}}`,
|
|
14768
14906
|
monospace: (s) => `\\mathtt{${s}}`
|
|
14769
14907
|
};
|
|
14770
|
-
var
|
|
14908
|
+
var Serializer5 = class {
|
|
14771
14909
|
options;
|
|
14772
14910
|
dictionary;
|
|
14773
14911
|
level = -1;
|
|
@@ -14782,11 +14920,18 @@ var LatexSyntax = (() => {
|
|
|
14782
14920
|
/**
|
|
14783
14921
|
* Serialize the expression, and if the expression is an operator
|
|
14784
14922
|
* of precedence less than or equal to prec, wrap it in some parens.
|
|
14785
|
-
*
|
|
14923
|
+
*
|
|
14924
|
+
* Skip wrapping for matchfix operators (Abs, Floor, Ceil, Norm, etc.)
|
|
14925
|
+
* and Delimiter since they already have visible delimiters.
|
|
14786
14926
|
*/
|
|
14787
14927
|
wrap(expr, prec) {
|
|
14788
14928
|
if (expr === null || expr === void 0) return "";
|
|
14789
14929
|
if (prec === void 0) {
|
|
14930
|
+
const name2 = operator(expr);
|
|
14931
|
+
if (name2) {
|
|
14932
|
+
const def = this.dictionary.ids.get(name2);
|
|
14933
|
+
if (def?.kind === "matchfix") return this.serialize(expr);
|
|
14934
|
+
}
|
|
14790
14935
|
return this.wrapString(
|
|
14791
14936
|
this.serialize(expr),
|
|
14792
14937
|
this.options.groupStyle(expr, this.level + 1)
|
|
@@ -15080,7 +15225,7 @@ var LatexSyntax = (() => {
|
|
|
15080
15225
|
return body;
|
|
15081
15226
|
}
|
|
15082
15227
|
function serializeLatex(expr, dict, options) {
|
|
15083
|
-
const serializer = new
|
|
15228
|
+
const serializer = new Serializer5(dict, options);
|
|
15084
15229
|
return serializer.serialize(expr);
|
|
15085
15230
|
}
|
|
15086
15231
|
|
|
@@ -15207,7 +15352,7 @@ var LatexSyntax = (() => {
|
|
|
15207
15352
|
}
|
|
15208
15353
|
|
|
15209
15354
|
// src/latex-syntax.ts
|
|
15210
|
-
var version = "0.55.
|
|
15355
|
+
var version = "0.55.6";
|
|
15211
15356
|
return __toCommonJS(latex_syntax_exports);
|
|
15212
15357
|
})();
|
|
15213
15358
|
Object.assign(exports, LatexSyntax); Object.defineProperty(exports, '__esModule', { value: true });}));
|
package/dist/math-json.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.55.
|
|
1
|
+
/** Compute Engine 0.55.6 */
|
|
2
2
|
|
|
3
3
|
// src/math-json/utils.ts
|
|
4
4
|
function isNumberObject(expr) {
|
|
@@ -115,7 +115,7 @@ function expressionToDictionaryValue(expr) {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// src/math-json.ts
|
|
118
|
-
var version = "0.55.
|
|
118
|
+
var version = "0.55.6";
|
|
119
119
|
export {
|
|
120
120
|
dictionaryFromExpression,
|
|
121
121
|
isFunctionObject,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Compute Engine 0.55.
|
|
2
|
-
function b(n){return n!==null&&typeof n=="object"&&"num"in n}function s(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function M(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):j(n)||y(n)?null:n}function l(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function h(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function d(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function J(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function m(n){return typeof n=="string"&&y(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:s(n)?n.sym:null}function a(n){let t=l(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=h(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function E(n){if(n===null)return null;if(M(n))return n;let t=a(n);if(t)return{[t[0]]:t[1]};if(l(n)==="Dictionary"){let i={},o=h(n);for(let e=1;e<J(n);e++){let u=a(o[e]);u&&(i[u[0]]=O(u[1])??"Nothing")}return{dict:i}}return null}function g(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function j(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function y(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function O(n){return n==null?null:f(n)?n.str:b(n)?parseFloat(n.num):s(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var S="0.55.
|
|
1
|
+
/** Compute Engine 0.55.6 */
|
|
2
|
+
function b(n){return n!==null&&typeof n=="object"&&"num"in n}function s(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function M(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):j(n)||y(n)?null:n}function l(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function h(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function d(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function J(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function m(n){return typeof n=="string"&&y(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:s(n)?n.sym:null}function a(n){let t=l(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=h(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function E(n){if(n===null)return null;if(M(n))return n;let t=a(n);if(t)return{[t[0]]:t[1]};if(l(n)==="Dictionary"){let i={},o=h(n);for(let e=1;e<J(n);e++){let u=a(o[e]);u&&(i[u[0]]=O(u[1])??"Nothing")}return{dict:i}}return null}function g(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function j(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function y(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function O(n){return n==null?null:f(n)?n.str:b(n)?parseFloat(n.num):s(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var S="0.55.6";export{E as dictionaryFromExpression,r as isFunctionObject,f as isStringObject,s as isSymbolObject,g as mapArgs,d as operand,l as operator,c as stringValue,m as symbol,S as version};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** MathJSON 0.55.
|
|
1
|
+
/** MathJSON 0.55.6 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
|
-
var MathJson=(()=>{var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var O=(n,t)=>{for(var i in t)a(n,i,{get:t[i],enumerable:!0})},A=(n,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of g(t))!j.call(n,e)&&e!==i&&a(n,e,{get:()=>t[e],enumerable:!(o=E(t,e))||o.enumerable});return n};var S=n=>A(a({},"__esModule",{value:!0}),n);var T={};O(T,{dictionaryFromExpression:()=>d,isFunctionObject:()=>r,isStringObject:()=>f,isSymbolObject:()=>u,mapArgs:()=>J,operand:()=>b,operator:()=>s,stringValue:()=>c,symbol:()=>M,version:()=>V});function N(n){return n!==null&&typeof n=="object"&&"num"in n}function u(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function p(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):k(n)||m(n)?null:n}function s(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function y(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function b(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function D(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function M(n){return typeof n=="string"&&m(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:u(n)?n.sym:null}function h(n){let t=s(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=y(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function d(n){if(n===null)return null;if(p(n))return n;let t=h(n);if(t)return{[t[0]]:t[1]};if(s(n)==="Dictionary"){let i={},o=y(n);for(let e=1;e<D(n);e++){let l=h(o[e]);l&&(i[l[0]]=F(l[1])??"Nothing")}return{dict:i}}return null}function J(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function k(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function m(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function F(n){return n==null?null:f(n)?n.str:N(n)?parseFloat(n.num):u(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var V="0.55.
|
|
3
|
+
var MathJson=(()=>{var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var O=(n,t)=>{for(var i in t)a(n,i,{get:t[i],enumerable:!0})},A=(n,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of g(t))!j.call(n,e)&&e!==i&&a(n,e,{get:()=>t[e],enumerable:!(o=E(t,e))||o.enumerable});return n};var S=n=>A(a({},"__esModule",{value:!0}),n);var T={};O(T,{dictionaryFromExpression:()=>d,isFunctionObject:()=>r,isStringObject:()=>f,isSymbolObject:()=>u,mapArgs:()=>J,operand:()=>b,operator:()=>s,stringValue:()=>c,symbol:()=>M,version:()=>V});function N(n){return n!==null&&typeof n=="object"&&"num"in n}function u(n){return n!==null&&typeof n=="object"&&"sym"in n}function f(n){return n!==null&&typeof n=="object"&&"str"in n}function p(n){return n!==null&&typeof n=="object"&&"dict"in n&&typeof n.dict=="object"&&!Array.isArray(n.dict)&&n.dict!==null}function r(n){return n!==null&&typeof n=="object"&&"fn"in n&&Array.isArray(n.fn)&&n.fn.length>0&&typeof n.fn[0]=="string"}function c(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"?null:n.length>=2&&n.at(0)==="'"&&n.at(-1)==="'"?n.substring(1,n.length-1):k(n)||m(n)?null:n}function s(n){return Array.isArray(n)?n[0]:n==null?"":r(n)?n.fn[0]:""}function y(n){return Array.isArray(n)?n.slice(1):n!==void 0&&r(n)?n.fn.slice(1):[]}function b(n,t){return Array.isArray(n)?n[t]??null:n===null||!r(n)?null:n.fn[t]??null}function D(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):r(n)?Math.max(0,n.fn.length-1):0}function M(n){return typeof n=="string"&&m(n)?n.length>=2&&n.at(0)==="`"&&n.at(-1)==="`"?n.slice(1,-1):n:n==null?null:u(n)?n.sym:null}function h(n){let t=s(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let[i,o]=y(n),e=c(i);return e?[e,o??"Nothing"]:null}return null}function d(n){if(n===null)return null;if(p(n))return n;let t=h(n);if(t)return{[t[0]]:t[1]};if(s(n)==="Dictionary"){let i={},o=y(n);for(let e=1;e<D(n);e++){let l=h(o[e]);l&&(i[l[0]]=F(l[1])??"Nothing")}return{dict:i}}return null}function J(n,t){let i=null;if(Array.isArray(n)&&(i=n),r(n)&&(i=n.fn),i===null)return[];let o=1,e=[];for(;o<i.length;)e.push(t(i[o])),o+=1;return e}function k(n){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(n)||/^[+-]?(0|[1-9][0-9]*)(\.[0-9]+)?(\([0-9]+\))?([eE][+-]?[0-9]+)?$/.test(n)}function m(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||n.length>=2&&n[0]==="`"&&n[n.length-1]==="`"}function F(n){return n==null?null:f(n)?n.str:N(n)?parseFloat(n.num):u(n)?n.sym:typeof n=="string"||typeof n=="number"?n:Array.isArray(n)?{fn:n}:n}var V="0.55.6";return S(T);})();
|
|
4
4
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
package/dist/math-json.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** MathJSON 0.55.
|
|
1
|
+
/** MathJSON 0.55.6 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var MathJson = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -149,7 +149,7 @@ var MathJson = (() => {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// src/math-json.ts
|
|
152
|
-
var version = "0.55.
|
|
152
|
+
var version = "0.55.6";
|
|
153
153
|
return __toCommonJS(math_json_exports);
|
|
154
154
|
})();
|
|
155
155
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
package/dist/numerics.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.55.
|
|
1
|
+
/** Compute Engine 0.55.6 */
|
|
2
2
|
|
|
3
3
|
// src/compute-engine/numeric-value/types.ts
|
|
4
4
|
var NumericValue = class {
|
|
@@ -8473,7 +8473,7 @@ function gammaln2(c) {
|
|
|
8473
8473
|
}
|
|
8474
8474
|
|
|
8475
8475
|
// src/numerics.ts
|
|
8476
|
-
var version = "0.55.
|
|
8476
|
+
var version = "0.55.6";
|
|
8477
8477
|
export {
|
|
8478
8478
|
BigNumericValue,
|
|
8479
8479
|
DEFAULT_PRECISION,
|