Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "dot" for multiplication doesn't seem to work #3

Open
oiiiiiiii opened this issue Sep 30, 2024 · 0 comments
Open

Using "dot" for multiplication doesn't seem to work #3

oiiiiiiii opened this issue Sep 30, 2024 · 0 comments

Comments

@oiiiiiiii
Copy link

First of all, thank you SO much for your work on this project. It is really incredible what is possible with that and how easy it is to use, great work, seriously. Now to the actual issue:

I believe using dot for multiplication, as it is shown in the readme, doesn't work. Or (more likely) I'm doing something wrong setting it up. I installed the project using pip install typst-sympy-calculator as described in the readme. Then I wrote this short python script:

from DefaultTypstCalculator import get_default_calculator

calculator = get_default_calculator()
typst_math = r'5 dot 5'
expr = calculator.simplify(typst_math)
print(calculator.typst(expr))

This results in the following error:

File ".../venv/lib/python3.12/site-packages/gen/TypstGrammarLexer.py", line 282, in setType
    raise Exception("Unknown ID: " + self.text)
Exception: Unknown ID: dot

When I replace dot with * it works however. Is this a bug or did I miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant