tree-sitter-c icon indicating copy to clipboard operation
tree-sitter-c copied to clipboard

C precedence bugs

Open hlandau opened this issue 2 years ago • 0 comments

Using the following in the playground leads to an inaccurate parse:

int f(void) {
  return a *= b != c ? d : e;
}

This parses as (a*=(b!=c))?d:e, not a *= ((b!=c) ? d : e).

Proof: https://gcc.godbolt.org/z/dqYYnbcE4

Another misparse is a(b) >> c &= d.

Reported thanks to atk

hlandau avatar May 09 '22 06:05 hlandau