diff --git a/corpus/preprocessor.txt b/corpus/preprocessor.txt index 4180bdf..542a7d0 100644 --- a/corpus/preprocessor.txt +++ b/corpus/preprocessor.txt @@ -133,3 +133,13 @@ int main() { (return_statement (number_literal)) (preproc_else (return_statement (number_literal))))))) + +==================================== +Unknown preprocessor directives +==================================== + +#pragma mark - UIViewController + +--- + +(translation_unit (preproc_call (preproc_directive) (preproc_arg))) diff --git a/grammar.js b/grammar.js index a077c38..321c499 100644 --- a/grammar.js +++ b/grammar.js @@ -149,7 +149,7 @@ module.exports = grammar({ repeat($._compound_statement_item) ), - preproc_directive: $ => /#[ \t]+\a\w*/, + preproc_directive: $ => /#[ \t]*\a\w*/, preproc_arg: $ => token(prec(-1, repeat1(choice(/./, '\\\n')))), // Main Grammar