Skip to content

Commit a2b2b15

Browse files
authored
Merge pull request #1 from bastie/swift6
Swift6
2 parents 1476b05 + 05d0eee commit a2b2b15

32 files changed

Lines changed: 4922 additions & 29887 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ DerivedData/
77
.swiftpm/configuration/registries.json
88
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
99
.netrc
10+
11+
Package.resolved
12+

Package.resolved

Lines changed: 0 additions & 14 deletions
This file was deleted.

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "LStXML2Code",
8-
platforms: [.macOS(.v13)],
8+
platforms: [.macOS(.v15)],
99
products: [
1010
// Products define the executables and libraries a package produces, making them visible to other packages.
1111
.library(
@@ -16,7 +16,7 @@ let package = Package(
1616
dependencies: [
1717
.package(
1818
url: "https://github.com/bastie/JavApi4Swift.git",
19-
from: "0.7.5"
19+
from: "0.25.0"
2020
)
2121
],
2222
targets: [

Sources/BMF2Code/BMF2Code.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import LStXML2Code
99
/// Quelletxtgenerator zur Nutzung des durch das BMF bereitgestellten Pseudo-Quelltext zur Berechnung der Lohnsteuerabzüge bei der Einkommensteuer.
1010
public struct BMF2Code {
1111
/// Interne Version
12-
public static let VERSION = "1.0.3"
12+
public static let VERSION = "1.1.0"
1313

1414

1515
// MARK: main entry point

Sources/LStXML2Code/Nodes/CharNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class CharNode : Node , CustomDebugStringConvertible {
1313

1414
let char : Character
1515

16-
static var initiated : [Character:CharNode] = [:]
16+
nonisolated(unsafe) static var initiated : [Character:CharNode] = [:]
1717
public static func value (of newChar : Character) -> CharNode {
1818
if let result = initiated[newChar] {
1919
return result

Sources/LStXML2Code/Nodes/FloatNumberNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class FloatNumberNode : Node, CustomDebugStringConvertible {
2525

2626
/// Set the new Value and return the oldValue. On error return nil
2727
public func setValue (stringRepresentation : String) -> Double?{
28-
if let newValue = Double(stringRepresentation) {
28+
if let _ = Double(stringRepresentation) {
2929
let oldValue = self.asString
3030
self.asString = stringRepresentation
3131
return Double(oldValue)

Sources/LStXML2Code/PAPTreeEncodingImpl.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class PAPTreeEncodingImpl : PAPTreeEncoding {
2424
for (name,value) in oldAttributes {
2525
newNode.addAttribute(name, value)
2626
if name == "exec" {
27-
exec(stmt: value)
27+
_ = exec(stmt: value)
2828
}
2929
}
3030
for child in oldNode.getChilds() {
@@ -168,7 +168,7 @@ class PAPTreeEncodingImpl : PAPTreeEncoding {
168168
}
169169
position.count += 1
170170
}
171-
else if let nextNode = node as? DotNode { // maybe it is a float value
171+
else if let _ = node as? DotNode { // maybe it is a float value
172172
if let _ = number {
173173
number!.append(".") // better generator error than runtime error, so ! instead of ? is using
174174
position.count += 1
@@ -230,21 +230,21 @@ class PAPTreeEncodingImpl : PAPTreeEncoding {
230230
// MARK: DotNodes in Statement to Tree
231231

232232
for i in 0..<asNodes.count {
233-
if let dot = asNodes[i] as? DotNode {
234-
if let receiver = asNodes[i-1] as? ValueNode,
235-
let message = asNodes[i+1] as? ValueNode {
233+
if let _ = asNodes[i] as? DotNode {
234+
if let _ = asNodes[i-1] as? ValueNode,
235+
let _ = asNodes[i+1] as? ValueNode {
236236
//print ("call \(message.getValue()) on type \(receiver.getValue())")
237237
}
238-
else if let receiver = asNodes[i-1] as? IdentiferNode,
239-
let message = asNodes[i+1] as? ValueNode {
238+
else if let _ = asNodes[i-1] as? IdentiferNode,
239+
let _ = asNodes[i+1] as? ValueNode {
240240
//print ("call \(message.getValue()) on instance \(receiver.getName())")
241241
}
242-
else if let receiver = asNodes[i-1] as? ClosedRoundBracketNode,
243-
let message = asNodes[i+1] as? ValueNode {
242+
else if let _ = asNodes[i-1] as? ClosedRoundBracketNode,
243+
let _ = asNodes[i+1] as? ValueNode {
244244
//print ("call \(message.getValue()) on result of before")
245245
}
246-
else if let receiver = asNodes[i-1] as? ClosedSquareBracketNode,
247-
let message = asNodes[i+1] as? ValueNode {
246+
else if let _ = asNodes[i-1] as? ClosedSquareBracketNode,
247+
let _ = asNodes[i+1] as? ValueNode {
248248
//print ("call \(message.getValue()) on array element before")
249249
}
250250
else {
@@ -256,19 +256,19 @@ class PAPTreeEncodingImpl : PAPTreeEncoding {
256256
// Note: a subclass or subtype is handled as CONSTANT
257257
do {
258258
var messageType : String?
259-
let message = asNodes[i+1]
259+
let _ = asNodes[i+1]
260260
for var j in (i+2)..<asNodes.count {
261261
if let _ = asNodes[j] as? SpaceNode {
262262
// skip
263263
}
264264
else if let _ = asNodes[j] as? OpenRoundBracketNode {
265265
messageType = "METHOD"
266266
}
267-
if let messageType {
267+
if let _ = messageType {
268268
j = asNodes.count
269269
}
270270
}
271-
if let messageType {} else {
271+
if let _ = messageType {} else {
272272
messageType = "CONSTANT"
273273
}
274274

@@ -694,7 +694,7 @@ class PAPTreeEncodingImpl : PAPTreeEncoding {
694694
}
695695
break
696696
case ".":
697-
if let numeric = Int (next) // Ziffer / Nummer?
697+
if let _ = Int (next) // Ziffer / Nummer?
698698
//&& !numericDetected // aber nicht schon ein Dezimal erkannt => Fehler
699699
{
700700
print ("number detected: \(next) - waiting for end")
@@ -761,7 +761,7 @@ class PAPTreeEncodingImpl : PAPTreeEncoding {
761761
content = next.trimmingCharacters(in: .whitespaces)
762762
} // END-FOR
763763
// last part of statement
764-
var detected = next.trimmingCharacters(in: .whitespaces)
764+
let detected = next.trimmingCharacters(in: .whitespaces)
765765
if detected.count > 0 {
766766
if callDetected {
767767
print ("call detected with target: \(next)")
File renamed without changes.

0 commit comments

Comments
 (0)