Fixes for swift 5.8 (#42)

* Fixes for swift 5.8

* Add 5.8 to CI

* More fixes
This commit is contained in:
Adam Fowler
2024-07-19 10:52:49 +01:00
committed by GitHub
parent 5bb66ac425
commit cde358e364
3 changed files with 15 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ jobs:
timeout-minutes: 15 timeout-minutes: 15
strategy: strategy:
matrix: matrix:
image: ["swift:5.9", "swift:5.10", "swiftlang/swift:nightly-6.0-jammy"] image: ["swift:5.8", "swift:5.9", "swift:5.10", "swiftlang/swift:nightly-6.0-jammy"]
container: container:
image: ${{ matrix.image }} image: ${{ matrix.image }}

View File

@@ -2,7 +2,7 @@
--minversion 0.53.10 --minversion 0.53.10
# Swift version # Swift version
--swiftversion 5.9 --swiftversion 5.8
# file options # file options
--exclude .build --exclude .build

View File

@@ -68,19 +68,21 @@ struct MustacheContext {
/// return context with indent and parameter information for invoking a partial /// return context with indent and parameter information for invoking a partial
func withPartial(indented: String?, inheriting: [String: MustacheTemplate]?) -> MustacheContext { func withPartial(indented: String?, inheriting: [String: MustacheTemplate]?) -> MustacheContext {
let indentation: String? = if let indented { let indentation: String?
(self.indentation ?? "") + indented if let indented {
indentation = (self.indentation ?? "") + indented
} else { } else {
self.indentation indentation = self.indentation
} }
let inherits: [String: MustacheTemplate]? = if let inheriting { let inherits: [String: MustacheTemplate]?
if let inheriting {
if let originalInherits = self.inherited { if let originalInherits = self.inherited {
originalInherits.merging(inheriting) { value, _ in value } inherits = originalInherits.merging(inheriting) { value, _ in value }
} else { } else {
inheriting inherits = inheriting
} }
} else { } else {
self.inherited inherits = self.inherited
} }
return .init( return .init(
stack: self.stack, stack: self.stack,
@@ -95,10 +97,11 @@ struct MustacheContext {
/// return context with indent information for invoking an inheritance block /// return context with indent information for invoking an inheritance block
func withBlockExpansion(indented: String?) -> MustacheContext { func withBlockExpansion(indented: String?) -> MustacheContext {
let indentation: String? = if let indented { let indentation: String?
(self.indentation ?? "") + indented if let indented {
indentation = (self.indentation ?? "") + indented
} else { } else {
self.indentation indentation = self.indentation
} }
return .init( return .init(
stack: self.stack, stack: self.stack,