                 if let ch = nextScalar() {
                     buffer.unicodeScalars.append(ch)
                     if ch == "/" {
-                        let (bufferedString, isMatchingTag) = self.checkForMatchingTag(tag)
+                        let (bufferedString, isMatchingTag) = checkForMatchingTag(tag)
                         buffer.append(bufferedString)
                         if isMatchingTag {
                             break loop


struct Typographizer {

    enum TypographizerTokenResult: String {
        case openingSingle = "opening-single"
        case closingSingle = "closing-single"
        case openingDouble = "opening-double"
        case closingDouble = "closing-double"
        case apostrophe = "apostrophe"
        case enDash = "en-dash"
        // Unchanged text because it doesn’t contain the trigger characters:
        case unchanged = "unchanged"
        // It’s one of the trigger characters but didn’t need changing:
        case ignored = "ignored"
        // Was skipped because it was either an HTML tag, or a pair of tags with protected text in between:
        case skipped = "skipped"
    }
    
    struct TypographizerToken {
        let result: TypographizerTokenResult
        let text: String
        
        init(_ result: TypographizerTokenResult, _ text: String) {
            self.result = result
            self.text = text
        }

    }
    
    
    private mutating func nextToken() throws -> Token? {
        while let ch = nextScalar() {
            switch ch {
            case "´",
                 "`":
                // FIXME: Replacing a combining accent only works for the very first scalar in a string
                return Token(.apostrophe, apostrophe)
            case "\"",
                 "'",
                 "-":
                return try fixableToken(ch)
            case "<" where isHTML:
                return try htmlToken()
            default:
                return try unchangedToken(ch)
            }
        }
        return nil
