diff --git a/pkg/addr/fmt.go b/pkg/addr/fmt.go index 12b094d23f..ed9b2d9de1 100644 --- a/pkg/addr/fmt.go +++ b/pkg/addr/fmt.go @@ -65,7 +65,7 @@ func ParseFormattedAS(as string, opts ...FormatOption) (AS, error) { } as = trimmed } - return ParseASSep(as, o.separator) + return parseAS(as, o.separator) } // FormatIA formats the ISD-AS. diff --git a/private/path/fabridquery/parser.go b/private/path/fabridquery/parser.go index 358ffd4a21..954adfd51b 100644 --- a/private/path/fabridquery/parser.go +++ b/private/path/fabridquery/parser.go @@ -176,7 +176,7 @@ func (l *pathpolicyConstraintsListener) ExitWildcardAS(c *pathpolicyconstraints. // ExitLegacyAS is called when exiting the LegacyAS production. func (l *pathpolicyConstraintsListener) ExitLegacyAS(c *pathpolicyconstraints.LegacyASContext) { - as, err := addr.ParseASSep(c.GetText()[1:], "_") + as, err := addr.ParseFormattedAS(c.GetText()[1:], addr.WithSeparator("_")) if err != nil { c.SetException(antlr.NewFailedPredicateException(c.GetParser(), c.GetText(), err.Error())) } @@ -186,7 +186,7 @@ func (l *pathpolicyConstraintsListener) ExitLegacyAS(c *pathpolicyconstraints.Le // ExitAS is called when exiting the AS production. func (l *pathpolicyConstraintsListener) ExitAS(c *pathpolicyconstraints.ASContext) { - as, err := addr.ParseASSep(c.GetText()[1:], "_") + as, err := addr.ParseFormattedAS(c.GetText()[1:], addr.WithSeparator("_")) if err != nil { c.SetException(antlr.NewFailedPredicateException(c.GetParser(), c.GetText(), err.Error())) }