feat(bna): implement fix-labels command

The fix-labels command will fix a symbol file by automatically renaming
labels matching a certain regex, and looking for the captured parameter
in a "fixlist" i.e. a newline delimited list of OG names.
This commit is contained in:
phaneron 2026-04-29 03:13:52 -04:00
parent d020e6ba36
commit cbb42eb953
6 changed files with 145 additions and 4 deletions

View file

@ -39,7 +39,7 @@ type QueryParams struct {
MaxBuild uint32
// Regular expression for tokens (symbols/type information)
Token string
// If true, Token is a POSIX regular expression
// If true, Token is a RE2 regular expression
RegEx bool
}
@ -202,9 +202,9 @@ func Query(params *QueryParams) {
var token_query token_query
token_query.params = params
if params.RegEx {
token_query.token_regexp = regexp.MustCompilePOSIX(token_query.params.Token)
token_query.token_regexp = regexp.MustCompile(token_query.params.Token)
} else {
token_query.token_regexp = regexp.MustCompilePOSIX(regexp.QuoteMeta(params.Token))
token_query.token_regexp = regexp.MustCompile(regexp.QuoteMeta(params.Token))
}
if err := token_query.load_sample_database(); err != nil {