Skip to content

Commit c1a7fcf

Browse files
xzbdmwgopherbot
authored andcommitted
go/analysis/passes/printf: extract operation parsing logic into tools/internal/fmtstr
This CL made a refactor that extract operation parsing logic into tools/internal/fmtstr package, so they can be used uniformly by printf-analyzer for type checking, DocumentHighlight, and future possibility for SemanticHighlight and rich Hover information with little effort. Previously, the code responsible for parsing and validating printf-style format strings was spread inline and blend together in printf.go, in order to use it for documenthighligt/hover, this CL extends formatState by encoding posRange and metainfo for every sub-item of a operation (flag, width, precision, verb), and only expose those field, by that way callers can compute necessary information from them for various usages. Updates golang/go#70050 Change-Id: I8337ad0bdf9f5c1aa301d2e9155b2d4938cf4a7c GitHub-Last-Rev: 8e57634 GitHub-Pull-Request: #547 Reviewed-on: https://go-review.googlesource.com/c/tools/+/632598 LUCI-TryBot-Result: Go LUCI <[email protected]> Commit-Queue: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
1 parent 1b796a9 commit c1a7fcf

File tree

4 files changed

+562
-239
lines changed

4 files changed

+562
-239
lines changed

0 commit comments

Comments
 (0)