                 guard let bitNumber = valuesByName[word] else {
                     try throwError(.invalidEnumerationValue)
                 }
-                let flags: Int64 = bitNumber <= 0 ? 0 : 1 << (bitNumber - 1)
+                flags = bitNumber <= 0 ? 0 : 1 << (bitNumber - 1)
                 guard (result & flags) == 0 else {
                     try throwError(.duplicateValue)
                 }

        }

        while true {
            var bitNumber: Int64 = 0
            if scanner.scanInt64(&bitNumber) {
                let flags: Int64 = bitNumber <= 0 ? 0 : 1 << (bitNumber - 1)
                guard (result & flags) == 0 else {
                    try throwError(.duplicateValue)
                }

    private func scanEnumeration() throws {
        assert(scanner.charactersToBeSkipped == CharacterSet.whitespaces)

        let value: Value
        var number: Int64 = 0
        if scanner.scanInt64(&number) {
            value = Value.enumeration(number)
        } else if let word = scanner.scanWord() {
            let result = word.lowercased()
            guard let valuesByName = definitions.enumerations.valuesByNameForAlias[currentFieldName],
                    let number = valuesByName[result] else {
                try throwError(.invalidEnumerationValue)
            }
            value = Value.enumeration(number)
        } else {
            try throwError(.expectedEnumerationValue)
        }
        
        guard currentEntity.add(name: currentFieldNameWithIndex, value: value) else {
            try throwError(.duplicateField)
        }
        if areasLog {
            print("\(currentFieldNameWithIndex): .\(number)")
        }
    }
    
