diff --git a/grammar/grammar.funcs.go b/grammar/grammar.funcs.go index 8224b3b..b767cfc 100644 --- a/grammar/grammar.funcs.go +++ b/grammar/grammar.funcs.go @@ -27,11 +27,11 @@ func (p *Parser) String() string { r += fmt.Sprintf("rule %s", rule.Name) if len(rule.Tags) > 0 { - r += fmt.Sprintf(" :") - for i := 0; i < len(rule.Tags)-1; i++ { - r += fmt.Sprintf(" %s", rule.Tags[i]) + r += " :" + for _, tag := range rule.Tags { + r += fmt.Sprintf(" %s", tag) } - r += fmt.Sprintf("%s {\n", rule.Tags[len(rule.Tags)-1]) + r += " {\n" } else { r += fmt.Sprintf(" {\n") }