
If I notice any problems with this, I'll report them
Code: Select all
class Test{
a() {
}
__New(_hWnd=-1, _debug=0, _test=0) {
return this
}
}
Code: Select all
<parser id="ahk_function" displayName="AHK" commentExpr="((/\*.*?\*)/|((?<=[\s]);.*?$))">
<!-- AutoHotKey Function List -->
<classRange
mainExpr="^[ \t]*(class|struct)[ \t]+[\w]+([ \t]+|[ \t]+(extends)[ \t]+)?\w*([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{"
openSymbole = "\{"
closeSymbole = "\}"
displayMode="node">
<className>
<nameExpr expr="(class|struct)[\s]+[\w]+"/>
<nameExpr expr="[\s]+[\w]+"/>
<nameExpr expr="[\w]+"/>
</className>
<function
mainExpr="^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*(\([^)]*\)|\[[^]]*\])([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*:(?=([\s]*[\r\n]|[\s]+;.*[\r\n]))|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$: ])+\d*(?<![\s])::(?=[^\s])?">
<functionName>
<funcNameExpr expr="([\w#!^+&<>*~$])+\d*(\([^)]*\)|\[[^]]*\])|([\w#!^+&<>*~$: ])+\d*::?"/>
</functionName>
</function>
</classRange>
<function
mainExpr="^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*\([^)]*\)([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*:(?=([\s]*[\r\n]|[\s]+;.*[\r\n]))|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$: ])+\d*(?<![\s])::(?=[^\s])?"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="([\w#!^+&<>*~$])+\d*\([^)]*\)|([\w#!^+&<>*~$: ])+\d*::?"/>
</functionName>
</function>
</parser>
I didn't notice, it's the negative default value causing the problem - I just saw there is a problem. If I'll find further problems, I'll let you know.Nightwolf85 wrote:Wow pretty embarrassing how long this went without getting caught, it wasn't the constructor that was the problem, I hadn't allowed for negative default values... seeing as how that went unnoticed I'm sure there are others, keep pointing them out to me and I'll add the conditions to the parser.
Code: Select all
class Test {
; ******************************************************************************************************************************************
/*
Class: Test
Helper class
Authors:
<hoppfrosch at hoppfrosch@anywhere.com>: Original
value:
xxx - ABC
*/
}
Code: Select all
:?:f::fails on hotstrings with ? option
Code: Select all
<parser id="ahk_function" displayName="AHK" commentExpr="((/\*.*?\*)/|((?<=[\s]);.*?$))">
<!-- AutoHotKey Function List -->
<classRange
mainExpr="^[ \t]*(class|struct)[ \t]+[\w]+([ \t]+|[ \t]+(extends)[ \t]+)?\w*([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{"
openSymbole = "\{"
closeSymbole = "\}"
displayMode="node">
<className>
<nameExpr expr="(class|struct)[\s]+[\w]+"/>
<nameExpr expr="[\s]+[\w]+"/>
<nameExpr expr="[\w]+"/>
</className>
<function
mainExpr="^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*(\([^)]*\)|\[[^]]*\])([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*:(?=([\s]*[\r\n]|[\s]+;.*[\r\n]))|^[ \t]*(?!(;|if\(|while\(|for\())([^\r\n\t])+\d*(?<![\s])::(?=[^\s])?">
<functionName>
<funcNameExpr expr="([\w#!^+&<>*~$])+\d*(\([^)]*\)|\[[^]]*\])|([^\r\n\t])+\d*::?"/>
</functionName>
</function>
</classRange>
<function
mainExpr="^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*\([^)]*\)([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*:(?=([\s]*[\r\n]|[\s]+;.*[\r\n]))|^[ \t]*(?!(;|if\(|while\(|for\())([^\r\n\t])+\d*(?<![\s])::(?=[^\s])?"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="([\w#!^+&<>*~$])+\d*\([^)]*\)|([^\r\n\t])+\d*::?"/>
</functionName>
</function>
</parser>
Code: Select all
class test {
a(){
}
}
Code: Select all
class test {
a(){
}
}
Thanks for the fix.Nightwolf85 wrote: Fixed:
Code: Select all
<parser id="ahk_function" displayName="AHK" commentExpr="((/\*.*?\*)/|((?<=[\s]);.*?$))">
<!-- AutoHotKey Function List -->
<classRange
mainExpr="^[ \t]*(class|struct)[ \t]+[\w]+([ \t]+|[ \t]+(extends)[ \t]+)?\w*([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{"
openSymbole = "\{"
closeSymbole = "\}"
displayMode="node">
<className>
<nameExpr expr="(class|struct)[\s]+[\w]+"/>
<nameExpr expr="[\s]+[\w]+"/>
<nameExpr expr="[\w]+"/>
</className>
<function
mainExpr="^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*(\([^)]*\)|\[[^]]*\])([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*:(?=([\s]*[\r\n]|[\s]+;.*[\r\n]))|^[ \t]*(?!(;|if\(|while\(|for\())([^\r\n\t])+\d*(?<![\s])::">
<functionName>
<funcNameExpr expr="([\w#!^+&<>*~$])+\d*(\([^)]*\)|\[[^]]*\])|([\w#!^+&<>*~$])+\d*:(?!:)|(?![ ])([^\r\n\t])+\d*::"/>
</functionName>
</function>
</classRange>
<function
mainExpr="^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*\([^)]*\)([\s]|(/\*.*?\*)/|((?<=[\s]);[^\r\n]*?$))*?[\s]*\{|^[ \t]*(?!(if\(|while\(|for\())([\w#!^+&<>*~$])+\d*:(?=([\s]*[\r\n]|[\s]+;.*[\r\n]))|^[ \t]*(?!(;|if\(|while\(|for\())([^\r\n\t])+\d*(?<![\s])::"
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="([\w#!^+&<>*~$])+\d*\([^)]*\)|([\w#!^+&<>*~$])+\d*:(?!:)|(?![ ])([^\r\n\t])+\d*::"/>
</functionName>
</function>
</parser>
Hey Nightwolf85, I just wanted to say thank you for all your work on this. I have put this function list ability into play a few minutes ago, and I look forward to taking advantage of it.Nightwolf85 wrote:I noticed another bug, not with finding functions and labels, but with displaying them.
If a function had a default value using the := operator it would display as a label in the list. This wasn't a big deal since nothing was missing, but looked strange and so I fixed it:
Users browsing this forum: No registered users and 4 guests