-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added field of boolean type to config for enabling/disabling of implicit multiplication. #1502
base: develop
Are you sure you want to change the base?
Added field of boolean type to config for enabling/disabling of implicit multiplication. #1502
Conversation
…cit multiplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just leave the implicitMultiplication
option undocumented until the logic is implemented in the parser.
If you do want to implement the full logic of enabling/disabling implicit multiplication, this can help you get started. The file you should be editing is https://github.com/josdejong/mathjs/blob/develop/src/expression/parse.js. The parser is structured as a chain of functions that get called recursively in order of increasing operator precedence. Each function matches its own part of the expression, then calls the next function. Here is a small part of the chain:
In order to disable implicit multiplication, the functions
Hope that helps :-) |
Out of curiosity: what does |
@harrysarson it is in reference to this: #792 (comment) |
@ericman314 I'm happy to implement it as well, would you like that to be in this PR or a separate one? |
Thanks! I think you're good to do it in this PR. |
Thanks Nick! I agree with Eric, the actual enabling/disabling of implicit multiplication in Maybe change the description of the option to something like "Enable implicit multiplication in the expression parser. Default value is Please don't forget to add some unit tests :) |
@nicholasnbg I see this PR is still open. Do you still plan on implementing this new option? It would be a nice addition. |
Issue: #1334
It's my first contribution to the project, please let me know if this is wrong, or if I've missed something.