lib/rouge/lexers/swift.rb in rouge-2.0.5 vs lib/rouge/lexers/swift.rb in rouge-2.0.6

- old
+ new

@@ -16,15 +16,15 @@ keywords = Set.new %w( break case continue default do else fallthrough if in for return switch where while try catch throw guard defer repeat as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__ - associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned weak willSet throws rethrows associatedtype + associativity didSet get infix inout mutating none nonmutating operator override postfix precedence prefix set unowned weak willSet throws rethrows precedencegroup ) declarations = Set.new %w( - class deinit enum extension final func import init internal lazy let optional private protocol public required static struct subscript typealias var dynamic indirect associatedtype + class deinit enum extension final func import init internal lazy let optional private protocol public required static struct subscript typealias var dynamic indirect associatedtype open fileprivate ) constants = Set.new %w( true false nil ) @@ -95,12 +95,14 @@ end end rule /#available\([^)]+\)/, Keyword::Declaration - rule /(#selector\()([^)]+?(?:[(].*?[)])?)(\))/ do + rule /(#(?:selector|keyPath)\()([^)]+?(?:[(].*?[)])?)(\))/ do groups Keyword::Declaration, Name::Function, Keyword::Declaration end + + rule /#(line|file|column|function|dsohandle)/, Keyword::Declaration rule /(let|var)\b(\s*)(#{id})/ do groups Keyword, Text, Name::Variable end