SourceForge has been redesigned. Learn more.
Close

#1382 LexCPP "allow dollars" option doesn't always work

Bug
closed-fixed
Scintilla (796)
5
2012-07-14
2012-07-08
No

LexCPP "allow dollars" option doesn't always work. For example, if you try to switch between two LexCPP based lexers with different value for "lexer.cpp.allow.dollars", related character set that contains word characters will not be properly updated as it is created only once at the same time as lexer object.

Attached is a patch that fixes the problem.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2012-07-10

    Fix committed.

     
  • Neil Hodgson

    Neil Hodgson - 2012-07-10
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-fixed
     
  • Marko Njezic

    Marko Njezic - 2012-07-10

    I've seen that you opted for a different solution by extending CharacterSet class.

    However, wouldn't it have been simpler then to just add removal methods to the CharacterSet class and use them instead? Assigning a cleanly constructed character set class each time a property is being set is error prone as you have to remember to synchronize parameters passed to the class constructor (if they get changed in the future).

    The following patch adds removal methods: http://pastebin.com/iDTrBcrQ

    And their use is simple as well:

    if (options...) {
    setWord.Add(...);
    } else {
    setWord.Remove(...);
    }

     
  • Neil Hodgson

    Neil Hodgson - 2012-07-10

    CharacterSet will have to be extended eventually to handle Unicode character sets well with some sort of sparse representation. Supporting removal is easy with the current implementation but may be significant work with another representation.

     
  • Neil Hodgson

    Neil Hodgson - 2012-07-14
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.