You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The big advantage of CoffeeScript - optional parentheses for function invocation - is also a big disadvantage when it comes to allowing ambiguous syntax that does not run the way it reads on the screen.
We should improve the ACE editor coffeescript mode to add warnings in the following situations:
Function invocation with an argument that contains an expression that contains a non-parenthesesed operator with lower precedence than "a - b". For example
"touches a and touches b" which is interpreted as "touches(a and touches(b))" should generate a warning, requiring parentheses.
Function invocation with an argument with a leading unary minus or unary plus. "a +b" is interpreted as coffeescript as "a(+b)" - an extra space is required for "a + b". This is the worst thing in CoffeeScript, and should generate a warning when it is being interpreted as unary minus or plus.
Nested invocation of functions with more than one argument. "dot random color, random [1..100]" is interpreted as "dot(random(color, random([1..100])))". This ambiguity is hard to read and we should require our users to use some parentheses around the inner calls.
The text was updated successfully, but these errors were encountered:
Also, they point out CoffeeLint: https://github.com/clutchski/coffeelint - a good approach to investigate would be to integrate CoffeeLint into the ACE coffeescript mode (to provide warnings) and then add what we need to CoffeeLint.
The big advantage of CoffeeScript - optional parentheses for function invocation - is also a big disadvantage when it comes to allowing ambiguous syntax that does not run the way it reads on the screen.
We should improve the ACE editor coffeescript mode to add warnings in the following situations:
"touches a and touches b" which is interpreted as "touches(a and touches(b))" should generate a warning, requiring parentheses.
The text was updated successfully, but these errors were encountered: