Skip to content

Commit

Permalink
Update Swift keyword to Swift 5.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Feb 21, 2024
1 parent 3ef4362 commit 5479ed3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -131,7 +131,7 @@ Latest development builds (artifacts in Release configuration for each compiler
* [PostgreSQL](tools/lang/PostgreSQL.sql), PostgreSQL 14.
* [Transact-SQL](tools/lang/Transact-SQL.sql), SQL Server 2019.
* [Oracle](tools/lang/Oracle.sql), Oracle 20, incomplete.
* [Swift](tools/lang/Swift.swift), up to Swift 5.8.
* [Swift](tools/lang/Swift.swift), up to Swift 5.10.
* TCL, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#tcl)
* [Texinfo](tools/lang/Texinfo.texi), up to Texinfo 7.0.
* [TOML File](https://toml.io/)
Expand Down
21 changes: 11 additions & 10 deletions src/EditLexers/stlSwift.c
Expand Up @@ -5,27 +5,28 @@ static KEYWORDLIST Keywords_Swift = {{
//++Autogenerated -- start of section automatically generated
"Any Protocol Self Type actor as associatedtype associativity async await break case catch class continue convenience "
"default defer deinit didSet do dynamic else enum extension fallthrough false fileprivate final for func get guard "
"if import in indirect infix init inout internal is lazy left let mutating nil none nonisolated nonmutating "
"open operator optional override postfix precedence precedencegroup prefix private protocol public "
"if import in indirect infix init inout internal is lazy left let macro mutating nil none nonisolated nonmutating "
"open operator optional override package postfix precedence precedencegroup prefix private protocol public "
"repeat required rethrows return right self set some static struct subscript super switch "
"throw throws true try typealias unowned var weak where while willSet "

, // 1 directive
"available( colorLiteral( column dsohandle else elseif endif error( file fileID fileLiteral( filePath function "
"if imageLiteral( keyPath( line selector( sourceLocation( warning( "
"available( colorLiteral( column dsohandle else elseif endif error( externalMacro( "
"file fileID fileLiteral( filePath function if imageLiteral( keyPath( line selector( sourceLocation( unavailable( "
"warning( "

, // 2 attribute
"GKInspectable NSApplicationMain NSCopying NSManaged Sendable UIApplicationMain autoclosure available( convention "
"discardableResult dynamicCallable dynamicMemberLookup escaping frozen inlinable main nonobjc objc objcMembers "
"propertyWrapper requires_stored_property_inits resultBuilder testable unchecked unknown usableFromInline "
"warn_unqualified_access "
"GKInspectable NSCopying NSManaged Sendable attached( autoclosure available( backDeployed( convention "
"discardableResult dynamicCallable dynamicMemberLookup escaping freestanding( frozen inlinable main nonobjc "
"objc objcMembers propertyWrapper requires_stored_property_inits resultBuilder testable "
"unchecked unknown usableFromInline warn_unqualified_access "

, // 3 class
"AnyClass AnyKeyPath AnyObject KeyPath PartialKeyPath WritableKeyPath "

, // 4 struct
"Array Bool Character ClosedRange Dictionary Double Float Float32 Float64 Hasher Int Int16 Int32 Int64 Int8 Mirror Range "
"Set Slice StaticString String SystemRandomNumberGenerator UInt UInt16 UInt32 UInt64 UInt8 Void "
"Array Bool Character ClosedRange Dictionary Double Float Float16 Float32 Float64 Hasher Int Int16 Int32 Int64 Int8 "
"Mirror Range Set Slice StaticString String SystemRandomNumberGenerator UInt UInt16 UInt32 UInt64 UInt8 Void "

, // 5 protocol
"Collection Comparable Equatable Error Hashable Identifiable MutableCollection OptionSet RandomNumberGenerator Sequence "
Expand Down
2 changes: 1 addition & 1 deletion tools/lang/JavaScript.js
@@ -1,5 +1,5 @@
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
// https://www.ecma-international.org/publications/standards/Ecma-262.htm
// https://ecma-international.org/publications-and-standards/standards/ecma-262/
// 2020 https://tc39.es/ecma262/2020/
// 2021 https://tc39.es/ecma262/2021/
// 2022 https://tc39.es/ecma262/2022/
Expand Down
15 changes: 11 additions & 4 deletions tools/lang/Swift.swift
@@ -1,6 +1,6 @@
// 5.8 https://www.swift.org/
// 5.10 https://www.swift.org/
// https://swift.org/documentation/
// https://github.com/apple/swift
// https://github.com/apple/swift-evolution

//! keywords ===========================================================
// Keywords and Punctuation
Expand Down Expand Up @@ -62,6 +62,7 @@ Type
unowned
weak willSet

macro package
// Asynchronous Functions and Methods
async
// Actor Declaration
Expand All @@ -76,18 +77,22 @@ actor nonisolated
#else
#endif
#sourceLocation(file: file-path, line: line-number)
#sourceLocation()
#error(diagnostic-message)
#warning(diagnostic-message)
#available(availability-arguments)
#unavailable(availability-arguments)

// Literal Expression
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/expressions#Literal-Expression
// https://developer.apple.com/documentation/swift/macros
#file
#fileID
#filePath
#line
#column
#function
#externalMacro(module: String,type: String)
#dsohandle
// playground-literal
#colorLiteral(red: expression, green: expression, blue: expression, alpha: expression)
Expand All @@ -104,16 +109,18 @@ actor nonisolated
//! attribute ===========================================================
// https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes
// Declaration Attributes
@attached()
@available()
@backDeployed()
@discardableResult
@dynamicCallable
@dynamicMemberLookup
@freestanding()
@frozen
@GKInspectable
@inlinable
@main
@nonobjc
@NSApplicationMain
@NSCopying
@NSManaged
@objc
Expand All @@ -122,7 +129,6 @@ actor nonisolated
@resultBuilder
@requires_stored_property_inits
@testable
@UIApplicationMain
@unchecked
@usableFromInline
@warn_unqualified_access
Expand Down Expand Up @@ -158,6 +164,7 @@ protocol Error
@frozen struct Int16
@frozen struct Int32
@frozen struct Int64
@frozen struct Float16
typealias Float32 = Float
typealias Float64 = Double
@frozen struct SystemRandomNumberGenerator
Expand Down

0 comments on commit 5479ed3

Please sign in to comment.