3 ms·
For me it's actually the opposite, I find using the priority makes it actually a lot more readable, especially once you have a lot of operators. It's also quite
by ImprobableTruth 6y ago
For me it's actually the opposite, I find using the priority makes it actually a lot more readable, especially once you have a lot of operators. It's also quite close to a generalized (and potentially dynamic) version that is just a function that takes in a priority and returns the correct parser.
- tom_mellior 6y agoIt's not that I'm opposed to priorities, it's just that I think it's unreasonably hard to see the typos here: (3) Exp -> Exp2 (4) Exp2 -> Exp2 * Exp3 (5) Exp3 -> Exp2 / Exp2 (6) Exp2 -> Exp3 There are reasons why we usually give variables more meaningful names than var1, var2, var3. (Obviously I agree that if the parser can be expanded dynamically with operators with numeric priorities, then you need numeric priorities. But that is a very different case.)