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

Add implicit multiplication #39

Open
cshaa opened this issue Jun 17, 2021 · 2 comments
Open

Add implicit multiplication #39

cshaa opened this issue Jun 17, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@cshaa
Copy link
Owner

cshaa commented Jun 17, 2021

Make this:

 a^2 + 2 a b + b^2

parse as this:

  a**2 + 2*a*b + b**2

The implicit multiplication operator can be overloaded (see #30) using options.operators.juxtapos. If you want to disable multiplication by juxtaposition, redefine the operator to throw an error.

@cshaa cshaa added the enhancement New feature or request label Jun 17, 2021
@cshaa cshaa added this to the v3 milestone Jun 17, 2021
@cshaa cshaa removed this from the v3 milestone Jun 17, 2021
@cshaa
Copy link
Owner Author

cshaa commented Jun 17, 2021

I couldn't figure out the correct grammar for this, but if anybody wants to give it a shot, PRs are always welcome. However, I suspect it would be much easier to implement with a PEG instead of Jison (see #40).

@cshaa cshaa added the help wanted Extra attention is needed label Jun 17, 2021
@cshaa cshaa added this to the v4 milestone Jun 18, 2021
@cshaa
Copy link
Owner Author

cshaa commented Jun 23, 2021

See this SO answer for a great analysis of the problem.

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

No branches or pull requests

1 participant