我在hackingwithswift博客上遇到了这段代码。那么上面这个listloop的意义是什么(这种语法意味着什么)
indirect enum LinkedListItem<T> {
case endPoint(value: T)
case linkNode(value: T, next: LinkedListItem)
}
let third = LinkedListItem.endPoint(value: "Third")
let second = LinkedListItem.linkNode(value: "Second", next: third)
let first = LinkedListItem.linkNode(value: "First", next: second)
var currentNode = first
listLoop: while true {
switch currentNode {
case .endPoint(let value):
print(value)
break listLoop
case .linkNode(let value, let next):
print(value)
currentNode = next
}
}