Ваши комментарии

Many thanks and a thousand units of gratitude to you, good sir. I thank you on the behalf of the dev team. :-)

 

Hey, this is pretty good. Thanks so much for your help! I notice the invalid highlighting doesn't play nicely with default values for parameters, so something like:

Function ModFavorPoints(int iFavorPoints = 1)

Can throw off the highlight for the rest of the file. Any thoughts on that? FWIW, I'm using this file as my test case.

 

Heh. It may have gotten "corrupted" by my rambling experiments not knowing what I was doing. :-)

I was also suspicious of the "\b" after your first comment, but it didn't appear to be the culprit here, or at least removing it didn't stop the hangs.

The goal with a self include was to run everything in the pattern through the entire language definition again, so that parameters could be properly colored. If I comment out the contents of that dictionary, function parameters are treated as plain-text. Basically I want to to treat anything in the parentheses of a function declaration as it's own mini-document and run the normal language rules over it. This accomplished that goal, but clearly in some sub-standard way that began choking when something changed in Sublime's internals.


 Managed to at least resolve my own problem, but I think there still might be some bugs in the syntax parser that were not present in previous builds.


Basically, I set my function parameter matcher to stop trying to match at a close parenthesis rather than end of line. Interestingly, it would consistently hang at the 161st function declared in the file. I'm not sure what's magical about that number (it's not a power of two, for instance), but that definitely proved to be the border.


Thanks to FichteFoll for being an excellent sounding board and pointing me in the right direction!

Also... it appears to work fine until it's being run over a file with more than 160 functions in it. Without fail, it will hang the moment the last parenthesis is typed on the declaration of the 161st function. Hmmmm.

If you take a look at the language definition, towards the bottom is a repository where I deal with function parameters, which gets referenced from the area which matches function declarations. So in the following line:

Function DoTheThing(int numberOne, float numberTwo, Actor target)

The parser would recognize that it's a function declaration, then let the "params" entry in the repository parse the bit in parentheses so that the types there would pick up proper syntax highlighting (with "int" and "float" as base types and "Actor" as a class). So it passes them back through with a self include.

As far as I could tell (and I set this definition up a while ago and haven't looked at it since, so I may be forgetting the logic that brought me here), this seemed like the best way of handling it.

So, yeah, sorry I wasn't clear. I'm not trying to pass function parameters into the syntax processing, I'm wanting to properly process the syntax of function parameters. :-)

Thanks for the help -- through a painstaking commenting/uncommenting, I've narrowed it down to this portion towards the bottom of the file:


<key>include</key>
<string>$self</string>


If I comment out the part where I include $self, everything works fine. So I guess the question is, is there a better way to pass function parameters through syntax processing? I'm guessing this enters some kind of infinite loop, but this wasn't the case in earlier builds.



Сервис поддержки клиентов работает на платформе UserEcho