Skip to content

Commit

Permalink
TestErrTuple
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jul 5, 2022
1 parent 6c1a19c commit 232a527
Show file tree
Hide file tree
Showing 14 changed files with 198 additions and 168 deletions.
10 changes: 10 additions & 0 deletions parser/_nofmt/cmdlinestyle1/cmd.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package main

func main() {
changeYpos -0.7, 8
changeYpos -0.7
changeYpos - 0.7
changeYpos-0.7
x[1]
x []...
}
88 changes: 65 additions & 23 deletions parser/_nofmt/cmdlinestyle1/parser.expect
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

file cmd1.gop
noEntrypoint
file cmd.gop
ast.FuncDecl:
Name:
ast.Ident:
Expand All @@ -17,25 +16,68 @@ ast.FuncDecl:
X:
ast.CallExpr:
Fun:
ast.SelectorExpr:
ast.Ident:
Name: changeYpos
Args:
ast.UnaryExpr:
Op: -
X:
ast.CallExpr:
Fun:
ast.CallExpr:
Fun:
ast.Ident:
Name: add
Args:
ast.BasicLit:
Kind: INT
Value: 100
ast.BasicLit:
Kind: INT
Value: 200
Args:
ast.BasicLit:
Kind: INT
Value: 0
Sel:
ast.Ident:
Name: Test
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.BasicLit:
Kind: INT
Value: 8
ast.ExprStmt:
X:
ast.CallExpr:
Fun:
ast.Ident:
Name: changeYpos
Args:
ast.UnaryExpr:
Op: -
X:
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.ExprStmt:
X:
ast.BinaryExpr:
X:
ast.Ident:
Name: changeYpos
Op: -
Y:
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.ExprStmt:
X:
ast.BinaryExpr:
X:
ast.Ident:
Name: changeYpos
Op: -
Y:
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.ExprStmt:
X:
ast.IndexExpr:
X:
ast.Ident:
Name: x
Index:
ast.BasicLit:
Kind: INT
Value: 1
ast.ExprStmt:
X:
ast.CallExpr:
Fun:
ast.Ident:
Name: x
Args:
ast.SliceLit:
File renamed without changes.
41 changes: 41 additions & 0 deletions parser/_nofmt/cmdlinestyle2/parser.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package main

file cmd2.gop
noEntrypoint
ast.FuncDecl:
Name:
ast.Ident:
Name: main
Type:
ast.FuncType:
Params:
ast.FieldList:
Body:
ast.BlockStmt:
List:
ast.ExprStmt:
X:
ast.CallExpr:
Fun:
ast.SelectorExpr:
X:
ast.CallExpr:
Fun:
ast.CallExpr:
Fun:
ast.Ident:
Name: add
Args:
ast.BasicLit:
Kind: INT
Value: 100
ast.BasicLit:
Kind: INT
Value: 200
Args:
ast.BasicLit:
Kind: INT
Value: 0
Sel:
ast.Ident:
Name: Test
3 changes: 3 additions & 0 deletions parser/_nofmt/cmdlinestyle3/cmd.gop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
println (1+2i, 2)
println (1, a...)
println (a...)
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,24 @@ ast.FuncDecl:
ast.BasicLit:
Kind: INT
Value: 2
ast.ExprStmt:
X:
ast.CallExpr:
Fun:
ast.Ident:
Name: println
Args:
ast.BasicLit:
Kind: INT
Value: 1
ast.Ident:
Name: a
ast.ExprStmt:
X:
ast.CallExpr:
Fun:
ast.Ident:
Name: println
Args:
ast.Ident:
Name: a
11 changes: 1 addition & 10 deletions parser/_testdata/cmdlinestyle1/cmd.gop
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
package main

func main() {
changeYpos -0.7, 8
changeYpos -0.7
changeYpos - 0.7
changeYpos-0.7
x[1]
x []...
}
println (1+2i)*2
80 changes: 19 additions & 61 deletions parser/_testdata/cmdlinestyle1/parser.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

file cmd.gop
noEntrypoint
ast.FuncDecl:
Name:
ast.Ident:
Expand All @@ -17,67 +18,24 @@ ast.FuncDecl:
ast.CallExpr:
Fun:
ast.Ident:
Name: changeYpos
Name: println
Args:
ast.UnaryExpr:
Op: -
ast.BinaryExpr:
X:
ast.ParenExpr:
X:
ast.BinaryExpr:
X:
ast.BasicLit:
Kind: INT
Value: 1
Op: +
Y:
ast.BasicLit:
Kind: IMAG
Value: 2i
Op: *
Y:
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.BasicLit:
Kind: INT
Value: 8
ast.ExprStmt:
X:
ast.CallExpr:
Fun:
ast.Ident:
Name: changeYpos
Args:
ast.UnaryExpr:
Op: -
X:
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.ExprStmt:
X:
ast.BinaryExpr:
X:
ast.Ident:
Name: changeYpos
Op: -
Y:
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.ExprStmt:
X:
ast.BinaryExpr:
X:
ast.Ident:
Name: changeYpos
Op: -
Y:
ast.BasicLit:
Kind: FLOAT
Value: 0.7
ast.ExprStmt:
X:
ast.IndexExpr:
X:
ast.Ident:
Name: x
Index:
ast.BasicLit:
Kind: INT
Value: 1
ast.ExprStmt:
X:
ast.CallExpr:
Fun:
ast.Ident:
Name: x
Args:
ast.SliceLit:
Kind: INT
Value: 2
1 change: 0 additions & 1 deletion parser/_testdata/cmdlinestyle5/cmd5.gop

This file was deleted.

41 changes: 0 additions & 41 deletions parser/_testdata/cmdlinestyle5/parser.expect

This file was deleted.

1 change: 0 additions & 1 deletion parser/_testdata/cmdlinestyle6/cmd.gop

This file was deleted.

Loading

0 comments on commit 232a527

Please sign in to comment.