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

Modify parser to include common errors to provide better error messages than "syntax error" #720

Open
davmlaw opened this issue Jan 25, 2024 · 2 comments

Comments

@davmlaw
Copy link
Contributor

davmlaw commented Jan 25, 2024

The current design uses Parsley to define the correct grammar only, which leads to a "syntax error" on some common mistakes.

If we modified the grammar parser to include common mistakes, then manually checked for them, we could give much more informative messages than "syntax error".

For instance, consider an insertion:

NC_000017.11:g.43091687_43091688insGATTACA

Here are some common mistakes I have seen in the wild:

Integer length for insertion

Example: NC_000017.11:g.43091687_43091688ins7
Suggested error: "Insertions require inserted sequence, rather than an integer length"

Missing insertion

Example: NC_000017.11:g.43091687_43091688ins
Suggested error: "Insertions require inserted sequence"

@davmlaw
Copy link
Contributor Author

davmlaw commented Jan 25, 2024

I am happy to do the work and make a pull request, just raising the issue for discussion

@davmlaw
Copy link
Contributor Author

davmlaw commented Feb 28, 2024

Potentually related to #367

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