-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge minus operators with subsequent terms
This happens for all non-calc and non-url functions.
- Loading branch information
Mangara
committed
Mar 24, 2018
1 parent
b96265e
commit b0212aa
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b0212aa
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.
Ok, this seems fine for some range of functions. Is there any reason for supporting more than a single '-'? It seems to be syntactically incorrect at least for the numeric values. For the same reason, I have some doubts regarding the combination of '-' and an identifier. Actually, when the arguments are incorrect, the function should not be accepted at all and the declaration should be ignored.
b0212aa
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.
You're right. I assumed double negation would be valid, but it's not.
The only use case for double-minus I see is for supporting the
var
function, although actual support for that would require a lot of other changes, so it can probably be treated as a special case (likecalc
).Regarding single-minus + identifier, there don't seem to be many use cases for these, but I did find a family of functions that takes arbitrary user-defined identifiers that are allowed to start with a dash (but not two). As long as there is no full function argument validation, rejecting these seems premature.