Re: lexer and coloring in scintillua

62 views
Skip to first unread message

Kagehi

unread,
Sep 23, 2012, 3:54:58 PM9/23/12
to scite-i...@googlegroups.com
Well, actually, it is. That is why I say that I find the guys page on how to do it confusing some times. The "coloring style" is the same as an imbedded lexer, so, his example is imbedding CCS into your own lexer:

local css = l.load('css')

You would do the same, I believe, with the coloring and styles:

local light = l.load('light')


I think that will "override" the default colors for everything, as long as your definitions use the standard "style" names. If you want to use the colors,
but your own names, then would would have to reference the color names, from the list of colors defined in the lua file:

l.my_comments = style {fore = l.colors.dark_grey}

None of the things in the definition are "rules", so they don't get linked into the M part until added in during the M._rules section, and thus the examples
that are given, for "imbedding" another language, are not needed. Basically, I think, though don't quote me on it, that just using l.load "copies" the colors,
and styles, into your own code, and then you just use them as though you had coded them in yourself. This is certainly how added external code works "normally",
under Lua.

On Sunday, September 23, 2012 3:24:40 AM UTC-7, Sergio Spina wrote:
Well, I've written a lexer in scintilua. Now I would like to link it with a coloring style, say "dark.lua" or "light.lua" in the "themes" folder, so that to obtain a correct syntax-highlighting in SCiTe. It seems that in the api page there's no explanation of that.

Many thanks.
Reply all
Reply to author
Forward
0 new messages