herbert breunung wrote:
a general clean solution is always better but in this case we need to
distinguish when {} is code block
and when var block. i think an look behind would not be nessesary inly a
flag that can remeber if we still
in variable mode that begins at $ % @ + name + -> + :: . maybe it covers
not all but maybe i could help you in future too.
Code block vs var block is one possible thing to differentiate,
and yes, it looks like a good place to start. However, "sub tr;"
is also a failure case. So I am planning to study the Perl parser
in detail first (which is pending; I don't particularly look
forward to it :-) heh heh) to see if some simple and reliable
parsing method or heuristic can be used to recognize barewords.
Ultimately, I think grokking Perl parsing is important if a good
solution is to be found.
Flag are extra state, and it must be placed somewhere, otherwise a
piece of code can be lexed differently when the lexer is started
from different positions (earlier versions of LexPerl has this
problem.) But if the best solution requires it, then I'm all for
it. My preference for looking backwards and forwards is simply to
avoid the need for Scintilla to store additional state
information, unless it is absolutely unavoidable.
When I was studying the lexing of variable mode, I went from
pretty smug to becoming less and less sure of myself. :-) The
current heuristics are okay most of the time, but variable specs
can become pretty complex, and I don't think I can code something
to lex them perfectly at this time. That's why I think I have to
go study the Perl parser... This last few percent of error is
something I would rather not attempt to fix hastily.
[snip]
you see most parts are implemented and i would like it do myself but i
need a little bit of help from an more experienced
writer of scintilla lexer.
New-style parser code is much better to work on. However, LexPerl
is old style code, along with its HERE doc portion. So yeah, looks
like a fair bit of work to do.
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest