From b2573802ecaf2a7dbb794a3a82ca8f9f6e95ba4b Mon Sep 17 00:00:00 2001 From: Matthias Simon Date: Fri, 25 Oct 2024 14:59:15 +0200 Subject: [PATCH] Add Region for parser --- ttcn3/syntax/parser.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ttcn3/syntax/parser.go b/ttcn3/syntax/parser.go index 6ee030e0..516b5d23 100644 --- a/ttcn3/syntax/parser.go +++ b/ttcn3/syntax/parser.go @@ -2,11 +2,13 @@ package syntax import ( "bytes" + "context" "errors" "fmt" "io" "io/ioutil" "os" + trc "runtime/trace" "strconv" "strings" @@ -77,6 +79,9 @@ func NewParser(src []byte) *parser { // ErrorList which is sorted by file position. func Parse(src []byte, opts ...ParserOption) (root *Root, names map[string]bool, uses map[string]bool) { + region := trc.StartRegion(context.Background(), "syntax.Parse") + defer region.End() + p := NewParser(src) for _, opt := range opts { if err := opt(p); err != nil {