[DTrace-devel] [PATCH] lexer: support // comments
Eugene Loh
eugene.loh at oracle.com
Wed Jul 23 14:04:39 UTC 2025
On 7/22/25 23:14, Kris Van Hees wrote:
> On Tue, Jul 22, 2025 at 09:18:16PM -0400, Eugene Loh wrote:
>> 3) Where do all the rules in this patch (tested by err.*) come from? E.g.,
>> C seems more lenient:
>>
>> $ cat x.c
>> // /* hello */
>> // comment /*
>> // comment //
>> int main(int c, char **v) {
>> /*
>> * //
>> */
>> return 0;
>> }
>> $ gcc x.c
>> $ echo $?
>> 0
> Yes, C is more lenient. I based the implementation on the behaviour of other
> DTrace implementations that added //-comments. I'd be open to making it more
> lenient as well - I hoestly didn't check out C's behaviour because the rules
> I observed for other DTrace implementations seemed to be quite consistent with
> what DTrace is doing with block comments (/* ... */).
Worth mentioning in the commit message?
More information about the DTrace-devel
mailing list