lezer-parser / javascript

A JavaScript lezer grammar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bitwise operator precedence is wrong

jedwards1211 opened this issue · comments

This probably doesn't affect anything this grammar is being used for, but FWIW...

The grammar defines precedence

  bitOr @left,
  bitXor @left,
  bitAnd @left,

But according to MDN the correct precedence is

7: bitwise AND left-to-right Bitwise ANDx & y
6: bitwise XOR left-to-right Bitwise XORx ^ y
5: bitwise OR left-to-right Bitwise ORx | y

Thanks for spotting that. Merged.