Hi, @mateos81 and All,
Concerning your present parser :
<parser id="ob_function_old" displayName="Omni-Bot (old)" commentExpr="((/\*.*?\*)/|(//.*?$))">
<function mainExpr="^[ \t]*(global |member )?([0-9A-Za-z_\.]+)(\ *)\=(\ *)function(\ *)\(([0-9A-Za-z_\,\ ]*)\)" displayMode="$functionName">
<functionName>
<nameExpr expr="^[ \t]*(global |member )?\K[0-9A-Za-z_\.]+"/>
</functionName>
</function>
</parser>
I modified and simplified the different regexes, in the same way I did, in my previous post ! So, I ended up with this version :
<parser
id="ob_function_old"
displayName="Omni-Bot (old)"
commentExpr="/\*.*?\*/|//.*?$">
<function
mainExpr="(?-i)^\h*(global\x20|member\x20)?[\w.]+\x20*=(\x20*function\x20*\([\w,\x20]*\))?\s*\{"
displayMode="$functionName">
<functionName>
<nameExpr expr="(?-i)^\h*(global\x20|member\x20)?\K[\w.]+"/>
</functionName>
</function>
</parser>
Remark :
Because of the
in-line // comment, the function
AXIS does
not appear in the
function-list panel.
Logical !
AXIS = // Team
So, three work-around syntaxes are possible :
AXIS = { // Team
AllBots = true, // Each bot is considered for a role
or :
AXIS = {
// Team
AllBots = true, // Each bot is considered for a role
or :
// Team
AXIS =
{
AllBots = true, // Each bot is considered for a role
Note that, with the 1st solution, there must be, at least, two blank characters, between the { and the start comment //, although I don’t understand exactly why ;-))
Given your example file : https://pastebin.com/Uk9jdfzw and using the syntax AXIS = { // Team, the function List panel displays the 22 elements, below :
Map
Navigation
jump
navigate
Roles
AXIS
DEFENDER
DEFENDER1
AxisBridgeSuicide
OnEnter
Test0
Test
Test2
Test_3
OnMapLoad
OnBotJoin
InitializeRoutes
MapRoutes
BUILD_Command_POST
NonFunctionClassLevelTest
NonFunctionClassLevelTestWithFunction
Test
I didn’t study your enhanced parser, with classRange node, yet ! I hope to be able to get some results as I know very little about objects classes :-((
Cheers,
guy038
P.S. :
To test your parser, I used the following association
<association id= "ob_function_old" langID= "0" />
which enabled me to simply use Normal Text language ;-))
IMPORTANT : Follow the link, below, for further discussion !
https://community.notepad-plus-plus.org/post/53905