mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 15:54:17 +02:00
Added Visual Basic function list + unittest case
Fix #3239, close #15953
This commit is contained in:
parent
f5f7c14853
commit
d6a32d2f0c
15
PowerEditor/Test/FunctionList/vb/unitTest
Normal file
15
PowerEditor/Test/FunctionList/vb/unitTest
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Module Program
|
||||||
|
Public num1 As Integer
|
||||||
|
Public num2 As Integer
|
||||||
|
Public answer As Integer
|
||||||
|
Sub Main(args As String())
|
||||||
|
Console.Write("Type a number and press Enter")
|
||||||
|
num1 = Console.ReadLine()
|
||||||
|
Console.Write("Type another number to add to it and press Enter")
|
||||||
|
num2 = Console.ReadLine()
|
||||||
|
answer = num1 + num2
|
||||||
|
Console.WriteLine("The answer is " & answer)
|
||||||
|
Console.Write("Press any key to continue...")
|
||||||
|
Console.ReadKey(True)
|
||||||
|
End Sub
|
||||||
|
End Module
|
@ -0,0 +1 @@
|
|||||||
|
{"leaves":["Main"],"root":"unitTest"}
|
50
PowerEditor/installer/functionList/vb.xml
Normal file
50
PowerEditor/installer/functionList/vb.xml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!-- ==========================================================================\
|
||||||
|
|
|
||||||
|
| To learn how to make your own language parser, please check the following
|
||||||
|
| link:
|
||||||
|
| https://npp-user-manual.org/docs/function-list/
|
||||||
|
|
|
||||||
|
\=========================================================================== -->
|
||||||
|
<NotepadPlus>
|
||||||
|
<functionList>
|
||||||
|
<!-- ========================================================== [ VBS ] -->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
| Based on:
|
||||||
|
| http://sourceforge.net/p/notepad-plus/patches/613/
|
||||||
|
\-->
|
||||||
|
<parser
|
||||||
|
displayName="Visual Basic (.NET|Script|for Applications)"
|
||||||
|
id ="vb_function"
|
||||||
|
commentExpr="(?m:((?<=').*?$)|((?i:REM)([\t ].*?)?$))"
|
||||||
|
>
|
||||||
|
<classRange
|
||||||
|
mainExpr="(?s:(?<SCOPE>(?i:CLASS|TYPE)).*?(?i:END[\t ]\k<SCOPE>))"
|
||||||
|
displayMode="node" >
|
||||||
|
<className>
|
||||||
|
<nameExpr expr="(?i:CLASS|TYPE)[\t ]+(?:[A-Za-z_][\w]*\b)(?:.*?[\r\n])" />
|
||||||
|
<nameExpr expr="[\t ]+(?:[A-Za-z_][\w]*\b)" />
|
||||||
|
<nameExpr expr="[A-Za-z_][\w]*" />
|
||||||
|
</className>
|
||||||
|
<function
|
||||||
|
mainExpr="(?m:^[\t ]*(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|SHARED|SHADOWS|OVERRIDABLE|OVERRIDES|READONLY|WRITEONLY)[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$))" >
|
||||||
|
<functionName>
|
||||||
|
<funcNameExpr expr="(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:STATIC[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
|
||||||
|
<funcNameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
|
||||||
|
<funcNameExpr expr="(?i:(?:GET|LET|SET)[\t ]+)?[A-Za-z_][\w]*(?=[\t ]*\()"/>
|
||||||
|
</functionName>
|
||||||
|
</function>
|
||||||
|
</classRange>
|
||||||
|
<function
|
||||||
|
mainExpr="^[\t ]*(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|(?:DECLARE(?:[\t ]+(ANSI|UNICODE|AUTO))?))[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"
|
||||||
|
displayMode="$functionName">
|
||||||
|
<functionName>
|
||||||
|
<nameExpr expr="(?i:(?:(?:PUBLIC|PRIVATE|PROTECTED|FRIEND|PROTECTED FRIEND)[\t ]+)?(?:(?:STATIC|(?:DECLARE(?:[\t ]+(?:ANSI|UNICODE|AUTO))?))[\t ]+)?(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
|
||||||
|
<nameExpr expr="(?i:(?:SUB|FUNCTION|PROPERTY)).*?(?:\(|$)"/>
|
||||||
|
<nameExpr expr="(?i:(?:GET|LET|SET)[\t ]+)?[A-Za-z_][\w]*(?i:[\t ]+(LIB|ALIAS)[\t ]+[\w"\.]+)*(?=[\t ]*\()"/>
|
||||||
|
</functionName>
|
||||||
|
</function>
|
||||||
|
</parser>
|
||||||
|
</functionList>
|
||||||
|
</NotepadPlus>
|
@ -218,6 +218,11 @@ SectionGroup "Function List Files" functionListComponent
|
|||||||
File ".\functionList\latex.xml"
|
File ".\functionList\latex.xml"
|
||||||
${MementoSectionEnd}
|
${MementoSectionEnd}
|
||||||
|
|
||||||
|
${MementoSection} "VisualBasic" VB_FL
|
||||||
|
SetOutPath "$INSTDIR\functionList"
|
||||||
|
File ".\functionList\vb.xml"
|
||||||
|
${MementoSectionEnd}
|
||||||
|
|
||||||
${MementoSection} "NppExecScript" NppExecScript_FL
|
${MementoSection} "NppExecScript" NppExecScript_FL
|
||||||
SetOutPath "$INSTDIR\functionList"
|
SetOutPath "$INSTDIR\functionList"
|
||||||
File ".\functionList\nppexec.xml"
|
File ".\functionList\nppexec.xml"
|
||||||
@ -397,6 +402,10 @@ SectionGroup un.functionListComponent
|
|||||||
Delete "$INSTDIR\functionList\latex.xml"
|
Delete "$INSTDIR\functionList\latex.xml"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
Section un.VB_FL
|
||||||
|
Delete "$INSTDIR\functionList\vb.xml"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
Section un.NppExecScript_FL
|
Section un.NppExecScript_FL
|
||||||
Delete "$INSTDIR\functionList\nppexec.xml"
|
Delete "$INSTDIR\functionList\nppexec.xml"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user