parser

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package parser preserves srcpack's historical parser API while delegating source extraction and cleanup to nexssp/lang.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanSource

func CleanSource(src []byte, opts Options, out *bytes.Buffer)

CleanSource applies source cleanup using the shared language implementation.

func ProcessContent

func ProcessContent(src string, opts Options) string

ProcessContent applies the requested cleanup to full source text.

func StripComments

func StripComments(src string) string

StripComments removes comments while preserving string literals.

func TrimBlankLines

func TrimBlankLines(src string) string

TrimBlankLines collapses runs of blank lines.

func TrimIndent

func TrimIndent(src string) string

TrimIndent removes leading indentation from every line.

func Truncate

func Truncate(src []byte, opts Options, snippets []string) string

Truncate keeps configured head and tail lines and marks omitted content.

Types

type Options

type Options = extract.Options

Options controls language extraction and source cleanup.

type Result

type Result = extract.Result

Result contains extracted declaration snippets, function metadata, or processed content when signatures are unavailable.

func Parse

func Parse(path string, src []byte, lang string, opts Options) (Result, error)

Parse delegates language-specific source extraction to nexssp/lang.

Jump to

Keyboard shortcuts

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