feat(aa): add the Kind struct to manage aa rules.

This commit is contained in:
Alexandre Pujol 2024-05-28 18:15:22 +01:00
parent 1333ec2025
commit 3b0944c615
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
23 changed files with 239 additions and 223 deletions

View file

@ -24,7 +24,7 @@ func newRule(rule []string) RuleBase {
idx := 0
for idx < len(rule) {
if rule[idx] == tokCOMMENT {
if rule[idx] == COMMENT.Tok() {
comment = " " + strings.Join(rule[idx+1:], " ")
break
}
@ -85,15 +85,15 @@ func (r RuleBase) Equals(other any) bool {
}
func (r RuleBase) String() string {
return renderTemplate("comment", r)
return renderTemplate(r.Kind(), r)
}
func (r RuleBase) Constraint() constraint {
return anyKind
}
func (r RuleBase) Kind() string {
return "base"
func (r RuleBase) Kind() Kind {
return COMMENT
}
type Qualifier struct {