PeterCJ 8435308b02 Add XSD-based validation for the various XML files
And fix the themes and javascript.js functionlist that don’t match XSD.

Fix #16618, close #16619
2025-06-04 19:42:01 +02:00

48 lines
1.7 KiB
XML

<?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>
<!-- ================================================ [ JavaScript ] -->
<parser
displayName="JavaScript"
id ="javascript_function"
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
>
<classRange mainExpr="\bclass\s+[A-Za-z_$][\w$]*[^{]*{" openSymbole="\{" closeSymbole="\}">
<className>
<!-- Make consecutive patterns to extract the identifier. -->
<nameExpr expr="class\s+[A-Za-z_$][\w$]*" />
<nameExpr expr="\s+[A-Za-z_$][\w$]*" />
<nameExpr expr="[A-Za-z_$][\w$]*" />
</className>
<function mainExpr="\b(?:(?:static|async)\s+)?\b(?!if|while|for|switch)\b[A-Za-z_$][\w$]*\s*\([^\)]*\)\s*{">
<functionName>
<funcNameExpr expr="[A-Za-z_$][\w$]*\s*\(" />
<funcNameExpr expr="[A-Za-z_$][\w$]*" />
</functionName>
</function>
</classRange>
<function
mainExpr="((^|\s+|[;\}\.])([A-Za-z_$][\w$]*\.)*[A-Za-z_$][\w$]*\s*[=:]|^|[\s;\}]+)\s*function(\s+[A-Za-z_$][\w$]*)?\s*\([^\)\(]*\)[\n\s]*\{"
>
<functionName>
<nameExpr expr="[A-Za-z_$][\w$]*\s*[=:]|[A-Za-z_$][\w$]*\s*\(" />
<nameExpr expr="[A-Za-z_$][\w$]*" />
</functionName>
<className>
<nameExpr expr="([A-Za-z_$][\w$]*\.)*[A-Za-z_$][\w$]*\." />
<nameExpr expr="([A-Za-z_$][\w$]*\.)*[A-Za-z_$][\w$]*" />
</className>
</function>
</parser>
</functionList>
</NotepadPlus>