Skip to content

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

@rmosolgo

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!

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