Bläddra i källkod

Fix regex for unknown preprocessor directives

Signed-off-by: Nathan Sobo <nathan@github.com>
pull/8/head
Max Brunsfeld 8 år sedan
committed by Nathan Sobo
förälder
incheckning
fcb4537288
2 ändrade filer med 11 tillägg och 1 borttagningar
  1. +10
    -0
      corpus/preprocessor.txt
  2. +1
    -1
      grammar.js

+ 10
- 0
corpus/preprocessor.txt Visa fil

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

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

Laddar…
Avbryt
Spara