Closed cannero closed 3 months ago
Looking at dotnet fsi
, it does evaluate to 4
in both cases, so I don't believe it has any special meaning in that context.
Thank you for the detailed bug report!
You're right, 1+1
should parse as an infix expression in this case.
+1
(and -1
) do have a special meaning as they are interpreted as the sign of an integer. You can see the AST of how it is interpreted.
The tricky thing, in the case of 1-1
, is that 1-
binds stronger than -1
, which means that the sign should be interpreted as an infix operator
Description If there is no space between the plus and a number in an expression, the plus sign is seen as belonging to the number.
Here an example, with spaces it parses correctly:
The grammer shows: (sorry, I copied this from emacs, the names are likely off)
Without spaces, the operator is missing as
+1
is seen as constant, therefore the right-hand side is shown as application expression:Or am I missing something and
+1
has some special meaning in this context?Environment
OS: windows Grammar version: commit 01c19eddaa7ae1968f23dd2fde8e36fbba901318 Editor: emacs