rkirsling / modallogic

Modal Logic Playground
http://rkirsling.github.io/modallogic/
MIT License
367 stars 55 forks source link

formula parser exception #4

Closed minicast closed 8 years ago

minicast commented 8 years ago

The following formula

((p&q)&((p&q)&(p&q)))

is not parsed successfully (it is reported as not well formed)

rkirsling commented 8 years ago

Ack! How embarrassing.

All this time I never stopped to realize that even with parentheses required, the parsing strategy I'm using is only guaranteed to work for left-recursive expressions. (That means there's always a way to write an equivalent formula that will parse correctly, but that's hardly something I can demand of the user. :stuck_out_tongue:)

On the bright side, this is a good excuse to drop the requirement of parentheses altogether—I'll switch to a legitimate context-free parser this weekend.

Thanks for bringing this to my attention!

rkirsling commented 8 years ago

Fixed in 1a84cd9b8c71e10ed0f5f5965ad815d78bdd173e.