Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1162 Batch file lexer bug

Bug
open-accepted
Neil Hodgson
Scintilla (790)
3
2013-02-09
2011-06-05
XhmikosR
No

In some cases the identifier is not highlighted right.
See the attached batch file and screenshot for more info.

Discussion

  • XhmikosR
    XhmikosR
    2011-06-05

     
    Attachments
  • XhmikosR
    XhmikosR
    2011-06-05

     
    Attachments
  • Neil Hodgson
    Neil Hodgson
    2011-06-05

    Insufficient information.

     
  • Neil Hodgson
    Neil Hodgson
    2011-06-05

    • assigned_to: nobody --> nyamatongwe
     
  • MvGulik
    MvGulik
    2011-06-06

    Think OP is revering to the fact that in DOS you have general %enviroment_var% notation and special %0..%9 var's (different notation) for CMD/CALL and %a..%z, %A..%Z for FOR loop variables. (and these short vars can also be used with options %~1x)

    Output of sample.bat: "whatever_argument_FIRST_VAR_SECOND_VAR"
    where "whatever_argument" is from the %1 argument.

     
  • XhmikosR
    XhmikosR
    2011-06-06

    Thanks mvgulik for your explanation which covers what the batch file is supposed to do.
    Those identifiers should be highlighted but they aren't.

     
  • Neil Hodgson
    Neil Hodgson
    2011-06-07

    OK. I'll accept a patch but won't be working on this myself.

     
  • Neil Hodgson
    Neil Hodgson
    2011-06-07

    • priority: 5 --> 3
    • milestone: --> Bug
    • status: open --> open-accepted
     
  • XhmikosR
    XhmikosR
    2012-04-09

    Another bug with batch files:

    TITLE Running "svnsync sync --username XhmikosR https://mpc-hc.googlecode.com/svn"
    ECHO Running "svnsync sync --username XhmikosR https://mpc-hc.googlecode.com/svn"

    In the TITLE line the "com" is highlighted which is wrong since it's enclosed into strings, but in the ECHO command it is not which is correct. Additionally, if I use ECHO: then the "com" part is highlighted in the ECHO command too.

    The "com" part is also highlighted in the following example:
    cmd /C start "" /command ""any_command https://testurl.com""/svn""

     
  • scrubble
    scrubble
    2013-02-09

    I had originally posted the following in Notepad++ forum (I'm using npp v6.2.3), but I believe it belongs here as well (or maybe, instead)...

    I'm having issues with the syntax highlighter for .BAT files. Whenever it finds a parentheses inside an IF-ELSE structure, it flags it as red, while the .BAT itself has no issues and runs perfectly.

    A single-line example would be as follows:

    IF NOT %batdate%==%override_date% (goto :DATE-OVERRIDE) ELSE (goto :DATE-CONFIRM)
    

    The red highlighting of parentheses also happens inside multi-line IF-ELSE structures.

     
    • Neil Hodgson
      Neil Hodgson
      2013-02-09

      No unusual highlighting of the example in SciTE so appears to be specific to Notepad++.

      Adding a new issue to an existing bug means it is much less visible. If this is really a Scintilla bug then there should be a separate bug report with an example showing the problem in SciTE.