Skip to content

Commit

Permalink
Swift: Added some keyword (#2756)
Browse files Browse the repository at this point in the history
  • Loading branch information
timroesner committed Feb 11, 2021
1 parent 9f59f52 commit cf354ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/prism-swift.js
Expand Up @@ -16,7 +16,7 @@ Prism.languages.swift = Prism.languages.extend('clike', {
}
}
},
'keyword': /\b(?:as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,
'keyword': /\b(?:as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|some|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,
'number': /\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,
'constant': /\b(?:nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,
'atrule': /@\b(?:IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-swift.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/languages/swift/keyword_feature.test
Expand Up @@ -55,6 +55,7 @@ safe
self
Self
set
some
static
struct
subscript
Expand Down Expand Up @@ -137,6 +138,7 @@ __LINE__
["keyword", "self"],
["keyword", "Self"],
["keyword", "set"],
["keyword", "some"],
["keyword", "static"],
["keyword", "struct"],
["keyword", "subscript"],
Expand Down

0 comments on commit cf354ef

Please sign in to comment.