Left-associative operators vs Right-associative operators

associativity, operator-precedence, operators, parsing

Solution

Operators at the same precedence are all either right associative or all left associative so the problem doesn't arise.

Problem

If we have an expression: ``` a $ b @ c ``` `$` is a left-associative operator, `@` is right-associative. They have the same precedence. How is this expression parsed? As `(a $ b) @ c` or as `a $ (b @ c)`?

Original source