[Klone-users] Don't Translate C/C++ comment

Stefano Barbato barbato at koanlogic.com
Tue Jan 5 10:23:09 EST 2010



On 05/gen/2010, at 14.22, Mickael Auger wrote:

> Hi,
> 
> I wish to comment a block in my klx page with /* */ syntax.
> However the parse of klx page translates the content of C/C++ comment (function translate_script_to_c())
> 
> For example, if I write :
> =-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-==-=-=-=-=-=-==-=-=-=-=-=-=
> <table>
> <%
> for(i=0; i<10; i++)
> {
>   %><tr><td>one cell</td></tr><%
>   /*
>   other version TODO
>   <tr><td>cell<% io_printf(out,"%d",i); %></td></tr>
>   */
> }
> %>
> </table>
> =-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-==-=-=-=-=-=-==-=-=-=-=-=-=
> 
> this example doesn't compile because the strings "<%" and "%>" in comment block are translated.
> 
> Could not translate the content in /* */ comment block, please ?


Hello Mickael,

KLone parser doesn't look into "<% .* %>" blocks at the moment, it just takes what's contained between those two opening/closing tags (and it takes the first closing tag found). 

So what it find parsing your code is two nested code blocks that are not allowed by the current parser.

bye!
stefano





More information about the Klone-users mailing list