enkimute / ganja.js

:triangular_ruler: Javascript Geometric Algebra Generator for Javascript, c++, c#, rust, python. (with operator overloading and algebraic literals) -
MIT License
1.52k stars 107 forks source link

Inline parser regression: character choking #166

Open kungfooman opened 7 months ago

kungfooman commented 7 months ago

Simple example:

Algebra(2, 0, 1, () => {
  console.log(0xff / 255);
});

Generated code:

image

This bug may also be responsible for:

Algebra(3,0,1).inline("E**(r1 * 1e01)");
// vs.
Algebra(3,0,1).inline((r1) => E**(r1 * 1e01));

Output: image

Suddenly ** is Element.Mul and * is Element.LDot in contrast to ** being Element.Pow.

(I didn't figure out yet which commit introduced these bugs, but maybe you already have a feeling what's wrong)