-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing Function Call with empty parameters fails #18
Comments
That being said ... the following works fine (using between) Parsing logic
|
I suspect you have an infinite loop in your recursive |
Thanks again for getting back to me so quickly. Happy to supply the code (see below), but the loop is in the Parser, with the code I supplied. I have a number of functions that work great, the only failure is in the TEST() permutation. Examples of Functions that work TEST() never makes it out of the parser. Any thoughts would be greatly appreciated Parser codepublic static class ExprParser
|
I can't reproduce the issue using the code you supplied. |
My apologizes, I had not integrated with the latest version. Corrected and verified. |
Parsing Function Call with empty parameters fails
I have been able to create a reasonably complex expression evaluator. The only issue I am having is that when the object text contains a function with no arguments it fails (spinning in DLL) ... suspect Between not working with no arguments.
Expression that fails:
TEST()
Expression that works fine:
TEST(X)
TEST(X,X ...)
Parsing logic (directly from your test application)
private static Parser<char, T> Parenthesised(Parser<char, T> parser)
=> parser.Between(Tok("("), Tok(")"));
...
var call = Parenthesised(Rec(() => expr).Separated(Tok(",")))
.Select<Func<IExpr, IExpr>>(args => method => new Call(method, args.ToImmutableArray()))
.Labelled("function call");
Unfortunately, I have not been able to debug the DLL so I cant give you more details.
Thanks in advance.
The text was updated successfully, but these errors were encountered: