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

Improve #pragma parsing #303

Open
tamasvajk opened this issue Apr 26, 2023 · 0 comments
Open

Improve #pragma parsing #303

tamasvajk opened this issue Apr 26, 2023 · 0 comments

Comments

@tamasvajk
Copy link
Collaborator

Invalid #pragma preprocessor directives produce warnings. The compiler is able to parse (and ignore) them. This is not the case currently with the tree-sitter grammar.
For example the below produces an AST on sharplab.io:

#pragma warning disable 1     // Okay
#pragma warning disable CS1   // Okay
#pragma warning disable 1,2   // Okay

#pragma warning disable 1;2     // CS1696
#pragma warning suppress 1      // CS1634
#pragma                         // CS1633
#pragma anything can come here  // CS1633

;

I think these invalid directives come up fairly rarely. The only one that I've seen was #pragma warning suppress ....

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