summaryrefslogtreecommitdiff
path: root/Utility/Matcher.hs
Commit message (Collapse)AuthorAge
* fix handling of Not in the matcherGravatar Joey Hess2013-05-25
|
* Fix bug in parsing of parens in some preferred content expressions. This ↵Gravatar Joey Hess2013-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes the behavior of the manual mode group. The current manual mode preferred content expression is: "present and (((exclude=*/archive/* and exclude=archive/*) or (not (copies=archive:1 or copies=smallarchive:1))) or (not copies=semitrusted+:1))" The old matcher misparsed this, to basically: OR (present and (...)) (not copies=semitrusted+:1)) The paren handling and indeed the whole conversion from tokens to the matcher was just wrong. The new way may not be the cleverest, but I think it is correct, and you can see how it pattern matches structurally against the expressions when parsing them. That expression is now parsed to: MAnd (MOp <function>) (MOr (MOr (MAnd (MOp <function>) (MOp <function>)) (MNot (MOr (MOp <function>) (MOp <function>)))) (MNot (MOp <function>))) Which appears correct, and behaves correct in testing. Also threw in a simplifier, so the final generated Matcher has less unnecessary clutter in it. Mostly so that I could more easily read & confirm them. Also, added a simple test of the Matcher to the test suite. There is a small chance of badly formed preferred content expressions behaving differently than before due to this rewrite.
* finished where indentation changesGravatar Joey Hess2012-12-13
|
* --auto fixesGravatar Joey Hess2012-12-06
| | | | | | | * get/copy --auto: Transfer data even if it would exceed numcopies, when preferred content settings want it. * drop --auto: Fix dropping content when there are no preferred content settings.
* avoid duplicate code with a more generic monadic matcherGravatar Joey Hess2012-10-13
| | | | | Interesting type signature ghc derived for this: forall o (m :: * -> *). Monad m => Matcher o -> (o -> m Bool) -> m Bool
* wired preferred content up to get, copy, and drop --autoGravatar Joey Hess2012-10-08
|
* added preferred-content log, and allow editing it with vicfgGravatar Joey Hess2012-10-04
| | | | | | | | | | | | | | This includes a full parser for the boolean expressions in the log, that compiles them into Matchers. Those matchers are not used yet. A complication is that matching against an expression should never crash git-annex with an error. Instead, vicfg checks that the expressions parse. If a bad expression (or an expression understood by some future git-annex version) gets into the log, it'll be ignored. Most of the code in Limit couldn't fail anyway, but I did have to make limitCopies check its parameter first, and return an error if it's bad, rather than erroring at runtime.
* fun with symbolsGravatar Joey Hess2012-03-17
| | | | | | Nothing at all on hackage is using <&&> or <||>. (Also, <&&> should short-circuit on failure.)
* optimize monadic ||Gravatar Joey Hess2012-03-16
| | | | | (||) used applicative style runs both conditions rather than short circuiting. Add an orM that properly short-circuits.
* go go gadget hlintGravatar Joey Hess2011-09-20
|
* simplifyGravatar Joey Hess2011-09-20
|
* convert Token to have separate constructors for each peice of syntaxGravatar Joey Hess2011-09-20
|
* golfing with curryGravatar Joey Hess2011-09-18
|
* probably better to error on unknown tokenGravatar Joey Hess2011-09-18
|
* make find show files meeting limits, even when not presentGravatar Joey Hess2011-09-18
| | | | | | | | | find: Rather than only showing files whose contents are present, when used with --exclude --copies or --in, displays all files that match the specified conditions. Note that this is a behavior change for find --exclude! Old behavior can be gotten with find --in . --exclude=...
* add a value to match against to match and matchMGravatar Joey Hess2011-09-18
|
* move to UtilityGravatar Joey Hess2011-09-18