config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	L_BASH     = "bash"
	L_BATCH    = "batch"
	L_VBSCRIPT = "vbs"
)
View Source
const HuloPkgFileName = "hulo.pkg.yaml"
View Source
const HuloPkgLockFileName = "hulo.pkg.lock.yaml"
View Source
const HuloRCFileName = "hulorc.yaml"
View Source
const HuloReplFileName = "hulo-repl.yaml"
View Source
const HuloReplTemplate = `` /* 243-byte string literal not displayed */
View Source
const HulocFileName = "huloc.yaml"

HulocFileName is the default configuration file name.

View Source
const PromptThemeTemplate = `` /* 483-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type BashOptions

type BashOptions struct {
	MultiString   string `yaml:"multi_string"`
	BooleanFormat string `yaml:"boolean_format" validate:"oneof=number string command"`
}

BashOptions is the configuration for the Bash compiler.

type BatchOptions

type BatchOptions struct {
	CommentSyntax string `yaml:"comment_syntax" validate:"oneof=rem double_colon"`
}

BatchOptions is the configuration for the Batch compiler.

type CompilerOptions

type CompilerOptions struct {
	Bash     *BashOptions     `yaml:"bash"`
	Batch    *BatchOptions    `yaml:"batch"`
	VBScript *VBScriptOptions `yaml:"vbs"`
}

CompilerOptions is the configuration for the compiler.

type DebugSettingsAnalyzer added in v0.2.0

type DebugSettingsAnalyzer struct {
	Output string `yaml:"output"`
	Enable bool   `yaml:"enable"`
	Timing bool   `yaml:"timing"`
}

type DebugSettingsLexer added in v0.2.0

type DebugSettingsLexer struct {
	Output string `yaml:"output"`
	Enable bool   `yaml:"enable"`
}

type DebugSettingsParser added in v0.2.0

type DebugSettingsParser struct {
	Output string `yaml:"output"`
	Enable bool   `yaml:"enable"`
}

type DebugSettingsToken added in v0.2.0

type DebugSettingsToken struct {
	Output string `yaml:"output"`
	Enable bool   `yaml:"enable"`
}

type DebugSettingsTranspiler added in v0.2.0

type DebugSettingsTranspiler struct {
	Output string `yaml:"output"`
	Enable bool   `yaml:"enable"`
}

type Dependency added in v0.2.0

type Dependency struct {
	Version      string       `yaml:"version"`
	Resolved     string       `yaml:"resolved"`
	Commit       string       `yaml:"commit"`
	Dependencies []Dependency `yaml:"dependencies"`
	Dev          bool         `yaml:"dev"`
}

type HuloPkg added in v0.2.0

type HuloPkg struct {
	Name         string            `yaml:"name"`
	Version      string            `yaml:"version"`
	Description  string            `yaml:"description"`
	Author       string            `yaml:"author"`
	License      string            `yaml:"license"`
	Repository   string            `yaml:"repository"`
	Homepage     string            `yaml:"homepage"`
	Keywords     []string          `yaml:"keywords"`
	Scripts      map[string]string `yaml:"scripts"`
	Dependencies map[string]string `yaml:"dependencies"`
	Main         string            `yaml:"main"`
}

func NewHuloPkg added in v0.2.0

func NewHuloPkg() *HuloPkg

type HuloPkgLock added in v0.2.0

type HuloPkgLock struct {
	Dependencies []Dependency `yaml:"dependencies"`
}

type HuloRC added in v0.2.0

type HuloRC struct {
	Registry    Registry `yaml:"registry"`
	Network     Network  `yaml:"network"`
	HuloModules string   `yaml:"hulo_modules"`
}

type HuloRepl added in v0.2.0

type HuloRepl struct {
	Theme           string                  `yaml:"theme" validate:"oneof=default dark light colorful custom"`
	ThemeFiles      map[string]string       `yaml:"theme_files"`
	HistoryFile     string                  `yaml:"history_file"`
	DevelopmentMode bool                    `yaml:"development_mode"`
	DebugLevel      string                  `yaml:"debug_level" validate:"oneof=debug info warn error"`
	Keybindings     map[string]string       `yaml:"keybindings"`
	MaxSuggestions  uint16                  `yaml:"max_suggestions" validate:"required,min=1,max=100"`
	Parser          DebugSettingsParser     `yaml:"parser" validate:"required"`
	Transpiler      DebugSettingsTranspiler `yaml:"transpiler" validate:"required"`
	Analyzer        DebugSettingsAnalyzer   `yaml:"analyzer" validate:"required"`
	Lexer           DebugSettingsLexer      `yaml:"lexer" validate:"required"`
	Token           DebugSettingsToken      `yaml:"token" validate:"required"`
	Target          string                  `yaml:"target" validate:"required,oneof=bash batch vbs"`
}

type Huloc

type Huloc struct {
	CompilerOptions CompilerOptions `yaml:"compiler_options"`
	Main            string          `yaml:"main" validate:"required,endswith=.hl"`
	Include         []string        `yaml:"include"`
	Exclude         []string        `yaml:"exclude"`
	HuloPath        string          `yaml:"hulopath"`
	// EnableMangle is the option to enable variable name mangling.
	// If true, the variable name will be mangled to a random string, like `_scope_0_1`.
	// If false, the variable name will be used as is.
	EnableMangle bool          `yaml:"enable_mangle"`
	Parser       ParserOptions `yaml:"parser_options"`
	// OutDir is the output directory.
	OutDir string `yaml:"out_dir"`
	// Targets is the targets to compile.
	Targets []string `yaml:"targets"`
}

Huloc is the configuration for the Hulo compiler.

func (*Huloc) Validate

func (c *Huloc) Validate() error

Validate validates the Huloc configuration.

type Network added in v0.2.0

type Network struct {
	Timeout     int `yaml:"timeout"`
	Retries     int `yaml:"retries"`
	Concurrency int `yaml:"concurrency"`
}

type ParserOptions added in v0.2.0

type ParserOptions struct {
	// ShowASTTree is the option to show the AST tree.
	// If the value is "stdout", the AST tree will be shown to the standard output.
	// If the value is "file", the AST tree will be shown to the file.
	// If the value is "none", the AST tree will not be shown.
	ShowASTTree string `yaml:"show_ast_tree"`
	// EnableTracer is the option to enable the tracer.
	EnableTracer bool `yaml:"enable_tracer"`
	// DisableTiming is the option to disable the timing.
	DisableTiming bool `yaml:"disable_timing"`
	// WatchNode is the option to watch the node.
	WatchNode []string `yaml:"watch_node"`
}

ParserOptions is the options for the parser.

type PromptTheme added in v0.2.0

type PromptTheme struct {
	PrefixTextColor              string `yaml:"prefix_text_color"`
	PrefixBGColor                string `yaml:"prefix_bg_color"`
	InputTextColor               string `yaml:"input_text_color"`
	InputBGColor                 string `yaml:"input_bg_color"`
	PreviewSuggestionTextColor   string `yaml:"preview_suggestion_text_color"`
	PreviewSuggestionBGColor     string `yaml:"preview_suggestion_bg_color"`
	SuggestionTextColor          string `yaml:"suggestion_text_color"`
	SuggestionBGColor            string `yaml:"suggestion_bg_color"`
	SelectedSuggestionTextColor  string `yaml:"selected_suggestion_text_color"`
	SelectedSuggestionBGColor    string `yaml:"selected_suggestion_bg_color"`
	DescriptionTextColor         string `yaml:"description_text_color"`
	DescriptionBGColor           string `yaml:"description_bg_color"`
	SelectedDescriptionTextColor string `yaml:"selected_description_text_color"`
	SelectedDescriptionBGColor   string `yaml:"selected_description_bg_color"`
	ScrollbarThumbColor          string `yaml:"scrollbar_thumb_color"`
	ScrollbarBGColor             string `yaml:"scrollbar_bg_color"`
}

type Registry added in v0.2.0

type Registry struct {
	Default string            `yaml:"default"`
	Mirrors map[string]string `yaml:"mirrors"`
}

type VBScriptOptions

type VBScriptOptions struct {
	CommentSyntax string `yaml:"comment_syntax" validate:"oneof=rem single_quote"`
}

VBScriptOptions is the configuration for the VBScript compiler.

Jump to

Keyboard shortcuts

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