Re: [PATCH 1/1] kernel-doc: Support arrays of pointers struct fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> writes:

>> Sigh ... seeing more indecipherable regexes added to kernel-doc is like
>> seeing another load of plastic bags dumped into the ocean...  it doesn't
>> change the basic situation, but it's still sad.
>> 
>> Oh well, applied, thanks.
>
> Thanks. I have to say I feel the same...
>
> Regexes aren't great for parsing C, that's for sure. :-I But what are the
> options? Write a proper parser for (a subset of) C?

Every now and then I've pondered on this a bit.  There are parsers out
there, of course; we could consider using something like tree-sitter.
There's just two little problems:

- That's a massive dependency to drag into the docs build that seems
  unlikely to speed things up.

- kernel-doc is really two parsers - one for C code, one for the
  comment syntax.  Strangely, nobody has written a grammar for this
  combination.

A suitably motivated developer could probably create a C+kerneldoc
grammer that would let us make a rock-solid, tree-sitter-based parser
that would be mostly maintained by somebody else.  But that doesn't get
us around the "adding a big dependency" problem.

<back to work now...>

jon




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux