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

Beginner question - extending expression parser #61

Open
alex-barylski opened this issue Jan 14, 2022 · 0 comments
Open

Beginner question - extending expression parser #61

alex-barylski opened this issue Jan 14, 2022 · 0 comments

Comments

@alex-barylski
Copy link

Curious, I am trying to extend your expression example, by allowing variable names with "." separators:

        $identifier = atLeastOne(alphaChar());
        $identifierDot = many($identifier->optional()->append(char('.')));

This isn't working, so I'm clearly not understanding how this library works. What am I missing? I'm stuck trying to think of the problem in terms of a regex solution.

How would I parse / match a variable with arbitrary number of '.' separators? And have that returned to the AST as a complete string, not further parsed.

Any help much appreciated :)

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

No branches or pull requests

1 participant