Spaces:
Sleeping
Sleeping
File size: 2,017 Bytes
f1ff2be | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | <?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>
<!-- ===================================================== [ NppExec ] -->
<parser
displayName="NppExec"
id ="nppexec_syntax"
>
<!-- Define NppExec script as the range started by a pair of colons
and ending right before the next pair of colons or the file's
end, respectively
-->
<classRange
mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
(?ims) # ignore case, ^ and $ match start/end of line, dot matches newline
^\h*
::
.*?
(?=::|\Z)
"
>
<className>
<!-- The script's name is shown without its preceding pair
of colons
-->
<nameExpr expr="(?im-s)^\h*::\K(?:(.+?)(?=\h*\/{2}|$))" />
</className>
<!-- Define jump labels as functions. Names are starting with one
or two colons (thus the script's name itself is shown as a
function) and terminated by a line comment, the line's end
or the file's end
-->
<function
mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
(?im-s) # ignore case, ^ and $ match start/end of line, dot doesn't match newline
^\h*
:{1,2}.+?
\h*(?=\/{2}|$|\Z)
"
>
<functionName>
<!-- The script name is shown including its preceding pair
of colons, jump labels are shown without the preceding
single colon
-->
<funcNameExpr expr="(?im-s)\h*(?(?=::)(.+)|(?::\K(.+)))" />
</functionName>
</function>
</classRange>
</parser>
</functionList>
</NotepadPlus>
|