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

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