The logic at fault is, when Attribute is parsed from AttributeSyntax, for some reason " is replaced with an empty string - unsure why this was applied during initial implementation, when swift-syntax was integrated. As far as I can see, the behaviour changes a little, but it changes in a correct manner, that is, the reported issue is fixed.
I suspect there was an assumption made initially that quotes did not look good, especially when writing unit tests; however, as practice shows, they are needed.
extension Attribute {
convenience init(_ attribute: AttributeSyntax) {
...
let components = part.split(separator: ":", maxSplits: 1)
switch components.count {
case 2:
arguments[components[0].trimmed] = components[1].replacingOccurrences(of: "\"", with: "").trimmed as NSString
case 1:
arguments["\(idx)"] = components[0].replacingOccurrences(of: "\"", with: "").trimmed as NSString
...
}
...
}
Resolves #1043
Context
The logic at fault is, when Attribute is parsed from
AttributeSyntax
, for some reason"
is replaced with an empty string - unsure why this was applied during initial implementation, whenswift-syntax
was integrated. As far as I can see, the behaviour changes a little, but it changes in a correct manner, that is, the reported issue is fixed.I suspect there was an assumption made initially that quotes did not look good, especially when writing unit tests; however, as practice shows, they are needed.