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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MangleModule ¶
func ResolveAllDependencies ¶
func ResolveAllDependencies(resolver *DependecyResolver, mainFile string) error
从 main 入口开始解析
Types ¶
type DependecyResolver ¶
type DependecyResolver struct {
// contains filtered or unexported fields
}
func NewDependecyResolver ¶
func NewDependecyResolver() *DependecyResolver
type ExportInfo ¶
type ExportInfo struct{}
type ImportInfo ¶
type ImportInfo struct { ModulePath string SymbolName []string Alias string Kind ImportKind }
type ImportKind ¶
type ImportKind int
const ( ImportSingle ImportKind = iota ImportMulti ImportAll )
type Module ¶
type Module struct { Name string // 模块名,要处理别名的情况 import "time" as t Path string // 模块绝对路径 AST *hast.File Exports map[string]*ExportInfo Imports []*ImportInfo Dependencies []string Transpiled *bast.File Symbols *SymbolTable State ModuleState Pkg *config.HuloPkg }
func (*Module) ResolveImportedSymbols ¶
在 main 模块下 查询他的依赖 utils_calculate, add, m_add
type ModuleState ¶
type ModuleState int
const ( ModuleStateUnresolved ModuleState = iota ModuleStateResolved ModuleStateMangled )
type SymbolTable ¶
type SymbolTable struct{}
Click to show internal directories.
Click to hide internal directories.