                 
                 switch scanner.peek(aheadBy: 1) {
                 case Byte.forwardSlash?:
-                    if isClosingTag(name) {
+                    if try isClosingTag(name) {
                         break outerLoop
                     } else {
                         throw Error.malformedXML("Expected closing tag </\(name.fasterString)>")

    
    mutating func extractAttributeValue() throws -> Bytes {
        skip(until: .quote)
        assert(scanner.peek() == .quote)
        
        // opening `"`
        scanner.pop()
        skipWhitespace()
        
        let value = consume(until: .quote)
        
        guard scanner.peek() == .quote else {
            throw Error.malformedXML("expected closing `\"`")
        }
        
        // closing `"`
        scanner.pop()
        return value
    }
}

extension XMLParser {
    mutating func isClosingTag(_ expectedTagName: Bytes) -> Bool {
        assert(scanner.peek(aheadBy: 1) == .forwardSlash)
        
        // </
        scanner.pop(2)
        
        let tagName = consume(until: tagNameTerminators)
        skipWhitespace()
        assert(scanner.peek() == .greaterThan)
        scanner.pop()
        return tagName.elementsEqual(expectedTagName)
    }
    
    mutating func eatComment() {
        assert(scanner.peek() == .exclamationPoint)
        
        //TODO(Brett): be sure this is actually a comment before popping.
        // otherwise throw an error
        // !--
        scanner.pop(3)
        
        while scanner.peek() != nil {
            skip(until: .hyphen)
            
            guard scanner.peek(aheadBy: 1) != .hyphen else {
                // -->
                scanner.pop(3)
                break
            }
        }

        
        // Comment
        case Byte.exclamationPoint:
            try eatComment()
            return try extractTag()
        
        // Object
