katef / libfsm

DFA regular expression library & friends
BSD 2-Clause "Simplified" License
931 stars 52 forks source link

provide more control over generated function and package names for Go #402

Closed dgryski closed 1 year ago

dgryski commented 1 year ago

Fixes #360

$ re -r pcre -k pair -e Meow -E 'matchers' -pl amd64_go meow |head -4
#include "textflag.h"

// func MeowMatch(data []byte) int
TEXT    ·MeowMatch(SB), NOSPLIT, $0-32

$ re -r pcre -k pair -e Meow -E 'matchers'-pl go meow |head -4
package matchersfsm

func MeowMatch(data []byte) int {
    var idx = ^uint(0)
dgryski commented 1 year ago

Not super happy with the choice of E for the flag, nor do I like that it changes the default behaviour for the Go printer (even if I think it makes it better).