Has anyone fixed the vim syntax highlighting for [[...]] strings?
The version of lua.vim available at our tools page (which has recently moved
to lua-users) does not handle nested comments, as in
return [[ alpha [[ beta ]] gamma ]]
I think I fixed this as follows, but I know little of vim syntax highlighting.
< syn region luaString start=+\[\[+ end=+\]\]+
> syn region luaString2 start=+\[\[+ end=+\]\]+ contains=luaString2
> hi link luaString2 String
Does anyone out there knows whether this is the correct or better way?
Also, we're considering adding block comments to Lua in the form --[[...]],
as suggested in lua-users (there's even a patch available there). We would
like that this form could be highlighted correctly in vim and other editors,
even when the --[[...]] contains [[..]] strings and other --[[...]] comments.
We'd like to know whether highlighting --[[...]] comments is possible/easy
to do in vim and other editors. Please let us know. Thanks.
>Also, we're considering adding block comments to Lua in the form --[[...]]
Will they be recursive? I mean, suppose I comment out (e.g. for testing) a
block of code that includes a block comment:
This will not work if the first "]]" closes both comments. I suppose
"[[...]]" recursion goes without saying even in comments, but just to be
I know it is possible to do so becouse in the following C code,
when you change the first "#if 1" to "#if 0", the text is highlighted
The C syntax highlighting code is quite complicated and, unfortunately, I am
with much time at the moment to look further into this.
b = 3
As soon as I have some spare time I will try to fix Luas syntax highlighting
> -----Original Message-----
> From: [hidden email]
> [[hidden email] Behalf Of Luiz Henrique de
> Sent: Saturday, January 19, 2002 8:55 AM
> To: Multiple recipients of list
> Subject: Re: syntax highlighting Lua
> >>Also, we're considering adding block comments to Lua in the
> form --[[...]]
> >Will they be recursive?
> Yes, just like [[..]] strings: they end at the matching ]].