Oliver Hamlet
4db34be2c9
Upgrade to nom v5
...
Error handling has changed, affecting the error variants LCI exports,
and macros are replaced by functions, so all the parsing code has been rewritten.
2019-06-30 11:25:23 +01:00
Oliver Hamlet
cb19ec084a
Add coverage checking for Travis builds
2019-06-16 20:36:14 +01:00
Oliver Hamlet
44d73e0611
Apply clippy suggestions
2019-06-16 20:33:28 +01:00
Oliver Hamlet
611e4490d2
Replace deprecated libc::uint32_t with u32
2019-06-16 20:33:04 +01:00
Oliver Hamlet
2e05117b61
Update versions and changelog for v1.3.0
2019-04-07 12:25:40 +01:00
Oliver Hamlet
f039ba397f
Add GameType::Tes3 for Morrowind support
2019-04-07 12:20:10 +01:00
Oliver Hamlet
ea3a922ee7
Update versions and changelog for v1.2.2
2019-01-26 09:50:40 +00:00
Oliver Hamlet
53a5e22225
Fix functions with a regex parameter not parsing closing ')'
2019-01-26 09:46:41 +00:00
Oliver Hamlet
529e4fc6d1
Error if not all the input is consumed when parsing expressions
2019-01-26 09:44:33 +00:00
Oliver Hamlet
3777c067a4
Update versions and changelog for v1.2.1
2019-01-20 00:47:21 +00:00
Oliver Hamlet
8e116d2980
Fix parsing executables with non-US-English version info resources
...
pelite is hardcoded to only look for US English version info resources,
but executables may not have any, so just get the first version info
resource instead.
2019-01-20 00:38:32 +00:00
Oliver Hamlet
517b636743
Update versions and changelog for v1.2.0
2018-12-22 23:51:01 +00:00
Oliver Hamlet
9ef82fe886
Run rustfmt (Rust 1.31.1)
2018-12-22 22:50:16 +00:00
Oliver Hamlet
5e1ba5709b
Support parsing Script Extender product version fields
...
They've got a format that matches the format for fixed-size version fields in resource files.
2018-12-22 22:50:16 +00:00
Oliver Hamlet
c90814a8ab
Read product version from string field
...
File Explorer displays the ProductVersion version string field, not the fixed-size product version field, so read from it so that LOOT's behaviour matches.
2018-12-22 22:50:16 +00:00
Oliver Hamlet
31d870df9c
Add tests parsing conditions that caused problems
2018-12-22 22:50:15 +00:00
Oliver Hamlet
4f1b1c0bf0
Update versions and changelog for 1.1.1
2018-11-14 21:17:59 +00:00
Oliver Hamlet
3007a9e090
Fix parsing error if parentheses are padded with whitespace
2018-11-14 20:51:02 +00:00
Oliver Hamlet
579ba2969a
Fix backslashes not allowed in paths that can't be regexes
2018-11-14 20:51:02 +00:00
Oliver Hamlet
26bbda4925
Fix parsing of greater/less-than-or-equal-to parameters
2018-11-14 20:18:28 +00:00
Oliver Hamlet and GitHub
84c46ebe79
Note the supported metadata syntax version
2018-11-07 18:58:35 +00:00
Oliver Hamlet and GitHub
1e20451e73
Update README.md
2018-11-06 14:13:37 +00:00
Oliver Hamlet
a600083cc9
Apply clippy suggestions
2018-10-25 18:34:00 +01:00
Oliver Hamlet
80676f72b4
Update versions and changelog for 1.1.0
2018-10-23 21:12:41 +01:00
Oliver Hamlet
0c0e8a6639
Add support for product_version() conditions
...
This checks the product version field of executables instead of their
file version field.
2018-10-23 21:12:40 +01:00
Oliver Hamlet
07737cebe8
Add ability to read executable product version field
2018-10-23 21:12:40 +01:00
Oliver Hamlet
5512581c0f
Move test resources into subdirectory
2018-10-23 21:12:40 +01:00
Oliver Hamlet
b6a9066eaa
Update readme
2018-10-21 14:42:50 +01:00
Oliver Hamlet
c0bea60673
Add FFI wrapper crate
2018-10-20 21:13:33 +01:00
Oliver Hamlet
0f805d80ea
Allow condition cache to be cleared
2018-10-20 21:12:55 +01:00
Oliver Hamlet
efe01a060d
Don't try to read executable versions for plugins with no stored version
2018-10-20 21:12:54 +01:00
Oliver Hamlet
d6d968c7b5
Update readme
2018-10-07 10:52:09 +01:00
Oliver Hamlet
180b728728
Improve parsing error messages
...
Nom's custom error type handling isn't great, requiring a lot of
fix_error! macro calls, and even then the complete! macro hardcodes the
error type it expects as u32, so it can't be used and instead the
CompleteStr type needs to be used everywhere.
2018-10-07 10:45:24 +01:00
Oliver Hamlet
d28c194c9d
Add typedef to abstract away custom parsing error type
2018-10-07 10:45:24 +01:00
Oliver Hamlet
10d078b843
Improve content of I/O and PE parsing errors
2018-10-07 10:45:24 +01:00
Oliver Hamlet
2bb3d8b26f
Take advantage of match ergonomics
2018-10-06 16:26:18 +01:00
Oliver Hamlet
d3f4169d76
Update readme
2018-10-06 16:04:57 +01:00
Oliver Hamlet
04a92f9968
Implement the Error trait on the Error enum
2018-10-06 16:04:57 +01:00
Oliver Hamlet
594c8d19af
Don't expose third-party dependencies in API
...
Also implement FromStr on Expression instead of the parse() function.
2018-10-06 15:08:26 +01:00
Oliver Hamlet
48ec04a95f
Only cache some function results
...
Some functions evaluate more quickly without caching than with caching,
because they use data that is cached in a separate read-only cache
that's faster to check, and don't do anything complex with that data.
2018-10-06 13:38:55 +01:00
Oliver Hamlet
f6f51e2ee6
Add benchmarks to help optimise result caching
2018-10-06 13:28:03 +01:00
Oliver Hamlet
3404924752
Cache Function evaluation results, and use cached results
2018-10-06 11:45:57 +01:00
Oliver Hamlet
11a92511c1
Update readme
2018-10-06 10:42:18 +01:00
Oliver Hamlet
2c8473435a
Implement Clone and Default traits on Expression and types it depends on
2018-10-06 10:39:17 +01:00
Oliver Hamlet
77c58c965f
Implement Display trait on Expression and all types it depends on
2018-10-06 10:36:39 +01:00
Oliver Hamlet
5d9441623a
Derive PartialEq, Eq for Expression, CompoundCondition and Condition
2018-10-06 10:29:50 +01:00
Oliver Hamlet
3bf009e579
Implement PartialEq, Eq for Function
2018-10-06 10:29:50 +01:00
Oliver Hamlet
9f6e941955
Add Travis and AppVeyor config
2018-10-05 20:30:50 +01:00
Oliver Hamlet
ce85be1201
Add MIT license
2018-10-05 20:21:14 +01:00
Oliver Hamlet
360058725a
Update readme
2018-10-05 19:54:12 +01:00
Oliver Hamlet
be313c40cb
Support reading file version from Windows executables
2018-10-05 19:52:51 +01:00
Oliver Hamlet
2def44d3aa
Rename release_numbers field to release_ids
...
It's more accurate as they can be non-numeric.
2018-10-05 17:13:31 +01:00
Oliver Hamlet
a3f8d1423c
Pad release numbers to equal length when comparing
2018-10-05 17:13:31 +01:00
Oliver Hamlet
ab2726d5be
Fix a few incorrect test assertions
2018-10-05 17:13:31 +01:00
Oliver Hamlet
3b1f3592b3
Support extended version identifier separators
...
Space, colon and underscore should separate release and pre-release identifiers.
2018-10-05 17:13:31 +01:00
Oliver Hamlet
45ab848c1f
Add tests for non-semver version string comparisons
...
Almost at parity with pseudosem, only identifier padding and extended
separators to go.
2018-10-05 17:13:30 +01:00
Oliver Hamlet
98291fdc23
Implement semver version string comparison
2018-10-05 17:13:30 +01:00
Oliver Hamlet
8cb69dfa86
Add lexicographical evaluation of version conditions
...
Versions aren't yet read from executables, and evaluation isn't
pseudosem-compatible.
2018-10-05 17:12:38 +01:00
Oliver Hamlet
3acf2ffea1
Refactor game-specific code and add tests for it
2018-10-04 22:16:30 +01:00
Oliver Hamlet
107f61868c
Silence name warnings
2018-10-04 22:16:29 +01:00
Oliver Hamlet
3e1c2084e5
Add evaluation of checksum() conditions
2018-10-03 19:21:45 +01:00
Oliver Hamlet
2e57585787
Add evaluation of active() and many_active() conditions
2018-10-03 18:31:26 +01:00
Oliver Hamlet
8526ca5a83
Create case-insensitive regexes in tests
2018-10-03 18:30:11 +01:00
Oliver Hamlet
1d396911a5
Fix formatting
2018-10-03 18:21:07 +01:00
Oliver Hamlet
1881348db3
Create Regex objects to match case insensitively
2018-10-03 18:17:35 +01:00
Oliver Hamlet
0db0930d31
Add evaluation of many() conditions
2018-10-03 17:15:35 +01:00
Oliver Hamlet
72be3f8172
Add evaulation of file regex conditions
2018-10-03 17:15:35 +01:00
Oliver Hamlet
291d7a7a69
Move check to see if path is in game directory to parsing time
2018-10-03 17:15:35 +01:00
Oliver Hamlet
fe7b0514fb
Split regex arguments that contain parent paths at parsing time
...
This will simplify evaluation and catches syntax errors earlier, and
matches the current LOOT implementation's parse-only behaviour more
closely, though that implementation also checks that the parent path is
valid regex, which is pointless.
2018-10-03 17:15:35 +01:00
Oliver Hamlet
b9448e2072
Implement file path function evaluation
2018-10-03 17:15:34 +01:00
Oliver Hamlet
11fef635d3
Split function parsing and evaluation code into separate files
2018-10-03 17:15:34 +01:00
Oliver Hamlet
28af316ecc
Add more test cases (unimplemented)
2018-10-03 17:15:34 +01:00
Oliver Hamlet
f51b06d25c
Add parsing of version and checksum conditions
2018-10-03 17:15:34 +01:00
Oliver Hamlet
abdc841c15
Add parsing of file regex, active regex, many and many_active functions
2018-10-03 17:15:34 +01:00
Oliver Hamlet
dfb41233bd
Update nom to v4 and regex to v1
2018-10-03 17:15:33 +01:00
Oliver Hamlet
53c632fd75
Refactoring, add active(file) function parsing
2018-10-03 17:15:33 +01:00
Oliver Hamlet
dbb1a4987a
Implement parsing for everything down to Function
2018-10-03 17:15:33 +01:00
Oliver Hamlet
b3435122dd
Initial commit of experimental LOOT condition parser
...
Some FilePath functionality is missing, not all tests pass, and parsing
is incorrect for all structs.
2018-10-03 17:15:33 +01:00