##// END OF EJS Templates
cleanup: replace contiguous spaces in regex patterns with an explicit count...
Matt Harbison -
r44472:ac3cb5e0 default
parent child Browse files
Show More
@@ -331,9 +331,9 b' class fileheredocmatcher(embeddedmatcher'
331 )
331 )
332 self._fileres = [
332 self._fileres = [
333 # "cat > NAME << LIMIT" case
333 # "cat > NAME << LIMIT" case
334 re.compile(r' \$ \s*cat' + namepat + heredoclimitpat),
334 re.compile(r' {2}\$ \s*cat' + namepat + heredoclimitpat),
335 # "cat << LIMIT > NAME" case
335 # "cat << LIMIT > NAME" case
336 re.compile(r' \$ \s*cat' + heredoclimitpat + namepat),
336 re.compile(r' {2}\$ \s*cat' + heredoclimitpat + namepat),
337 ]
337 ]
338
338
339 def startsat(self, line):
339 def startsat(self, line):
@@ -426,7 +426,7 b' class pydoctestmatcher(embeddedmatcher):'
426 """
426 """
427
427
428 _prefix = ' >>> '
428 _prefix = ' >>> '
429 _prefixre = re.compile(r' (>>>|\.\.\.) ')
429 _prefixre = re.compile(r' {2}(>>>|\.\.\.) ')
430
430
431 # If a line matches against not _prefixre but _outputre, that line
431 # If a line matches against not _prefixre but _outputre, that line
432 # is "an expected output line" (= not a part of code fragment).
432 # is "an expected output line" (= not a part of code fragment).
@@ -436,7 +436,7 b' class pydoctestmatcher(embeddedmatcher):'
436 # run-tests.py. But "directive line inside inline python code"
436 # run-tests.py. But "directive line inside inline python code"
437 # should be rejected by Mercurial reviewers. Therefore, this
437 # should be rejected by Mercurial reviewers. Therefore, this
438 # regexp does not matche against such directive lines.
438 # regexp does not matche against such directive lines.
439 _outputre = re.compile(r' $| [^$]')
439 _outputre = re.compile(r' {2}$| {2}[^$]')
440
440
441 def __init__(self):
441 def __init__(self):
442 super(pydoctestmatcher, self).__init__("doctest style python code")
442 super(pydoctestmatcher, self).__init__("doctest style python code")
@@ -509,7 +509,7 b' class pyheredocmatcher(embeddedmatcher):'
509 _prefix = ' > '
509 _prefix = ' > '
510
510
511 _startre = re.compile(
511 _startre = re.compile(
512 r' \$ (\$PYTHON|"\$PYTHON"|python).*' + heredoclimitpat
512 r' {2}\$ (\$PYTHON|"\$PYTHON"|python).*' + heredoclimitpat
513 )
513 )
514
514
515 def __init__(self):
515 def __init__(self):
@@ -239,7 +239,7 b' class monotone_source(common.converter_s'
239 # key "test@selenic.com"
239 # key "test@selenic.com"
240 # mtn >= 0.45:
240 # mtn >= 0.45:
241 # key [ff58a7ffb771907c4ff68995eada1c4da068d328]
241 # key [ff58a7ffb771907c4ff68995eada1c4da068d328]
242 certlist = re.split(br'\n\n key ["\[]', certlist)
242 certlist = re.split(br'\n\n {6}key ["\[]', certlist)
243 for e in certlist:
243 for e in certlist:
244 m = self.cert_re.match(e)
244 m = self.cert_re.match(e)
245 if m:
245 if m:
General Comments 0
You need to be logged in to leave comments. Login now