mirror of
https://github.com/mnaberez/py65.git
synced 2024-06-14 13:29:28 +00:00
Fix regular expression warnings on Python 3.12
This commit is contained in:
parent
85ed46fd68
commit
8dce37f6b8
|
@ -5,6 +5,8 @@
|
|||
dropped when pasting in larger amounts of text. This makes it possible
|
||||
to paste programs into EhBASIC and Taliforth. Patch by SamCoVT.
|
||||
|
||||
- Fixed regular expression warnings on Python 3.12.
|
||||
|
||||
- The ``fill`` command in the monitor now shows an error message if an
|
||||
address or value is out of range.
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@ class Monitor(cmd.Cmd):
|
|||
line = command
|
||||
break
|
||||
|
||||
pattern = '^%s\s+' % re.escape(shortcut)
|
||||
pattern = r'^%s\s+' % re.escape(shortcut)
|
||||
matches = re.match(pattern, line)
|
||||
if matches:
|
||||
start, end = matches.span()
|
||||
|
@ -580,7 +580,7 @@ class Monitor(cmd.Cmd):
|
|||
if args == '':
|
||||
return
|
||||
|
||||
pairs = re.findall('([^=,\s]*)=([^=,\s]*)', args)
|
||||
pairs = re.findall(r'([^=,\s]*)=([^=,\s]*)', args)
|
||||
if pairs == []:
|
||||
return self._output("Syntax error: %s" % args)
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ class AddressParser(object):
|
|||
return self.labels[num]
|
||||
|
||||
else:
|
||||
matches = re.match('^([^\s+-]+)\s*([+\-])\s*([$+%]?\d+)$', num)
|
||||
matches = re.match(r'^([^\s+-]+)\s*([+\-])\s*([$+%]?\d+)$', num)
|
||||
if matches:
|
||||
label, sign, offset = matches.groups()
|
||||
|
||||
|
@ -88,7 +88,7 @@ class AddressParser(object):
|
|||
"""Parse a string containing an address or a range of addresses
|
||||
into a tuple of (start address, end address)
|
||||
"""
|
||||
matches = re.match('^([^:,]+)\s*[:,]+\s*([^:,]+)$', addresses)
|
||||
matches = re.match(r'^([^:,]+)\s*[:,]+\s*([^:,]+)$', addresses)
|
||||
if matches:
|
||||
start, end = map(self.number, matches.groups(0))
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user