diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-04-19 11:15:13 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-04-19 11:15:13 -0700 |
commit | 15a32f06839819cbbf6f40dccc5189c66379bcc0 (patch) | |
tree | e617324370912bdde25d476f32e7ab3297975828 /sys/src/cmd/cpp/cpp.h | |
parent | 2c596d0021299bdeb05bb92866c150b8e43977e9 (diff) | |
download | plan9front-15a32f06839819cbbf6f40dccc5189c66379bcc0.tar.xz |
fix cpp operator associativity
We used to treat all operators as right associative,
which means that we would evaluate them incorrecty.
For example, '2 - 1 + 1' would evaluate as '2 - (1 + 2)',
instead of '(2 - 1) + 1'.
This adds an assoc parameter to struct pri, and then uses
it to decide how to evaluate operators.
Diffstat (limited to 'sys/src/cmd/cpp/cpp.h')
0 files changed, 0 insertions, 0 deletions