stefnotch / aftermath-editor

A WYSIWYG mathematics editor that understands your formulas!
https://stefnotch.github.io/aftermath-editor
MIT License
14 stars 0 forks source link

Postfix and infix operator overlap #51

Closed stefnotch closed 1 year ago

stefnotch commented 1 year ago

If a postfix and an infix operator have the same token, one would have to look ahead to figure out which one it actually is. That's very cringe, so we won't be doing it. Instead, we just disallow that sort of ambiguity.

Well, it's not simply cringe, it actually has to do with parser design. When I have f(a,b), then I treat the f as a variable, and the (a,b) as a postfix operator. (function application) Same idea goes for arr[0]. (array indexing)