Commit Graph
38 Commits
Author SHA1 Message Date
Oliver Hamlet 1a8fb00e5b Add support for "not (<expression>)" syntax
Following a discussion on Discord where their absence lead to combining
not-function conditions and truth tables. It's just easier to invert a
whole expression.
2021-02-13 12:12:44 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ebae951eae Update nom requirement from 5.0.0 to 6.0.0 (#6)
Updates the requirements on [nom](https://github.com/Geal/nom) to permit the latest version.
- [Release notes](https://github.com/Geal/nom/releases)
- [Changelog](https://github.com/Geal/nom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Geal/nom/compare/5.0.0...6.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-02 18:51:39 +00:00
Oliver Hamlet b9d5d57dac Fix regex conditions returning true for partial matches
The regex engine implicitly adds .*? to the beginning and end of
expressions, so add ^ and $ to input expressions.
2019-07-23 19:04:22 +01:00
Oliver Hamlet 52792626af Update to Rust 2018 syntax 2019-06-30 11:25:23 +01:00
Oliver Hamlet 6cfefc6c31 Rename GameType variants to use fewer acronyms
A minor quality of life improvement since the nom 5 update is a
breaking change.
2019-06-30 11:25:23 +01:00
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 44d73e0611 Apply clippy suggestions 2019-06-16 20:33:28 +01:00
Oliver Hamlet f039ba397f Add GameType::Tes3 for Morrowind support 2019-04-07 12:20:10 +01: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 9ef82fe886 Run rustfmt (Rust 1.31.1) 2018-12-22 22:50:16 +00:00
Oliver Hamlet 3007a9e090 Fix parsing error if parentheses are padded with whitespace 2018-11-14 20:51:02 +00:00
Oliver Hamlet a600083cc9 Apply clippy suggestions 2018-10-25 18:34:00 +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 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 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 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 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