atom / language-c Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preprocessor directives improvements + specs #102
Conversation
| ) | ||
| (\\)) | ||
| )? | ||
| ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From atom/language-css#38:
This should be triple-quoted, not sure why Travis is passing
Not necessary. (?x) will remove all \n, \t anyway.
''' are required when pattern contains comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to know
|
What do you think about |
| 'name': 'keyword.control.import.c' | ||
| 'name': 'punctuation.definition.directive.c' | ||
| '3': | ||
| 'name': 'keyword.control.directive.conditional.c' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are elif, else, etc. given a special subscope but define, defined, etc. aren't?
Also, is there any way to reduce the amount of non-capture groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add subscopes for them. Also define, defined should be #define is matched above, #defined isn't a directive
|
Why were quotes in the spec file changed? Standardization with other languages I'm guessing (though there really isn't any with regards to the type of quotes used)? |
Single/double quotes were mixed. I used double quotes for |
| 'include': '#numbers' | ||
| } | ||
| { | ||
| 'match': '(?>\\\\\\s*\\n)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this supposed to be an atomic group?
| it "tokenizes them", -> | ||
| {tokens} = grammar.tokenizeLine '// comment' | ||
| expect(tokens[0]).toEqual value: '//', scopes: ['source.cpp', 'comment.line.double-slash.c++', 'punctuation.definition.comment.c++'] | ||
| expect(tokens[1]).toEqual value: ' comment', scopes: ['source.cpp', 'comment.line.double-slash.c++'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why it's still c++? Probably should be replaced (in separate PR): c++ -> cpp
Edit: #108
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Preprocessor directives improvements + specs
|
|
to follow changes in atom/language-c#102
to follow changes in atom/language-c#102

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Added specs for preprocessor directives
Renamed
keyword.control.import->keyword.control.directiveI think it's confusing that all preprocessor directives are tokenized as
import#is tokenized as part of a keywordBefore:
#-punctuation.definition.keyword,define-keyword.control.importAfter:
#define-keyword.control.directive,#-punctuation.definition.directiveStrings and numbers are tokenized in
#line 151 "copy.c"Fixes #92