Commit graph

1 commit

Author SHA1 Message Date
Austin Clements
4e695dd634 go/ast: add ParseDirective for parsing directive comments
This adds an ast.Directive API for parsing directive comments such as
"//go:build" and "//go:embed".

This will help tools standardize the syntax of these directive
comments. Even within the standard Go tools there's little agreement
on the finer details of the syntax of directives today.

Fixes #68021.

Change-Id: I84a988a667682c9ac70632df6e925461ac95e381
Reviewed-on: https://go-review.googlesource.com/c/go/+/704835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2025-10-21 14:49:10 -07:00