parser-combinators icon indicating copy to clipboard operation
parser-combinators copied to clipboard

Make it possible for operators in makeExprParser to fail conditionally by analyzing their operands

Open TheDrawingCoder-Gamer opened this issue 3 years ago • 0 comments

I'm running in to trouble with makeExprParser. I would like to conditionally return an error if something in an operator is wrong. I am making an assign operator, and the left side can only be an identifier. I'm finding that it's impossible to do any kind of error without fully traversing my Expr. I think it would be helpful if there was a version of makeExprParser that allows operators to return Either e a, and when Left e is returned, return that error if no alternative is found.

TheDrawingCoder-Gamer avatar Jun 09 '22 15:06 TheDrawingCoder-Gamer