From 58b55220b48e8a2356cf7a04858965a6f8fb50fc Mon Sep 17 00:00:00 2001 From: Matt <5638426+mattbruv@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:22:36 -0400 Subject: [PATCH] add multiline pragma support --- tools/inlineasm/helpers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/inlineasm/helpers.py b/tools/inlineasm/helpers.py index 5e296c6bd..be85311f0 100644 --- a/tools/inlineasm/helpers.py +++ b/tools/inlineasm/helpers.py @@ -1,17 +1,16 @@ import re -pragmaRegex = r"(#pragma\sGLOBAL_ASM\((.*)\))" +pragmaRegex = r"(#pragma\sGLOBAL_ASM\((.*?)\))" def getPragmaMatches(fileText): - matches = re.findall(pragmaRegex, fileText) + matches = re.findall(pragmaRegex, fileText, flags=re.DOTALL) return matches # Arguments are processed outside of the regex to keep it simple # and support any changes we may make in the future def getPragmaArgs(argString): args = argString.split(",") - args = map(str.strip, args) - args = map(lambda x: x.replace("\"", ""), args) + args = map(lambda s: s.split("\"")[1], args) return list(args) labelRegex = r".+:"