Author Topic: Go lang: some functions not matched  (Read 625 times)

Offline ccpaging

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Go lang: some functions not matched
« on: February 23, 2016, 06:07:18 am »
Code: [Select]
<Label group="Function" match="func\s+(\w+)([^\{]*)\{" name="\1" descr="\1 \2" scope="1" image="18"/>

can match

Code: [Select]
func NewEncoding(encoder string) *Encoding {

but not match

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

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

Offline ccpaging

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Go lang: some functions not matched
« Reply #1 on: February 23, 2016, 03:12:28 pm »
Code: [Select]
<Label group="Function" match="func\s+([^\{]*)\{" name="\1" descr="\1 \2" scope="1" image="18"/>
This may better.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2161
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Go lang: some functions not matched
« Reply #2 on: February 23, 2016, 11:51:19 pm »
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
  1. <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.

Offline ccpaging

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Go lang: some functions not matched
« Reply #3 on: February 24, 2016, 05:04:35 am »
That is fine.

[ Specified attachment is not available ]
« Last Edit: February 24, 2016, 05:06:42 am by ccpaging »