mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
PreValue -> Value
This commit is contained in:
parent
cc434ded89
commit
3f5ec4b737
@ -345,7 +345,7 @@ class Integer(_Component):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
class PreValue(_Component):
|
class Value(_Component):
|
||||||
"""
|
"""
|
||||||
A value component lead by an optional preamble.
|
A value component lead by an optional preamble.
|
||||||
"""
|
"""
|
||||||
|
@ -16,7 +16,7 @@ class Raw(base.CaselessLiteral):
|
|||||||
TOK = "r"
|
TOK = "r"
|
||||||
|
|
||||||
|
|
||||||
class Path(base.PreValue):
|
class Path(base.Value):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -24,11 +24,11 @@ class Code(base.Integer):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Reason(base.PreValue):
|
class Reason(base.Value):
|
||||||
preamble = "m"
|
preamble = "m"
|
||||||
|
|
||||||
|
|
||||||
class Body(base.PreValue):
|
class Body(base.Value):
|
||||||
preamble = "b"
|
preamble = "b"
|
||||||
|
|
||||||
|
|
||||||
@ -60,12 +60,12 @@ class Header(_HeaderMixin, base.KeyValue):
|
|||||||
preamble = "h"
|
preamble = "h"
|
||||||
|
|
||||||
|
|
||||||
class ShortcutContentType(_HeaderMixin, base.PreValue):
|
class ShortcutContentType(_HeaderMixin, base.Value):
|
||||||
preamble = "c"
|
preamble = "c"
|
||||||
key = base.TokValueLiteral("Content-Type")
|
key = base.TokValueLiteral("Content-Type")
|
||||||
|
|
||||||
|
|
||||||
class ShortcutLocation(_HeaderMixin, base.PreValue):
|
class ShortcutLocation(_HeaderMixin, base.Value):
|
||||||
preamble = "l"
|
preamble = "l"
|
||||||
key = base.TokValueLiteral("Location")
|
key = base.TokValueLiteral("Location")
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class WF(base.CaselessLiteral):
|
|||||||
TOK = "wf"
|
TOK = "wf"
|
||||||
|
|
||||||
|
|
||||||
class Body(base.PreValue):
|
class Body(base.Value):
|
||||||
preamble = "b"
|
preamble = "b"
|
||||||
|
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ class TestMisc:
|
|||||||
assert base.TokValue.parseString('"\'val\'"')[0].val == "'val'"
|
assert base.TokValue.parseString('"\'val\'"')[0].val == "'val'"
|
||||||
|
|
||||||
def test_prevalue(self):
|
def test_prevalue(self):
|
||||||
class TT(base.PreValue):
|
class TT(base.Value):
|
||||||
preamble = "m"
|
preamble = "m"
|
||||||
e = TT.expr()
|
e = TT.expr()
|
||||||
v = e.parseString("m'msg'")[0]
|
v = e.parseString("m'msg'")[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user