tree-sitter-c-sharp
tree-sitter-c-sharp copied to clipboard
Ignore code between `#if false` ... `#endif`?
E.g.
#if false
this is a fairly common pattern in C# to disable code, but can also be used for comments or anything else.
#endif
Currently, this grammar basically ignores preprocessor directives. The parser is not aware of preprocessor variables, so it can't really do any better. However, in case of #if false we can be certain that the code shouldn't end up in the parse tree.
This introduces an extra special case for preprocessor directives, but it would improve parsing results.
I'd rather try and get #189 tackled which would cover this.