Skip to content

How to add "... expected {TOKEN}" to error messages? #88

Description

@rmosolgo

Hi! I've been using Racc very happily with graphql-ruby for a while now. It's easy-to-use and fast, so thanks for maintaining it!

I'd like to improve the error messages to have some helpful info, for example, instead of:

Parse error on ")" at [1, 17]

I'd like to say:

Parse error on ")" at [1,17] (expected ":")

However, in reviewing the on_error docs, I don't see a way to access which token was expected. Is it possible to do that with Racc?

Thanks!

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions