#939 Add GetWordChars to complement SetWordChars

Completed
closed
Scintilla (358)
5
2012-07-14
2012-05-25
Mark Yen
No

Add functions to get various character classes (word, space, punctuation) from scintilla; this is the opposite of SCI_SETWORDCHARS and friends.
This is a duplicate of https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3529543&group_id=2439 which for some reason won't let me attach files :( Sorry about that.

The attached patch (hg mq) adds the functionality and tests. I'll need to think a bit about what the API would look like to pass around Unicode ranges instead of individual characters; for now it's just bags of bytes, since that's what the character classification stuff does currently.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2012-05-25
    • assigned_to: nobody --> nyamatongwe
     
  • Neil Hodgson

    Neil Hodgson - 2012-05-26

    The Python tests fail with Python 2.x: there needs to be some generic conversion of byte strings to and from sets since type(b"x"[0]) changed from str to int.

    There have been some other API additions just committed so the new APIs should be allocated from 2646.

     
  • Mark Yen

    Mark Yen - 2012-05-29

    python 2.x compatibility

     
  • Mark Yen

    Mark Yen - 2012-05-29

    Thanks! The readme in that directory mentioned that the tests only run on Windows with Python 3.x, so I didn't try to build in 2.x compatibility. It now has that... though I just realized that the version checking needs to use sys.version_info[0] instead of sys.version_info.major if it needs to run on Python 2.6 :( Sorry about that.

    The API numbers are also fixed.

     
  • Neil Hodgson

    Neil Hodgson - 2012-05-29

    The tests previously ran only on Python 3 but Python 3 uptake has been slow and 2.7 offered some extra compatibility so they were made compatible with 2.7. I don't think it can (easily) be made to run on 2.6 as 2.6 doesn't have b"" literals IIRC.

    Since 3.2.0 is frozen, this won't be committed until after 3.2.0 is released.

     
  • Neil Hodgson

    Neil Hodgson - 2012-06-04

    Committed.

     
  • Neil Hodgson

    Neil Hodgson - 2012-06-04
    • milestone: --> Completed
     
  • Neil Hodgson

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

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