mappings

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name       string   `json:"name"`
	Type       string   `json:"type"`
	Modifiers  []string `json:"modifiers,omitempty"`
	Visibility string   `json:"visibility,omitempty"`
}

Field represents a class field

type Generator

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

Generator generates mappings.json from Polyloft source files

func NewGenerator

func NewGenerator(rootPath string) *Generator

NewGenerator creates a new mappings generator

func (*Generator) Generate

func (g *Generator) Generate(outputPath string) error

Generate creates a mappings.json file by scanning all .pf files

type Mappings

type Mappings struct {
	Version  string                    `json:"version"`
	Packages map[string]PackageMapping `json:"packages"`
}

Mappings represents the complete mapping file

type PackageMapping

type PackageMapping struct {
	Name        string            `json:"name"`
	Path        string            `json:"path"`
	Description string            `json:"description,omitempty"`
	Version     string            `json:"version"`
	Symbols     []Symbol          `json:"symbols"`
	Imports     []string          `json:"imports"`
	Exports     []string          `json:"exports"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

PackageMapping represents all symbols in a package/module

type Parameter

type Parameter struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Optional bool   `json:"optional,omitempty"`
	Variadic bool   `json:"variadic,omitempty"`
}

Parameter represents a function parameter

type Symbol

type Symbol struct {
	Name        string            `json:"name"`
	Type        string            `json:"type"` // "class", "function", "variable", "constant"
	ReturnType  string            `json:"returnType,omitempty"`
	Parameters  []Parameter       `json:"parameters,omitempty"`
	Fields      []Field           `json:"fields,omitempty"`
	Methods     []Symbol          `json:"methods,omitempty"`
	Description string            `json:"description,omitempty"`
	File        string            `json:"file"`
	Line        int               `json:"line"`
	Parent      string            `json:"parent,omitempty"`
	Implements  []string          `json:"implements,omitempty"`
	Modifiers   []string          `json:"modifiers,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

Symbol represents a symbol (class, function, variable, etc.) in a Polyloft file

Jump to

Keyboard shortcuts

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