summaryrefslogtreecommitdiff
path: root/tools/mpy_ld.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-07-22 22:58:52 +1000
committerDamien George <damien@micropython.org>2025-07-24 12:48:18 +1000
commit7729e80fdddbd9f75cb350de70a84ed26cb601fd (patch)
treeed5f7327b25021e88970b4b3582aa7d21befd350 /tools/mpy_ld.py
parent6a4306a0df1e936954bfeff65297d74b9b0954e2 (diff)
all: Go back to using default ruff quote style.
Commit dc2fcfcc5511a371ff684f7d7772e7a7b479246d seems to have accidentally changed the ruff quote style to "preserve", instead of keeping it at the default which is "double". Put it back to the default and update relevant .py files with this rule. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tools/mpy_ld.py')
-rwxr-xr-xtools/mpy_ld.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py
index a600ec12c..af8450a84 100755
--- a/tools/mpy_ld.py
+++ b/tools/mpy_ld.py
@@ -1521,31 +1521,31 @@ def parse_linkerscript(source):
symbols = {}
LINE_REGEX = re.compile(
- r'^(?P<weak>PROVIDE\()?' # optional weak marker start
- r'(?P<symbol>[a-zA-Z_]\w*)' # symbol name
- r'=0x(?P<address>[\da-fA-F]{1,8})*' # symbol address
- r'(?(weak)\));$', # optional weak marker end and line terminator
+ r"^(?P<weak>PROVIDE\()?" # optional weak marker start
+ r"(?P<symbol>[a-zA-Z_]\w*)" # symbol name
+ r"=0x(?P<address>[\da-fA-F]{1,8})*" # symbol address
+ r"(?(weak)\));$", # optional weak marker end and line terminator
re.ASCII,
)
inside_comment = False
for line in (line.strip() for line in source.readlines()):
- if line.startswith('/*') and not inside_comment:
- if not line.endswith('*/'):
+ if line.startswith("/*") and not inside_comment:
+ if not line.endswith("*/"):
inside_comment = True
continue
if inside_comment:
- if line.endswith('*/'):
+ if line.endswith("*/"):
inside_comment = False
continue
- if line.startswith('//'):
+ if line.startswith("//"):
continue
- match = LINE_REGEX.match(''.join(line.split()))
+ match = LINE_REGEX.match("".join(line.split()))
if not match:
continue
tokens = match.groupdict()
- symbol = tokens['symbol']
- address = int(tokens['address'], 16)
+ symbol = tokens["symbol"]
+ address = int(tokens["address"], 16)
if symbol in symbols:
raise ValueError(f"Symbol {symbol} already defined")
symbols[symbol] = address