Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
16ca3d6b
Commit
16ca3d6b
authored
Mar 10, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1055 from hypothesis/new-streamer-operators
New streamer operators
parents
b2e3446c
ee21d27b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
streamfilter.coffee
h/js/streamfilter.coffee
+13
-3
No files found.
h/js/streamfilter.coffee
View file @
16ca3d6b
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
..]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment