Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Adding types comply with good programming practice #134

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions grammars/c.cson
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
3 changes: 3 additions & 0 deletions spec/c-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down