Go lang: some functions not matched

Started by ccpaging, February 23, 2016, 06:07:18 AM

Previous topic - Next topic

ccpaging


<Label group="Function" match="func\s+(\w+)([^\{]*)\{" name="\1" descr="\1 \2" scope="1" image="18"/>


can match


func NewEncoding(encoder string) *Encoding {


but not match


func (enc *Encoding) EncodeToString(src []byte) string {


As c++, "(enc *Encoding)" is "class", EncodeToString is "method".

ccpaging

<Label group="Function" match="func\s+([^\{]*)\{" name="\1" descr="\1 \2" scope="1" image="18"/>

This may better.

alex

Hi,

thanks for feedback and suggestion!. Honestly I have written schema, but now one has validated it before. So it may happen that it is not optimal and probably does not have some newest syntax schema features (fex Scope Exits)..

You mostly correct, except of fact that than 2 capture is gone. But I think it is OK.
This version may be even better ;)
Code (xml) Select
<Label group="Function" match="func\s+([^\{]+?)\s+?\{" name="\1" descr="\1" scope="1" image="18"/>

I have version in Online repository also. So you can update your schema manually or with Update Manager (Help->Check for updates...).

Best regards,
Alex.
P.S: If you will have some more comments/suggestions for Go schema, I will be happy to update it.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

ccpaging

#3
That is fine.

[attach=2]

ccpaging


func Logf(lvl Level, format string, args ...interface{}) {
Global.intLogf(lvl, format, args...)
}


This is not in function list.

alex

To get that working one need more complex regexp :) And who knows how long it will survive (at least until one would use () inside of the parameters section).
The Label definition from below shall work better:
Code (xml) Select
<Label group="Function" match="func\s+(?:(\([^\)]+?\))\s+)?(\w+)\s*(\([^\)]+?\))\s*(?:([^\{]+?)\s*)?\{" name="\1 \2 \3 \4" descr="\1" scope="1" image="18"/>
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

ccpaging

#6
It is working.   ;)

But others is missing.

The attach file is a sample.

Thanks very much.

alex

To be precise: "some other missing" :)
Please validate this one:
Code (xml) Select
<Label group="Function" match="func\s+(?:(\([^\)]+?\))\s+)?(\w+)\s*(\([^\)]*?\))\s*(?:([^\{]+?)\s*)?\{" name="\1 \2 \3 \4" descr="\1" scope="1" image="18" style="function" highlight="\2"/>

You can try it with a syntax schema file attached - there are some other features added.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

ccpaging

 :) :) :) The last one is fine, everything.