docparse

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package docparse parses structured metadata from Guile-style docstrings.

Docstrings may contain metadata sections (Syntax:, Parameters:, Returns:, Category:, Keywords:) that are extracted into structured fields, and prose sections (Examples:, See also:) that remain in the Doc text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseValueType

func ParseValueType(name string) values.TypeConstraint

ParseValueType converts a Scheme-style type name to a TypeConstraint. Known names return the corresponding ValueType constant. Unknown names return a NamedTypeConstraint preserving the original name. Empty names return nil (unspecified).

Types

type DocInfo

type DocInfo struct {
	Doc        string
	Syntax     string // extracted from "Syntax: ..." line
	ParamNames []string
	ParamTypes []values.TypeConstraint
	ReturnType values.TypeConstraint
	Category   string
	Keywords   []string
}

DocInfo holds structured metadata extracted from a docstring.

func ParseDocstring

func ParseDocstring(raw string) DocInfo

ParseDocstring parses a raw docstring into structured metadata. Metadata sections (Syntax:, Parameters:, Returns:, Category:, Keywords:) are extracted into typed fields. Prose sections (Examples:, See also:) remain in the Doc text.

func (DocInfo) HasStructuredMetadata

func (p DocInfo) HasStructuredMetadata() bool

HasStructuredMetadata reports whether any structured metadata was extracted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL