parsers

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, p Parser)

func SanitizeToIdentifier

func SanitizeToIdentifier(name string) string

SanitizeToIdentifier converts a string into a valid Go identifier (CamelCase). It handles hyphens, underscores, and other non-alphanumeric characters by acting as delimiters for CamelCasing.

func ToKebabCase

func ToKebabCase(s string) string

ToKebabCase converts a CamelCase string to kebab-case. It handles acronyms (e.g. JSONData -> json-data) and simple cases (CamelCase -> camel-case).

Types

type NameAllocator

type NameAllocator struct {
	// contains filtered or unexported fields
}

NameAllocator manages the assignment of unique identifier names.

func NewNameAllocator

func NewNameAllocator() *NameAllocator

NewNameAllocator creates a new allocator with pre-reserved names.

func (*NameAllocator) Allocate

func (na *NameAllocator) Allocate(input string) string

Allocate generates a unique name based on the input string. It sanitizes the input and handles collisions by appending numbers.

type ParseOptions added in v0.0.20

type ParseOptions struct {
	SearchPaths []string
	Recursive   bool
}

type Parser

type Parser interface {
	Parse(fsys fs.FS, root string, options *ParseOptions) (*model.DataModel, error)
}

func Get

func Get(name string) (Parser, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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