matching preferred content before key is known
This will let import try to match preferred content expressions before downloading the content and generating its key. If an expression needs a key, it preferredContentParser with preferredContentKeylessTokens will fail to parse it. standard and groupwanted are not in preferredContentKeylessTokens because they may refer to an expression that refers to a key. That needs further work to support them.
This commit is contained in:
parent
aa7710982b
commit
9411a7c93c
5 changed files with 97 additions and 43 deletions
|
@ -76,8 +76,15 @@ seek :: MatchExpressionOptions -> CommandSeek
|
|||
seek o = do
|
||||
parser <- if largeFilesExpression o
|
||||
then mkLargeFilesParser
|
||||
else preferredContentParser
|
||||
matchAll matchAll groupMap M.empty . Just <$> getUUID
|
||||
else do
|
||||
u <- getUUID
|
||||
pure $ preferredContentParser $ preferredContentTokens $ PCD
|
||||
{ matchStandard = matchAll
|
||||
, matchGroupWanted = matchAll
|
||||
, getGroupMap = groupMap
|
||||
, configMap = M.empty
|
||||
, repoUUID = Just u
|
||||
}
|
||||
case parsedToMatcher $ parser ((matchexpr o)) of
|
||||
Left e -> liftIO $ bail $ "bad expression: " ++ e
|
||||
Right matcher -> ifM (checkmatcher matcher)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue