TeXZilla icon indicating copy to clipboard operation
TeXZilla copied to clipboard

Improve expression grouping using operator precedence

Open fred-wang opened this issue 11 years ago • 0 comments

See http://www.w3.org/Math/MathML3/chapter3.html#id.3.3.1.3 for a discussion of grouping of sub-expressions.

Expression grouping was removed in 2f3e5f4faaa913842f2fa610b06f55d2f40e027e because it didn't work very well and was a serious performance burden for Jison.

I believe in general, correct operator grouping is not possible because one has to infer some semantics from the TeX source , especially when fences are involved like in y = { [0,1) ; (2,3] }^2.

However, I think it would still be possible to improve the grouping via operator precedence:

  • do this in newMrow instead of relying on the grammar's operator precedence
  • only do this for a restricted set of operators like unary/binary operators and relations.
  • fences should not be involved or only at the beginning and end of the mrow

fred-wang avatar Jan 23 '14 10:01 fred-wang