Oh my… I didn’t type the disjunction pipe (|) between the single line comment’s RE and the string literals’ one. How awful of me…
Thank you very much, @MAPJe71 , yours works flawlessly. You’ve even added the restriction of multi-line comments’ delimiters to be at the start of the line, which I also missed.
However, though not explicitly said in the AHK documentation, multi-line comments allow arbitrary indentation before their delimiters, so I’ve added that as well, a minor change.
Also, single line comments’ delimiter in this language must not be preceded by non-space, so I’ve added the assertion (?<!\S) too, which is clearer than the original I used, (^|\s) (which is not even an assertion, but does the trick).
And, regarding the flags, I think neither the multi-line nor single-line RE flags are explicitly needed in the expression, since they are both enabled by default in the parser (I’ve tested it), and the negated single-line flag can be bypassed by using the non-greedy wildcard, as I originally did. But, anyways, they clarify the purpose of the RE, and even if the Functions List engine changed its behavior regarding this matter, your RE would continue to work, so I’ll use the explicit flags as well.
I should probably have done the comentExpr and classRange’s mainExpr with the extended RE flag, as the other larger ones, so this wouldn’t have happened.
Sorry I posted for nothing, it was already night and I was losing all hope. Thank you for your quick response. ^^
Also, regarding the displayMode attribute, I knew it wasn’t used as of now, but I had read it was reserved for future use, so I tried to guess something and see if it worked in the future. But now that you mention it, I’ve checked the other native parsers in the file and none of them include it, so I guess this implementation has perhaps been cancelled and I’ve removed it from mine as well. Thanks.
Btw, I’ve noticed that global functions are unaffected by the commentExpr, yet not methods within classes. It’s not a problem at all, but it surprised me, so I’ll let it written here in case someone is puzzled by this as well. In a code like this:
class myClass {
/*
myMethod() ...
*/
}
/*
myFunction() ...
*/
myFunction will be found by the parser, yet being commented, but not myMethod, which is commented as well (regardless of the indentation of the comment delimiters).