Support nested parens in make-docfile args
* lib-src/make-docfile.c (scan_c_stream): Allow nested parens. E.g., ‘(Lisp_Object XXX (force))’ for the identifier ‘force’, where XXX is a macro. This is for future changes.
This commit is contained in:
@@ -1205,12 +1205,13 @@ scan_c_stream (FILE *infile)
|
||||
c = getc (infile);
|
||||
}
|
||||
/* Copy arguments into ARGBUF. */
|
||||
while (true)
|
||||
for (ptrdiff_t nested = 0; ; )
|
||||
{
|
||||
*p++ = c;
|
||||
if (argbuf + sizeof argbuf <= p)
|
||||
fatal ("argument buffer exhausted");
|
||||
if (c == ')')
|
||||
nested += (c == '(') - (c == ')');
|
||||
if (c == ')' && !nested)
|
||||
break;
|
||||
c = getc (infile);
|
||||
if (c < 0)
|
||||
|
||||
Reference in New Issue
Block a user