From 5278e4b66d3261c8ff114bf4cd0e69307d1ffd5f Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 28 Nov 2012 15:09:36 -0600 Subject: Changed parser to split by ">=" and "<=" --- wqflask/wqflask/parser.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/parser.py b/wqflask/wqflask/parser.py index a94a8842..676efa1e 100644 --- a/wqflask/wqflask/parser.py +++ b/wqflask/wqflask/parser.py @@ -35,8 +35,8 @@ def parse(pstring): items = [] - separators = [re.escape(x) for x in (":", "=", "<", ">")] - separators = '([%s])' % ("".join(separators)) + separators = [re.escape(x) for x in ("<=", ">=", ":", "=", "<", ">")] + separators = '(%s)' % ("|".join(separators)) print("separators:", separators) @@ -69,6 +69,9 @@ if __name__ == '__main__': parse("foo=[3 2 1]") parse("WIKI=ho*") parse("LRS>9") + parse("LRS>=18") + parse("foo <= 2") + parse("cisLRS<20") parse("foo=[3 2 1)") parse("foo=(3 2 1)") parse("shh") -- cgit v1.2.3