#1642 tcl lexer (LexTCL.cxx) -quotes not terminating

Cosmetic
closed-rejected
5
2015-05-12
2014-08-14
No

Hello!

When working with tcl-files in SciTE, I noticed that strings like
$("bla") which is a jquery call in a tcl file result in incorrect detection of the quote's boundaries. The lexer thinks the quote starts at the second ", and thus never terminates.

Discussion

  • Markus Moser

    Markus Moser - 2015-02-23

    Here's a litte patch that allows the usage of $("abc") jquery selectors in tcl code.

     
  • Neil Hodgson

    Neil Hodgson - 2015-02-23
    • labels: --> scintilla, lexer, tcl
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2015-02-23

    Committed as [a11a03].

    Also re-indented the file since it had become messy as [b38366] so please use the current version for any new patches.

     

    Related

    Commit: [a11a03]
    Commit: [b38366]

  • Neil Hodgson

    Neil Hodgson - 2015-03-13
    • status: open-fixed --> closed-fixed
     
  • Markus Moser

    Markus Moser - 2015-03-25

    Thanks for the commit. There is still one minor issue with my patch. ( and ) within quotes is not formatted correctly. The first ( within a quote is highlighted, but the second is not.

    I don't have a perfect understanding of the TCl lexer code and apologize for this oversight.
    I suppose the following would fix it:

    --- a/lexers/LexTCL.cxx Sat Mar 21 09:16:35 2015 +1100
    +++ b/lexers/LexTCL.cxx Wed Mar 25 11:18:58 2015 +0100
    @@ -257,7 +257,7 @@
    sc.ForwardSetState(SCE_TCL_DEFAULT);
    visibleChars = true; // necessary if a " is the first and only character on a line
    goto next;
    - } else if (sc.ch == '[' || sc.ch == ']' || sc.ch == '$' || sc.ch == '(') {
    + } else if (sc.ch == '[' || sc.ch == ']' || sc.ch == '$' || sc.ch == '(' || sc.ch == ')') {
    sc.SetState(SCE_TCL_OPERATOR);
    expected = sc.ch == '[';
    sc.ForwardSetState(SCE_TCL_IN_QUOTE);

     
    • Neil Hodgson

      Neil Hodgson - 2015-03-25

      An example would help.

       
  • Markus Moser

    Markus Moser - 2015-03-25

    try something like

    " (abc) "

    and you'll notice only the first bracket is highlighted.

     
    • Neil Hodgson

      Neil Hodgson - 2015-03-25

      A full example with context. I'm trying to work out what your original problem really was since I can't see why there is jquery inside TCL.

       
  • Markus Moser

    Markus Moser - 2015-03-25

    The jquery strings are for web pages generated by OpenACS (openacs.org), where you can generate web pages dynamically using tcl code. The issue with jquery is fixed now, but there is some issue with brackets inside strings, which just pops up if you startup scite, switch to tcl mode and enter a string like the one I pasted above. I hope this clarifies the issue.

     
    • Neil Hodgson

      Neil Hodgson - 2015-03-25

      The closing bracket is caused by the patch. Unless there is an example showing why the patch is needed then it should be backed out.

       
  • Markus Moser

    Markus Moser - 2015-03-25

    or you could commit the one-liner above to fix the closing bracket

     
    • Neil Hodgson

      Neil Hodgson - 2015-03-25

      Are you really refusing to show the problem code?

       
  • Neil Hodgson

    Neil Hodgson - 2015-03-25
    • status: closed-fixed --> open
     
  • Neil Hodgson

    Neil Hodgson - 2015-03-26
    • status: open --> open-rejected
     
  • Neil Hodgson

    Neil Hodgson - 2015-03-26

    Change set [ea7867] reverts [a11a03] to fix regression.

    As there is no evidence for the originally reported problem, reclassifying as rejected.

     

    Related

    Commit: [a11a03]
    Commit: [ea7867]

  • Neil Hodgson

    Neil Hodgson - 2015-05-12
    • status: open-rejected --> closed-rejected
     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks