mirror of
https://github.com/github/semantic.git
synced 2024-11-29 02:44:36 +03:00
Merge branch 'master' into interpreter-decomposition
This commit is contained in:
commit
8b5dfbee42
@ -22,9 +22,11 @@ import Test.Hspec.Expectations.Pretty
|
||||
spec :: Spec
|
||||
spec = parallel $ do
|
||||
it "lists example fixtures" $ do
|
||||
examples "test/fixtures/go/" `shouldNotReturn` []
|
||||
examples "test/fixtures/ruby/" `shouldNotReturn` []
|
||||
examples "test/fixtures/javascript/" `shouldNotReturn` []
|
||||
|
||||
describe "go" $ runTestsIn "test/fixtures/go/"
|
||||
describe "javascript" $ runTestsIn "test/fixtures/javascript/"
|
||||
describe "ruby" $ runTestsIn "test/fixtures/ruby/"
|
||||
|
||||
|
5
test/fixtures/go/array-types.A.go
vendored
Normal file
5
test/fixtures/go/array-types.A.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
type a [2+2]x
|
||||
}
|
5
test/fixtures/go/array-types.B.go
vendored
Normal file
5
test/fixtures/go/array-types.B.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
type a [1+1]y
|
||||
}
|
16
test/fixtures/go/array-types.diffA-B.txt
vendored
Normal file
16
test/fixtures/go/array-types.diffA-B.txt
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ArrayTy
|
||||
(RelationalOperator
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))
|
16
test/fixtures/go/array-types.diffB-A.txt
vendored
Normal file
16
test/fixtures/go/array-types.diffB-A.txt
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ArrayTy
|
||||
(RelationalOperator
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))
|
13
test/fixtures/go/array-types.parseA.txt
vendored
Normal file
13
test/fixtures/go/array-types.parseA.txt
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ArrayTy
|
||||
(RelationalOperator
|
||||
(NumberLiteral)
|
||||
(NumberLiteral))
|
||||
(Identifier))))))
|
13
test/fixtures/go/array-types.parseB.txt
vendored
Normal file
13
test/fixtures/go/array-types.parseB.txt
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ArrayTy
|
||||
(RelationalOperator
|
||||
(NumberLiteral)
|
||||
(NumberLiteral))
|
||||
(Identifier))))))
|
5
test/fixtures/go/array-with-implicit-length.A.go
vendored
Normal file
5
test/fixtures/go/array-with-implicit-length.A.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const a1 = [...]int{1, 2, 3}
|
||||
}
|
5
test/fixtures/go/array-with-implicit-length.B.go
vendored
Normal file
5
test/fixtures/go/array-with-implicit-length.B.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const a1 = [...]int{4,5,6}
|
||||
}
|
24
test/fixtures/go/array-with-implicit-length.diffA-B.txt
vendored
Normal file
24
test/fixtures/go/array-with-implicit-length.diffA-B.txt
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(Other "composite_literal"
|
||||
(ArrayTy
|
||||
(Identifier))
|
||||
{+(Element
|
||||
(NumberLiteral))+}
|
||||
{+(Element
|
||||
(NumberLiteral))+}
|
||||
(Element
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })
|
||||
{-(Element
|
||||
(NumberLiteral))-}
|
||||
{-(Element
|
||||
(NumberLiteral))-}))))))
|
24
test/fixtures/go/array-with-implicit-length.diffB-A.txt
vendored
Normal file
24
test/fixtures/go/array-with-implicit-length.diffB-A.txt
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(Other "composite_literal"
|
||||
(ArrayTy
|
||||
(Identifier))
|
||||
{+(Element
|
||||
(NumberLiteral))+}
|
||||
(Element
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })
|
||||
{+(Element
|
||||
(NumberLiteral))+}
|
||||
{-(Element
|
||||
(NumberLiteral))-}
|
||||
{-(Element
|
||||
(NumberLiteral))-}))))))
|
19
test/fixtures/go/array-with-implicit-length.parseA.txt
vendored
Normal file
19
test/fixtures/go/array-with-implicit-length.parseA.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(Other "composite_literal"
|
||||
(ArrayTy
|
||||
(Identifier))
|
||||
(Element
|
||||
(NumberLiteral))
|
||||
(Element
|
||||
(NumberLiteral))
|
||||
(Element
|
||||
(NumberLiteral))))))))
|
19
test/fixtures/go/array-with-implicit-length.parseB.txt
vendored
Normal file
19
test/fixtures/go/array-with-implicit-length.parseB.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(Other "composite_literal"
|
||||
(ArrayTy
|
||||
(Identifier))
|
||||
(Element
|
||||
(NumberLiteral))
|
||||
(Element
|
||||
(NumberLiteral))
|
||||
(Element
|
||||
(NumberLiteral))))))))
|
8
test/fixtures/go/assignment-statements.A.go
vendored
Normal file
8
test/fixtures/go/assignment-statements.A.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
a = 1
|
||||
b, c += 2, 3
|
||||
d *= 3
|
||||
e += 1
|
||||
}
|
8
test/fixtures/go/assignment-statements.B.go
vendored
Normal file
8
test/fixtures/go/assignment-statements.B.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
x = 1
|
||||
y, c += 2, 3
|
||||
z *= 3
|
||||
h += 1
|
||||
}
|
31
test/fixtures/go/assignment-statements.diffA-B.txt
vendored
Normal file
31
test/fixtures/go/assignment-statements.diffA-B.txt
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))))
|
31
test/fixtures/go/assignment-statements.diffB-A.txt
vendored
Normal file
31
test/fixtures/go/assignment-statements.diffB-A.txt
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))))
|
27
test/fixtures/go/assignment-statements.parseA.txt
vendored
Normal file
27
test/fixtures/go/assignment-statements.parseA.txt
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))))
|
27
test/fixtures/go/assignment-statements.parseB.txt
vendored
Normal file
27
test/fixtures/go/assignment-statements.parseB.txt
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))))
|
7
test/fixtures/go/call-expressions.A.go
vendored
Normal file
7
test/fixtures/go/call-expressions.A.go
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
x(b, c...)
|
||||
y(b, c,)
|
||||
z(b,c...,)
|
||||
}
|
7
test/fixtures/go/call-expressions.B.go
vendored
Normal file
7
test/fixtures/go/call-expressions.B.go
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
a(b, c...)
|
||||
b(b, c,)
|
||||
c(b,c...,)
|
||||
}
|
20
test/fixtures/go/call-expressions.diffA-B.txt
vendored
Normal file
20
test/fixtures/go/call-expressions.diffA-B.txt
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Identifier))))
|
20
test/fixtures/go/call-expressions.diffB-A.txt
vendored
Normal file
20
test/fixtures/go/call-expressions.diffB-A.txt
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Identifier))))
|
17
test/fixtures/go/call-expressions.parseA.txt
vendored
Normal file
17
test/fixtures/go/call-expressions.parseA.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier))))
|
17
test/fixtures/go/call-expressions.parseB.txt
vendored
Normal file
17
test/fixtures/go/call-expressions.parseB.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier))))
|
5
test/fixtures/go/case-statements.A.go
vendored
Normal file
5
test/fixtures/go/case-statements.A.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
switch { }
|
||||
}
|
5
test/fixtures/go/case-statements.B.go
vendored
Normal file
5
test/fixtures/go/case-statements.B.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
switch { case foo: f1() }
|
||||
}
|
12
test/fixtures/go/case-statements.diffA-B.txt
vendored
Normal file
12
test/fixtures/go/case-statements.diffA-B.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Switch
|
||||
{+(Case
|
||||
(Case
|
||||
(Other "expression_list"
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)))+})))
|
12
test/fixtures/go/case-statements.diffB-A.txt
vendored
Normal file
12
test/fixtures/go/case-statements.diffB-A.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Switch
|
||||
{-(Case
|
||||
(Case
|
||||
(Other "expression_list"
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)))-})))
|
6
test/fixtures/go/case-statements.parseA.txt
vendored
Normal file
6
test/fixtures/go/case-statements.parseA.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Switch)))
|
12
test/fixtures/go/case-statements.parseB.txt
vendored
Normal file
12
test/fixtures/go/case-statements.parseB.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Switch
|
||||
(Case
|
||||
(Case
|
||||
(Other "expression_list"
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier))))))
|
9
test/fixtures/go/channel-types.A.go
vendored
Normal file
9
test/fixtures/go/channel-types.A.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
type (
|
||||
c1 chan<- chan int
|
||||
c2 chan<- chan<- struct{}
|
||||
c3 chan<- <-chan int
|
||||
)
|
||||
}
|
9
test/fixtures/go/channel-types.B.go
vendored
Normal file
9
test/fixtures/go/channel-types.B.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
type (
|
||||
c2 chan<- chan string
|
||||
c3 chan<- chan<- struct{}
|
||||
c4 chan<- <-chan string
|
||||
)
|
||||
}
|
26
test/fixtures/go/channel-types.diffA-B.txt
vendored
Normal file
26
test/fixtures/go/channel-types.diffA-B.txt
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(StructTy))))
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) }))))))
|
26
test/fixtures/go/channel-types.diffB-A.txt
vendored
Normal file
26
test/fixtures/go/channel-types.diffB-A.txt
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(StructTy))))
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) }))))))
|
21
test/fixtures/go/channel-types.parseA.txt
vendored
Normal file
21
test/fixtures/go/channel-types.parseA.txt
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(Identifier))))
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(StructTy))))
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(Identifier)))))))
|
21
test/fixtures/go/channel-types.parseB.txt
vendored
Normal file
21
test/fixtures/go/channel-types.parseB.txt
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(Identifier))))
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(StructTy))))
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(ChannelTy
|
||||
(Identifier)))))))
|
5
test/fixtures/go/comment.A.go
vendored
Normal file
5
test/fixtures/go/comment.A.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
// this is a comment
|
||||
}
|
7
test/fixtures/go/comment.B.go
vendored
Normal file
7
test/fixtures/go/comment.B.go
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
/*
|
||||
this is a block comment
|
||||
*/
|
||||
}
|
7
test/fixtures/go/comment.diffA-B.txt
vendored
Normal file
7
test/fixtures/go/comment.diffA-B.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
{ (Comment)
|
||||
->(Comment) }))
|
7
test/fixtures/go/comment.diffB-A.txt
vendored
Normal file
7
test/fixtures/go/comment.diffB-A.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
{ (Comment)
|
||||
->(Comment) }))
|
6
test/fixtures/go/comment.parseA.txt
vendored
Normal file
6
test/fixtures/go/comment.parseA.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Comment)))
|
6
test/fixtures/go/comment.parseB.txt
vendored
Normal file
6
test/fixtures/go/comment.parseB.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Comment)))
|
5
test/fixtures/go/const-declarations-with-types.A.go
vendored
Normal file
5
test/fixtures/go/const-declarations-with-types.A.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const zero int = 0
|
||||
}
|
5
test/fixtures/go/const-declarations-with-types.B.go
vendored
Normal file
5
test/fixtures/go/const-declarations-with-types.B.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const one, two uiint64 = 1, 2
|
||||
}
|
17
test/fixtures/go/const-declarations-with-types.diffA-B.txt
vendored
Normal file
17
test/fixtures/go/const-declarations-with-types.diffA-B.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{+(Identifier)+})
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Other "expression_list"
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{+(NumberLiteral)+})))))
|
17
test/fixtures/go/const-declarations-with-types.diffB-A.txt
vendored
Normal file
17
test/fixtures/go/const-declarations-with-types.diffB-A.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{-(Identifier)-})
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Other "expression_list"
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{-(NumberLiteral)-})))))
|
12
test/fixtures/go/const-declarations-with-types.parseA.txt
vendored
Normal file
12
test/fixtures/go/const-declarations-with-types.parseA.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Other "expression_list"
|
||||
(NumberLiteral))))))
|
14
test/fixtures/go/const-declarations-with-types.parseB.txt
vendored
Normal file
14
test/fixtures/go/const-declarations-with-types.parseB.txt
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral))))))
|
5
test/fixtures/go/const-declarations-without-types.A.go
vendored
Normal file
5
test/fixtures/go/const-declarations-without-types.A.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const zero = 0
|
||||
}
|
5
test/fixtures/go/const-declarations-without-types.B.go
vendored
Normal file
5
test/fixtures/go/const-declarations-without-types.B.go
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const one, two = 1, 2
|
||||
}
|
15
test/fixtures/go/const-declarations-without-types.diffA-B.txt
vendored
Normal file
15
test/fixtures/go/const-declarations-without-types.diffA-B.txt
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{+(Identifier)+})
|
||||
(Other "expression_list"
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{+(NumberLiteral)+})))))
|
15
test/fixtures/go/const-declarations-without-types.diffB-A.txt
vendored
Normal file
15
test/fixtures/go/const-declarations-without-types.diffB-A.txt
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{-(Identifier)-})
|
||||
(Other "expression_list"
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{-(NumberLiteral)-})))))
|
11
test/fixtures/go/const-declarations-without-types.parseA.txt
vendored
Normal file
11
test/fixtures/go/const-declarations-without-types.parseA.txt
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral))))))
|
13
test/fixtures/go/const-declarations-without-types.parseB.txt
vendored
Normal file
13
test/fixtures/go/const-declarations-without-types.parseB.txt
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral))))))
|
9
test/fixtures/go/const-with-implicit-values.A.go
vendored
Normal file
9
test/fixtures/go/const-with-implicit-values.A.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const (
|
||||
zero = iota
|
||||
one
|
||||
two
|
||||
)
|
||||
}
|
9
test/fixtures/go/const-with-implicit-values.B.go
vendored
Normal file
9
test/fixtures/go/const-with-implicit-values.B.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const (
|
||||
a = iota
|
||||
b
|
||||
c
|
||||
)
|
||||
}
|
20
test/fixtures/go/const-with-implicit-values.diffA-B.txt
vendored
Normal file
20
test/fixtures/go/const-with-implicit-values.diffA-B.txt
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(Identifier)))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))
|
20
test/fixtures/go/const-with-implicit-values.diffB-A.txt
vendored
Normal file
20
test/fixtures/go/const-with-implicit-values.diffB-A.txt
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(Other "expression_list"
|
||||
(Identifier)))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) }))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))
|
17
test/fixtures/go/const-with-implicit-values.parseA.txt
vendored
Normal file
17
test/fixtures/go/const-with-implicit-values.parseA.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(Identifier)))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier)))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))))))
|
17
test/fixtures/go/const-with-implicit-values.parseB.txt
vendored
Normal file
17
test/fixtures/go/const-with-implicit-values.parseB.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(Identifier)))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier)))
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))))))
|
8
test/fixtures/go/constructors.A.go
vendored
Normal file
8
test/fixtures/go/constructors.A.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
make(chan<- int)
|
||||
make(chan<- int, (new - old))
|
||||
make(chan<- int, 5, 10)
|
||||
new(map[string]string)
|
||||
}
|
8
test/fixtures/go/constructors.B.go
vendored
Normal file
8
test/fixtures/go/constructors.B.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
make(chan<- string)
|
||||
make(chan<- string, (new - old))
|
||||
make(chan<- string, 7, 11)
|
||||
new(map[int]int)
|
||||
}
|
34
test/fixtures/go/constructors.diffA-B.txt
vendored
Normal file
34
test/fixtures/go/constructors.diffA-B.txt
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) }))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(DictionaryTy
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) }))))
|
34
test/fixtures/go/constructors.diffB-A.txt
vendored
Normal file
34
test/fixtures/go/constructors.diffB-A.txt
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) }))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) }
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(DictionaryTy
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) }))))
|
27
test/fixtures/go/constructors.parseA.txt
vendored
Normal file
27
test/fixtures/go/constructors.parseA.txt
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(Identifier))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(Identifier))
|
||||
(NumberLiteral)
|
||||
(NumberLiteral))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(DictionaryTy
|
||||
(Identifier)
|
||||
(Identifier)))))
|
27
test/fixtures/go/constructors.parseB.txt
vendored
Normal file
27
test/fixtures/go/constructors.parseB.txt
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(Identifier))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(ChannelTy
|
||||
(Identifier))
|
||||
(NumberLiteral)
|
||||
(NumberLiteral))
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(DictionaryTy
|
||||
(Identifier)
|
||||
(Identifier)))))
|
9
test/fixtures/go/float-literals.A.go
vendored
Normal file
9
test/fixtures/go/float-literals.A.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
f1 = 1.5
|
||||
f2 = 1.5e100
|
||||
f3 = 1.5e+50
|
||||
f4 = 1.5e-5
|
||||
f5 = .5e-50
|
||||
}
|
9
test/fixtures/go/float-literals.B.go
vendored
Normal file
9
test/fixtures/go/float-literals.B.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
f1 = 2.6
|
||||
f2 = 2.6e211
|
||||
f3 = 2.6e+60
|
||||
f4 = 2.6e-7
|
||||
f5 = .6e-60
|
||||
}
|
35
test/fixtures/go/float-literals.diffA-B.txt
vendored
Normal file
35
test/fixtures/go/float-literals.diffA-B.txt
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))))
|
35
test/fixtures/go/float-literals.diffB-A.txt
vendored
Normal file
35
test/fixtures/go/float-literals.diffB-A.txt
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
{ (FloatLiteral)
|
||||
->(FloatLiteral) }))))
|
30
test/fixtures/go/float-literals.parseA.txt
vendored
Normal file
30
test/fixtures/go/float-literals.parseA.txt
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))))
|
30
test/fixtures/go/float-literals.parseB.txt
vendored
Normal file
30
test/fixtures/go/float-literals.parseB.txt
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))
|
||||
(Assignment
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(FloatLiteral)))))
|
24
test/fixtures/go/for-statements.A.go
vendored
Normal file
24
test/fixtures/go/for-statements.A.go
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
for {
|
||||
a()
|
||||
goto loop
|
||||
}
|
||||
for i := 0; i < 5; i++ {
|
||||
a()
|
||||
break loop
|
||||
}
|
||||
for ; i < 10; i++ {
|
||||
a()
|
||||
continue loop2
|
||||
}
|
||||
for ;; {
|
||||
a()
|
||||
continue
|
||||
}
|
||||
for x := range y {
|
||||
a(x)
|
||||
break
|
||||
}
|
||||
}
|
24
test/fixtures/go/for-statements.B.go
vendored
Normal file
24
test/fixtures/go/for-statements.B.go
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
for ;; {
|
||||
a()
|
||||
goto loop
|
||||
}
|
||||
for x := range y {
|
||||
a()
|
||||
break loop
|
||||
}
|
||||
for ;; {
|
||||
a()
|
||||
continue loop2
|
||||
}
|
||||
for ; i < 10; i++ {
|
||||
a()
|
||||
continue
|
||||
}
|
||||
for {
|
||||
a(x)
|
||||
break
|
||||
}
|
||||
}
|
74
test/fixtures/go/for-statements.diffA-B.txt
vendored
Normal file
74
test/fixtures/go/for-statements.diffA-B.txt
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
{+(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Other "goto_statement"
|
||||
(Identifier)))+}
|
||||
{+(For
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Break
|
||||
(Identifier)))+}
|
||||
{+(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue
|
||||
(Identifier)))+}
|
||||
{+(For
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue))+}
|
||||
(For
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
{+(Identifier)+})
|
||||
{+(Break)+}
|
||||
{-(Other "goto_statement"
|
||||
(Identifier))-}))
|
||||
{-(For
|
||||
(VarDecl
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Break
|
||||
(Identifier)))-}
|
||||
{-(For
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue
|
||||
(Identifier)))-}
|
||||
{-(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue))-}
|
||||
{-(For
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Break))-}))
|
71
test/fixtures/go/for-statements.diffB-A.txt
vendored
Normal file
71
test/fixtures/go/for-statements.diffB-A.txt
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
{+(For
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Other "goto_statement"
|
||||
(Identifier))))+}
|
||||
{+(For
|
||||
(VarDecl
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Break
|
||||
(Identifier)))+}
|
||||
{+(For
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue
|
||||
(Identifier)))+}
|
||||
{ (For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Other "goto_statement"
|
||||
(Identifier)))
|
||||
->(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue)) }
|
||||
(For
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
{+(Identifier)+})
|
||||
(Break
|
||||
{-(Identifier)-}))
|
||||
{-(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue
|
||||
(Identifier)))-}
|
||||
{-(For
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue))-}
|
||||
{-(For
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Break)))-}))
|
46
test/fixtures/go/for-statements.parseA.txt
vendored
Normal file
46
test/fixtures/go/for-statements.parseA.txt
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(For
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Other "goto_statement"
|
||||
(Identifier))))
|
||||
(For
|
||||
(VarDecl
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Break
|
||||
(Identifier)))
|
||||
(For
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue
|
||||
(Identifier)))
|
||||
(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue))
|
||||
(For
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Break))))
|
37
test/fixtures/go/for-statements.parseB.txt
vendored
Normal file
37
test/fixtures/go/for-statements.parseB.txt
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Other "goto_statement"
|
||||
(Identifier)))
|
||||
(For
|
||||
(Other "expression_list"
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Break
|
||||
(Identifier)))
|
||||
(For
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue
|
||||
(Identifier)))
|
||||
(For
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(IncrementStatement)
|
||||
(FunctionCall
|
||||
(Identifier))
|
||||
(Continue))
|
||||
(For
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Break)))))
|
8
test/fixtures/go/function-declarations.A.go
vendored
Normal file
8
test/fixtures/go/function-declarations.A.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
func f1() {}
|
||||
func f2(a int, b, c, d string) int {}
|
||||
func f2() (int, error) {}
|
||||
func f2() (result int, err error) {}
|
||||
}
|
8
test/fixtures/go/function-declarations.B.go
vendored
Normal file
8
test/fixtures/go/function-declarations.B.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
func fa() {}
|
||||
func fb(a int, b, c, d string) int {}
|
||||
func fc() (int, error) {}
|
||||
func fd() (result int, err error) {}
|
||||
}
|
38
test/fixtures/go/function-declarations.diffA-B.txt
vendored
Normal file
38
test/fixtures/go/function-declarations.diffA-B.txt
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
(ParseError
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(ParseError
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier))
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Args
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Args
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))))))
|
38
test/fixtures/go/function-declarations.diffB-A.txt
vendored
Normal file
38
test/fixtures/go/function-declarations.diffB-A.txt
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
(ParseError
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(ParseError
|
||||
(FunctionCall
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier))
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Args
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Args
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))))))
|
34
test/fixtures/go/function-declarations.parseA.txt
vendored
Normal file
34
test/fixtures/go/function-declarations.parseA.txt
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
(ParseError
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(ParseError
|
||||
(FunctionCall
|
||||
(Identifier))))
|
||||
(Function
|
||||
(Identifier)
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Args
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Args
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))))))
|
34
test/fixtures/go/function-declarations.parseB.txt
vendored
Normal file
34
test/fixtures/go/function-declarations.parseB.txt
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
(ParseError
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(ParseError
|
||||
(FunctionCall
|
||||
(Identifier))))
|
||||
(Function
|
||||
(Identifier)
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Args
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Args
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(ParameterDecl
|
||||
(Identifier)
|
||||
(Identifier))))))
|
7
test/fixtures/go/function-literals.A.go
vendored
Normal file
7
test/fixtures/go/function-literals.A.go
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const s1 = func(s string) (int, int) {
|
||||
return 1, 2
|
||||
}
|
||||
}
|
7
test/fixtures/go/function-literals.B.go
vendored
Normal file
7
test/fixtures/go/function-literals.B.go
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
const s1 = func(b int) (string, string) {
|
||||
return 1, 2
|
||||
}
|
||||
}
|
19
test/fixtures/go/function-literals.diffA-B.txt
vendored
Normal file
19
test/fixtures/go/function-literals.diffA-B.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(AnonymousFunction
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Return
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))))))))
|
19
test/fixtures/go/function-literals.diffB-A.txt
vendored
Normal file
19
test/fixtures/go/function-literals.diffB-A.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(AnonymousFunction
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Return
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))))))))
|
17
test/fixtures/go/function-literals.parseA.txt
vendored
Normal file
17
test/fixtures/go/function-literals.parseA.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(AnonymousFunction
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))))))))
|
17
test/fixtures/go/function-literals.parseB.txt
vendored
Normal file
17
test/fixtures/go/function-literals.parseB.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "const_declaration"
|
||||
(VarAssignment
|
||||
(Other "identifier_list"
|
||||
(Identifier))
|
||||
(Other "expression_list"
|
||||
(AnonymousFunction
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Other "expression_list"
|
||||
(NumberLiteral)
|
||||
(NumberLiteral)))))))))
|
8
test/fixtures/go/function-types.A.go
vendored
Normal file
8
test/fixtures/go/function-types.A.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
type (
|
||||
a func(int) int
|
||||
b func(int, string) (bool, error)
|
||||
)
|
||||
}
|
8
test/fixtures/go/function-types.B.go
vendored
Normal file
8
test/fixtures/go/function-types.B.go
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
type (
|
||||
x func(string) string
|
||||
y func(string, int) (chan, error)
|
||||
)
|
||||
}
|
30
test/fixtures/go/function-types.diffA-B.txt
vendored
Normal file
30
test/fixtures/go/function-types.diffA-B.txt
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(FunctionTy
|
||||
(Args
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
{ (Identifier)
|
||||
->(Identifier) }))
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(FunctionTy
|
||||
(Args
|
||||
{-(Identifier)-}
|
||||
(Identifier)
|
||||
{+(Identifier)+})
|
||||
(Args
|
||||
{+(ParameterDecl
|
||||
(ChannelTy
|
||||
(ParseError)
|
||||
(Identifier)))+}
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-}))))))
|
30
test/fixtures/go/function-types.diffB-A.txt
vendored
Normal file
30
test/fixtures/go/function-types.diffB-A.txt
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(FunctionTy
|
||||
(Args
|
||||
{ (Identifier)
|
||||
->(Identifier) })
|
||||
{ (Identifier)
|
||||
->(Identifier) }))
|
||||
(TypeDecl
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(FunctionTy
|
||||
(Args
|
||||
{-(Identifier)-}
|
||||
(Identifier)
|
||||
{+(Identifier)+})
|
||||
(Args
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+}
|
||||
{-(ParameterDecl
|
||||
(ChannelTy
|
||||
(ParseError)
|
||||
(Identifier)))-}))))))
|
21
test/fixtures/go/function-types.parseA.txt
vendored
Normal file
21
test/fixtures/go/function-types.parseA.txt
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(FunctionTy
|
||||
(Args
|
||||
(Identifier))
|
||||
(Identifier)))
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(FunctionTy
|
||||
(Args
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Args
|
||||
(Identifier)
|
||||
(Identifier)))))))
|
23
test/fixtures/go/function-types.parseB.txt
vendored
Normal file
23
test/fixtures/go/function-types.parseB.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Other "type_declaration"
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(FunctionTy
|
||||
(Args
|
||||
(Identifier))
|
||||
(Identifier)))
|
||||
(TypeDecl
|
||||
(Identifier)
|
||||
(FunctionTy
|
||||
(Args
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Args
|
||||
(ParameterDecl
|
||||
(ChannelTy
|
||||
(ParseError)
|
||||
(Identifier)))))))))
|
6
test/fixtures/go/go-and-defer-statements.A.go
vendored
Normal file
6
test/fixtures/go/go-and-defer-statements.A.go
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
defer x.y()
|
||||
go x.y()
|
||||
}
|
6
test/fixtures/go/go-and-defer-statements.B.go
vendored
Normal file
6
test/fixtures/go/go-and-defer-statements.B.go
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
defer a.b()
|
||||
go c.d()
|
||||
}
|
19
test/fixtures/go/go-and-defer-statements.diffA-B.txt
vendored
Normal file
19
test/fixtures/go/go-and-defer-statements.diffA-B.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(Program
|
||||
(Module
|
||||
(Identifier))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Defer
|
||||
(FunctionCall
|
||||
(SubscriptAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
(Go
|
||||
(FunctionCall
|
||||
(SubscriptAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user