using Scintillua for integration(embedding) in an application with LuaJit #40
Replies: 3 comments 2 replies
-
Scintillua's LexLPeg.cxx can be directly compiled into an application, or it can be compiled as a shared object (dll). Textadept chooses to compile it in directly into the executable.
Your other questions come from a Textadept discussion. What I meant in that discussion is that Textadept has a Lua interface to Scintilla (which is NOT Scintillua; two separate things here) that you would have to extract to use in another editor. LexLPeg.cxx strictly provides syntax highlighting for Scintilla. It is not an interface to use the Scintilla editing component using Lua. Sorry for the name confusion there.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Yes, both dlls are produced from the cxx/h files using the same method (see the Makefile). LexLPeg32.dll is a compiled as a 32-bit dll for drop-in use with 32-bit applications. (The other dll is compiled as a 64-bit dll.)
LexLPeg.cxx is a static, external C++ Scintilla lexer that has an internal Lua state that enables use of the dynamic Lua LPeg lexers in *lexers/*.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
No, it's not that simple, unfortunately.
If you want to use the dll, you need to use it within a Scintilla application because it's an external Scintilla lexer. If you want to use Scintillua with a non-Scintilla editor, then you'd ignore the dlls and just use the Lua lexer library in *lexers/* to generate syntax highlighting information, and then invoke your editor's coloring API with the results. https://orbitalquark.github.io/scintillua/manual.html#using-scintillua-as-a-lua-library gives an example of using Scintillua within a Lua interpreter. You would take the `tokens` table in that example and use that to call into your editor's text coloring API.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dr-dba
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How it fitted into TextAdept? I did not found "scintillua.dll" there.
Is it built-in directly in "textadept.exe"?
that sounds exactly as lua module writen in C-language, isnt, either .. ?
for me, this code:
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
LUALIB_API int luaopen_lpeg(lua_State *L);
}
.. is a classic Lua dll writen in C for Lua, exposing it's methods.
And normally, given as for example "scintilua.dll",
you are able to do something "local scntl = require('scintilua')",
and get it's methods/objects/props exposed in Lua types.
Isnt this a definiton of Lua (in C++) module?
Er.. why need to remove parts of it?
there is a single file of C++ code - LexLPeg.cxx and LexLPeg.h,
so, what and why i need to remove from it?
I would be more than happy ..
Beta Was this translation helpful? Give feedback.
All reactions