study: use checkedint as a drop-in replacement of native long

ag0aep6g anonymous at example.com
Wed Mar 24 22:04:15 UTC 2021


On 24.03.21 22:38, Gregor Mückl wrote:
> What I'm missing is a clear statement about operator associativity and 
> operator precedence for expressions. When I'm reading the spec without 
> applying any additional common sense, a + b * c could be evaluated 
> strictly from left to right because I don't see how mathematical 
> operator precedence is explicitly established anywhere. Neither do I see 
> associativity established anywhere. If assignment was clearly defined to 
> be right-associative, things would be unambiguous.

It's in the grammar.

`a + b * c` is parsed as (skipping the boring parts):

AddExpression
   "a"
   "+"
   MulExpression
     "b"
     "*"
     "c"

And `a = b = c`:

AssignExpression
   "a"
   "="
   AssignExpression
     "b"
     "="
     "c"


More information about the Digitalmars-d mailing list