-
Notifications
You must be signed in to change notification settings - Fork 26
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
Suggestion: Warn about implicit multiplication at the end of a line #49
Comments
This is available and you can turn it on under Inspections in the preferences. I thought it was on by default (or at least I don't remember turning it on and it's working). |
Can you give a complete example? Commas in Mathematica can only appear in a list, in function arguments or in things like This shows a slightly yellow underline where the comma is missing and a red underline where the comma is at the end. Therefore, it is telling something (1) might be wrong and something (2) is definitely wrong. You might ask, why the missing comma is only "probably wrong". It is because Mathematica considers whitespace as multiplication in certain circumstances. This here
is a list of the elements |
For some amusement: Actually the following is correct syntax:
It parses to The message happens to be of the It can be triggered from a notebook if we write By this reasoning the missing command and the extra comma are similar: neither is a real syntax error (though the latter may trigger a more scary looking warning). Note: Personally I am happy with the current setup of red/yellow underlines. |
@Masterxilo You are right, the annotator currently only dives into lists and function calls. I'll fix this. @szhorvat I gave this a long thought whether or not I allow the parser to say |
The SciDraw package actually has its own warning, along the lines of: "I found a Null, stray comma?". I think they should either have made it a fatal parsing error, or otherwise the parser should just ignore trailing commas (like in C and Python). |
I run into this quite often:
The first line is missing a comma. But the code is parsed and executed correctly and gives undesired results.
The text was updated successfully, but these errors were encountered: