-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add operator overloads for parser actions (#70) #114
base: main
Are you sure you want to change the base?
Conversation
…efore` and `Then`.
Thank you very much for the contribution! I think this is quite a good idea.
In summary: I like |
Thank you for the fast reaction!
P.S. I don't know what to do next. Shall I close PR and you will reimplement the shown concept here or you will create a branch where we can merge this stuff and continue to work atop the changes already done here? |
I don’t think this PR needs to be closed! You can make the changes on this branch and we’ll merge the PR for release in v3. (V3 is currently a “when I get around to finishing work on it” sort of deal.) |
Ok, thanks. This roadmap works for me :-D |
Did this make it v3? It seems like a cool alternative to the LINQ style/query syntax, and could have less perf implications than the query syntax, as far as I can see. |
It did not, I was awaiting a response from @sirAndros. You're welcome to pick it up if they're no longer interested! |
I might take you up on this when I get more familiar with the library and general concept of parser combinators. |
Hi, guys! |
Hi @sirAndros, saw your invite to your fork. My open source TODO list is unfortunately filled up. Have a new release of https://github.com/bUnit-dev/bUnit I have to work on since we're tracking the .NET 7 release, and those bastards over in the asp.net core repo have a scheduled 😁 Its been super fun getting learning Pidgin last month, but unfortunately don't have any more time to dig deep right now. |
Hello!
First, thank you for this awesome lib!
I'd testing it within pet project where monsters like ANTLR and Hime are overkill.
Declare parser with solely C# is really good but I found myself uncomfortable when some native actions like "OR" or "NOT" should be declared as method calls even for simple cases.
Found similar issue (#70), but it was long time ago and author seems to disappear.
This PR is proof of concept operator overloads API.
I've implemented hastily some overloads to show you API mockup in
ApiSugarParserTests
. Everything in this PR is discussible and with high probability should be improved before land into the next release."Not" operator is quite straight forward. Can't imagine what to improve :)
"Plus" operator from original issue (#70). This feature needs better design as you and will cause changes in
SequenceParser's
. Maybe we don't really need it."Or" operator is why I'm originally here. It also need some additional work to cover advanced cases (e.g. when apply
not
,optional
etc. for one of operands)"More" and "Less" operators is very questionable. It looks good to have some short ways to describe
Before
andThan
but this operators can confuse some users. Bitshifts (>>
/<<
) operators can play here a little better but it's forbidden to use anything butint
as second argument for these operators.Any thought here are very welcome!
Regards, Andrei.