Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8603d41ba9
Fetching contributors…

Cannot retrieve contributors at this time

110 lines (109 sloc) 3.972 kb
---
name: C++
fileTypes:
- cc
- cpp
- cp
- cxx
- c++
- C
- h
- hh
- hpp
- h++
firstLineMatch: -\*- C\+\+ -\*-
scopeName: source.c++
uuid: 26251B18-6B1D-11D9-AFDB-000D93589AF6
foldingStartMarker: "(?x)\n\
\t\t /\\*\\*(?!\\*)\n\
\t\t|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))\n\
\t"
patterns:
- include: source.c
- name: storage.modifier.c++
match: \b(friend|explicit|private|protected|public|virtual)\b
- name: keyword.control.c++
match: \b(catch|namespace|operator|try|throw|using)\b
- name: keyword.control.c++
match: \bdelete\b(\s*\[\])?|\bnew\b(?!])
- name: variable.other.readwrite.member.c++
match: \b(f|m)[A-Z]\w*\b
comment: common C++ instance var naming idiom -- fMemberName
- name: variable.language.c++
match: \b(this)\b
- name: storage.type.template.c++
match: \btemplate\b\s*
- name: keyword.operator.cast.c++
match: \b(const_cast|dynamic_cast|reinterpret_cast|static_cast)\b\s*
- name: keyword.operator.c++
match: \b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq)\b
- name: storage.type.c++
match: \b(class|wchar_t)\b
- name: storage.modifier.c++
match: \b(export|mutable|typename)\b
- name: meta.function.destructor.c++
endCaptures:
"0":
name: punctuation.definition.parameters.c
begin: "(?x)\n\
\t\t\t\t(?: ^ # begin-of-line\n\
\t\t\t\t | (?: (?<!else|new|=) ) # or word + space before name\n\
\t\t\t\t)\n\
\t\t\t\t((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\
\t\t\t\t \\s*(\\() (?=[^)]*\\) # match \"(\" and use look-ahead for \")\"\n\
\t\t\t\t (\\s*=\\s*0)?\\s* # optional pure modifier\n\
\t\t\t\t (\\{|\\n)) # start bracket or end-of-line\n\
\t\t\t"
beginCaptures:
"1":
name: entity.name.function.c
"2":
name: punctuation.definition.parameters.c
end: \)
patterns:
- include: $base
- name: meta.function.destructor.prototype.c++
endCaptures:
"0":
name: punctuation.definition.parameters.c
begin: "(?x)\n\
\t\t\t\t(?: ^ # begin-of-line\n\
\t\t\t\t | (?: (?<!else|new|=) ) # or word + space before name\n\
\t\t\t\t)\n\
\t\t\t\t((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\
\t\t\t\t \\s*(\\() (?=[^)]*\\) # match \"(\" and use look-ahead for \")\"\n\
\t\t\t\t (\\s*=\\s*0)?\\s* # optional pure modifier\n\
\t\t\t\t ;) # terminating semi-colon\n\
\t\t\t"
beginCaptures:
"1":
name: entity.name.function.c
"2":
name: punctuation.definition.parameters.c
end: \)
patterns:
- include: $base
- name: meta.function.constructor.c++
endCaptures:
"0":
name: punctuation.definition.parameters.c
begin: "(?x)\n\
\t\t\t\t(?: ^\\s*) # begin-of-line\n\
\t\t\t\t((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\
\t\t\t\t \\s*(\\() (?= # match \"(\"\n\
\t\t\t\t (?<arg> [^()]++ | \\( \\g<arg>*+ \\) )*+ # function arguments\n\
\t\t\t\t \\) # match \")\"\n\
\t\t\t\t (\\s* : (?<base> \\s* [A-Za-z_][A-Za-z0-9_]* \\( \\g<arg>*+ \\) ) (, \\g<base>)* (, (?=\\s*\\n))? )? \\s* # optional base constructors\n\
\t\t\t\t (\\{|\\n)) # start bracket or end-of-line\n\
\t\t\t"
beginCaptures:
"1":
name: entity.name.function.c
"2":
name: punctuation.definition.parameters.c
end: \)
patterns:
- include: $base
foldingStopMarker: (?<!\*)\*\*/|^\s*\}
keyEquivalent: ^~C
comment: I don't think anyone uses .hp. .cp tends to be paired with .h. (I could be wrong. :) -- chris
Jump to Line
Something went wrong with that request. Please try again.