compiler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package compiler handles SIMPL Windows compilation orchestration and result parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCompileTimeLine

func ParseCompileTimeLine(line string) (float64, bool)

ParseCompileTimeLine parses a line like "Compile Time: 0.23 seconds" and returns (0.23, true) if matched, else (0, false).

func ParseStatLine

func ParseStatLine(line, prefix string) (int, bool)

ParseStatLine parses a line like "Program Warnings: 1" and returns (1, true) if matched, else (0, false).

Types

type CompileDependencies

type CompileDependencies struct {
	ProcessMgr    interfaces.ProcessManager
	WindowMgr     interfaces.WindowManager
	Keyboard      interfaces.KeyboardInjector
	ControlReader interfaces.ControlReader
}

CompileDependencies holds all external dependencies for testing

type CompileOptions

type CompileOptions struct {
	FilePath                      string
	RecompileAll                  bool
	Hwnd                          uintptr
	SimplPid                      uint32        // Known PID from ShellExecuteEx (preferred over searching)
	SimplPidPtr                   *uint32       // Pointer to store PID for signal handlers
	SkipPreCompilationDialogCheck bool          // For testing - skip the pre-compilation dialog check
	CompilationTimeout            time.Duration // Override default timeout (0 = use default 5 minutes)
}

CompileOptions holds options for the compilation

type CompileResult

type CompileResult struct {
	Warnings        int
	Notices         int
	Errors          int
	CompileTime     float64
	ErrorMessages   []string
	WarningMessages []string
	NoticeMessages  []string
	HasErrors       bool
}

CompileResult holds the results of a compilation

type Compiler

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

Compiler orchestrates the compilation process with injected dependencies

func NewCompiler

func NewCompiler(log logger.LoggerInterface) *Compiler

NewCompiler creates a new Compiler with the provided logger and default dependencies

func NewCompilerWithDeps

func NewCompilerWithDeps(log logger.LoggerInterface, deps *CompileDependencies) *Compiler

NewCompilerWithDeps creates a new Compiler with custom dependencies for testing

func (*Compiler) Compile

func (c *Compiler) Compile(opts CompileOptions) (*CompileResult, error)

Compile orchestrates the compilation process for a SIMPL Windows file This includes: - Handling pre-compilation dialogs - Triggering the compile - Monitoring compilation progress - Parsing results - Closing dialogs

Jump to

Keyboard shortcuts

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