widcardw / asciimath-parser

https://asciimath.widcard.win
MIT License
13 stars 3 forks source link

Allow chaining underscores and carets #13

Open kwinso opened 12 months ago

kwinso commented 12 months ago

I know it's kind of not how original ASCIIMath works, but it's quite handy.

What I'm talking about is to allow a_b_c which will be the same as a_(b_c).

Same thing with a^b^c == a^(b^c)

widcardw commented 12 months ago

This idea is reasonable, but the package is written fully with algorithm, without analyzers like nearley (the nearley version is in a separated package). As a result, the program should consider all the edge cases.

This feature can be implemented easily, but some other problems should be concerned, since I have made _ and ^ the same token category. I could think of some problems like a_b^c being parsed into a_{b^c}...

I'll try it when I am free these days.