diff options
| author | Mel <einebeere@gmail.com> | 2022-07-28 21:22:19 +0000 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-07-28 21:22:19 +0000 |
| commit | 95c742ef729a657198be43dc2f295f249860332f (patch) | |
| tree | e6e2aebd39072af63eddd9349443e6981e4a61a9 /pkg/lang/parser/parser_test.go | |
| parent | 895120776a0ae4dd121029f1730d29ca886e201e (diff) | |
| download | jinx-95c742ef729a657198be43dc2f295f249860332f.tar.zst jinx-95c742ef729a657198be43dc2f295f249860332f.zip | |
Finish type decl parser test
Diffstat (limited to 'pkg/lang/parser/parser_test.go')
| -rw-r--r-- | pkg/lang/parser/parser_test.go | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/pkg/lang/parser/parser_test.go b/pkg/lang/parser/parser_test.go index 24f3044..4bdaa1c 100644 --- a/pkg/lang/parser/parser_test.go +++ b/pkg/lang/parser/parser_test.go @@ -757,15 +757,14 @@ func TestTypeDeclStmt(t *testing.T) { Value: ast.ExprBinary{ Left: ast.Expr{ At: source.NewLoc(2, 2), - Kind: ast.ExprKindBinary, - Value: ast.ExprBinary{ - Left: ast.Expr{At: source.NewLoc(2, 2), Kind: ast.ExprKindThis, Value: ast.ExprThis{}}, - Op: ast.BinOpDot, - Right: ast.Expr{ - At: source.NewLoc(2, 7), - Kind: ast.ExprKindIdent, - Value: ast.ExprIdent{Value: ast.IdentNode{At: source.NewLoc(2, 7), Value: "bar"}}, + Kind: ast.ExprKindMember, + Value: ast.ExprMember{ + Obj: ast.Expr{ + At: source.NewLoc(2, 2), + Kind: ast.ExprKindThis, + Value: ast.ExprThis{}, }, + Key: ast.IdentNode{At: source.NewLoc(2, 7), Value: "bar"}, }, }, Op: ast.BinOpAssign, @@ -799,15 +798,14 @@ func TestTypeDeclStmt(t *testing.T) { Value: ast.StmtReturn{ Value: ast.Expr{ At: source.NewLoc(6, 9), - Kind: ast.ExprKindBinary, - Value: ast.ExprBinary{ - Left: ast.Expr{At: source.NewLoc(6, 9), Kind: ast.ExprKindThis, Value: ast.ExprThis{}}, - Op: ast.BinOpDot, - Right: ast.Expr{ - At: source.NewLoc(6, 14), - Kind: ast.ExprKindIdent, - Value: ast.ExprIdent{Value: ast.IdentNode{At: source.NewLoc(6, 14), Value: "bar"}}, + Kind: ast.ExprKindMember, + Value: ast.ExprMember{ + Obj: ast.Expr{ + At: source.NewLoc(6, 9), + Kind: ast.ExprKindThis, + Value: ast.ExprThis{}, }, + Key: ast.IdentNode{At: source.NewLoc(6, 14), Value: "bar"}, }, }, }, |
