Example #1
0
File: compile.go Project: 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
}
Example #2
0
File: compile.go Project: jbert/gol
func (gb *GolangBackend) compileIdentifier(ni *gol.NodeIdentifier) (string, error) {
	return mangleIdentifier(ni.String()), nil
}