diff --git a/grammars/c.cson b/grammars/c.cson index 8ce070f..0f2a895 100644 --- a/grammars/c.cson +++ b/grammars/c.cson @@ -213,6 +213,11 @@ 'match': '\\b([A-Za-z0-9_]+_t)\\b' 'name': 'support.type.posix-reserved.c' } + { + 'comment': 'Reserved for a good pratice types' + 'match': '\\b([A-Za-z0-9_]+_[aefpsu])\\b' + 'name': 'support.type.good-practice-reserved.c' + } { 'include': '#block' } diff --git a/spec/c-spec.coffee b/spec/c-spec.coffee index 4ccd8e6..33ad9ba 100644 --- a/spec/c-spec.coffee +++ b/spec/c-spec.coffee @@ -50,6 +50,9 @@ describe "Language-C", -> {tokens} = grammar.tokenizeLine 'myType_t var;' expect(tokens[0]).toEqual value: 'myType_t', scopes: ['source.c', 'support.type.posix-reserved.c'] + {tokens} = grammar.tokenizeLine 'myTypeGoodPractice_t var;' + expect(tokens[0]).toEqual value: 'myTypeGoodPractice_t', scopes: ['source.c', 'support.type.good-practice-reserved.c'] + it "tokenizes 'line continuation' character", -> {tokens} = grammar.tokenizeLine 'ma' + '\\' + '\n' + 'in(){};' expect(tokens[0]).toEqual value: 'ma', scopes: ['source.c']