Commit 16ca3d6b authored by Randall Leeds's avatar Randall Leeds

Merge pull request #1055 from hypothesis/new-streamer-operators

New streamer operators
parents b2e3446c ee21d27b
class ClauseParser class ClauseParser
filter_fields : ['references', 'text', 'user', 'uri', 'id', 'tags', 'created', 'updated'] filter_fields : ['references', 'text', 'user', 'uri', 'id', 'tags', 'created', 'updated']
operators: ['=','=>', '>=', '<=', '=<', '>', '<', '[', '#', '^', '{'] operators: [
'#<=', '#>=', '#<', '#>', '#=',
'=>', '>=', '<=', '=<', '>', '<',
'[', '=~', '^', '{',
'='
]
operator_mapping: operator_mapping:
'=': 'equals' '=': 'equals'
'>': 'gt' '>': 'gt'
...@@ -10,9 +15,14 @@ class ClauseParser ...@@ -10,9 +15,14 @@ class ClauseParser
'=<': 'le' '=<': 'le'
'<=': 'le' '<=': 'le'
'[' : 'one_of' '[' : 'one_of'
'#' : 'matches' '=~' : 'matches'
'^' : 'first_of' '^' : 'first_of'
'{' : 'match_of' # one_of but not exact search '{' : 'match_of' # one_of but not exact search
'#=' : 'lene'
'#>' : 'leng'
'#>=' : 'lenge'
'#<' : 'lenl'
'#<=' : 'lenle'
insensitive_operator : 'i' insensitive_operator : 'i'
parse_clauses: (clauses) -> parse_clauses: (clauses) ->
...@@ -48,7 +58,7 @@ class ClauseParser ...@@ -48,7 +58,7 @@ class ClauseParser
for operator in @operators for operator in @operators
if (rest.indexOf operator) is 0 if (rest.indexOf operator) is 0
oper = @operator_mapping[operator] oper = @operator_mapping[operator]
if operator is '[' if operator is '[' or operator is '{'
value = rest[operator.length..].split ',' value = rest[operator.length..].split ','
else else
value = rest[operator.length..] value = rest[operator.length..]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment