what about support, for example, CSS inside the
<style> tag in html?
Logged In: YES
One way is to combine more lexers in editing a file. I don't
know how this is difficult.
Another way is to reimplement CSS lexer in HTML lexer. The
problem is, that there are not enough free states for it. I
though about it some time ago and my proposal is to
separate HTML lexer into ASP and PHP (and maybe pure
HTML) lexer and include CSS everywhere. Any comments?
Logged In: YES
I'd love to see a more generic approach to this problem.
The way I see it, Scintilla would maintain a stack of lexers
when parsing the file. Each parser would have a way to push
a new lexer into the the stack when it encounters a
particular token (like <script> tag), and should have a way
to pop the lexer back when reading another token (like
</script>), if and only if the other lexer is in a
particular state, (not inside a string, for instance).
I know this probably means a lot of work, but this would be
a great advantage.
For instance, I once started to code in cheetah, which is a
superset of Python to generate template. The generated text
Building a lexer for this particular application is
difficult and not very useful, yet the solution given above
would allow this situation to be handled satisfactory
without much work, if you already have a Python, HTML, CSS
You don't just need a stack of lexers, you need a way for
islands of text for a particular lexer to communicate - if your
ASP lexer sees a language directive then this has to be
remembered for the next piece of ASP text. SinkWorld tries
to solve this and there is code in the current SinkWorld CVS
for this feature. There are still quite a few outstanding issues
and I haven't enough time available to concentrate on
SinkWorld deals with the situation where you instantiate a
lexer multiple times such as where a HTML uses both server
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.