Since Python 3.6, unrecognized escape sequences produce a DeprecationWarning.
Since Python 3.12, unrecognized escape sequences produce a SyntaxWarning.
In a future Python version they will be eventually a SyntaxError.
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
Fix these by using raw string literals.
disasm = disasm.decode('utf-8', 'replace')
- instpat = re.compile('\s*([0-9a-fA-F]+):\t+([0-9a-fA-F ]+)\t+([a-zA-Z][^;]+)\s*;?.*')
- branchpat = re.compile('(b|bl|b..|bl..|cbnz|cbz)(?:\.[wn])?\s+(?:r[0-9]+,\s*)?([0-9a-fA-F]+)')
- filepat = re.compile('[^\s]+[/\\\\]([a-zA-Z0-9._-]+:[0-9]+)(?:\s.*)?')
- funcpat = re.compile('[0-9a-fA-F]+\s*<([^>]+)>:.*')
+ instpat = re.compile(r'\s*([0-9a-fA-F]+):\t+([0-9a-fA-F ]+)\t+([a-zA-Z][^;]+)\s*;?.*')
+ branchpat = re.compile(r'(b|bl|b..|bl..|cbnz|cbz)(?:\.[wn])?\s+(?:r[0-9]+,\s*)?([0-9a-fA-F]+)')
+ filepat = re.compile(r'[^\s]+[/\\\\]([a-zA-Z0-9._-]+:[0-9]+)(?:\s.*)?')
+ funcpat = re.compile(r'[0-9a-fA-F]+\s*<([^>]+)>:.*')
prev_src = ''
prev_file = ''
disasm = disasm.decode('utf-8', 'replace')
- instpat = re.compile('\s*([0-9a-fA-F]+):\t+([0-9a-fA-F ]+)\t+([a-zA-Z][^;]+)\s*;?.*')
- filepat = re.compile('[^\s]+[/\\\\]([a-zA-Z0-9._-]+:[0-9]+)(?:\s.*)?')
- funcpat = re.compile('[0-9a-fA-F]+\s*<([^>]+)>:.*')
+ instpat = re.compile(r'\s*([0-9a-fA-F]+):\t+([0-9a-fA-F ]+)\t+([a-zA-Z][^;]+)\s*;?.*')
+ filepat = re.compile(r'[^\s]+[/\\\\]([a-zA-Z0-9._-]+:[0-9]+)(?:\s.*)?')
+ funcpat = re.compile(r'[0-9a-fA-F]+\s*<([^>]+)>:.*')
prev_file = ''
prev_func = ''
def regs_and_bits():
l = [('reg_' + r.lower(), r + ' register') for r in regs]
- l += [('bit_' + re.sub('\/| ', '_', b).lower(), b + ' bit') for b in bits]
+ l += [('bit_' + re.sub(r'\/| ', '_', b).lower(), b + ' bit') for b in bits]
return tuple(l)
a = ['REG_' + r.upper() for r in regs] + \
- ['BIT_' + re.sub('\/| ', '_', b).upper() for b in bits] + \
+ ['BIT_' + re.sub(r'\/| ', '_', b).upper() for b in bits] + \
['READ_DATE_TIME', 'WRITE_DATE_TIME', 'READ_REG', 'WRITE_REG', 'WARNING']
Ann = SrdIntEnum.from_list('Ann', a)
L = len(cmds)
-a = [re.sub('\/', '_', c[0]).replace('2READ', 'READ2X') for c in cmds.values()] + ['BIT', 'FIELD', 'WARN']
+a = [re.sub(r'\/', '_', c[0]).replace('2READ', 'READ2X') for c in cmds.values()] + ['BIT', 'FIELD', 'WARN']
Ann = SrdIntEnum.from_list('Ann', a)
def cmd_annotation_classes():