Merge pull request #1398 from justvanrossum/regex-raw-strings

[ttLib] Use raw strings for regex patterns, fixes #1389.
This commit is contained in:
Just van Rossum 2018-12-05 12:58:42 +01:00 committed by GitHub
commit 93cb09316a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,7 @@ def bitRepr(value, bits):
return s
_mnemonicPat = re.compile("[A-Z][A-Z0-9]*$")
_mnemonicPat = re.compile(r"[A-Z][A-Z0-9]*$")
def _makeDict(instructionList):
opcodeDict = {}
@ -195,8 +195,8 @@ _whiteRE = re.compile(r"\s*")
_pushCountPat = re.compile(r"[A-Z][A-Z0-9]*\s*\[.*?\]\s*/\* ([0-9]+).*?\*/")
_indentRE = re.compile("^FDEF|IF|ELSE\[ \]\t.+")
_unindentRE = re.compile("^ELSE|ENDF|EIF\[ \]\t.+")
_indentRE = re.compile(r"^FDEF|IF|ELSE\[ \]\t.+")
_unindentRE = re.compile(r"^ELSE|ENDF|EIF\[ \]\t.+")
def _skipWhite(data, pos):
m = _whiteRE.match(data, pos)