Skip to content

Commit b15defb

Browse files
authored
Merge pull request #15 from tigerpixel/development
Swift 5.1
2 parents 79b9dd2 + 4937a9f commit b15defb

15 files changed

Lines changed: 47 additions & 37 deletions

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
osx_image: xcode10.3
1+
osx_image: xcode11
22
language: objective-c
33

44
install:

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@
5252
## Version 2.0.1
5353

5454
### *Released 2019-08-20*
55-
* Update to Swift Package Manager to make compatible with Swift 5
56-
* This version is only required is using SPM
55+
* Update to Swift Package Manager to make compatible with Swift 5.
56+
* This version is only required is using SPM.
57+
58+
## Version 2.1.0
59+
60+
### *Released 2019-09-30*
61+
* Update to Swift Package Manager to make compatible with Swift 5.1.
62+
* Added Swift package manager capabilities to all platforms.
63+
* Updated Swift code to take advantage of Swift 5.1 features.
64+
* Swiftlint version update to 0.35.0
5765

Package.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.1
22
//
33
// Package.swift
44
// ParserCombinator
@@ -13,6 +13,10 @@ import PackageDescription
1313

1414
let package = Package(
1515
name: "ParserCombinator",
16+
platforms: [
17+
// Other platforms compile as far back as possible by default.
18+
.macOS(.v10_10)
19+
],
1620
products: [
1721
.library(name: "ParserCombinator", targets: ["ParserCombinator"])
1822
],

ParserCombinator.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Pod::Spec.new do |s|
88
s.name = 'ParserCombinator'
9-
s.version = '2.0.1'
9+
s.version = '2.1.0'
1010
s.summary = 'Exquisitely simple functional parsing in Swift.'
1111
s.description = <<-DESC
1212
A simple parser combinator, created in Swift. Functional parser combinators can be extremely useful but can also be difficult to understand. ParserCombinator attempts to strip this back and create a simple and user friendly way to parse complex strings into other objects. Technical terms, like 'monad', are avoided or explained if necessary and docs are provided in plain English, with examples.
@@ -22,7 +22,7 @@ A simple parser combinator, created in Swift. Functional parser combinators can
2222
s.watchos.deployment_target = '2.0'
2323
s.osx.deployment_target = '10.9'
2424
s.tvos.deployment_target = '9.0'
25-
s.swift_version = '5.0'
25+
s.swift_version = '5.1'
2626

2727
s.source_files = 'Sources/**/*.swift'
2828
end

ParserCombinator.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@
927927
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
928928
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
929929
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
930+
MARKETING_VERSION = 2.1.0;
930931
PRODUCT_BUNDLE_IDENTIFIER = com.tigerpixel.ParserCombinator;
931932
PRODUCT_NAME = ParserCombinator;
932933
SKIP_INSTALL = YES;
@@ -950,6 +951,7 @@
950951
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
951952
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
952953
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
954+
MARKETING_VERSION = 2.1.0;
953955
PRODUCT_BUNDLE_IDENTIFIER = com.tigerpixel.ParserCombinator;
954956
PRODUCT_NAME = ParserCombinator;
955957
SKIP_INSTALL = YES;

ParserCombinator/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.1</string>
18+
<string>$(MARKETING_VERSION)</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,25 @@ Pull requests for improvements are welcome.
2525
There are no external requirements for this project, just Swift.
2626

2727
- iOS 8.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+
28-
- Xcode 10.3+
29-
- Swift 5.0+
28+
- Xcode 11+
29+
- Swift 5.1+
3030

3131
For previous versions of Xcode and Swift please see prior releases.
3232

3333
## Installation
3434

35+
### Swift Package Manager
36+
37+
The [Swift Package Manager](https://swift.org/package-manager) is the official tool for managing the distribution of Swift code. It is currently available for all Apple platforms. It can also be used with Linux but this project does not fully support Linux at this point in time.
38+
39+
If you use it to manage your dependencies, simply add ParserCombinator to the dependencies value of your Package.swift file.
40+
41+
```swift
42+
dependencies: [
43+
.package(url: "https://github.com/Tigerpixel/ParserCombinator.git", from: "2.1.0")
44+
]
45+
```
46+
3547
### Cocoapods
3648

3749
ParserCombinator is available through [CocoaPods](https://cocoapods.org/pods/ParserCombinator). To install it, simply add the following line to your Podfile:
@@ -50,18 +62,6 @@ github "tigerpixel/ParserCombinator"
5062

5163
If you use Carthage to build your dependencies, make sure you have added `ParserCombinator.framework` to the "_Linked Frameworks and Libraries_" section of your target, and have included them in your Carthage framework copying build phase.
5264

53-
### Swift Package Manager
54-
55-
The [Swift Package Manager](https://swift.org/package-manager) is the official tool for managing the distribution of Swift code. It is currently available for macOS. It can also be used with Linux but this project does not fully support Linux at this point in time.
56-
57-
If you use it to manage your dependencies, simply add ParserCombinator to the dependencies value of your Package.swift file.
58-
59-
```swift
60-
dependencies: [
61-
.Package(url: "https://github.com/Tigerpixel/ParserCombinator.git", majorVersion: 2)
62-
]
63-
```
64-
6565
### Git Submodule
6666

6767
1. Add the ParserCombinator repository as a [submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) of your application’s repository.

Sources/ParserCombinator/Character+UnicodeScalar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extension Character {
1010

1111
/// The characters's value represented as Unicode scalar value.
1212
var unicodeScalar: UnicodeScalar {
13-
return String(self).unicodeScalars.first!
13+
String(self).unicodeScalars.first!
1414
}
1515

1616
}

Sources/ParserCombinator/CharacterParsers.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public func character(condition: @escaping (Character) -> Bool) -> Parser<Charac
5757
- returns: The parser whith the same semantic as the character set given.
5858
*/
5959
public func character(isInCharacterSet charSet: CharacterSet) -> Parser<Character> {
60-
return character { charSet.contains($0.unicodeScalar) }
60+
character { charSet.contains($0.unicodeScalar) }
6161
}
6262

6363
/**
@@ -71,7 +71,7 @@ public func character(isInCharacterSet charSet: CharacterSet) -> Parser<Characte
7171
- returns: The parser which will only allow the given character to pass, all others will fail.
7272
*/
7373
public func character(isEqualTo token: Character) -> Parser<Character> {
74-
return character { $0 == token }
74+
character { $0 == token }
7575
}
7676

7777
/**
@@ -85,7 +85,7 @@ public func character(isEqualTo token: Character) -> Parser<Character> {
8585
- returns: The parser which will only allow the given characters to pass, all others will fail.
8686
*/
8787
public func character(isInString string: String) -> Parser<Character> {
88-
return character { string.contains($0) }
88+
character { string.contains($0) }
8989
}
9090

9191
// MARK: Pre-made pasers using the character parser function for common sets of characters.

Sources/ParserCombinator/NumberParsers.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,5 @@
99
/// A set of tokens describing an integer number. The number can consist of one or more digits.
1010
public let integerNumber = digit.oneOrMany.map { characterArray -> Int in
1111

12-
guard let integerNumber = Int(String(characterArray)) else {
13-
return 0
14-
}
15-
16-
return integerNumber
12+
Int(String(characterArray)) ?? 0
1713
}

0 commit comments

Comments
 (0)