#973 cobol: number masks incorrectly highlighted

Cosmetic
closed-fixed
Scintilla (794)
3
2010-07-30
2010-06-06
Anonymous
No

masks like the followings
99v99 and 9(2)v9

aren't hightlighted by current cobol lexer.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2010-06-07

    Since I don't use COBOL, I will not be working on this myself.

     
  • Neil Hodgson

    Neil Hodgson - 2010-06-07
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2010-06-07
    • priority: 5 --> 3
     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-06-07

    hi, here the fix:

    src/gtkscintilla2/scintilla/src/LexCOBOL.cxx | 4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/src/gtkscintilla2/scintilla/src/LexCOBOL.cxx b/src/gtkscintilla2/scintilla/src/LexCOBOL.cxx
    index cd42e3e..05bf1d9 100644
    --- a/src/gtkscintilla2/scintilla/src/LexCOBOL.cxx
    +++ b/src/gtkscintilla2/scintilla/src/LexCOBOL.cxx
    @@ -90,11 +90,11 @@ static int classifyWordCOBOL(unsigned int start, unsigned int end, /*WordList &k
    getRange(start, end, styler, s, sizeof(s));

    char chAttr = SCE_C_IDENTIFIER;
    - if (isdigit(s[0]) || (s[0] == '.')) {
    + if (isdigit(s[0]) || (s[0] == '.') || (s[0] == 'v')) {
    chAttr = SCE_C_NUMBER;
    char *p = s + 1;
    while (*p) {
    - if (!isdigit(*p) && isCOBOLwordchar(*p)) {
    + if ((!isdigit(*p) && (*p) != 'v') && isCOBOLwordchar(*p)) {
    chAttr = SCE_C_IDENTIFIER;
    break;
    }

     
  • Neil Hodgson

    Neil Hodgson - 2010-06-07

    Committed.

    Looks like this treats any 'v' as eligible to be part of a number even just the letter 'v' by itself which appears ambiguous. Possibly it could check the previous character to check it is an OK mask character.

     
  • Neil Hodgson

    Neil Hodgson - 2010-06-07
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2010-07-30
    • 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:





No, thanks