lua-users home
lua-l archive

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


When I need to check the syntax of some Lua file or buffer in Titmouse, I
put the

do return end;

at the beginning of the buffer under the hoods and then I call lua_dostring
on it. Lua checks the syntax in the whole buffer and reports the problems if
there are some.

Roman Vanicek
XTG Systems, s.r.o.


----- Original Message -----
From: "Matt Holmes" <kerion@bellatlantic.net>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
Sent: 29. srpna 2001 22:35
Subject: lua 4.1 Alpha


> Is there any concrete release date on 4.1 Alpha yet? I am writing an IDE,
> and I could really use some of the functionality in 4.1 alpha (namely
> lua_loadbuffer). I need to be able to check to make sure that the code in
a
> Lua file "compiles" so to speak, without actually running it.
>
> I know that at one point someone on the list suggested just wrapping the
> block in a function, like:
>
> function CheckSyntax()
> <huge block of Lua code from a file>
> end
>
> then using lua_dostring() on that string, but it seems that Lua still
> executes the buffer (which makes very little since, unless Lua
automatically
> executes the first function it finds if no code is found in the global
> chunk?).
>
> Any help with this would be greatly appreciated :)
>
> Matt "Kerion" Holmes
> Lead Developer
> Lua Studio - The Lua IDE
> http://www.sourceforge.net/projects/visuallua/
>
>
>