ThirdParty/Pygments/pygments/lexers/objective.py

changeset 5713
6762afd9f963
parent 4697
c2e9bf425554
child 6651
e8f3b5568b21
equal deleted inserted replaced
5712:f0d08bdeacf4 5713:6762afd9f963
3 pygments.lexers.objective 3 pygments.lexers.objective
4 ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for Objective-C family languages. 6 Lexers for Objective-C family languages.
7 7
8 :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import re 12 import re
13 13
296 # Whitespace and Comments 296 # Whitespace and Comments
297 (r'\n', Text), 297 (r'\n', Text),
298 (r'\s+', Text), 298 (r'\s+', Text),
299 (r'//', Comment.Single, 'comment-single'), 299 (r'//', Comment.Single, 'comment-single'),
300 (r'/\*', Comment.Multiline, 'comment-multi'), 300 (r'/\*', Comment.Multiline, 'comment-multi'),
301 (r'#(if|elseif|else|endif)\b', Comment.Preproc, 'preproc'), 301 (r'#(if|elseif|else|endif|available)\b', Comment.Preproc, 'preproc'),
302 302
303 # Keywords 303 # Keywords
304 include('keywords'), 304 include('keywords'),
305 305
306 # Global Types 306 # Global Types
411 # Identifier 411 # Identifier
412 (r'[a-zA-Z_]\w*', Name) 412 (r'[a-zA-Z_]\w*', Name)
413 ], 413 ],
414 'keywords': [ 414 'keywords': [
415 (words(( 415 (words((
416 'break', 'case', 'continue', 'default', 'do', 'else', 416 'as', 'break', 'case', 'catch', 'continue', 'default', 'defer',
417 'fallthrough', 'for', 'if', 'in', 'return', 'switch', 'where', 417 'do', 'else', 'fallthrough', 'for', 'guard', 'if', 'in', 'is',
418 'while'), suffix=r'\b'), 418 'repeat', 'return', '#selector', 'switch', 'throw', 'try',
419 'where', 'while'), suffix=r'\b'),
419 Keyword), 420 Keyword),
420 (r'@availability\([^)]+\)', Keyword.Reserved), 421 (r'@availability\([^)]+\)', Keyword.Reserved),
421 (words(( 422 (words((
422 'associativity', 'convenience', 'dynamic', 'didSet', 'final', 423 'associativity', 'convenience', 'dynamic', 'didSet', 'final',
423 'get', 'infix', 'inout', 'lazy', 'left', 'mutating', 'none', 424 'get', 'indirect', 'infix', 'inout', 'lazy', 'left', 'mutating',
424 'nonmutating', 'optional', 'override', 'postfix', 'precedence', 425 'none', 'nonmutating', 'optional', 'override', 'postfix',
425 'prefix', 'Protocol', 'required', 'right', 'set', 'Type', 426 'precedence', 'prefix', 'Protocol', 'required', 'rethrows',
426 'unowned', 'weak', 'willSet', '@availability', '@autoclosure', 427 'right', 'set', 'throws', 'Type', 'unowned', 'weak', 'willSet',
427 '@noreturn', '@NSApplicationMain', '@NSCopying', '@NSManaged', 428 '@availability', '@autoclosure', '@noreturn',
428 '@objc', '@UIApplicationMain', '@IBAction', '@IBDesignable', 429 '@NSApplicationMain', '@NSCopying', '@NSManaged', '@objc',
430 '@UIApplicationMain', '@IBAction', '@IBDesignable',
429 '@IBInspectable', '@IBOutlet'), suffix=r'\b'), 431 '@IBInspectable', '@IBOutlet'), suffix=r'\b'),
430 Keyword.Reserved), 432 Keyword.Reserved),
431 (r'(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__' 433 (r'(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__'
432 r'|__FILE__|__FUNCTION__|__LINE__|_)\b', Keyword.Constant), 434 r'|__FILE__|__FUNCTION__|__LINE__|_'
435 r'|#(?:file|line|column|function))\b', Keyword.Constant),
433 (r'import\b', Keyword.Declaration, 'module'), 436 (r'import\b', Keyword.Declaration, 'module'),
434 (r'(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)', 437 (r'(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)',
435 bygroups(Keyword.Declaration, Text, Name.Class)), 438 bygroups(Keyword.Declaration, Text, Name.Class)),
436 (r'(func)(\s+)([a-zA-Z_]\w*)', 439 (r'(func)(\s+)([a-zA-Z_]\w*)',
437 bygroups(Keyword.Declaration, Text, Name.Function)), 440 bygroups(Keyword.Declaration, Text, Name.Function)),

eric ide

mercurial