misra.py: Handle spaces in directive arguments (#2532)

This commit is contained in:
Georgy Komarov 2020-02-11 22:59:11 +03:00 committed by GitHub
parent 099dd57eb8
commit 403a61bc11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -841,11 +841,11 @@ class Define:
self.args = []
self.expansionList = ''
res = re.match(r'#define [A-Za-z0-9_]+\(([A-Za-z0-9_,]+)\)[ ]+(.*)', directive.str)
res = re.match(r'#define [A-Za-z0-9_]+\(([A-Za-z0-9_, ]+)\)[ ]+(.*)', directive.str)
if res is None:
return
self.args = res.group(1).split(',')
self.args = res.group(1).strip().split(',')
self.expansionList = res.group(2)
def __repr__(self):

View File

@ -986,6 +986,7 @@ union misra_19_2 { }; // 19.2
#define M_20_7_3(A) ((A)+A) // 20.7
#define M_20_7_4(A) x##A // 20.10 this test was written to see there are not FPs
#define M_20_7_5(A,B) f(A, B) // no warning
#define MUL(a ,b ) ( a * b ) // 20.7
#define M_20_10(a) (#a) // 20.10