You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.8 KiB
43 lines
1.8 KiB
4 years ago
|
<?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>
|
||
|
<!-- ========================================================== [ C# ] -->
|
||
|
|
||
|
<!--
|
||
|
| Based on:
|
||
|
| http://sourceforge.net/p/notepad-plus/patches/613/
|
||
|
\-->
|
||
|
<parser
|
||
|
displayName="C#"
|
||
|
id ="csharp_class"
|
||
|
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
|
||
|
>
|
||
|
<classRange
|
||
|
mainExpr ="^[\t\x20]*((public|protected|private|internal)\s+)?(\w+\s*)?(class|struct|interface)[\t\x20]+[^\{]+\{"
|
||
|
openSymbole ="\{"
|
||
|
closeSymbole="\}"
|
||
|
>
|
||
|
<className>
|
||
|
<nameExpr expr="(class|struct|interface)[\t\x20]+\w+" />
|
||
|
<nameExpr expr="[\t\x20]+\w+" />
|
||
|
<nameExpr expr="\w+" />
|
||
|
</className>
|
||
|
<function
|
||
|
mainExpr="^[^\S\r\n]*(?<modifier1>(?:public|protected|internal|private)\s*)?(?<modifier2>(?:new|static|virtual|sealed|override|abstract|extern)\s*)?(partial\s*)?(?<type>(?!(return|if|else))\w+(?<genericType><[\w,\s<>]+>)?\s+)(?<name>\w+(?<genericNameType><[\w,\s<>]+>)?\s?)\((?<params>[\w\s,<>\[\]\:=\.]*)\)(?<ctorChain>\s*\:\s*(?:base|this)\s*\((?<ctorParams>[\w\s,<>\[\]\:=\.]*)\))?[\w\s<>\:,\(\)\[\]]*(?:\{|;)"
|
||
|
>
|
||
|
<functionName>
|
||
|
<funcNameExpr expr="(\w+(<[\w,\s<>]+>)?\s?)\(" />
|
||
|
<funcNameExpr expr="(\w+(<[\w,\s<>]+>)?\s?)" />
|
||
|
</functionName>
|
||
|
</function>
|
||
|
</classRange>
|
||
|
</parser>
|
||
|
</functionList>
|
||
|
</NotepadPlus>
|