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

Unexpected letter when a letter is expected (among others) #2

Open
ip1981 opened this issue Nov 13, 2019 · 1 comment
Open

Unexpected letter when a letter is expected (among others) #2

ip1981 opened this issue Nov 13, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@ip1981
Copy link
Member

ip1981 commented Nov 13, 2019

A simple string a-1] fails to parse saying that "a" is unexpected, while expected [, whitespaces, letter or digit, -, .. The "a" letter fits "letter or digit".

P. S. It also says the error is at position 3.

@jgrund jgrund added the bug Something isn't working label Nov 13, 2019
@jgrund
Copy link
Member

jgrund commented Nov 13, 2019

The error for this expression looks like:

Err(
    Errors {
        position: 3,
        errors: [
            Expected(
                Token(
                    '[',
                ),
            ),
            Expected(
                Static(
                    "whitespaces",
                ),
            ),
            Expected(
                Static(
                    "letter or digit",
                ),
            ),
            Expected(
                Token(
                    '-',
                ),
            ),
            Expected(
                Token(
                    '.',
                ),
            ),
            Unexpected(
                Token(
                    'a',
                ),
            ),
        ],
    },
)

Everything except the unexpected token a looks correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants