Skip to content

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

Open

Description

@ip1981

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.

Activity

  1. added
    bug
    on Nov 13, 2019
  2. jgrund commented on Nov 13, 2019

    @jgrund
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions