Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18491

    Monkeyman
    Participant

    I am a PHP developer and I write scripts for VQMod. They all have mixed content: XML + PHP mostly (JS can be added as well). I love, when text is highlighted, but XML and PHP doesn’t mix well. See for yourself:

    Problem’s very simple: EmEditor thinks, that -> is a closing tag for previously opened < tag, however it’s not. The same happens in most similar cases (e.g.:, simple string like this “<“ will “open” the highlighted text):

    Could you add a feature to add a list of EXCLUDED symbols or symbol combinations for each highlighted option? I mean add a “Exclude tags” field on Highlight (1) tab near “Begin tag” and “End tag” ones. For example, in fore-mentioned cases I’d add ->, “>” and “<“ combinations, since they always interfere.

    #18494

    Meir
    Participant

    Dear Monkey…

    The issue is quite broader. I work with Perl. And that language has some rather queer exceptions. One example: @my_array is … you guessed, an array! $#my array is the highest index currently occupied. But EmEditor considers everything beyond the ‘#’ as comment. And there are many more exceptions.

    Try and open one of the syntax highlighting files. Open Tools->Properties for the current configuration->Highlight(1). Click the ‘Export’ button and same the ‘esy’ file. Its syntax seem simple enough. Especially note the line
    #Keyword color=4,word=on,rightall=off,case=on,insidetag=off,regexp=off,rightall2=off
    There seem to be a possibility to specify some syntax highlighting by regular expressions. I once asked Yutaka for some usage examples. He doesn’t seem to consider this request as worthy of his attention. May be you can convince him otherwise…?

    #18496

    CaptainFlint
    Participant

    I work with Perl. And that language has some rather queer exceptions. One example: @my_array is … you guessed, an array! $#my array is the highest index currently occupied. But EmEditor considers everything beyond the ‘#’ as comment. And there are many more exceptions.

    Perl is not a very good example. It is mathematically proven that it cannot be statically parsed (that is, without running the script itself), not to mention doing this with only regexps, having no customizable lexer and parser.
    Of course, it does not mean that there is no place for improvements — some common and non-contradictory expressions still can be detected and highlighted, but with Perl’s versatility it’s quite a troublesome task. As a Perl developer, I would be extremely glad to see improvements in this area too…

    #18497

    Monkeyman
    Participant

    I think most cases can be covered with exclusions list. For Perl you could add $#, for example, to avoid parsing this as a comment. Of course it’s impossible to cover all cases, but that’s OK.

    So… Any word from developers?

    #18498

    Meir
    Participant

    That’s not a completely bad idea at all 🙂 Monkeyman! Thanks!

    It could simply take care of some keywords used as variable or methods names: e.g., format is a keyword but $format is a perfectly legal variable name. warn is a keyword, but $object->warn is an object’s method call, etc.

    Good!

    Well, Yutaka, how about it (and about RegEx usage examples?)

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.