aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/filt/filt.peg
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-01-20 15:26:51 +0100
committerGitHub <noreply@github.com>2017-01-20 15:26:51 +0100
commit2ca48e5d0861e1c8ed679a9bb6464c19a5dabedf (patch)
tree440d6f2c9af2a0ff5aa878cc72a041f67f7d09ee /web/src/js/filt/filt.peg
parent9a88a2fdea727c6ab4c20926527ef8a4abae0f40 (diff)
parentbc8f5a2d712599f016a7a0fc46681206e0984cc9 (diff)
downloadmitmproxy-2ca48e5d0861e1c8ed679a9bb6464c19a5dabedf.tar.gz
mitmproxy-2ca48e5d0861e1c8ed679a9bb6464c19a5dabedf.tar.bz2
mitmproxy-2ca48e5d0861e1c8ed679a9bb6464c19a5dabedf.zip
Merge pull request #1940 from s4chin/add-marked-filter
web: Add ~marked filter
Diffstat (limited to 'web/src/js/filt/filt.peg')
-rw-r--r--web/src/js/filt/filt.peg15
1 files changed, 10 insertions, 5 deletions
diff --git a/web/src/js/filt/filt.peg b/web/src/js/filt/filt.peg
index ccaaa072..352b1337 100644
--- a/web/src/js/filt/filt.peg
+++ b/web/src/js/filt/filt.peg
@@ -117,6 +117,10 @@ function method(regex){
methodFilter.desc = "method matches " + regex;
return methodFilter;
}
+function markedFilter(flow){
+ return flow.marked;
+}
+markedFilter.desc = "is marked";
function noResponseFilter(flow){
return flow.request && !flow.response;
}
@@ -172,24 +176,24 @@ cc "control character" = [|&!()~"]
__ "optional whitespace" = ws*
OrExpr
- = first:AndExpr __ "|" __ second:OrExpr
+ = first:AndExpr __ "|" __ second:OrExpr
{ return or(first, second); }
/ AndExpr
AndExpr
- = first:NotExpr __ "&" __ second:AndExpr
+ = first:NotExpr __ "&" __ second:AndExpr
{ return and(first, second); }
- / first:NotExpr ws+ second:AndExpr
+ / first:NotExpr ws+ second:AndExpr
{ return and(first, second); }
/ NotExpr
NotExpr
- = "!" __ expr:NotExpr
+ = "!" __ expr:NotExpr
{ return not(expr); }
/ BindingExpr
BindingExpr
- = "(" __ expr:OrExpr __ ")"
+ = "(" __ expr:OrExpr __ ")"
{ return binding(expr); }
/ Expr
@@ -203,6 +207,7 @@ NullaryExpr
/ "~e" { return errorFilter; }
/ "~q" { return noResponseFilter; }
/ "~s" { return responseFilter; }
+ / "~marked" { return markedFilter; }
BooleanLiteral