Menu

Splus language support

Help
2012-07-17
2013-06-12
  • blueberrycake

    blueberrycake - 2012-07-17

    Would it be possible to add support for the S-plus language? I tried adding it myself, but the "Add" button on the language list is grayed out and not functional.

    Here are the CTAGS specifications for it:

     --langdef=Splus
     --langmap=Splus:.s.S.R.r.q
     --regex-Splus=/^[ \t]+"?([.A-Za-z][.A-Za-z0-9_]*)"?[\t]*<-[\t]*function/\1/
     --regex-Splus=/^"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-/\1/
    

    Thanks!
    bbc

     
  • UFO

    UFO - 2012-07-17

    Hi,

    the buttons get activated when you start entering text :)
    Then you've got some expressions in your regex, which "gnu regex"
    doesn't know. For example use "[]" instead of "\t".
    To be honest I don't know about your dots inside of the brackets..

     
  • blueberrycake

    blueberrycake - 2012-07-17

    I got it figured out, thanks.

    For anyone else interesting in Splus/R support, here's the Regex that I used to identify functions:

     Input: [[:blank:]]*([[:graph:]_]+)[[:blank:]]*<-[[:blank:]]*function
    Output: \1
    
     
  • UFO

    UFO - 2012-07-18

    I don't know Splus/R, but is this single regex rule all that would make sense for this language?
    If you think you've got a cool set of settings for it, don't hesitate exporting it in the dialog and
    attach it here. Others could simply download it and import it again. Also I would include it in
    the next version of SC. Thanks.

     
  • blueberrycake

    blueberrycake - 2012-07-18

    There are some other features to the language that I dont use (e.g. S3 and S4 object models) that would probably be worth adding if you wanted to include it in the distribution. Also, this regex just pulls out the function names, but doesnt enumerate the function parameters and default values. I just wanted a quick way to jump between function definitions, and dont really care for any of the other stuff.

     

Log in to post a comment.