parser

package
v0.1.0-preview.8 Latest Latest
Warning

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

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

Documentation

Overview

Package parser parses Spice annotations embedded in valid Go comments.

@NamedInterface("parser")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLegacyImportError

func IsLegacyImportError(err error) bool

IsLegacyImportError reports whether parsing found the retired import spelling. Callers use this to attach the hard-cut diagnostic and exact replacement without accepting the old directive.

func ParseComment

func ParseComment(input string, position token.Position) (annotation.Annotation, bool, error)

ParseComment parses a single comment line. The bool reports whether the line contains a Spice annotation. Both "//@Name" and "// @Name" are accepted.

func ParseImportComment

func ParseImportComment(
	input string,
	position token.Position,
) (annotation.ImportDirective, bool, error)

ParseImportComment parses one file-scoped annotation import declaration. The bool distinguishes ordinary comments from malformed import declarations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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