Skip to content

Commit

Permalink
Don't mention right associativity
Browse files Browse the repository at this point in the history
As suggested by @HansOlsson.

Co-authored-by: Hans Olsson <HansOlsson@users.noreply.github.com>
  • Loading branch information
henrikt-ma and HansOlsson committed Feb 22, 2022
1 parent 0ab81e3 commit d6cce50
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ \section{Operator Precedence and Associativity}\label{operator-precedence-and-as
Precedence group associativity is used to determine the implicit subexpression structure when operators belong to the same group of equal precedence.
Left associativity means that subexpressions are formed from left to right.
For example, left associativity of binary additive operators means that \lstinline!1 - 2 - 3! is implicitly structured as \lstinline!(1 - 2) - 3!.
Right associativity means forming subexpressions from right to left, but there is no precedence group with this associativity in Modelica.
A precedence group may also be non-associative, meaning that there is no implicit subexpression structure defined based on associativity.
For example, non-associativity of relational operators means that \lstinline!1 < 2 < 3! is an invalid expression.
Note that the operators don't need to be identical for associativity to matter; also \lstinline!1 == 2 < 3! is invalid, and \lstinline!1 - 2 + 3! is implicitly structured as \lstinline!(1 - 2) + 3!.
Expand Down

0 comments on commit d6cce50

Please sign in to comment.