Skip to content

Commit

Permalink
[Swift] Update keyword list to 5.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Mar 13, 2022
1 parent 10c2047 commit 3deb9fb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Latest development builds (artifacts in Release configuration for each compiler
* [PostgreSQL](../main/tools/lang/PostgreSQL.sql), PostgreSQL 13.
* [Transact-SQL](../main/tools/lang/Transact-SQL.sql), SQL Server 2019.
* [Oracle](../main/tools/lang/Oracle.sql), Oracle 20, incomplete.
* [Swift](../main/tools/lang/Swift.swift), Swift 5.5.
* [Swift](../main/tools/lang/Swift.swift), Swift 5.6.
* TCL, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#tcl)
* Texinfo
* TOML File
Expand Down
2 changes: 1 addition & 1 deletion src/EditLexers/stlSwift.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static KEYWORDLIST Keywords_Swift = {{
, // 2 attribute
"GKInspectable NSApplicationMain NSCopying NSManaged UIApplicationMain autoclosure available( convention "
"discardableResult dynamicCallable dynamicMemberLookup escaping frozen inlinable main nonobjc objc objcMembers "
"propertyWrapper requires_stored_property_inits testable unknown warn_unqualified_access "
"propertyWrapper requires_stored_property_inits resultBuilder testable unknown usableFromInline warn_unqualified_access "

, // 3 class
"AnyClass AnyKeyPath AnyObject KeyPath PartialKeyPath WritableKeyPath "
Expand Down
22 changes: 13 additions & 9 deletions tools/lang/Swift.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 5.5 https://docs.swift.org/
// 5.6 https://docs.swift.org/
// https://docs.swift.org/swift-book/
// https://swift.org/documentation/
// https://github.com/apple/swift
Expand All @@ -15,56 +15,58 @@ fileprivate func
import init inout internal
let
open operator
private protocol public
private precedencegroup protocol public
rethrows
static struct subscript
typealias
var

// Keywords used in statements
break
case continue
case catch continue
default defer do
else
fallthrough for
guard
if in
repeat return
throw
switch
where while

// Keywords used in expressions and types
as Any
Any as
catch
false
is
nil
super self Self
rethrows
self Self super
throw throws
true try

// Keywords reserved in particular contexts
associativity
convenience
dynamic didSet
didSet dynamic
final
get
infix indirect
indirect infix
lazy left
mutating
none nonmutating
optional override
postfix precedence prefix Protocol
required right
some set
set some
Type
unowned
weak willSet
precedencegroup

async await

//! directive ===========================================================
// Keywords that begin with a number sign
// Compiler Control Statements
// https://docs.swift.org/swift-book/ReferenceManual/Statements.html
#if
Expand Down Expand Up @@ -115,9 +117,11 @@ async await
@objc
@objcMembers
@propertyWrapper
@resultBuilder
@requires_stored_property_inits
@testable
@UIApplicationMain
@usableFromInline
@warn_unqualified_access

// Type Attributes
Expand Down

0 comments on commit 3deb9fb

Please sign in to comment.