lang: Core language and GAPI changes

These changes help plumb things in more easily for the lambdas work.
This commit is contained in:
James Shubin
2023-09-25 16:10:10 -04:00
parent 47d2a661bc
commit d4b1e8f1be
6 changed files with 261 additions and 1037 deletions

View File

@@ -451,60 +451,6 @@ func TestUnification1(t *testing.T) {
},
})
}
{
//$v = 42
//$x = template("hello", $v) # redirect var for harder unification
//test "t1" {
// anotherstr => $x,
//}
innerFunc := &ast.ExprCall{
Name: "template",
Args: []interfaces.Expr{
&ast.ExprStr{
V: "hello", // whatever...
},
&ast.ExprVar{
Name: "v",
},
},
}
stmt := &ast.StmtProg{
Body: []interfaces.Stmt{
&ast.StmtBind{
Ident: "v",
Value: &ast.ExprInt{
V: 42,
},
},
&ast.StmtBind{
Ident: "x",
Value: innerFunc,
},
&ast.StmtRes{
Kind: "test",
Name: &ast.ExprStr{
V: "t1",
},
Contents: []ast.StmtResContents{
&ast.StmtResField{
Field: "anotherstr",
Value: &ast.ExprVar{
Name: "x",
},
},
},
},
},
}
testCases = append(testCases, test{
name: "complex template",
ast: stmt,
fail: false,
expect: map[interfaces.Expr]*types.Type{
innerFunc: types.NewType("str"),
},
})
}
{
// import "datetime"
//test "t1" {