FunctionList Parsers: Additions & Suggestions

Rob Kodey
2013-07-02
2014-10-01
<< < 1 2 (Page 2 of 2)
  • Rocco

    Rocco - 2013-12-20

    Lua
    I'm not too good at regex but this seems to work ok. Supports both "function name()" and "name = function()" type functions.

                <association langID="23" id="lua_function"/>
    
                <parser id="lua_function" displayName="Lua function" commentExpr="--[^\n]*">
                    <function
                        mainExpr="(function[ \t]+[\w\:\.]+[ \t]*\(|[\w\:\.]+[ \t]*=[ \t]*function)"
                        displayMode="$functionName">
                        <functionName>
                            <nameExpr expr="(function[ \t]+\K[\w\:\.]+|[\w\:\.]+)"/>
                        </functionName>
                    </function>
                </parser>
    
     
    • Menno Vogels

      Menno Vogels - 2013-12-21

      You can use to following to include multi-line comment (MLC) in the Lua parser:

      commentExpr="--(?'MLC'(?:\[(?'NESTED'=*)\[).*?(?:]\k'NESTED']))|(?'SLC'[^\r\n]*)">
      

      Single-line comment (SLC):

      -- at start of line marks SLC to end of line
      

      Multi-line comment (MLC):

      --[[ <-- this character combination marks  
      the beginning of 
      a multi-line comment and
      it ends with the characters ]]
      
      --[=[
      use equal signs between the square brackets
      to be able to nest comment.
      
      --[[
          nested 
          multi-line 
          comment
      ]]
      
      --[========[
          second multi-line nested comment
      ]========]
      make sure the number of equal signs between the left/opening and 
      the right/closing square brackets are equal.
      
      main comment zone ends here ]=]
      
       
      Last edit: Menno Vogels 2013-12-21
  • Deadooshka

    Deadooshka - 2013-12-20

    try to parse this PHP-code with and without comments and {-symbol. (v6.5.2 with any php-parser)

    <?php
    
    class _x1
    {
    
    /*
        function _commented1()
        {
            echo '1';
        }
    */
    
        function _f1()
        {
            $var = '{';
        }
    
    }
    
    /*
    function _commented2()
    {
        echo '2';
    }
    */
    
    ?>
    

    imo it is a bug of the FL-plugin itself.
    1) {-symbol inside string breaks class parsing.
    2) _commented2() is parsed although commented out.

     
    Last edit: Deadooshka 2013-12-22
  • Felix Nagel

    Felix Nagel - 2013-12-22

    The new JS and PHP parser in 6.5.2 works great, thanks for the update!

    One little issue: the regex does not work with namespaced extends like

    class ContentController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
    

    This can be fixed by adding \ to the PHP classRange mainExpr:

    <classRange mainExpr="^[\s]*(class|abstract[\s]+class|final[\s]+class)[\t ]+[\w]+([\s]*|[\s]*(extends|implements)[\s]+[\w|\\]+[\s]*)?\{"
    
     
  • Deadooshka

    Deadooshka - 2013-12-22

    character class for one character is not needed!

     
  • Mike T

    Mike T - 2014-03-15

    I have a request for a function parser. Could someone please write one for the R programming language? I have just started doing simple regex and my attempts to write a function parser have been unsuccessful.

     
  • alex

    alex - 2014-05-01

    Hi i am stil having issues with the PHP parser not showing correctly in my function list using notepad++ 6.5.5 it will only show function parameters not public function or classes either. What can i do to make them be viewed?

     
  • Mati

    Mati - 2014-05-14

    Could someone please provide a FunctionList parser for Fortran 77,90,95 please?

    I don't know how to write my own. Thank you.

     
<< < 1 2 (Page 2 of 2)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks