Add GetRule function for RSRParsers

This commit is contained in:
TeoV
2020-03-10 11:16:07 +02:00
committed by Dan Christian Bogos
parent 1f684b5d1a
commit 8e1898e6c9

View File

@@ -63,6 +63,17 @@ func NewRSRParsersMustCompile(parsersRules string, allFiltersMatch bool, rsrSepa
// RSRParsers is a set of RSRParser
type RSRParsers []*RSRParser
func (prsrs RSRParsers) GetRule() (out string) {
for i, prsr := range prsrs {
if i == 0 {
out = prsr.Rules
} else {
out = out + utils.NestingSep + prsr.Rules
}
}
return
}
func (prsrs RSRParsers) Compile() (err error) {
for _, prsr := range prsrs {
if err = prsr.Compile(); err != nil {