diff --git a/Cargo.lock b/Cargo.lock
index 0a54b496..6453344b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -581,7 +581,6 @@ dependencies = [
"esplugin",
"libloadorder",
"libloot",
- "loot-condition-interpreter",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 886b559e..fefd6545 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,7 @@ license = "GPL-3.0-or-later"
crc32fast = "1.4.2"
fancy-regex = "0.14.0"
log = { version = "0.4.26", features = ["std"] }
+loot-condition-interpreter = "5.3.2"
petgraph = "0.8.1"
rayon = "1.10.0"
rustc-hash = "2.1.1"
@@ -16,7 +17,6 @@ unicase = "2.8.1"
esplugin.workspace = true
libloadorder.workspace = true
-loot-condition-interpreter.workspace = true
[target.'cfg(windows)'.dependencies]
windows = { version = "0.61.1", features = ["Win32_Storage_FileSystem"] }
@@ -31,7 +31,6 @@ members = ["cpp", "ffi-errors", "nodejs", "parameterized-test", "python"]
[workspace.dependencies]
esplugin = "6.1.3"
libloadorder = "18.4.0"
-loot-condition-interpreter = "5.3.2"
[profile.release]
debug = "limited"
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 550d1a90..81a09871 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -90,7 +90,6 @@ set(LIBLOOT_INCLUDE_H_FILES
"${CMAKE_SOURCE_DIR}/include/loot/api_decorator.h"
"${CMAKE_SOURCE_DIR}/include/loot/database_interface.h"
"${CMAKE_SOURCE_DIR}/include/loot/exception/error_categories.h"
- "${CMAKE_SOURCE_DIR}/include/loot/exception/condition_syntax_error.h"
"${CMAKE_SOURCE_DIR}/include/loot/exception/cyclic_interaction_error.h"
"${CMAKE_SOURCE_DIR}/include/loot/exception/undefined_group_error.h"
"${CMAKE_SOURCE_DIR}/include/loot/enum/edge_type.h"
diff --git a/cpp/docs/api/reference.rst b/cpp/docs/api/reference.rst
index 5f32dd42..e12f4f53 100644
--- a/cpp/docs/api/reference.rst
+++ b/cpp/docs/api/reference.rst
@@ -95,9 +95,6 @@ Exceptions
.. doxygenclass:: loot::CyclicInteractionError
:members:
-.. doxygenclass:: loot::ConditionSyntaxError
- :members:
-
.. doxygenclass:: loot::UndefinedGroupError
:members:
diff --git a/cpp/include/loot/api.h b/cpp/include/loot/api.h
index bdf79f33..abdd10eb 100644
--- a/cpp/include/loot/api.h
+++ b/cpp/include/loot/api.h
@@ -34,7 +34,6 @@
#include "loot/api_decorator.h"
#include "loot/enum/game_type.h"
#include "loot/enum/log_level.h"
-#include "loot/exception/condition_syntax_error.h"
#include "loot/exception/cyclic_interaction_error.h"
#include "loot/exception/error_categories.h"
#include "loot/exception/undefined_group_error.h"
diff --git a/cpp/include/loot/exception/condition_syntax_error.h b/cpp/include/loot/exception/condition_syntax_error.h
deleted file mode 100644
index c3f0b18d..00000000
--- a/cpp/include/loot/exception/condition_syntax_error.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* LOOT
-
- A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
- Fallout: New Vegas.
-
- Copyright (C) 2012-2016 WrinklyNinja
-
- This file is part of LOOT.
-
- LOOT is free software: you can redistribute
- it and/or modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation, either version 3 of
- the License, or (at your option) any later version.
-
- LOOT is distributed in the hope that it will
- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LOOT. If not, see
- .
- */
-
-#ifndef LOOT_EXCEPTION_CONDITION_SYNTAX_ERROR
-#define LOOT_EXCEPTION_CONDITION_SYNTAX_ERROR
-
-#include
-
-namespace loot {
-/**
- * @brief An exception class thrown if invalid syntax is encountered when
- * parsing a metadata condition.
- */
-class ConditionSyntaxError : public std::system_error {
-public:
- using std::system_error::system_error;
-};
-}
-
-#endif
diff --git a/cpp/include/loot/exception/error_categories.h b/cpp/include/loot/exception/error_categories.h
index 710cfa5a..42773fcc 100644
--- a/cpp/include/loot/exception/error_categories.h
+++ b/cpp/include/loot/exception/error_categories.h
@@ -45,14 +45,6 @@ LOOT_API const std::error_category& esplugin_category();
* derived from std::error_category.
*/
LOOT_API const std::error_category& libloadorder_category();
-
-/**
- * @brief Get the error category that can be used to identify system_error
- * exceptions that are due to loot condition interpreter errors.
- * @returns A reference to the static object of unspecified runtime type,
- * derived from std::error_category.
- */
-LOOT_API const std::error_category& loot_condition_interpreter_category();
}
#endif
diff --git a/cpp/src/api/exception/error_categories.cpp b/cpp/src/api/exception/error_categories.cpp
index 283a81cb..b4bd9521 100644
--- a/cpp/src/api/exception/error_categories.cpp
+++ b/cpp/src/api/exception/error_categories.cpp
@@ -47,20 +47,6 @@ class libloadorder_category : public std::error_category {
return code.category().name() == name();
}
};
-
-class loot_condition_interpreter_category : public std::error_category {
- const char* name() const noexcept override {
- return "loot condition interpreter";
- }
-
- std::string message(int) const override {
- return "loot condition interpreter error";
- }
-
- bool equivalent(const std::error_code& code, int) const noexcept override {
- return code.category().name() == name();
- }
-};
}
LOOT_API const std::error_category& esplugin_category() {
@@ -72,9 +58,4 @@ LOOT_API const std::error_category& libloadorder_category() {
static detail::libloadorder_category instance;
return instance;
}
-
-LOOT_API const std::error_category& loot_condition_interpreter_category() {
- static detail::loot_condition_interpreter_category instance;
- return instance;
-}
}
diff --git a/cpp/src/api/exception/exception.cpp b/cpp/src/api/exception/exception.cpp
index 2966e718..25375af6 100644
--- a/cpp/src/api/exception/exception.cpp
+++ b/cpp/src/api/exception/exception.cpp
@@ -2,7 +2,6 @@
#include
-#include "loot/exception/condition_syntax_error.h"
#include "loot/exception/cyclic_interaction_error.h"
#include "loot/exception/error_categories.h"
#include "loot/exception/undefined_group_error.h"
@@ -18,7 +17,6 @@ constexpr std::string_view UNDEFINED_GROUP_ERROR_PREFIX =
"UndefinedGroupError: "sv;
constexpr std::string_view ESPLUGIN_ERROR_PREFIX = "EspluginError: "sv;
constexpr std::string_view LIBLOADORDER_ERROR_PREFIX = "LibloadorderError: "sv;
-constexpr std::string_view LCI_ERROR_PREFIX = "LciError: "sv;
constexpr std::string_view INVALID_ARGUMENT_PREFIX = "InvalidArgument: "sv;
bool startsWith(std::string_view str, std::string_view prefix) {
@@ -153,12 +151,6 @@ std::exception_ptr mapError(const ::rust::Error& error) {
return std::make_exception_ptr(
std::system_error(code, libloadorder_category(), details));
- } else if (startsWith(error.what(), LCI_ERROR_PREFIX)) {
- const auto [code, details] = parseSystemError(
- std::string_view(error.what()).substr(LCI_ERROR_PREFIX.size()));
-
- return std::make_exception_ptr(ConditionSyntaxError(
- code, loot_condition_interpreter_category(), details));
} else if (startsWith(error.what(), INVALID_ARGUMENT_PREFIX)) {
return std::make_exception_ptr(
std::invalid_argument(getErrorSuffix(error.what())));
diff --git a/cpp/src/error.rs b/cpp/src/error.rs
index c14885a7..1c27e63d 100644
--- a/cpp/src/error.rs
+++ b/cpp/src/error.rs
@@ -45,7 +45,6 @@ impl std::fmt::Display for VerboseError {
let prefix = match e.category() {
SystemErrorCategory::Esplugin => "EspluginError",
SystemErrorCategory::Libloadorder => "LibloadorderError",
- SystemErrorCategory::LootConditionInterpreter => "LciError",
_ => "UnknownCategoryError",
};
write!(f, "{}: {}: {}", prefix, e.code(), e.message())
@@ -63,6 +62,8 @@ variant_box_from_error!(MultilingualMessageContentsError, VerboseError::Other);
variant_box_from_error!(RegexError, VerboseError::Other);
variant_box_from_error!(LoadMetadataError, VerboseError::Other);
variant_box_from_error!(WriteMetadataError, VerboseError::Other);
+variant_box_from_error!(ConditionEvaluationError, VerboseError::Other);
+variant_box_from_error!(MetadataRetrievalError, VerboseError::Other);
impl From for VerboseError {
fn from(value: GameHandleCreationError) -> Self {
@@ -116,12 +117,6 @@ impl From for VerboseError {
}
}
-impl From for VerboseError {
- fn from(value: ConditionEvaluationError) -> Self {
- Self::SystemError(SystemError::from(value))
- }
-}
-
impl From for VerboseError {
fn from(value: GroupsPathError) -> Self {
match value {
@@ -132,15 +127,6 @@ impl From for VerboseError {
}
}
-impl From for VerboseError {
- fn from(value: MetadataRetrievalError) -> Self {
- match value {
- MetadataRetrievalError::ConditionEvaluationError(e) => e.into(),
- MetadataRetrievalError::RegexError(_) | _ => Self::Other(Box::new(value)),
- }
- }
-}
-
impl From for VerboseError {
fn from(value: PluginDataError) -> Self {
Self::SystemError(SystemError::from(value))
diff --git a/ffi-errors/Cargo.toml b/ffi-errors/Cargo.toml
index f78e54bc..042ce582 100644
--- a/ffi-errors/Cargo.toml
+++ b/ffi-errors/Cargo.toml
@@ -9,4 +9,3 @@ libloot = { path = ".." }
esplugin.workspace = true
libloadorder.workspace = true
-loot-condition-interpreter.workspace = true
diff --git a/ffi-errors/src/lci.rs b/ffi-errors/src/lci.rs
deleted file mode 100644
index 201068bb..00000000
--- a/ffi-errors/src/lci.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Unless otherwise noted, these constants and the mapping logic are copied from
-// loot-condition-interpreter-ffi.
-
-use loot_condition_interpreter::Error;
-use std::ffi::c_int;
-
-/// Something went wrong while parsing the condition expression.
-const LCI_ERROR_PARSING_ERROR: c_int = -2;
-
-/// Something went wrong while getting the version of an executable.
-const LCI_ERROR_PE_PARSING_ERROR: c_int = -3;
-
-/// Some sort of I/O error occurred.
-const LCI_ERROR_IO_ERROR: c_int = -4;
-
-/// The library encountered an error that should not have been possible to
-/// encounter.
-const LCI_ERROR_INTERNAL_LOGIC_ERROR: c_int = -8;
-
-// This constant is not copied from loot-condition-interpreter-ffi, but does not
-// conflict with any values defined there.
-pub(crate) const LCI_ERROR_UNKNOWN: c_int = c_int::MAX;
-
-#[must_use]
-pub(crate) fn map_error(err: &Error) -> c_int {
- match err {
- Error::ParsingIncomplete(_) | Error::UnconsumedInput(_) | Error::ParsingError(_, _) => {
- LCI_ERROR_PARSING_ERROR
- }
- Error::PeParsingError(_, _) => LCI_ERROR_PE_PARSING_ERROR,
- Error::IoError(_, _) => LCI_ERROR_IO_ERROR,
- _ => LCI_ERROR_INTERNAL_LOGIC_ERROR,
- }
-}
diff --git a/ffi-errors/src/lib.rs b/ffi-errors/src/lib.rs
index 8c074f20..52c7de3e 100644
--- a/ffi-errors/src/lib.rs
+++ b/ffi-errors/src/lib.rs
@@ -94,10 +94,9 @@
)]
use std::{error::Error, ffi::c_int};
-use libloot::error::{ConditionEvaluationError, LoadOrderError, PluginDataError};
+use libloot::error::{LoadOrderError, PluginDataError};
mod esplugin;
-mod lci;
mod libloadorder;
// It's important for API stability that these variants' values don't change.
@@ -107,7 +106,6 @@ mod libloadorder;
pub enum SystemErrorCategory {
Esplugin = 1,
Libloadorder = 2,
- LootConditionInterpreter = 3,
}
impl std::fmt::Display for SystemErrorCategory {
@@ -115,9 +113,6 @@ impl std::fmt::Display for SystemErrorCategory {
match self {
SystemErrorCategory::Esplugin => write!(f, "esplugin"),
SystemErrorCategory::Libloadorder => write!(f, "libloadorder"),
- SystemErrorCategory::LootConditionInterpreter => {
- write!(f, "loot-condition-interpreter")
- }
}
}
}
@@ -190,22 +185,6 @@ impl From for SystemError {
}
}
-impl From for SystemError {
- fn from(value: ConditionEvaluationError) -> Self {
- const LCI_ERROR_UNKNOWN: (i32, &str) = (
- lci::LCI_ERROR_UNKNOWN,
- "Could not retrieve loot-condition-interpreter error message",
- );
-
- from_error(
- value,
- SystemErrorCategory::LootConditionInterpreter,
- LCI_ERROR_UNKNOWN,
- crate::lci::map_error,
- )
- }
-}
-
fn from_error c_int>(
error: U,
category: SystemErrorCategory,
diff --git a/python/README.md b/python/README.md
index 5cb56c5a..b64f1bf3 100644
--- a/python/README.md
+++ b/python/README.md
@@ -47,5 +47,5 @@ python
- The Python exceptions that errors are mapped to are not the same as in the Rust or C++ interfaces:
- The API provides the custom `CyclicInteractionError`, `UndefinedGroupError`, `EspluginError` exception types.
- All other errors are raised as `ValueError` exceptions.
- - There's no equivalent to the C++ interface's `ConditionSyntaxError` class or the libloadorder and loot-condition-interpreter system error categories.
+ - There's no equivalent to the C++ interface's libloadorder system error category.
- The `LogLevel` enum and `set_logging_callback()` and `set_log_level()` functions are not exposed because the logging is integrated with Python's `logging` module instead.
diff --git a/python/src/error.rs b/python/src/error.rs
index aca857eb..05f4bf64 100644
--- a/python/src/error.rs
+++ b/python/src/error.rs
@@ -50,7 +50,6 @@ variant_box_from_error!(MetadataRetrievalError, VerboseError::Other);
impl From for VerboseError {
fn from(value: SortPluginsError) -> Self {
match value {
- SortPluginsError::MetadataRetrievalError(e) => e.into(),
SortPluginsError::UndefinedGroup(g) => Self::UndefinedGroupError(g),
SortPluginsError::CycleFound(cycle) => Self::CyclicInteractionError(cycle),
SortPluginsError::PluginDataError(e) => e.into(),