54 Commits
Author SHA1 Message Date
Oliver Hamlet f14e47e0e8 Switch to the regress crate for regex
It uses about 56 MB less memory when LOOT launches into my Skyrim SE
large test load order with the latest masterlist and prelude, and
explicitly targets ECMAScript-like syntax like C++ std::regex does,
though supports newer functionality.

Compared to fancy-regex's syntax support, regress adds support for the
\0 nul character escape and removes support for:

- modifiers (e.g. `(?i)`)
- some Unicode character classes (e.g. used with `\p{}` and `\P{}`)
- the ASCII/POSIX character classes (e.g. `[:alpha:]`)
- various character escapes, including \A \a \z \b{start} \<
  \b{end} \> \b{start-half} \b{end-half}
- (?P<name>exp) named capture groups

However, since regress's v flag requires more characters to be escaped
inside character classes than fancy-regex's Unicode support requires,
it's not used, so that further restricts the supported Unicode character
classes, and means that character class intersection, union and
subtraction syntaxes aren't supported.

The nul character escape is irrelevant for filename matching as it's not
allowed in Windows or Linux filenames.

Compared to C++ std::regex, the new restrictions are:

- the lack of support for ASCII/POSIX character classes
- the lack of support for control character escapes (e.g. `\cX`)

The lack of support for control character escapes is irrelevant as
control characters aren't allowed in Windows filenames.

A search of the masterlists doesn't find any use of the ASCII character
classes, and it's very unlikely that any user metadata would use them.
If such syntax is in use, it'll cause an error.
2025-07-29 18:25:40 +01:00
Oliver Hamlet efd2d43ae3 Update plugin name regex doc
fancy-regex supports more syntax than C++ std::regex, but for the syntax
that they both accept:

- std::regex matches . against a single character, fancy-regex matches
  it against a Unicode codepoint
- \w \W \d \D \s \S \b and \B are locale-dependent in std::regex but
  Unicode-aware and locale-independent in fancy-regex
- case-insensitive comparisons are locale-dependent in std::regex but
  are Unicode-aware and locale-independent in fancy-regex
- std::regex supports \0 and \cX escapes, where X is in [A-Za-z] but
  fancy-regex does not. This is not significant for libloot's usage as
  nul and control characters are not allowed in Windows filenames.
- std::regex treats \< and \> as < and > respectively, but fancy-regex
  treats them as start- and end-of-word boundary assertions
  respectively. This is not significant for libloot's usage as they are
  not allowed in Windows filenames.
- std::regex allows a literal [ to appear within a character class, but
  fancy-regex requires it to be escaped.

These differences are unlikely to cause any issues.
2025-07-29 17:56:31 +01:00
Oliver Hamlet bee0f36d7b Improve docs for language values 2025-06-11 17:34:56 +01:00
Oliver Hamlet 7bbf55cbb7 Update changelogs and version for 0.26.0 2025-04-19 21:58:39 +01:00
Oliver Hamlet 61eeb7ef85 Update metadata conditions docs 2025-04-19 21:58:39 +01:00
Oliver Hamlet 575e6d5c93 Add support for "constraint" in File metadata 2025-04-07 08:24:27 +01:00
Oliver Hamlet 84c0cca534 Implement support for OpenMW
Most of the complexity is handled by libloadorder, but it's worth noting that:

- The game path is OpenMW's install path, not Morrowind's
- OpenMW doesn't force master-flagged plugins to load before others
- OpenMW doesn't provide a way to record the load order of inactive plugins
- .omwgame and .omwaddon plugins are equivalent to .esm and .esp respectively, while .omwscripts plugins have a completely different format with none of the metadata that libloot uses.
- OpenMW effectively relies on additional data paths to load Morrowind's (and mods') files, and the last directory listed that contains a given filename is used to load a file with that filename, with the main data path effectively being the first listed.
- I've disabled support for ghosted plugins for OpenMW because it makes the multi-path stuff more confusing and may not provide any benefit.
2025-02-01 21:36:03 +00:00
Oliver Hamlet 0a7efcb4d3 Update version and changelogs for v0.21 release 2023-08-30 19:57:06 +01:00
Oliver HamletandOliver Hamlet dc95b18805 Replace use of Boost Format with fmt
Using the version of fmt that's bundled with spdlog.

This breaks compatibility with existing metadata messages that use
substitutions, as the placeholder syntax has changed. The new syntax is
compatible with C++20's std::format.
2023-08-29 21:32:52 +01:00
Oliver Hamlet 2141576a5a Update loot-condition-interpreter to v3.0.0 2023-08-18 18:40:13 +01:00
sibir f4236037e4 Remove notes on not operator & expressions
No longer true as of v0.17 of metadata syntax.
2022-11-16 00:25:07 -08:00
Oliver Hamlet 632b85ce78 Update version and changelogs for v0.18.0 release 2022-02-27 10:20:29 +00:00
Oliver Hamlet 874a3d86b5 Add support for the readable() condition function
Also clarify the behaviour of version functions when the no version is
read.
2022-02-27 10:07:26 +00:00
Oliver Hamlet 5589dfbf4c Replace references to GitHub Flavored Markdown with CommonMark
LOOT now uses Qt's support for Markdown, but its support for GFM is
bugged so LOOT uses CommonMark instead. The practical impact is very
minor, but reflect the difference in libloot's docs.
2022-02-06 17:45:08 +00:00
Oliver Hamlet 938e805816 Improve docs for version comparison conditions
Be explicit about how libloot's behaviour differs from SemVer, and add
examples.
2022-02-04 16:50:44 +00:00
Oliver Hamlet fa3c4d5fef Add missing docs about not-expression condition syntax 2022-01-11 19:58:52 +00:00
sibir-ine 720170509a Update Localised Content page
* Add Ukrainian to list of example languages (l10n added in v0.17.0).
2022-01-07 02:22:40 -08:00
Oliver Hamlet e8414a12cf Update version and changelog for v0.17.0 release 2021-09-24 22:04:22 +01:00
Oliver Hamlet 5ce0df0f03 Add support for masterlist prelude files
This allows common metadata to be shared across masterlists in a
'prelude' YAML file that is then injected into a masterlist when it is
loaded. Masterlist metadata can then reference anchors within the
prelude to make use of those common metadata.

The prelude file will be version controlled in a separate Git
repository, so the masterlist update functions also apply to managing
its versioning.
2021-09-23 13:31:34 +01:00
Oliver Hamlet caee647d86 Clarify that the "LOOT" condition file path may not exist
If the condition is being evaluated by an application other than LOOT.
2021-05-22 19:26:30 +01:00
Oliver Hamlet a9a71998f1 Rename the 'info' property in cleaning data objects to 'detail'
To be consistent with the new property in File objects, as they share
the same type and sematics.
2021-05-22 19:26:29 +01:00
Oliver Hamlet fc22d3d7a4 Add a "detail" property to File objects
This property can be used to provide detail about a requirement or
incompatibility that can be displayed in the error message displayed
for the file (if one is displayed).
2021-05-22 19:26:29 +01:00
sibir-ine 3b7694fc07 Update example in Examples
* LOOT currently displays type of notification by background color, not explicitly.
* Provided a manual translation of the example text, courtesy of a friend.
2021-04-09 04:46:34 -07:00
sibir-ine 06ce61de88 Update explanation in Language Support
* Explain new implementation of close matches.
* Wrapped lines at 80 characters.
2021-04-09 04:46:30 -07:00
Oliver Hamlet 0eace4b404 Updated example list of language codes
Fixes #78.
2021-04-03 13:32:49 +01:00