Updated functionList.xml to support Ruby

Supports def & class
Fix indentation with tabulations
closes #1742
This commit is contained in:
Jishin42 2016-04-12 13:45:45 +02:00 committed by Damien GERARD
parent 2fb505b5a8
commit 7f1fb46223
No known key found for this signature in database
GPG Key ID: F63EF57249C52C18

View File

@ -31,6 +31,7 @@ http://notepad-plus-plus.org/features/function-list.html
<association langID="22" id="python_function"/>
<association langID="26" id="bash_function"/>
<association langID="28" id="nsis_syntax"/>
<association langID="36" id="ruby_function"/>
<!--
if langID cannot be found above, you can still set the file extensions
<association ext=".my_passer_ext1" id="my_passer_id"/>
@ -194,7 +195,6 @@ http://notepad-plus-plus.org/features/function-list.html
</classRange>
<function
mainExpr="^[\s]*function[\s]+\w+\("
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="(?!(if|while|for))[\w_]+[\s]*\("/>
@ -205,6 +205,7 @@ http://notepad-plus-plus.org/features/function-list.html
</className>
</function>
</parser>
<parser id="bash_function" displayName="Shell" commentExpr="(#.*?$)">
<function
mainExpr="^[\t ]*(function[\t\r\n ]*)?([a-zA-Z0-9_])+[\t\r\n ]*(\([^\)]*\))?[\t\r\n ]*(\{)[^(\})\r\n\t ]*"
@ -214,6 +215,7 @@ http://notepad-plus-plus.org/features/function-list.html
</functionName>
</function>
</parser>
<parser id="python_function" displayName="Python class" commentExpr="(#.*?$|'''.*?('''|\Z))">
<classRange mainExpr="(?&lt;=^class ).*?(?=\n\S|\Z)">
<className>
@ -232,6 +234,29 @@ http://notepad-plus-plus.org/features/function-list.html
</function>
</parser>
<parser id="ruby_function" displayName="Ruby">
<!-- within a class-->
<classRange
mainExpr="(?&lt;=^class ).*?(?=\n\S|\Z)"
displayMode="node" >
<className>
<nameExpr expr="\w+"/>
</className>
<function mainExpr="^\s*def\s+\w+" displayMode="$className->$functionName" >
<functionName>
<funcNameExpr expr="(?&lt;=def\s)\w+"/>
</functionName>
</function>
</classRange>
<!-- without class-->
<function mainExpr="^\s*def\s+\w+" displayMode="$functionName" >
<functionName>
<nameExpr expr="(?&lt;=def\s)\w+"/>
</functionName>
</function>
</parser>
<parser id="cs_function" displayName="C# Class" commentExpr="((/\*.*?\*)/|(//.*?$))">
<classRange
mainExpr="^[\t ]*((public|protected|private|internal)[\s]+)?([\w]+[\s]*)?(class|struct|interface)[\t ]+[^\{]+\{"