Christophe.
+1
I've actually seen a simple example somewhere--and when I have time,
hopefully later today, I'll dig it out and send you the link. (There
is a chance that the example is old enough that it no longer works--I
haven't got as far as trying it so far.)
Actually including such a simple example in the documentation would be
nice.
Before someone jumps to create the example, I'd like to take a little
time to decide if there is an additional example that might
particularly help me in my quest to make a lexer for the TWiki markup
language.
In the other programs (nedit and kate) that I've added a highlighting
file for TWiki markup, I was able to use regular expressions, and think
that would be a help if I could do that in scite (as that is my
target). Of course, I guess that adds some amount of additional
overhead.
One thing that I have to learn to deal with is distinguishing the level
of headers from very similar markup at the beginning of a line--for
example, a level 1 header is marked up as \n---+ <heading text>\n, a
level 2 header is marked up as \n---++ <heading text>\n, and so on up
to level 6.
Similarly, a bullet or numbered list item at the first level is preceded
by 3 spaces, a bullet or numbered list item at the second level is
preceded by 6 spaces, so I have to be able to treat spaces as
significant.
> By doing this I'm sure that more people will use QScintilla because
> it would be easy to custom it. It seams that the users of Qscintilla
> are always the same and they don't seem to understand that the task
> for a newbie is very hard because all the examples are real ones and
> then there are a litlle bit complex to understand.
+1
Randy Kramer
--
I didn't have time to write a short letter, so I created a video
instead.--with apologies to Cicero, et.al.
> One thing that I have to learn to deal with is distinguishing the level
> of headers from very similar markup at the beginning of a line--for
> example, a level 1 header is marked up as \n---+ <heading text>\n, a
> level 2 header is marked up as \n---++ <heading text>\n, and so on up
> to level 6.
>
> Similarly, a bullet or numbered list item at the first level is preceded
> by 3 spaces, a bullet or numbered list item at the second level is
> preceded by 6 spaces, so I have to be able to treat spaces as
> significant.
I'm also interested by that kind of feature.
Thanks for your answer.
Christophe.
Ok, here is the link:
Writing a self-contained lexer for scintilla:
http://sphere.sourceforge.net/flik/docs/scintilla-container_lexer.html
I should give some disclaimers:
* As I mentioned earlier, I haven't tried this code so don't know if
it works (and, there is some fleshing out required--it is not like it
tells you exactly what to put in each named file). I presume it worked
at one time, but that may have been in a (much?) older version of
scite / scintilla
* The writer's email address is mentioned in the link--I was
anticipating writing to him at some point, but, iirc, I haven't tried
so far
* I am not a scite developer, nor affiliated with scite in any
way--I'm just a user interested in getting the lexer I need. I have
spent some time looking into this, but I'm neither a C or C++
programmer, so I started spending some time looking at some aspects of
C++. I did manage to sort of compile scite one time by downloading the
Debian source package, and then compiling that. I'm assuming that I
can make modifications for my purposes, and then compile the new code
the same way, though, if I create any new files, maybe I have to add
them to a make command or similar (I'm very much a novice in those
areas--compiling Pascal code in dos/Windows was more my speed ;-)
Randy Kramer
> > One thing that I have to learn to deal with is distinguishing the
> > level of headers from very similar markup at the beginning of a
> > line--for example, a level 1 header is marked up as \n---+ <heading
> > text>\n, a level 2 header is marked up as \n---++ <heading
> > text>\n, and so on up to level 6.
> >
> > Similarly, a bullet or numbered list item at the first level is
> > preceded by 3 spaces, a bullet or numbered list item at the second
> > level is preceded by 6 spaces, so I have to be able to treat spaces
> > as significant.
>
> I'm also interested by that kind of feature.
--
(Intentionally top posting, and leaving old information below in case
you need to refer to it.)
Just wondered if you had a chance to look at the link, maybe even try
it, and your reaction?
As I mentioned, it doesn't seem to be the "put this line of code here in
this file, this line of code there in that file", kind of clear
instructions that would help me, and I guess that's what hung me up. I
suspect it may be the same for you?
Maybe there is somebody out there who could carry the example a little
further by going that far? (And confirming that the example still
works?)
Randy Kramer