Remove redundant regex escapes

This commit is contained in:
Hugo van Kemenade 2022-04-10 18:17:20 +03:00
parent 13994d4b36
commit a9707e0a6f
2 changed files with 6 additions and 6 deletions

View File

@ -590,7 +590,7 @@ class PdfParser:
whitespace_mandatory whitespace_mandatory
+ rb"trailer" + rb"trailer"
+ whitespace_optional + whitespace_optional
+ rb"\<\<(.*\>\>)" + rb"<<(.*>>)"
+ newline + newline
+ rb"startxref" + rb"startxref"
+ newline + newline
@ -605,7 +605,7 @@ class PdfParser:
whitespace_optional whitespace_optional
+ rb"trailer" + rb"trailer"
+ whitespace_optional + whitespace_optional
+ rb"\<\<(.*?\>\>)" + rb"<<(.*?>>)"
+ newline + newline
+ rb"startxref" + rb"startxref"
+ newline + newline
@ -659,8 +659,8 @@ class PdfParser:
+ delimiter_or_ws + delimiter_or_ws
+ rb")" + rb")"
) )
re_dict_start = re.compile(whitespace_optional + rb"\<\<") re_dict_start = re.compile(whitespace_optional + rb"<<")
re_dict_end = re.compile(whitespace_optional + rb"\>\>" + whitespace_optional) re_dict_end = re.compile(whitespace_optional + rb">>" + whitespace_optional)
@classmethod @classmethod
def interpret_trailer(cls, trailer_data): def interpret_trailer(cls, trailer_data):
@ -719,7 +719,7 @@ class PdfParser:
re_array_start = re.compile(whitespace_optional + rb"\[") re_array_start = re.compile(whitespace_optional + rb"\[")
re_array_end = re.compile(whitespace_optional + rb"]") re_array_end = re.compile(whitespace_optional + rb"]")
re_string_hex = re.compile( re_string_hex = re.compile(
whitespace_optional + rb"\<(" + whitespace_or_hex + rb"*)\>" whitespace_optional + rb"<(" + whitespace_or_hex + rb"*)>"
) )
re_string_lit = re.compile(whitespace_optional + rb"\(") re_string_lit = re.compile(whitespace_optional + rb"\(")
re_indirect_reference = re.compile( re_indirect_reference = re.compile(

View File

@ -31,7 +31,7 @@ xbm_head = re.compile(
b"#define[ \t]+[^_]*_x_hot[ \t]+(?P<xhot>[0-9]+)[\r\n]+" b"#define[ \t]+[^_]*_x_hot[ \t]+(?P<xhot>[0-9]+)[\r\n]+"
b"#define[ \t]+[^_]*_y_hot[ \t]+(?P<yhot>[0-9]+)[\r\n]+" b"#define[ \t]+[^_]*_y_hot[ \t]+(?P<yhot>[0-9]+)[\r\n]+"
b")?" b")?"
b"[\\000-\\377]*_bits\\[\\]" rb"[\000-\377]*_bits\[]"
) )