Skip to content

Commit 05d0eee

Browse files
committed
remove most warnings
1 parent 230b8f6 commit 05d0eee

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

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)")

0 commit comments

Comments
 (0)