Menu

#1185 SAS lexer

Committed
closed
5
2018-09-09
2017-04-05
Luke R.
No

We have a version of a SAS lexer that we have been using, and would be happy to contribute it if there's interest. Given SAS is a proprietary/licensed system, I didn't know if this would be acceptable to include.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2017-04-05

    There are other proprietary language lexers included with Scintilla like Baan and Progress so that is fine. Scintilla has a permissive open-source license and lexers can be included if the authors are OK with that license applying to their code.

     
  • Cornillon

    Cornillon - 2018-06-03

    I'm not sure that the creator of this feature/proposition is still ok but yes, there's interest (and for 50 students a year too :)

     
  • Neil Hodgson

    Neil Hodgson - 2018-06-06

    Scintilla users expect that all of the code within Scintilla is available under the license of the whole project. Each file should include a reference to the overall license to indicate that use is permitted. This is commonly of the form:

    // The License.txt file describes the conditions under which this software may be distributed.
    

    Files may also be dual licensed if that is desired by their authors.

    SCI_NAMESPACE was dropped for Scintilla 4.x. Lexers should just include the 'using' without any conditional compilation:

    using namespace Scintilla;
    

    Both lexers define 3 local functions that are not called and should be removed: IsAWordChar, IsAWordStart, and IsAnOperator.

    ../lexers/LexSAS.cxx:34:20: warning: unused function 'IsAWordChar' [-Wunused-function]
    static inline bool IsAWordChar(const int ch) {
                       ^
    ../lexers/LexSAS.cxx:38:20: warning: unused function 'IsAWordStart' [-Wunused-function]
    static inline bool IsAWordStart(const int ch) {
                       ^
    ../lexers/LexSAS.cxx:42:20: warning: unused function 'IsAnOperator' [-Wunused-function]
    static inline bool IsAnOperator(const int ch) {
                       ^
    

    isoperator takes an int argument so should normally be fed sc.ch directly without a static_cast. The current code may behave strangely if given a Unicode file.

     
  • Luke R.

    Luke R. - 2018-06-17

    I'll get these fixed up - thanks for the helpful feedback!

     
  • Luke R.

    Luke R. - 2018-06-18

    Fixed up the suggested items (again, thanks). We have not aligned our main branch to 4.x yet, so keeping these changes in a separate branch: https://github.com/StatTag/scintilla/tree/lexer_fixes (since it was noted SCI_NAMESPACE drop is a 4.x change).

    For those looking to integrate, please note that earlier commits reference these two lexers in the following files:
    win32/scintilla.mak
    win32/deps.mak
    cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj

     
  • Neil Hodgson

    Neil Hodgson - 2018-06-21

    Commited as [974bc8].

    The lexer IDs were renumbered to continue the sequence.

    val SCLEX_STATA=124
    val SCLEX_SAS=125
    

    Credit added for "Luke Rasmussen". If you want your institution credited, please specify the desired form of their name(s).

    It should be safe to drop the SCI_NAMESPACE check in 3.x (if you want to merge branches) as there is nothing in the "Scintilla" namespace when SCI_NAMESPACE is undefined so "using namespace Scintilla" has no effect.

     

    Related

    Commit: [974bc8]

  • Neil Hodgson

    Neil Hodgson - 2018-09-05
    • labels: --> scintilla, lexer
    • assigned_to: Neil Hodgson
    • Group: Completed --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2018-09-09
    • status: open --> closed
     

Log in to post a comment.