[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Are Lua's own lexer/parser suitable for writing a syntax highlighter?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 9 Sep 2014 23:52:56 -0300
> I was under the impression that the parser just gives me more
> information about the file, so that I can color things more
> specifically, e.g. it may recognize an identifier as being a local
> variable or a global, so I can color them differently.
Oh, right, you need a parser for that. But you may be able to hook into
the parser to get this info. See
http://lua-users.org/lists/lua-l/2011-06/msg00091.html
> Would creating a new private lua_State for my syntax-highlighter's be
> a reasonable way to work around this?
No. You'd have to use a patched Lua and this will affect all Lua programs
that you load. You really need to turn off the token filter globally.