loop_yaklangcode

package
v1.4.4-alpha1202c Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateBatchRegexReplaceOptions

func ValidateBatchRegexReplaceOptions(opts *BatchRegexReplaceOptions) error

ValidateBatchRegexReplaceOptions 验证批量正则替换选项

Types

type BatchRegexReplaceOptions

type BatchRegexReplaceOptions struct {
	// 正则表达式模式
	Pattern string
	// 替换字符串
	Replacement string
	// 捕获组编号(0表示替换整个匹配,>0表示替换指定捕获组)
	Group int
	// 是否启用详细日志
	VerboseLog bool
}

BatchRegexReplaceOptions 批量正则替换选项

type BatchRegexReplaceResult

type BatchRegexReplaceResult struct {
	// 修改后的完整代码
	ModifiedCode string
	// 替换的行数
	ReplacementCount int
	// 修改的行详情
	ModifiedLines []ModifiedLineInfo
	// 是否有任何修改
	HasModifications bool
}

BatchRegexReplaceResult 批量正则替换结果

func BatchRegexReplace

func BatchRegexReplace(code string, opts *BatchRegexReplaceOptions) (*BatchRegexReplaceResult, error)

BatchRegexReplace 执行批量正则替换

func BatchRegexReplaceMultiPattern

func BatchRegexReplaceMultiPattern(code string, patterns []BatchRegexReplaceOptions) (*BatchRegexReplaceResult, error)

BatchRegexReplaceMultiPattern 支持多个模式的批量替换

type ErrorPattern

type ErrorPattern struct {
	Name        string
	ErrorGlobs  []string // Error message patterns
	LineGlobs   []string // Line content patterns
	LineRegexps []string // Line content regexps
	Hint        string
	Examples    []string // [incorrect, correct] pairs
}

ErrorPattern represents a pattern for detecting specific syntax errors

type LoopActionHistoryProvider

type LoopActionHistoryProvider interface {
	Get(string) string
	Set(string, any)
	GetLastNAction(int) []*reactloops.ActionRecord
}

LoopActionHistoryProvider 提供 Action 历史记录的接口

type ModifiedLineInfo

type ModifiedLineInfo struct {
	LineNumber   int    // 行号(从1开始)
	OriginalLine string // 原始行内容
	ModifiedLine string // 修改后行内容
}

ModifiedLineInfo 修改行信息

type ModifyRecord

type ModifyRecord struct {
	StartLine int
	EndLine   int
	Content   string
}

ModifyRecord 记录单次 modify_code 操作

type YakdocSearchResult

type YakdocSearchResult struct {
	Path    string
	Content string
}

YakdocSearchResult represents a search result from yakdoc

Jump to

Keyboard shortcuts

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