lang: ast: Clean up code slightly

This commit is contained in:
James Shubin
2024-02-21 13:29:48 -05:00
parent 6ae3481ae9
commit 733d7fb55f

View File

@@ -52,7 +52,9 @@ func FuncPrefixToFunctionsScope(prefix string) map[string]interfaces.Expr {
// XXX: should we run fn.SetType(st.Fn.Type()) ? // XXX: should we run fn.SetType(st.Fn.Type()) ?
exprs[name] = fn exprs[name] = fn
continue continue
} else if st, ok := x.(*simplepoly.WrappedFunc); simplepoly.DirectInterface && ok { }
if st, ok := x.(*simplepoly.WrappedFunc); simplepoly.DirectInterface && ok {
fn := &ExprFunc{ fn := &ExprFunc{
Title: name, Title: name,
@@ -73,8 +75,8 @@ func FuncPrefixToFunctionsScope(prefix string) map[string]interfaces.Expr {
} }
// Wrap every Expr in ExprPoly, so that the function can be used with // Wrap every Expr in ExprPoly, so that the function can be used with
// different types. Those functions are all builtins, so they don't need to // different types. Those functions are all builtins, so they don't need
// access the surrounding scope. // to access the surrounding scope.
exprPolys := make(map[string]interfaces.Expr) exprPolys := make(map[string]interfaces.Expr)
for name, expr := range exprs { for name, expr := range exprs {
exprPolys[name] = &ExprPoly{ exprPolys[name] = &ExprPoly{