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

improve brackets logic #17

Open
Atreyagaurav opened this issue Mar 1, 2022 · 1 comment · Fixed by #18
Open

improve brackets logic #17

Atreyagaurav opened this issue Mar 1, 2022 · 1 comment · Fixed by #18
Labels
help wanted Extra attention is needed

Comments

@Atreyagaurav
Copy link
Owner

Right now brackets logic is kinda funky. I recently noticed it was broken, (I need to put ert tests in CI soon).

Right now the logic is spread between the functions as well as inside a function to detect, a way to make it completely modular and hopefully working well.

Modify the litex-maybe-enclose function to also read which function it was called from, and then make appropriate judgement based on function name and arguments.

@Atreyagaurav Atreyagaurav added the help wanted Extra attention is needed label Mar 1, 2022
@Atreyagaurav Atreyagaurav linked a pull request Mar 10, 2022 that will close this issue
@Atreyagaurav
Copy link
Owner Author

This is really hard to generalize, Just realized that there is error of double superscript when the number is formatted as 2 × 10² format and is inside the exponential function.

(expt 2e5 2)2.000 \times 10^{5}^{2}, which is invalid expression for latex.

So, For now brackets were added only for expressions, and now I might have to consider values as well, which complicates things. Feels like I might have to make different representations for the sexp that are to be converted to latex instead of trying to convert it directly to latex.

It already adds too many brackets to make sure it doesn't miss any, and now this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant