diff --git a/ast/counter.go b/ast/counter.go index f5020bf..0145648 100644 --- a/ast/counter.go +++ b/ast/counter.go @@ -126,6 +126,6 @@ func (ctrs counters) termCountChildren(term parser.Term, parent counter) { case parser.ExtRef: ctrs.count(string(t), parent) default: - panic(fmt.Errorf("unexpected term type: %v %[1]T", t)) + panic(fmt.Errorf("counters.termCountChildren: unexpected term type: %v %[1]T", t)) } } diff --git a/ast/from_parsernode.go b/ast/from_parsernode.go index a939957..1f788ab 100644 --- a/ast/from_parsernode.go +++ b/ast/from_parsernode.go @@ -209,6 +209,6 @@ func (b Branch) fromParserNode(g parser.Grammar, term parser.Term, ctrs counters } } default: - panic(fmt.Errorf("unexpected term type: %v %[1]T", t)) + panic(fmt.Errorf("branch.fromParserNode: unexpected term type: %v %[1]T", t)) } } diff --git a/ast/to_parsernode.go b/ast/to_parsernode.go index 43336fe..c368009 100644 --- a/ast/to_parsernode.go +++ b/ast/to_parsernode.go @@ -180,6 +180,6 @@ func (b Branch) toParserNode(g parser.Grammar, term parser.Term, ctrs counters) case parser.CutPoint: return b.toParserNode(g, t.Term, ctrs) default: - panic(fmt.Errorf("unexpected term type: %v %[1]T", t)) + panic(fmt.Errorf("branch.toParserNode: unexpected term type: %v %[1]T", t)) } } diff --git a/cmd/codegen/grammar.go b/cmd/codegen/grammar.go index 42067be..40b5955 100644 --- a/cmd/codegen/grammar.go +++ b/cmd/codegen/grammar.go @@ -155,7 +155,7 @@ func walkTerm(term parser.Term) GoNode { case parser.ExtRef: node = stringNode("parser.ExtRef(`%s`)", safeString(string(t))) default: - panic(fmt.Errorf("unexpected term type: %v %[1]T", t)) + panic(fmt.Errorf("walkTerm: unexpected term type: %v %[1]T", t)) } return node diff --git a/wbnf/cutpoints.go b/wbnf/cutpoints.go index 69db094..8ff83b2 100644 --- a/wbnf/cutpoints.go +++ b/wbnf/cutpoints.go @@ -105,7 +105,7 @@ func findUniqueStrings(g parser.Grammar) frozen.Set { out = out.Merge(forTerm(t.Term), mergeFn) case parser.RE, parser.Rule, parser.ExtRef: // do nothing default: - panic(fmt.Errorf("unexpected term type: %v %[1]T", t)) + panic(fmt.Errorf("findUniqueStrings: unexpected term type: %v %[1]T", t)) } return out } @@ -166,6 +166,6 @@ func fixTerm(term parser.Term, callback func(t parser.Term) parser.Term) parser. case parser.S, parser.REF, parser.RE, parser.Rule, parser.ExtRef: return callback(term) default: - panic(fmt.Errorf("unexpected term type: %v %[1]T", t)) + panic(fmt.Errorf("fixTerm: unexpected term type: %v %[1]T", t)) } }