func parse()

in Cyborg/VectorDrawableParser.swift [283:301]


    func parse(element: String, attributes: [(XMLString, XMLString)]) -> ParseError? {
        if let currentChild = currentChild {
            return currentChild.parse(element: element, attributes: attributes)
        } else if element == name.rawValue,
            !hasFoundElement {
            hasFoundElement = true
            return parseAttributes(attributes)
        } else if let (child, assignment) = childForElement(element) {
            currentChild = child
            assignment(child)
            return child.parse(element: element, attributes: attributes)
        } else {
            if !hasFoundElement {
                return "Element \"\(element)\" found, expected \(name.rawValue)."
            } else {
                return "Found element \"\(element)\" nested in \(type(of: self)), when it is not an acceptable child node."
            }
        }
    }