diff options
author | Stephen Celis <stephen@stephencelis.com> | 2014-10-29 10:49:40 -0700 |
---|---|---|
committer | Stephen Celis <stephen@stephencelis.com> | 2014-10-29 10:49:40 -0700 |
commit | 3d9bf3a9b9164be4d7b9cc33b5fbcf84cdcbc36d (patch) | |
tree | af30cf2a2bcd6b5ea465645aec3982d89a25561a /pygments/lexers/objective.py | |
parent | 518218d49567f4472d004177da03f20fdfe54951 (diff) | |
download | pygments-3d9bf3a9b9164be4d7b9cc33b5fbcf84cdcbc36d.tar.gz |
Swift: Address PR feedback
- Use default('#pop')
- Fix oddly-wrapped lines
- Restore versionadded
Diffstat (limited to 'pygments/lexers/objective.py')
-rw-r--r-- | pygments/lexers/objective.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pygments/lexers/objective.py b/pygments/lexers/objective.py index 082167e1..8c974520 100644 --- a/pygments/lexers/objective.py +++ b/pygments/lexers/objective.py @@ -282,6 +282,8 @@ class LogosLexer(ObjectiveCppLexer): class SwiftLexer(RegexLexer): """ For `Swift <https://developer.apple.com/swift/>`_ source. + + .. versionadded:: 2.0 """ name = 'Swift' filenames = ['*.swift'] @@ -364,7 +366,7 @@ class SwiftLexer(RegexLexer): r'|UnicodeScalarType|Void|Word' # Foundation/Cocoa r'|NSErrorPointer|NSObjectProtocol|Selector)\b', Name.Builtin), - # Functions + # Functions (r'(abs|advance|alignof|alignofValue|assert|assertionFailure' r'|contains|count|countElements|debugPrint|debugPrintln|distance' r'|dropFirst|dropLast|dump|enumerate|equal|extend|fatalError' @@ -428,12 +430,12 @@ class SwiftLexer(RegexLexer): ], 'comment': [ (r':param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):', - Comment.Special) + Comment.Special) ], # Nested 'comment-single': [ - (r'$', Text, '#pop'), + default('#pop'), include('comment'), (r'[^\n]', Comment.Single) ], @@ -445,12 +447,12 @@ class SwiftLexer(RegexLexer): (r'[*/]', Comment.Multiline) ], 'module': [ - (r'$', Text, '#pop'), + default('#pop'), (r'[a-zA-Z_]\w*', Name.Class), include('root') ], 'preproc': [ - (r'$', Text, '#pop'), + default('#pop'), include('keywords'), (r'[A-Za-z]\w*', Comment.Preproc), include('root') |