Skip to content

Commit

Permalink
tools/gdb: fix checkpatch warning
Browse files Browse the repository at this point in the history
Use Python raw strings to avoid escaping:
SyntaxWarning: invalid escape sequence '\?'

Signed-off-by: yinshengkai <[email protected]>
  • Loading branch information
Gary-Hobson authored and xiaoxiang781216 committed Nov 25, 2024
1 parent 24add5e commit 7aa2dc2
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions tools/gdb/nuttxgdb/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,60 +45,60 @@
from os import path

PUNCTUATORS = [
"\[",
"\]",
"\(",
"\)",
"\{",
"\}",
"\?",
";",
",",
"~",
"\.\.\.",
"\.",
"\-\>",
"\-\-",
"\-\=",
"\-",
"\+\+",
"\+\=",
"\+",
"\*\=",
"\*",
"\!\=",
"\!",
"\&\&",
"\&\=",
"\&",
"\/\=",
"\/",
"\%\>",
"%:%:",
"%:",
"%=",
"%",
"\^\=",
"\^",
"\#\#",
"\#",
"\:\>",
"\:",
"\|\|",
"\|\=",
"\|",
"<<=",
"<<",
"<=",
"<:",
"<%",
"<",
">>=",
">>",
">=",
">",
"\=\=",
"\=",
r"\[",
r"\]",
r"\(",
r"\)",
r"\{",
r"\}",
r"\?",
r";",
r",",
r"~",
r"\.\.\.",
r"\.",
r"\-\>",
r"\-\-",
r"\-\=",
r"\-",
r"\+\+",
r"\+\=",
r"\+",
r"\*\=",
r"\*",
r"\!\=",
r"\!",
r"\&\&",
r"\&\=",
r"\&",
r"\/\=",
r"\/",
r"\%\>",
r"%:%:",
r"%:",
r"%=",
r"%",
r"\^\=",
r"\^",
r"\#\#",
r"\#",
r"\:\>",
r"\:",
r"\|\|",
r"\|\=",
r"\|",
r"<<=",
r"<<",
r"<=",
r"<:",
r"<%",
r"<",
r">>=",
r">>",
r">=",
r">",
r"\=\=",
r"\=",
]


Expand Down Expand Up @@ -134,7 +134,7 @@ def fetch_macro_info(file):
hash = hashlib.md5(f.read()).hexdigest()

macros = {}
p = re.compile(".*macro[ ]*:[ ]*([\S]+\(.*?\)|[\w]+)[ ]*(.*)")
p = re.compile(r".*macro[ ]*:[ ]*([\S]+\(.*?\)|[\w]+)[ ]*(.*)")
cache = path.join(path.dirname(path.abspath(file)), f"{hash}.json")
print(f"Load macro: {cache}")
if not path.isfile(cache):
Expand Down

0 comments on commit 7aa2dc2

Please sign in to comment.