lang: Rename prog struct field to body
This is more consistent and avoids the future prog.prog stuttering.
This commit is contained in:
@@ -46,7 +46,7 @@ func TestInterpolate0(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{},
|
Body: []interfaces.Stmt{},
|
||||||
}
|
}
|
||||||
testCases = append(testCases, test{ // 0
|
testCases = append(testCases, test{ // 0
|
||||||
"nil",
|
"nil",
|
||||||
@@ -57,7 +57,7 @@ func TestInterpolate0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -101,7 +101,7 @@ func TestInterpolate0(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -130,7 +130,7 @@ func TestInterpolate0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -160,7 +160,7 @@ func TestInterpolate0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -297,7 +297,7 @@ func TestInterpolateBasicStmt(t *testing.T) {
|
|||||||
//}
|
//}
|
||||||
{
|
{
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -315,7 +315,7 @@ func TestInterpolateBasicStmt(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -341,7 +341,7 @@ func TestInterpolateBasicStmt(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -373,7 +373,7 @@ func TestInterpolateBasicStmt(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: resName,
|
Name: resName,
|
||||||
@@ -397,7 +397,7 @@ func TestInterpolateBasicStmt(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
ast := &StmtProg{
|
ast := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -430,7 +430,7 @@ func TestInterpolateBasicStmt(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: resName,
|
Name: resName,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
code: `$rewsna = -42`,
|
code: `$rewsna = -42`,
|
||||||
fail: false,
|
fail: false,
|
||||||
exp: &StmtProg{
|
exp: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "rewsna",
|
Ident: "rewsna",
|
||||||
Value: &ExprInt{
|
Value: &ExprInt{
|
||||||
@@ -360,7 +360,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x1",
|
Ident: "x1",
|
||||||
Value: &ExprCall{
|
Value: &ExprCall{
|
||||||
@@ -381,7 +381,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x1",
|
Ident: "x1",
|
||||||
Value: &ExprCall{
|
Value: &ExprCall{
|
||||||
@@ -409,7 +409,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x1",
|
Ident: "x1",
|
||||||
Value: &ExprCall{
|
Value: &ExprCall{
|
||||||
@@ -430,7 +430,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x1",
|
Ident: "x1",
|
||||||
Value: &ExprCall{
|
Value: &ExprCall{
|
||||||
@@ -494,7 +494,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x1",
|
Ident: "x1",
|
||||||
Value: &ExprVar{
|
Value: &ExprVar{
|
||||||
@@ -514,7 +514,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x1",
|
Ident: "x1",
|
||||||
Value: &ExprVar{
|
Value: &ExprVar{
|
||||||
@@ -570,7 +570,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -611,7 +611,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -663,7 +663,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -715,7 +715,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -767,7 +767,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -819,7 +819,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -871,7 +871,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -923,7 +923,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -972,7 +972,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -1024,7 +1024,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -1091,7 +1091,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -1218,11 +1218,11 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "c1",
|
Name: "c1",
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -1261,11 +1261,11 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "c1",
|
Name: "c1",
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -1306,11 +1306,11 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "c1",
|
Name: "c1",
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -1413,19 +1413,19 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "x",
|
Name: "x",
|
||||||
Args: []*interfaces.Arg{},
|
Args: []*interfaces.Arg{},
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{},
|
Body: []interfaces.Stmt{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "y1",
|
Name: "y1",
|
||||||
Args: []*interfaces.Arg{},
|
Args: []*interfaces.Arg{},
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{},
|
Body: []interfaces.Stmt{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&StmtInclude{
|
&StmtInclude{
|
||||||
@@ -1459,7 +1459,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "c1",
|
Name: "c1",
|
||||||
Args: []*interfaces.Arg{
|
Args: []*interfaces.Arg{
|
||||||
@@ -1473,7 +1473,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprVar{
|
Name: &ExprVar{
|
||||||
@@ -1532,7 +1532,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "c1",
|
Name: "c1",
|
||||||
Args: []*interfaces.Arg{
|
Args: []*interfaces.Arg{
|
||||||
@@ -1546,7 +1546,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprVar{
|
Name: &ExprVar{
|
||||||
@@ -1605,7 +1605,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "foo1",
|
Name: "foo1",
|
||||||
Alias: "",
|
Alias: "",
|
||||||
@@ -1623,7 +1623,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "foo1",
|
Name: "foo1",
|
||||||
Alias: "bar",
|
Alias: "bar",
|
||||||
@@ -1641,7 +1641,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "foo1",
|
Name: "foo1",
|
||||||
Alias: "",
|
Alias: "",
|
||||||
@@ -1669,7 +1669,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "foo1",
|
Name: "foo1",
|
||||||
Alias: "*",
|
Alias: "*",
|
||||||
@@ -1687,11 +1687,11 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtClass{
|
&StmtClass{
|
||||||
Name: "c1",
|
Name: "c1",
|
||||||
Body: &StmtProg{
|
Body: &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "foo",
|
Name: "foo",
|
||||||
Alias: "bar",
|
Alias: "bar",
|
||||||
@@ -1723,7 +1723,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtFunc{
|
&StmtFunc{
|
||||||
Name: "f1",
|
Name: "f1",
|
||||||
Func: &ExprFunc{
|
Func: &ExprFunc{
|
||||||
@@ -1770,7 +1770,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
t.Fatal("could not build type")
|
t.Fatal("could not build type")
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtFunc{
|
&StmtFunc{
|
||||||
Name: "f2",
|
Name: "f2",
|
||||||
Func: fn,
|
Func: fn,
|
||||||
@@ -1821,7 +1821,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
// t.Fatal("could not build type")
|
// t.Fatal("could not build type")
|
||||||
//}
|
//}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtFunc{
|
&StmtFunc{
|
||||||
Name: "f3",
|
Name: "f3",
|
||||||
Func: fn,
|
Func: fn,
|
||||||
@@ -1867,7 +1867,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
t.Fatal("could not build type")
|
t.Fatal("could not build type")
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtFunc{
|
&StmtFunc{
|
||||||
Name: "f4",
|
Name: "f4",
|
||||||
Func: fn,
|
Func: fn,
|
||||||
@@ -1894,7 +1894,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "fn",
|
Ident: "fn",
|
||||||
Value: fn,
|
Value: fn,
|
||||||
@@ -1941,7 +1941,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
t.Fatal("could not build type")
|
t.Fatal("could not build type")
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "fn",
|
Ident: "fn",
|
||||||
Value: fn,
|
Value: fn,
|
||||||
@@ -1988,7 +1988,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
t.Fatal("could not build type")
|
t.Fatal("could not build type")
|
||||||
}
|
}
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "fn",
|
Ident: "fn",
|
||||||
Value: fn,
|
Value: fn,
|
||||||
@@ -2022,7 +2022,7 @@ func TestLexParse0(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp := &StmtProg{
|
exp := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtFunc{
|
&StmtFunc{
|
||||||
Name: "funcgen",
|
Name: "funcgen",
|
||||||
// This is the outer function...
|
// This is the outer function...
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ prog:
|
|||||||
{
|
{
|
||||||
posLast(yylex, yyDollar) // our pos
|
posLast(yylex, yyDollar) // our pos
|
||||||
$$.stmt = &StmtProg{
|
$$.stmt = &StmtProg{
|
||||||
Prog: []interfaces.Stmt{},
|
Body: []interfaces.Stmt{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
| prog stmt
|
| prog stmt
|
||||||
@@ -144,10 +144,10 @@ prog:
|
|||||||
//if _, ok := $2.stmt.(*StmtComment); !ok {
|
//if _, ok := $2.stmt.(*StmtComment); !ok {
|
||||||
//}
|
//}
|
||||||
if stmt, ok := $1.stmt.(*StmtProg); ok {
|
if stmt, ok := $1.stmt.(*StmtProg); ok {
|
||||||
stmts := stmt.Prog
|
stmts := stmt.Body
|
||||||
stmts = append(stmts, $2.stmt)
|
stmts = append(stmts, $2.stmt)
|
||||||
$$.stmt = &StmtProg{
|
$$.stmt = &StmtProg{
|
||||||
Prog: stmts,
|
Body: stmts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2715,7 +2715,7 @@ type StmtProg struct {
|
|||||||
importProgs []*StmtProg // list of child programs after running SetScope
|
importProgs []*StmtProg // list of child programs after running SetScope
|
||||||
importFiles []string // list of files seen during the SetScope import
|
importFiles []string // list of files seen during the SetScope import
|
||||||
|
|
||||||
Prog []interfaces.Stmt
|
Body []interfaces.Stmt
|
||||||
}
|
}
|
||||||
|
|
||||||
// String returns a short representation of this statement.
|
// String returns a short representation of this statement.
|
||||||
@@ -2729,7 +2729,7 @@ func (obj *StmtProg) String() string {
|
|||||||
// Nevertheless, it is a useful facility for operations that might only apply to
|
// Nevertheless, it is a useful facility for operations that might only apply to
|
||||||
// a select number of node types, since they won't need extra noop iterators...
|
// a select number of node types, since they won't need extra noop iterators...
|
||||||
func (obj *StmtProg) Apply(fn func(interfaces.Node) error) error {
|
func (obj *StmtProg) Apply(fn func(interfaces.Node) error) error {
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
if err := x.Apply(fn); err != nil {
|
if err := x.Apply(fn); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -2750,7 +2750,7 @@ func (obj *StmtProg) Init(data *interfaces.Data) error {
|
|||||||
obj.data = data
|
obj.data = data
|
||||||
obj.importProgs = []*StmtProg{}
|
obj.importProgs = []*StmtProg{}
|
||||||
obj.importFiles = []string{}
|
obj.importFiles = []string{}
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
if err := x.Init(data); err != nil {
|
if err := x.Init(data); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -2762,28 +2762,28 @@ func (obj *StmtProg) Init(data *interfaces.Data) error {
|
|||||||
// generally increases the size of the AST when it is used. It calls Interpolate
|
// generally increases the size of the AST when it is used. It calls Interpolate
|
||||||
// on any child elements and builds the new node with those new node contents.
|
// on any child elements and builds the new node with those new node contents.
|
||||||
func (obj *StmtProg) Interpolate() (interfaces.Stmt, error) {
|
func (obj *StmtProg) Interpolate() (interfaces.Stmt, error) {
|
||||||
prog := []interfaces.Stmt{}
|
body := []interfaces.Stmt{}
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
interpolated, err := x.Interpolate()
|
interpolated, err := x.Interpolate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
prog = append(prog, interpolated)
|
body = append(body, interpolated)
|
||||||
}
|
}
|
||||||
return &StmtProg{
|
return &StmtProg{
|
||||||
data: obj.data,
|
data: obj.data,
|
||||||
scope: obj.scope,
|
scope: obj.scope,
|
||||||
importProgs: obj.importProgs, // TODO: do we even need this here?
|
importProgs: obj.importProgs, // TODO: do we even need this here?
|
||||||
importFiles: obj.importFiles,
|
importFiles: obj.importFiles,
|
||||||
Prog: prog,
|
Body: body,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy returns a light copy of this struct. Anything static will not be copied.
|
// Copy returns a light copy of this struct. Anything static will not be copied.
|
||||||
func (obj *StmtProg) Copy() (interfaces.Stmt, error) {
|
func (obj *StmtProg) Copy() (interfaces.Stmt, error) {
|
||||||
copied := false
|
copied := false
|
||||||
prog := []interfaces.Stmt{}
|
body := []interfaces.Stmt{}
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
cp, err := x.Copy()
|
cp, err := x.Copy()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -2791,7 +2791,7 @@ func (obj *StmtProg) Copy() (interfaces.Stmt, error) {
|
|||||||
if cp != x { // must have been copied, or pointer would be same
|
if cp != x { // must have been copied, or pointer would be same
|
||||||
copied = true
|
copied = true
|
||||||
}
|
}
|
||||||
prog = append(prog, cp)
|
body = append(body, cp)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !copied { // it's static
|
if !copied { // it's static
|
||||||
@@ -2802,7 +2802,7 @@ func (obj *StmtProg) Copy() (interfaces.Stmt, error) {
|
|||||||
scope: obj.scope,
|
scope: obj.scope,
|
||||||
importProgs: obj.importProgs, // TODO: do we even need this here?
|
importProgs: obj.importProgs, // TODO: do we even need this here?
|
||||||
importFiles: obj.importFiles,
|
importFiles: obj.importFiles,
|
||||||
Prog: prog,
|
Body: body,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2827,7 +2827,7 @@ func (obj *StmtProg) Ordering(produces map[string]interfaces.Node) (*pgraph.Grap
|
|||||||
graph.AddVertex(obj)
|
graph.AddVertex(obj)
|
||||||
|
|
||||||
prod := make(map[string]interfaces.Node)
|
prod := make(map[string]interfaces.Node)
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
if stmt, ok := x.(*StmtClass); ok {
|
if stmt, ok := x.(*StmtClass); ok {
|
||||||
if stmt.Name == "" {
|
if stmt.Name == "" {
|
||||||
return nil, nil, fmt.Errorf("missing class name")
|
return nil, nil, fmt.Errorf("missing class name")
|
||||||
@@ -2880,7 +2880,7 @@ func (obj *StmtProg) Ordering(produces map[string]interfaces.Node) (*pgraph.Grap
|
|||||||
|
|
||||||
cons := make(map[interfaces.Node]string) // swapped!
|
cons := make(map[interfaces.Node]string) // swapped!
|
||||||
|
|
||||||
for _, node := range obj.Prog {
|
for _, node := range obj.Body {
|
||||||
g, c, err := node.Ordering(newProduces)
|
g, c, err := node.Ordering(newProduces)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
@@ -3348,7 +3348,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
newVariables := make(map[string]string)
|
newVariables := make(map[string]string)
|
||||||
newFunctions := make(map[string]string)
|
newFunctions := make(map[string]string)
|
||||||
newClasses := make(map[string]string)
|
newClasses := make(map[string]string)
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
imp, ok := x.(*StmtImport)
|
imp, ok := x.(*StmtImport)
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
@@ -3427,7 +3427,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
// collect all the bind statements in the first pass
|
// collect all the bind statements in the first pass
|
||||||
// this allows them to appear out of order in this scope
|
// this allows them to appear out of order in this scope
|
||||||
binds := make(map[string]struct{}) // bind existence in this scope
|
binds := make(map[string]struct{}) // bind existence in this scope
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
bind, ok := x.(*StmtBind)
|
bind, ok := x.(*StmtBind)
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
@@ -3447,7 +3447,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
|
|
||||||
// now collect all the functions, and group by name (if polyfunc is ok)
|
// now collect all the functions, and group by name (if polyfunc is ok)
|
||||||
funcs := make(map[string][]*StmtFunc)
|
funcs := make(map[string][]*StmtFunc)
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
fn, ok := x.(*StmtFunc)
|
fn, ok := x.(*StmtFunc)
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
@@ -3487,7 +3487,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
// now collect any classes
|
// now collect any classes
|
||||||
// TODO: if we ever allow poly classes, then group in lists by name
|
// TODO: if we ever allow poly classes, then group in lists by name
|
||||||
classes := make(map[string]struct{})
|
classes := make(map[string]struct{})
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
class, ok := x.(*StmtClass)
|
class, ok := x.(*StmtClass)
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
@@ -3509,7 +3509,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
// cases, such as double-recursion. It's left here for reference.
|
// cases, such as double-recursion. It's left here for reference.
|
||||||
if legacyProgSetScope {
|
if legacyProgSetScope {
|
||||||
// first set the scope on the classes, since it gets used in include...
|
// first set the scope on the classes, since it gets used in include...
|
||||||
for _, stmt := range obj.Prog {
|
for _, stmt := range obj.Body {
|
||||||
//if _, ok := stmt.(*StmtClass); !ok {
|
//if _, ok := stmt.(*StmtClass); !ok {
|
||||||
// continue
|
// continue
|
||||||
//}
|
//}
|
||||||
@@ -3529,7 +3529,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now set the child scopes...
|
// now set the child scopes...
|
||||||
for _, stmt := range obj.Prog {
|
for _, stmt := range obj.Body {
|
||||||
// NOTE: We used to skip over *StmtClass here for recursion...
|
// NOTE: We used to skip over *StmtClass here for recursion...
|
||||||
// Skip over *StmtClass here, since we already did it above...
|
// Skip over *StmtClass here, since we already did it above...
|
||||||
if _, ok := stmt.(*StmtClass); ok {
|
if _, ok := stmt.(*StmtClass); ok {
|
||||||
@@ -3614,7 +3614,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
if _, ok := x.(*StmtImport); ok { // TODO: should we skip this?
|
if _, ok := x.(*StmtImport); ok { // TODO: should we skip this?
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !stmtInList(stmt, obj.Prog) {
|
if !stmtInList(stmt, obj.Body) {
|
||||||
// Skip any unwanted additions that we pulled in.
|
// Skip any unwanted additions that we pulled in.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -3637,7 +3637,7 @@ func (obj *StmtProg) SetScope(scope *interfaces.Scope) error {
|
|||||||
if _, ok := x.(*StmtImport); ok { // TODO: should we skip this?
|
if _, ok := x.(*StmtImport); ok { // TODO: should we skip this?
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !stmtInList(stmt, obj.Prog) {
|
if !stmtInList(stmt, obj.Body) {
|
||||||
// Skip any unwanted additions that we pulled in.
|
// Skip any unwanted additions that we pulled in.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -3662,7 +3662,7 @@ func (obj *StmtProg) Unify() ([]interfaces.Invariant, error) {
|
|||||||
var invariants []interfaces.Invariant
|
var invariants []interfaces.Invariant
|
||||||
|
|
||||||
// collect all the invariants of each sub-expression
|
// collect all the invariants of each sub-expression
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
// skip over *StmtClass here
|
// skip over *StmtClass here
|
||||||
if _, ok := x.(*StmtClass); ok {
|
if _, ok := x.(*StmtClass); ok {
|
||||||
continue
|
continue
|
||||||
@@ -3706,7 +3706,7 @@ func (obj *StmtProg) Graph() (*pgraph.Graph, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// collect all graphs that need to be included
|
// collect all graphs that need to be included
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
// skip over *StmtClass here
|
// skip over *StmtClass here
|
||||||
if _, ok := x.(*StmtClass); ok {
|
if _, ok := x.(*StmtClass); ok {
|
||||||
continue
|
continue
|
||||||
@@ -3747,7 +3747,7 @@ func (obj *StmtProg) Output() (*interfaces.Output, error) {
|
|||||||
resources := []engine.Res{}
|
resources := []engine.Res{}
|
||||||
edges := []*interfaces.Edge{}
|
edges := []*interfaces.Edge{}
|
||||||
|
|
||||||
for _, stmt := range obj.Prog {
|
for _, stmt := range obj.Body {
|
||||||
// skip over *StmtClass here so its Output method can be used...
|
// skip over *StmtClass here so its Output method can be used...
|
||||||
if _, ok := stmt.(*StmtClass); ok {
|
if _, ok := stmt.(*StmtClass); ok {
|
||||||
// don't read output from StmtClass, it
|
// don't read output from StmtClass, it
|
||||||
@@ -3790,7 +3790,7 @@ func (obj *StmtProg) Output() (*interfaces.Output, error) {
|
|||||||
// TODO: return a multierr with all the unsafe elements, to provide better info
|
// TODO: return a multierr with all the unsafe elements, to provide better info
|
||||||
// TODO: technically this could be a method on Stmt, possibly using Apply...
|
// TODO: technically this could be a method on Stmt, possibly using Apply...
|
||||||
func (obj *StmtProg) IsModuleUnsafe() error { // TODO: rename this function?
|
func (obj *StmtProg) IsModuleUnsafe() error { // TODO: rename this function?
|
||||||
for _, x := range obj.Prog {
|
for _, x := range obj.Body {
|
||||||
// stmt's allowed: import, bind, func, class
|
// stmt's allowed: import, bind, func, class
|
||||||
// stmt's not-allowed: if, include, res, edge
|
// stmt's not-allowed: if, include, res, edge
|
||||||
switch x.(type) {
|
switch x.(type) {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
{
|
{
|
||||||
expr := &ExprStr{V: "hello"}
|
expr := &ExprStr{V: "hello"}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{V: "t1"},
|
Name: &ExprStr{V: "t1"},
|
||||||
@@ -88,7 +88,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{V: "test"},
|
Name: &ExprStr{V: "test"},
|
||||||
@@ -128,7 +128,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{V: "test"},
|
Name: &ExprStr{V: "test"},
|
||||||
@@ -170,7 +170,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{V: "test"},
|
Name: &ExprStr{V: "test"},
|
||||||
@@ -216,7 +216,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -271,7 +271,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -327,7 +327,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtRes{
|
&StmtRes{
|
||||||
Kind: "test",
|
Kind: "test",
|
||||||
Name: &ExprStr{
|
Name: &ExprStr{
|
||||||
@@ -372,7 +372,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x",
|
Ident: "x",
|
||||||
Value: innerFunc,
|
Value: innerFunc,
|
||||||
@@ -419,7 +419,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "x",
|
Ident: "x",
|
||||||
Value: innerFunc,
|
Value: innerFunc,
|
||||||
@@ -467,7 +467,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtBind{
|
&StmtBind{
|
||||||
Ident: "v",
|
Ident: "v",
|
||||||
Value: &ExprInt{
|
Value: &ExprInt{
|
||||||
@@ -513,7 +513,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
Args: []interfaces.Expr{},
|
Args: []interfaces.Expr{},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "datetime",
|
Name: "datetime",
|
||||||
},
|
},
|
||||||
@@ -552,7 +552,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "sys",
|
Name: "sys",
|
||||||
},
|
},
|
||||||
@@ -592,7 +592,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
// stmt := &StmtProg{
|
// stmt := &StmtProg{
|
||||||
// Prog: []interfaces.Stmt{
|
// Body: []interfaces.Stmt{
|
||||||
// &StmtImport{
|
// &StmtImport{
|
||||||
// Name: "fmt",
|
// Name: "fmt",
|
||||||
// },
|
// },
|
||||||
@@ -637,7 +637,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
// stmt := &StmtProg{
|
// stmt := &StmtProg{
|
||||||
// Prog: []interfaces.Stmt{
|
// Body: []interfaces.Stmt{
|
||||||
// &StmtImport{
|
// &StmtImport{
|
||||||
// Name: "fmt",
|
// Name: "fmt",
|
||||||
// },
|
// },
|
||||||
@@ -679,7 +679,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "fmt",
|
Name: "fmt",
|
||||||
},
|
},
|
||||||
@@ -732,7 +732,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "fmt",
|
Name: "fmt",
|
||||||
},
|
},
|
||||||
@@ -781,7 +781,7 @@ func TestUnification1(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
stmt := &StmtProg{
|
stmt := &StmtProg{
|
||||||
Prog: []interfaces.Stmt{
|
Body: []interfaces.Stmt{
|
||||||
&StmtImport{
|
&StmtImport{
|
||||||
Name: "fmt",
|
Name: "fmt",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user