Przeglądaj źródła

Fix regex for unknown preprocessor directives

Signed-off-by: Nathan Sobo <nathan@github.com>
pull/8/head
Max Brunsfeld 8 lat temu
committed by Nathan Sobo
rodzic
commit
fcb4537288
2 zmienionych plików z 11 dodań i 1 usunięć
  1. +10
    -0
      corpus/preprocessor.txt
  2. +1
    -1
      grammar.js

+ 10
- 0
corpus/preprocessor.txt Wyświetl plik

@ -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)))

+ 1
- 1
grammar.js Wyświetl plik

@ -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

Ładowanie…
Anuluj
Zapisz