[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Nested comments
From: |
Hans Aberg |
Subject: |
Re: Nested comments |
Date: |
Thu, 3 Jul 2003 00:29:49 +0200 |
At 14:30 -0400 2003/07/02, address@hidden wrote:
>>I implemented nested [* ... *] comments by the code
>below, but it turns out
>>to be slow with many nestings, and I do not know why.
>Is there a way to
>>make it faster?
>>
>
>Probably not by much, but you can try this:
>
><comment>{
> ([^\*\[]|"["[^*]|"*"[^\]])+ { }
> "["|"*" { }
> "[*" ++comment_level;
> "*]" {
> --comment_level;
> if (comment_level == 0) {
> BEGIN(INITIAL);
> }
> }
> <<EOF>> { ... }
>}
Actually, your suggestion takes 22% longer time... :-)
But thank you for your effort.
Hans Aberg
- Re: Nested comments, (continued)
RE: Nested comments, Mark Weaver, 2003/07/03
Re: Nested comments, Akim Demaille, 2003/07/03
Re: Nested comments, john43, 2003/07/02
Re: Nested comments, john43, 2003/07/02
- Re: Nested comments,
Hans Aberg <=
RE: Nested comments, Thurn, Martin, 2003/07/02
RE: Nested comments, john43, 2003/07/02
Re: Nested comments, Hans Aberg, 2003/07/02
Re: Nested comments, john43, 2003/07/05
Re: Nested comments, john43, 2003/07/07
Re: Nested comments, john43, 2003/07/07