source

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SourceFile

type SourceFile struct {
	Name    string // Display name (e.g., "script.ts", "<stdin>", "<eval>")
	Path    string // Full file path (empty for REPL/eval)
	Content string // The source code content
	// contains filtered or unexported fields
}

SourceFile represents a source file with its content and metadata

func FromFile

func FromFile(filePath, content string) *SourceFile

FromFile creates a SourceFile from a file path and content

func NewEvalSource

func NewEvalSource(content string) *SourceFile

NewEvalSource creates a source file for eval/REPL input

func NewReplSource

func NewReplSource(content string) *SourceFile

NewReplSource creates a source file for REPL input

func NewSourceFile

func NewSourceFile(name, path, content string) *SourceFile

NewSourceFile creates a new source file

func NewStdinSource

func NewStdinSource(content string) *SourceFile

NewStdinSource creates a source file for stdin input

func (*SourceFile) DisplayPath

func (sf *SourceFile) DisplayPath() string

DisplayPath returns the best path for display (prefers Path, falls back to Name)

func (*SourceFile) IsFile

func (sf *SourceFile) IsFile() bool

IsFile returns true if this represents an actual file (has a path)

func (*SourceFile) Lines

func (sf *SourceFile) Lines() []string

Lines returns the source split into lines (cached)

Jump to

Keyboard shortcuts

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