Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/43365 )

Change subject: util: Support anon structures in open brace verifier
......................................................................

util: Support anon structures in open brace verifier

Add support for anonymous structures in the open
brace verifier. This includes anonymous classes,
anonymous structs, anonymous enums and anonymous
unions.

This change also makes the verifier not trigger
error for structures that do not currently abide
to gem5's coding style and use non-uppercase
characters as their first character.

Change-Id: I8f0536dcc2c164e2d3d2a2e5b7a35d5ee351a814
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M util/style/verifiers.py
1 file changed, 4 insertions(+), 1 deletion(-)



diff --git a/util/style/verifiers.py b/util/style/verifiers.py
index c5beb02..8010f9e 100644
--- a/util/style/verifiers.py
+++ b/util/style/verifiers.py
@@ -470,7 +470,10 @@
     test_name = 'class opening brace position'
     opt_name = 'classbrace'

- regex = re.compile(r'\A(\s*)((class|struct|enum| union)\s+[A-Z].*\S)\s*\{')
+    # Matches a line that starts with optional spaces, followed by the
+    # structure's keyword, followed by any character and ending in an
+    # opening brace
+    regex = re.compile(r'\A(\s*)((class|struct|enum|union)[^\{]*)\{')

     def check_line(self, line, **kwargs):
         return self.regex.search(line) == None

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/43365
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8f0536dcc2c164e2d3d2a2e5b7a35d5ee351a814
Gerrit-Change-Number: 43365
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to