You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the expression parser, an (partially) invalid string takes a long time to fail. Ultimately the failure is reasonable, but the time it takes to fail may not be. I am looking for advice on the structure of multi-character sequences, is there a better way?
Exception message
(reasonable)
Exception has occurred: CLR/Pidgin.ParseException
Exception thrown: 'Pidgin.ParseException' in Pidgin.dll: 'Parse error.
unexpected 2
expected expression
at line 1, col 3'
at Pidgin.ParserExtensions.GetValueOrThrow[TToken,T](Result2 result) at Pidgin.ParserExtensions.ParseOrThrow[T](Parser2 parser, String input, Func`3 calculatePos)
at ApplicationSupport.Parsers.ExprParser.ParseOrThrow(String input) in /Users/mustik/Projects/ReservationCheck/ReservationCheck/Support/Parsers/ExprParser.cs:line 155
The text was updated successfully, but these errors were encountered:
Hi,
In the expression parser, an (partially) invalid string takes a long time to fail. Ultimately the failure is reasonable, but the time it takes to fail may not be. I am looking for advice on the structure of multi-character sequences, is there a better way?
Having lots of fun with this excellent tool!
Applicable Expression parsers
private static readonly Parser<char, Func<IExpr, IExpr, IExpr>> EqualTo
= Binary(Tok("=").Then(String("=")).ThenReturn(BinaryOperatorType.EqualTo)); // "=="
Input string
1=2
Expected
1==2
Exception message
(reasonable)
Exception has occurred: CLR/Pidgin.ParseException
Exception thrown: 'Pidgin.ParseException' in Pidgin.dll: 'Parse error.
unexpected 2
expected expression
at line 1, col 3'
at Pidgin.ParserExtensions.GetValueOrThrow[TToken,T](Result
2 result) at Pidgin.ParserExtensions.ParseOrThrow[T](Parser
2 parser, String input, Func`3 calculatePos)at ApplicationSupport.Parsers.ExprParser.ParseOrThrow(String input) in /Users/mustik/Projects/ReservationCheck/ReservationCheck/Support/Parsers/ExprParser.cs:line 155
The text was updated successfully, but these errors were encountered: