mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-29 07:10:26 +08:00
feat(gen): finish core/common
This commit is contained in:
@@ -11,7 +11,7 @@ var (
|
||||
errNoSuchSymbol = errors.New("no such sybmol")
|
||||
)
|
||||
|
||||
type symbolTable map[string]symbol
|
||||
type symbolTable map[string]*symbol
|
||||
|
||||
func (st symbolTable) apply(t string) string {
|
||||
for _, s := range st {
|
||||
@@ -20,6 +20,11 @@ func (st symbolTable) apply(t string) string {
|
||||
return t
|
||||
}
|
||||
|
||||
func (st symbolTable) contains(name string) bool {
|
||||
_, ok := st[name]
|
||||
return ok
|
||||
}
|
||||
|
||||
type symbolType uintptr
|
||||
|
||||
const (
|
||||
@@ -40,16 +45,16 @@ type symbol struct {
|
||||
fields []string
|
||||
}
|
||||
|
||||
func newSymbolConst(name, val string) symbol {
|
||||
return symbol{
|
||||
func newSymbolConst(name, val string) *symbol {
|
||||
return &symbol{
|
||||
stype: symbolTypeConst,
|
||||
name: name,
|
||||
fields: []string{val},
|
||||
}
|
||||
}
|
||||
|
||||
func newSymbolFunc(name, paras, evals string) symbol {
|
||||
return symbol{
|
||||
func newSymbolFunc(name, paras, evals string) *symbol {
|
||||
return &symbol{
|
||||
stype: symbolTypeFunc,
|
||||
name: name,
|
||||
fields: []string{paras, evals},
|
||||
|
||||
Reference in New Issue
Block a user