File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ def __init__(self):
210
210
# and the expansion in group 3.
211
211
_define_directive_re = re .compile (r'\s*#\s*define\s+(\w+)' +
212
212
r'(?:\s+|\((\w+)\)\s*)' +
213
- r'(.+)(?:/[*/])? ' )
213
+ r'(.+)' )
214
214
215
215
def read_line (self , line ):
216
216
"""Parse a C header line and record the PSA identifier it defines if any.
@@ -222,6 +222,7 @@ def read_line(self, line):
222
222
if not m :
223
223
return
224
224
name , parameter , expansion = m .groups ()
225
+ expansion = re .sub (r'/\*.*?\*/|//.*' , r' ' , expansion )
225
226
if name .endswith ('_FLAG' ) or name .endswith ('MASK' ):
226
227
# Macro only to build actual values
227
228
return
@@ -274,6 +275,9 @@ def read_line(self, line):
274
275
275
276
def read_file (self , header_file ):
276
277
for line in header_file :
278
+ while line .endswith ('\\ \n ' ):
279
+ cont = next (header_file )
280
+ line = line [:- 2 ] + cont
277
281
self .read_line (line )
278
282
279
283
@staticmethod
You can’t perform that action at this time.
0 commit comments