                 return "Internal Error: \(cause.localizedDescription)"
             }
             return "Internal Error"
-        case .undefinedError(let position, let causes):
+        case .undefinedError(let message, let position, let causes):
             if causes.isEmpty {
-                return "Undefined error at \(position.encodedOffset)"
+                return "\(message) at \(position.encodedOffset)"
             } else {
-                return "Undefined error at \(position.encodedOffset) caused by "+causes.map({"\($0)"}).joined(separator: ", ")
+                return "\(message) error at \(position.encodedOffset) caused by "+causes.map({"\($0)"}).joined(separator: ", ")
             }
         case .scanningError(let message, let position, let causes):
             if causes.isEmpty{

            return causes
        case .interpretationError(_, let causes):
            return causes
        case .undefinedError(_, let causes):
            return causes
        }
    }

                self = .parsingError(message: error, range: lexer.index...lexer.index, causes: errors ?? [])
            }
        } else {
            self = .undefinedError(message: "Undefined error", at: lexer.index, causes: errors ?? [])
        }
    }
    
