#631 TCL Lexer problem

Bug
closed-fixed
Scintilla (796)
3
2011-11-15
2007-11-23
AlexeyD
No

The TCL lexer seems to have a problem of not recognising TCL keywords placed in the same line as closing bracket. I.e. in the following code:

if { condition } {
some code
} else {
some other code
}

The "else" keyword won't be recognised as keyword. It will be correctly recognised and styled when it's on its own line though. This is true for any other keyword that can be used in that context.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2007-11-23
    • priority: 5 --> 3
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2007-11-23

    Logged In: YES
    user_id=12579
    Originator: NO

    Each language relies on fixes from users of that language, so this won't be fixed unless someone contributes a patch.

     
  • Robert Rotariu

    Robert Rotariu - 2007-12-17

    Logged In: YES
    user_id=1961446
    Originator: NO

    I tried this in Notepad++ and I can't reproduce what you said. I used the code you gave and "else" was highlited.
    I don't speak TCL, so I might be missing something. What version of scintilla did you use?

     
  • AlexeyD

    AlexeyD - 2007-12-17

    Logged In: YES
    user_id=17370
    Originator: YES

    File Added: SciTE.jpg

     
  • AlexeyD

    AlexeyD - 2007-12-17

    I see this in the most recent version of SciTE. Screenshot attached

     
  • Robert Rotariu

    Robert Rotariu - 2007-12-17

    Logged In: YES
    user_id=1961446
    Originator: NO

    I see. Hmmm... this is curious, because it doesn't happen to me.
    I can't think of anything else, so, I must ask you what version of scintilla (or SciTE, since they have matching versions) do you use. If it's an older version, try updating and see if it keeps happening. If it's the latest version, I have no idea what could be the problem.

     
  • AlexeyD

    AlexeyD - 2007-12-17

    Logged In: YES
    user_id=17370
    Originator: YES

    This *was* the latest version (1.75) of both Scintilla and SciTE. But he fact that you don't see it with another Scintilla based editor is curious. Does Notepad++ use vanilla version of scintilla? Or does it alter it in any way?

     
  • Robert Rotariu

    Robert Rotariu - 2007-12-18

    Logged In: YES
    user_id=1961446
    Originator: NO

    First time I ever hear of Vanilla Scintilla.
    Notepad++ uses regular Scintilla and, as far as I know, doesn't modify it. In fact, I've actually tried Notepad++ with both Scintilla 1.7.5 and with 1.7.3 (the version that Notepad++ uses at the moment) and they both work well.
    I just tried SciTE 1.7.5 and, yes, it does what you just said. I have no idea why this happens.
    I have also tried SciTE with the version of SciLexer.dll (1.7.5) that works fine in Notepad++ and still get the problem.
    This is definitely a SciTE problem, not a Scintilla one.

     
  • AlexeyD

    AlexeyD - 2008-01-14

    Logged In: YES
    user_id=17370
    Originator: YES

    > This is definitely a SciTE problem, not a Scintilla one.

    It does not seem so. I've came across the small IDE called Geany which uses Scintilla - it does exhibit exactly the same problem with TCL colouring.

    It's interesting to see how it's use of scintilla differs from that of Notepad++.

    Mind you Geany on Windows runs in Gtk ported for Windows if that makes any difference.

     
  • Colomban Wendling

    I'm raising this bug because we just got a report on Geany for the very same problem. I'm a TCL illiterate, but I made a patch[1] that fixes the issue, and don't seem to introduce weird behavior -- all TCL code I found and tested looked OK.
    If any TCL user mind test it and report their opinion on it, it'd be wonderful.

    [1] http://paste.debian.net/142678/ (sorry for linking remotely, but I don't seem to be allowed to attache a file here :/)

     
  • Neil Hodgson

    Neil Hodgson - 2011-11-05

    Committed the patch as it is more likely to be expected.

    The change could be seen as not very TCLish though: TCL doesn't have keywords. It has commands and the 'else' is an optional 'noise word' to the 'if' command.
    http://tmml.sourceforge.net/doc/tcl/if.html

     
  • Neil Hodgson

    Neil Hodgson - 2011-11-05
    • status: open-accepted --> open-fixed
     
  • Matan

    Matan - 2011-11-10

    How do I implement this patch on windows? (Geany 0.21)

     
  • Neil Hodgson

    Neil Hodgson - 2011-11-13

    I do not know anything about the integration of Scintilla in Geany.

     
  • Neil Hodgson

    Neil Hodgson - 2011-11-15
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks