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

[Bug]: Invalid regex in Ada TextMate grammar #1229

Open
slevithan opened this issue Dec 19, 2024 · 2 comments · May be fixed by #1230
Open

[Bug]: Invalid regex in Ada TextMate grammar #1229

slevithan opened this issue Dec 19, 2024 · 2 comments · May be fixed by #1230
Labels

Comments

@slevithan
Copy link

slevithan commented Dec 19, 2024

Environment

  • OS and Version: N/A
  • IDE Version: N/A
  • Ada & SPARK Extension Version: Latest

Bug Summary and Reproducer

Bug Summary:

This line is an invalid regex pattern ("(?=(;|\\))"), since it contains an unclosed group. It should include a third ) at the end, since the second-last closing paren is escaped and matches a literal ).

(Note that the correctly-closed version of this pattern ("(?=(;|\\)))") appears four other times in the same file. It is only this one instance that is missing the final closing paren.)

The result of this bug is that the pattern is an invalid Oniguruma regex, and it fails silently in vscode-textmate. It also causes the Ada grammar to error when using Shiki's JavaScript engine, since by default its JS engine doesn't silence regex errors.

Configuration and Logs

N/A

Other VS Code Extensions

No response

Additional context

No response

@eliericha
Copy link
Contributor

Hello @slevithan ,

Thank you for reporting this issue and submitting a fix. I'm not sure we will be able to authorize the change right now because most of the team is away for the end of year holidays and my account doesn't have authorization to validate PRs.

But I'll ping some people and see what can be done :)

Note that this syntax file integration/vscode/ada/advanced/ada.tmLanguage.json is not the one used by the VS Code extension. It is the simpler version in integration/vscode/ada/syntaxes/ada.tmLanguage.json which is used.

@slevithan
Copy link
Author

It would of course be great to get this fix landed sooner than later, so thank you for checking!

And thanks for the pointer. I just checked, and integration/vscode/ada/syntaxes/ada.tmLanguage.json doesn't include the same bug. But Shiki uses the advanced/ version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants