Преглед на файлове

Fix regex for unknown preprocessor directives

Signed-off-by: Nathan Sobo <nathan@github.com>
pull/8/head
Max Brunsfeld преди 8 години
committed by Nathan Sobo
родител
ревизия
fcb4537288
променени са 2 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. +10
    -0
      corpus/preprocessor.txt
  2. +1
    -1
      grammar.js

+ 10
- 0
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)))

+ 1
- 1
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

Зареждане…
Отказ
Запис