Skip to content
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

Internal QueryParser: Adds Monadic Parser API #1755

Merged
merged 9 commits into from
Aug 13, 2020

Conversation

bchong95
Copy link
Contributor

@bchong95 bchong95 commented Aug 5, 2020

Internal QueryParser: Adds Monadic Parser API

Description

Adds a monadic parser API for queries:

    internal static class QueryParser
    {
        public static class Monadic
        {
            public static TryCatch<SqlQuery> Parse(string text);
        }

        public static bool TryParse(string text, out SqlQuery sqlQuery);
        public static SqlQuery Parse(string text);
    }

Instead of adding TryParse to the DOM which is not supposed to have behavior.

Additionally a user can parse the query in an exceptionless manner and still get the error message and full stack trace.

TryCatch<SqlQuery> monadicParse = QueryParser.Monadic.Parse(text);
if(monadicParse.Failed)
{
     handleException(monadicParse.Exception);
}

SqlQuery query = monadicParse.Result;

sboshra
sboshra previously approved these changes Aug 7, 2020
Copy link
Contributor

@sboshra sboshra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Base automatically changed from revert-1626-users/brchon/Query/DisableAntlr to master August 13, 2020 00:28
@sboshra sboshra dismissed their stale review August 13, 2020 00:28

The base branch was changed.

@sboshra sboshra merged commit 7e2ccd9 into master Aug 13, 2020
@sboshra sboshra deleted the users/brchon/QueryParser/Monadic branch August 13, 2020 23:09
@ghost
Copy link

ghost commented Dec 15, 2021

Closing due to in-activity, pease feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants