Skip to content

Commit

Permalink
[Swift] Fix type name bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-zheng committed Jan 11, 2018
1 parent d6c2cb7 commit 2b96a1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rouge/lexers/swift.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class deinit enum extension final func import init internal lazy let optional pr
push :tuple
end

rule /(?!\b(if|while|for|private|internal|unowned|switch|case)\b)\b#{id}(?=(\?|!)?\s*[({])/ do |m|
if m[1] == '(' && m[0] =~ /^[[:upper:]]/
rule /(?!\b(if|while|for|private|internal|unowned|switch|case|do|catch)\b)\b#{id}(?=(\?|!)?\s*[({])/ do |m|
if m[0] =~ /^[[:upper:]]/ || m[1] == '('
token Keyword::Type
else
token Name::Function
Expand Down

0 comments on commit 2b96a1a

Please sign in to comment.