From 760fb1d2d3c179a4848430ebf557d0aeff8083a4 Mon Sep 17 00:00:00 2001 From: zeroCrowsky Date: Tue, 5 Apr 2016 21:05:47 +0200 Subject: [PATCH 1/3] Adding types comply with good programming practice It is recommended not to use the suffix _t 'because it is reserved by the POSIX standard for defining type aliases xxx_e : typedef enum xxx_u : typedef union xxx_s : typedef struct xxx_a : array xxx_f : function xxx_p : primitive type --- grammars/c.cson | 5 +++++ package.json | 4 ++-- spec/c-spec.coffee | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/grammars/c.cson b/grammars/c.cson index 8ce070f..e1d377f 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_]+_[esuap])\\b' + 'name': 'support.type.good-practice-reserved.c' + } { 'include': '#block' } diff --git a/package.json b/package.json index f743af6..b6f15cd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "version": "0.51.3", - "name": "language-c", - "description": "Atom language support for C/C++", + "name": "language-c-custom", + "description": "Atom language support for C/C++ custom", "homepage": "https://atom.github.io/language-c", "repository": { "type": "git", 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'] From 56a2742b3ae69cbb1b75d1ec4e8ae9c0f8ff41b7 Mon Sep 17 00:00:00 2001 From: zeroCrowsky Date: Tue, 5 Apr 2016 21:07:40 +0200 Subject: [PATCH 2/3] Fix error --- grammars/c.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars/c.cson b/grammars/c.cson index e1d377f..0f2a895 100644 --- a/grammars/c.cson +++ b/grammars/c.cson @@ -215,7 +215,7 @@ } { 'comment': 'Reserved for a good pratice types' - 'match': '\\b([A-Za-z0-9_]+_[esuap])\\b' + 'match': '\\b([A-Za-z0-9_]+_[aefpsu])\\b' 'name': 'support.type.good-practice-reserved.c' } { From c0794ba9181b563e2d8e8bb27d76d756c2bdc1d9 Mon Sep 17 00:00:00 2001 From: zeroCrowsky Date: Tue, 5 Apr 2016 21:28:58 +0200 Subject: [PATCH 3/3] Remove word "custom" for name and description in package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b6f15cd..f743af6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "version": "0.51.3", - "name": "language-c-custom", - "description": "Atom language support for C/C++ custom", + "name": "language-c", + "description": "Atom language support for C/C++", "homepage": "https://atom.github.io/language-c", "repository": { "type": "git",