summaryrefslogtreecommitdiffstats
path: root/Lib/email/_header_value_parser.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-03-26 00:11:54 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-03-26 00:11:54 (GMT)
commit765531d2d083c7a4e9478fcd960eebe04ac6b192 (patch)
tree5bbaa431016613dcbe05081e2ab29aed2f36fd6a /Lib/email/_header_value_parser.py
parent1f8898a5916b942c86ee8716c37d2db388e7bf2f (diff)
downloadcpython-765531d2d083c7a4e9478fcd960eebe04ac6b192.zip
cpython-765531d2d083c7a4e9478fcd960eebe04ac6b192.tar.gz
cpython-765531d2d083c7a4e9478fcd960eebe04ac6b192.tar.bz2
Issue #17516: use comment syntax for comments, instead of multiline string
Diffstat (limited to 'Lib/email/_header_value_parser.py')
-rw-r--r--Lib/email/_header_value_parser.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py
index 1928505..eb31558 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -1317,24 +1317,22 @@ RouteComponentMarker = ValueTerminal('@', 'route-component-marker')
# Parser
#
-"""Parse strings according to RFC822/2047/2822/5322 rules.
-
-This is a stateless parser. Each get_XXX function accepts a string and
-returns either a Terminal or a TokenList representing the RFC object named
-by the method and a string containing the remaining unparsed characters
-from the input. Thus a parser method consumes the next syntactic construct
-of a given type and returns a token representing the construct plus the
-unparsed remainder of the input string.
-
-For example, if the first element of a structured header is a 'phrase',
-then:
-
- phrase, value = get_phrase(value)
-
-returns the complete phrase from the start of the string value, plus any
-characters left in the string after the phrase is removed.
-
-"""
+# Parse strings according to RFC822/2047/2822/5322 rules.
+#
+# This is a stateless parser. Each get_XXX function accepts a string and
+# returns either a Terminal or a TokenList representing the RFC object named
+# by the method and a string containing the remaining unparsed characters
+# from the input. Thus a parser method consumes the next syntactic construct
+# of a given type and returns a token representing the construct plus the
+# unparsed remainder of the input string.
+#
+# For example, if the first element of a structured header is a 'phrase',
+# then:
+#
+# phrase, value = get_phrase(value)
+#
+# returns the complete phrase from the start of the string value, plus any
+# characters left in the string after the phrase is removed.
_wsp_splitter = re.compile(r'([{}]+)'.format(''.join(WSP))).split
_non_atom_end_matcher = re.compile(r"[^{}]+".format(