Documentation
¶
Overview ¶
Package comments extracts comments from source code using a character-level scanner configured by language-specific syntax families.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SupportedLanguages ¶
func SupportedLanguages() []string
SupportedLanguages returns all language names that have comment extraction support.
Types ¶
type Comment ¶
type Comment struct {
Text string // comment text without delimiters, trimmed
Kind string // "line", "block", or "doc"
Line int // 1-based start line
EndLine int // 1-based end line
Col int // 1-based start column
EndCol int // 1-based end column
}
Comment represents a single comment extracted from source code.
type Family ¶
type Family struct {
LinePrefix string // e.g. "//" or "#"; empty if no line comments
BlockOpen string // e.g. "/*"; empty if no block comments
BlockClose string // e.g. "*/"; empty if no block comments
}
Family describes the comment syntax for a group of languages.
func FamilyForLanguage ¶
FamilyForLanguage returns the comment syntax family for a language, or nil if the language has no comment syntax (e.g. json).
Click to show internal directories.
Click to hide internal directories.