Re: Trying to set up a lexer for LSL using scintillua, but.. its not working...

53 views
Skip to first unread message

Kagehi

unread,
Aug 16, 2012, 6:22:32 AM8/16/12
to scite-i...@googlegroups.com
Oh, and yes, I did add the line for making the lexers work to the global properties, hence all of them but mine working. lol

Kagehi

unread,
Aug 17, 2012, 1:45:08 PM8/17/12
to scite-i...@googlegroups.com
Ok.. Been hacking my way through this thing a bit last night, and found a few obvious bugs, which kept it from loading, one glaring omission in an example, which left it not doing anything past the first two lines, which are comments.. Looks like the only problems I can't fix myself have to do with patterns. Mainly, what the heck is the difference between:

lpeg.P - pattern
lpeg.R - range
lpeg.S - set
lpeg.V - nter???

The names might imply what they do, but internally, looking at the code, they all eventually feed into "pattern", as a regex, some place, I think. But the page that is supposed to describe how to make a lexer like this a) barely mentions them, b) only gives examples of using P, and thus, pretty much, explains jack about how they work, what each one is limited to, or why (and V doesn't even have an internal name in the C code, which makes any sense without tracing that code and trying to figure out what its doing exactly.

Oh, right.. That the "style" block, at the bottom, while it obviously won't work for vector and quarternian, until I figure out how to match them properly, doesn't seem to be coloring events either. I figure, for sake of my sanity, I need those to color, and I wouldn't mined of "user created" ones colored some other way. Is their some hierarchy of coloring, where, for example, it will color numbers (the definition has a problem in that it colors them as parts of words..), then won't color something else containing them? How is that sorted out?

Neil Hodgson

unread,
Aug 17, 2012, 11:47:00 PM8/17/12
to scite-i...@googlegroups.com
   You may find the foicica.com 'code' mailing list better for scintillua issues.


   Neil

Kagehi

unread,
Aug 18, 2012, 12:32:39 AM8/18/12
to scite-i...@googlegroups.com, nyama...@me.com
Urg.. Sometimes NoScript is a pain. Tried to do an attachment and got "caught" in the upload dialog, with no way to go back to my original message.

Anyway, found the last bug, which turned out to be one of two, "You need this line in the lexer, but its not in the template, nor do I explain why, or what it does." I ran into that twice, once with a rule that, if missing, caused all rules to fail, except the very first one found (which happened to be a comment at the start of my file). The other, turns out to be for user defined names/functions/etc., and if missing, causes things like keywords, numbers, and so on, that are part of your defined names, to color, even when its only a "part" of the word. Example: "list tlist" where "list" is a type, and tlist is the variable, would also color the list in tlist. :headdeask: I figured that one out, right in the middle of typing the reply. lol

Anyway, think I can live with the one bug still there, which is that <> is used to define a vector, but is being colored as though they where operators. :p Sure its fixable, but since its working, I am not going to complain. ;)

I'll attach the working lpeg lexer, for anyone that might want it.
lsl.lua
Reply all
Reply to author
Forward
0 new messages