summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/c_cpp.py11
-rw-r--r--pygments/lexers/objective.py25
2 files changed, 20 insertions, 16 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py
index 632871ba..a8d75c0a 100644
--- a/pygments/lexers/c_cpp.py
+++ b/pygments/lexers/c_cpp.py
@@ -61,10 +61,11 @@ class CFamilyLexer(RegexLexer):
(r'\*/', Error),
(r'[~!%^&*+=|?:<>/-]', Operator),
(r'[()\[\],.]', Punctuation),
- (words(('auto', 'break', 'case', 'const', 'continue', 'default', 'do',
- 'else', 'enum', 'extern', 'for', 'goto', 'if', 'register',
- 'restricted', 'return', 'sizeof', 'static', 'struct',
- 'switch', 'typedef', 'union', 'volatile', 'while'),
+ (words(('asm', 'auto', 'break', 'case', 'const', 'continue',
+ 'default', 'do', 'else', 'enum', 'extern', 'for', 'goto',
+ 'if', 'register', 'restricted', 'return', 'sizeof',
+ 'static', 'struct', 'switch', 'typedef', 'union',
+ 'volatile', 'while'),
suffix=r'\b'), Keyword),
(r'(bool|int|long|float|short|double|char|unsigned|signed|void)\b',
Keyword.Type),
@@ -208,7 +209,7 @@ class CppLexer(CFamilyLexer):
tokens = {
'statements': [
(words((
- 'asm', 'catch', 'const_cast', 'delete', 'dynamic_cast', 'explicit',
+ 'catch', 'const_cast', 'delete', 'dynamic_cast', 'explicit',
'export', 'friend', 'mutable', 'namespace', 'new', 'operator',
'private', 'protected', 'public', 'reinterpret_cast',
'restrict', 'static_cast', 'template', 'this', 'throw', 'throws',
diff --git a/pygments/lexers/objective.py b/pygments/lexers/objective.py
index fc8e5d17..ba1e0bae 100644
--- a/pygments/lexers/objective.py
+++ b/pygments/lexers/objective.py
@@ -298,7 +298,7 @@ class SwiftLexer(RegexLexer):
(r'\s+', Text),
(r'//', Comment.Single, 'comment-single'),
(r'/\*', Comment.Multiline, 'comment-multi'),
- (r'#(if|elseif|else|endif)\b', Comment.Preproc, 'preproc'),
+ (r'#(if|elseif|else|endif|available)\b', Comment.Preproc, 'preproc'),
# Keywords
include('keywords'),
@@ -413,23 +413,26 @@ class SwiftLexer(RegexLexer):
],
'keywords': [
(words((
- 'break', 'case', 'continue', 'default', 'do', 'else',
- 'fallthrough', 'for', 'if', 'in', 'return', 'switch', 'where',
- 'while'), suffix=r'\b'),
+ 'as', 'break', 'case', 'catch', 'continue', 'default', 'defer',
+ 'do', 'else', 'fallthrough', 'for', 'guard', 'if', 'in', 'is',
+ 'repeat', 'return', '#selector', 'switch', 'throw', 'try',
+ 'where', 'while'), suffix=r'\b'),
Keyword),
(r'@availability\([^)]+\)', Keyword.Reserved),
(words((
'associativity', 'convenience', 'dynamic', 'didSet', 'final',
- 'get', 'infix', 'inout', 'lazy', 'left', 'mutating', 'none',
- 'nonmutating', 'optional', 'override', 'postfix', 'precedence',
- 'prefix', 'Protocol', 'required', 'right', 'set', 'Type',
- 'unowned', 'weak', 'willSet', '@availability', '@autoclosure',
- '@noreturn', '@NSApplicationMain', '@NSCopying', '@NSManaged',
- '@objc', '@UIApplicationMain', '@IBAction', '@IBDesignable',
+ 'get', 'indirect', 'infix', 'inout', 'lazy', 'left', 'mutating',
+ 'none', 'nonmutating', 'optional', 'override', 'postfix',
+ 'precedence', 'prefix', 'Protocol', 'required', 'rethrows',
+ 'right', 'set', 'throws', 'Type', 'unowned', 'weak', 'willSet',
+ '@availability', '@autoclosure', '@noreturn',
+ '@NSApplicationMain', '@NSCopying', '@NSManaged', '@objc',
+ '@UIApplicationMain', '@IBAction', '@IBDesignable',
'@IBInspectable', '@IBOutlet'), suffix=r'\b'),
Keyword.Reserved),
(r'(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__'
- r'|__FILE__|__FUNCTION__|__LINE__|_)\b', Keyword.Constant),
+ r'|__FILE__|__FUNCTION__|__LINE__|_'
+ r'|#(?:file|line|column|function))\b', Keyword.Constant),
(r'import\b', Keyword.Declaration, 'module'),
(r'(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)',
bygroups(Keyword.Declaration, Text, Name.Class)),