示例#1
0
文件: compile.go 项目: jbert/gol
func (gb *GolangBackend) compileFuncCall(funcNameNode *gol.NodeIdentifier, argNodes *gol.NodeList) (string, error) {

	funcName := mangleIdentifier(funcNameNode.String())
	args := []string{}
	err := argNodes.Foreach(func(n gol.Node) error {
		nStr, err := gb.compile(n)
		if err != nil {
			return err
		}
		args = append(args, nStr)
		return nil
	})
	if err != nil {
		return "", err
	}
	s := funcName + "(" + strings.Join(args, ", ") + ")"
	return s, nil
}
示例#2
0
文件: compile.go 项目: jbert/gol
func (gb *GolangBackend) compileIdentifier(ni *gol.NodeIdentifier) (string, error) {
	return mangleIdentifier(ni.String()), nil
}