From a5b3f072b42405235ddc128122ce057d4a17d524 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 29 May 2012 17:02:18 +0000 Subject: [PATCH] update query parser's prefix list --- hledger-lib/Hledger/Data/Query.hs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/hledger-lib/Hledger/Data/Query.hs b/hledger-lib/Hledger/Data/Query.hs index 9bb45188d..1a1f19fa6 100644 --- a/hledger-lib/Hledger/Data/Query.hs +++ b/hledger-lib/Hledger/Data/Query.hs @@ -132,13 +132,7 @@ tests_parseQuery = [ parseQuery d "\"" `is` (Acct "\"", []) ] --- keep synced with patterns below, excluding "not" -prefixes = map (++":") [ - "inacct","inacctonly", - "desc","acct","date","edate","status","real","empty","depth" - ] -defaultprefix = "acct" - +-- XXX -- | Quote-and-prefix-aware version of words - don't split on spaces which -- are inside quotes, including quotes which may have one of the specified -- prefixes in front, and maybe an additional not: prefix in front of that. @@ -172,6 +166,24 @@ tests_words'' = [ "\"" `gives` ["\""] ] +-- XXX +-- keep synced with patterns below, excluding "not" +prefixes = map (++":") [ + "inacctonly" + ,"inacct" + ,"desc" + ,"acct" + ,"date" + ,"edate" + ,"status" + ,"real" + ,"empty" + ,"depth" + ,"tag" + ] + +defaultprefix = "acct" + -- -- | Parse the query string as a boolean tree of match patterns. -- parseQueryTerm :: String -> Query -- parseQueryTerm s = either (const (Any)) id $ runParser query () "" $ lexmatcher s