1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Go tests with parse error have much smaller trees when we halt on error

This commit is contained in:
Timothy Clem 2017-05-03 14:12:43 -07:00
parent 31c01c0092
commit 6e6d3e1432
37 changed files with 290 additions and 779 deletions

View File

@ -1,38 +1,6 @@
{+(ParseError {+(ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) (Identifier))+}
(Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
(Identifier)
(Args)
(Args
(Identifier)
(Identifier)))
(Function
(Identifier)
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))+}

View File

@ -1,38 +1,6 @@
{+(ParseError {+(ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) (Identifier))+}
(Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
(Identifier)
(Args)
(Args
(Identifier)
(Identifier)))
(Function
(Identifier)
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))+}

View File

@ -1,38 +1,6 @@
{-(ParseError {-(ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) (Identifier))-}
(Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
(Identifier)
(Args)
(Args
(Identifier)
(Identifier)))
(Function
(Identifier)
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))-}

View File

@ -1,38 +1,6 @@
{-(ParseError {-(ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) (Identifier))-}
(Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
(Identifier)
(Args)
(Args
(Identifier)
(Identifier)))
(Function
(Identifier)
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))-}

View File

@ -1,42 +1,7 @@
(ParseError (ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) { (Identifier)
(Args) ->(Identifier) })
(ParseError
(FunctionCall
{ (Identifier)
->(Identifier) })))
(Function
{ (Identifier)
->(Identifier) }
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
{ (Identifier)
->(Identifier) }
(Args)
(Args
(Identifier)
(Identifier)))
(Function
{ (Identifier)
->(Identifier) }
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))

View File

@ -1,42 +1,7 @@
(ParseError (ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) { (Identifier)
(Args) ->(Identifier) })
(ParseError
(FunctionCall
{ (Identifier)
->(Identifier) })))
(Function
{ (Identifier)
->(Identifier) }
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
{ (Identifier)
->(Identifier) }
(Args)
(Args
(Identifier)
(Identifier)))
(Function
{ (Identifier)
->(Identifier) }
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))

View File

@ -1,38 +1,6 @@
(ParseError (ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) (Identifier))
(Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
(Identifier)
(Args)
(Args
(Identifier)
(Identifier)))
(Function
(Identifier)
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))

View File

@ -1,38 +1,6 @@
(ParseError (ParseError
(Program (Module
(Module (Identifier))
(Identifier)) (Identifier)
(Function (Args)
(Identifier) (Identifier))
(Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(Identifier)
(Identifier)
(ParameterDecl
(Identifier)
(Identifier)))
(Identifier))
(Function
(Identifier)
(Args)
(Args
(Identifier)
(Identifier)))
(Function
(Identifier)
(Args)
(Args
(ParameterDecl
(Identifier)
(Identifier))
(ParameterDecl
(Identifier)
(Identifier))))))

View File

@ -1,24 +1,15 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Args)
(TypeDecl
(Identifier) (Identifier)
(Args) (FunctionTy
(Other "type_declaration" (Args
(TypeDecl (Identifier))
(Identifier) (Identifier)))
(FunctionTy (Identifier)
(Args (Args
(Identifier)) (Identifier)
(Identifier))) (Identifier)))+}
(TypeDecl
(Identifier)
(FunctionTy
(Args
(Identifier)
(Identifier))
(Args
(ParameterDecl
(ChannelTy
(ParseError)
(Identifier)))))))))+}

View File

@ -1,24 +1,15 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Args)
(TypeDecl
(Identifier) (Identifier)
(Args) (FunctionTy
(Other "type_declaration" (Args
(TypeDecl (Identifier))
(Identifier) (Identifier)))
(FunctionTy (Identifier)
(Args (Args
(Identifier)) (Identifier)
(Identifier))) (Identifier)))-}
(TypeDecl
(Identifier)
(FunctionTy
(Args
(Identifier)
(Identifier))
(Args
(ParameterDecl
(ChannelTy
(ParseError)
(Identifier)))))))))-}

View File

@ -1,4 +1,4 @@
(Program { (Program
(Module (Module
(Identifier)) (Identifier))
(Function (Function
@ -6,26 +6,31 @@
(Args) (Args)
(Other "type_declaration" (Other "type_declaration"
(TypeDecl (TypeDecl
{ (Identifier) (Identifier)
->(Identifier) }
(FunctionTy (FunctionTy
(Args (Args
{ (Identifier) (Identifier))
->(Identifier) }) (Identifier)))
{ (Identifier)
->(Identifier) }))
(TypeDecl (TypeDecl
{ (Identifier) (Identifier)
->(Identifier) }
(FunctionTy (FunctionTy
(Args (Args
{-(Identifier)-}
(Identifier) (Identifier)
{+(Identifier)+}) (Identifier))
(Args (Args
{+(ParameterDecl (Identifier)
(ChannelTy (Identifier)))))))->(ParseError
(ParseError) (Module
(Identifier)))+} (Identifier))
{-(Identifier)-} (Identifier)
{-(Identifier)-})))))) (Args)
(TypeDecl
(Identifier)
(FunctionTy
(Args
(Identifier))
(Identifier)))
(Identifier)
(Args
(Identifier)
(Identifier))) }

View File

@ -1,4 +1,18 @@
(Program { (ParseError
(Module
(Identifier))
(Identifier)
(Args)
(TypeDecl
(Identifier)
(FunctionTy
(Args
(Identifier))
(Identifier)))
(Identifier)
(Args
(Identifier)
(Identifier)))->(Program
(Module (Module
(Identifier)) (Identifier))
(Function (Function
@ -6,26 +20,17 @@
(Args) (Args)
(Other "type_declaration" (Other "type_declaration"
(TypeDecl (TypeDecl
{ (Identifier) (Identifier)
->(Identifier) }
(FunctionTy (FunctionTy
(Args (Args
{ (Identifier) (Identifier))
->(Identifier) }) (Identifier)))
{ (Identifier)
->(Identifier) }))
(TypeDecl (TypeDecl
{ (Identifier) (Identifier)
->(Identifier) }
(FunctionTy (FunctionTy
(Args (Args
{-(Identifier)-}
(Identifier) (Identifier)
{+(Identifier)+}) (Identifier))
(Args (Args
{+(Identifier)+} (Identifier)
{+(Identifier)+} (Identifier))))))) }
{-(ParameterDecl
(ChannelTy
(ParseError)
(Identifier)))-}))))))

View File

@ -1,24 +1,15 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Args)
(TypeDecl
(Identifier) (Identifier)
(Args) (FunctionTy
(Other "type_declaration" (Args
(TypeDecl (Identifier))
(Identifier) (Identifier)))
(FunctionTy (Identifier)
(Args (Args
(Identifier)) (Identifier)
(Identifier))) (Identifier)))
(TypeDecl
(Identifier)
(FunctionTy
(Args
(Identifier)
(Identifier))
(Args
(ParameterDecl
(ChannelTy
(ParseError)
(Identifier)))))))))

View File

@ -1,14 +1,8 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion (StringLiteral)
(Identifier) (StringLiteral))+}
(StringLiteral)
(ParseError
(StringLiteral)
(Import
(Identifier)
(StringLiteral))))))+}

View File

@ -1,14 +1,8 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion (StringLiteral)
(Identifier) (StringLiteral))+}
(StringLiteral)
(ParseError
(StringLiteral)
(Import
(Identifier)
(StringLiteral))))))+}

View File

@ -1,14 +1,8 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion (StringLiteral)
(Identifier) (StringLiteral))-}
(StringLiteral)
(ParseError
(StringLiteral)
(Import
(Identifier)
(StringLiteral))))))-}

View File

@ -1,14 +1,8 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion (StringLiteral)
(Identifier) (StringLiteral))-}
(StringLiteral)
(ParseError
(StringLiteral)
(Import
(Identifier)
(StringLiteral))))))-}

View File

@ -1,17 +1,10 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion { (StringLiteral)
(Identifier) ->(StringLiteral) }
{ (StringLiteral) { (StringLiteral)
->(StringLiteral) } ->(StringLiteral) })
(ParseError
{ (StringLiteral)
->(StringLiteral) }
(Import
(Identifier)
{ (StringLiteral)
->(StringLiteral) })))))

View File

@ -1,17 +1,10 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion { (StringLiteral)
(Identifier) ->(StringLiteral) }
{ (StringLiteral) { (StringLiteral)
->(StringLiteral) } ->(StringLiteral) })
(ParseError
{ (StringLiteral)
->(StringLiteral) }
(Import
(Identifier)
{ (StringLiteral)
->(StringLiteral) })))))

View File

@ -1,14 +1,8 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion (StringLiteral)
(Identifier) (StringLiteral))
(StringLiteral)
(ParseError
(StringLiteral)
(Import
(Identifier)
(StringLiteral))))))

View File

@ -1,14 +1,8 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(TypeConversion (StringLiteral)
(Identifier) (StringLiteral))
(StringLiteral)
(ParseError
(StringLiteral)
(Import
(Identifier)
(StringLiteral))))))

View File

@ -1,20 +1,11 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" (NumberLiteral)
(Identifier)) (Identifier))))+}
(Other "expression_list"
(NumberLiteral)
(Identifier)))
(Assignment
(Other "expression_list"
(NumberLiteral)
(Identifier))
(Other "expression_list"
(NumberLiteral)))))))+}

View File

@ -1,20 +1,11 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" (NumberLiteral)
(Identifier)) (Identifier))))+}
(Other "expression_list"
(NumberLiteral)
(Identifier)))
(Assignment
(Other "expression_list"
(NumberLiteral)
(Identifier))
(Other "expression_list"
(NumberLiteral)))))))+}

View File

@ -1,20 +1,11 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" (NumberLiteral)
(Identifier)) (Identifier))))-}
(Other "expression_list"
(NumberLiteral)
(Identifier)))
(Assignment
(Other "expression_list"
(NumberLiteral)
(Identifier))
(Other "expression_list"
(NumberLiteral)))))))-}

View File

@ -1,20 +1,11 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" (NumberLiteral)
(Identifier)) (Identifier))))-}
(Other "expression_list"
(NumberLiteral)
(Identifier)))
(Assignment
(Other "expression_list"
(NumberLiteral)
(Identifier))
(Other "expression_list"
(NumberLiteral)))))))-}

View File

@ -1,23 +1,12 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" { (NumberLiteral)
(Identifier)) ->(NumberLiteral) }
(Other "expression_list" (Identifier))))
{ (NumberLiteral)
->(NumberLiteral) }
(Identifier)))
(Assignment
(Other "expression_list"
{ (NumberLiteral)
->(NumberLiteral) }
(Identifier))
(Other "expression_list"
{ (NumberLiteral)
->(NumberLiteral) }))))))

View File

@ -1,23 +1,12 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" { (NumberLiteral)
(Identifier)) ->(NumberLiteral) }
(Other "expression_list" (Identifier))))
{ (NumberLiteral)
->(NumberLiteral) }
(Identifier)))
(Assignment
(Other "expression_list"
{ (NumberLiteral)
->(NumberLiteral) }
(Identifier))
(Other "expression_list"
{ (NumberLiteral)
->(NumberLiteral) }))))))

View File

@ -1,20 +1,11 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" (NumberLiteral)
(Identifier)) (Identifier))))
(Other "expression_list"
(NumberLiteral)
(Identifier)))
(Assignment
(Other "expression_list"
(NumberLiteral)
(Identifier))
(Other "expression_list"
(NumberLiteral)))))))

View File

@ -1,20 +1,11 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (VarAssignment
(Other "const_declaration" (Other "identifier_list"
(ParseError (Identifier))
(VarAssignment (Other "expression_list"
(Other "identifier_list" (NumberLiteral)
(Identifier)) (Identifier))))
(Other "expression_list"
(NumberLiteral)
(Identifier)))
(Assignment
(Other "expression_list"
(NumberLiteral)
(Identifier))
(Other "expression_list"
(NumberLiteral)))))))

View File

@ -1,17 +1,7 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError (StringLiteral))+}
(Identifier))
(StringLiteral)
(ParseError
(Identifier))
(StringLiteral)
(Identifier)
(ParseError
(Import
(Identifier)
(StringLiteral)))))+}

View File

@ -1,17 +1,7 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError (StringLiteral))+}
(Identifier))
(StringLiteral)
(ParseError
(Identifier))
(StringLiteral)
(Identifier)
(ParseError
(Import
(Identifier)
(StringLiteral)))))+}

View File

@ -1,17 +1,7 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError (StringLiteral))-}
(Identifier))
(StringLiteral)
(ParseError
(Identifier))
(StringLiteral)
(Identifier)
(ParseError
(Import
(Identifier)
(StringLiteral)))))-}

View File

@ -1,17 +1,7 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError (StringLiteral))-}
(Identifier))
(StringLiteral)
(ParseError
(Identifier))
(StringLiteral)
(Identifier)
(ParseError
(Import
(Identifier)
(StringLiteral)))))-}

View File

@ -1,20 +1,8 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError { (StringLiteral)
(Identifier)) ->(StringLiteral) })
{ (StringLiteral)
->(StringLiteral) }
(ParseError
(Identifier))
{ (StringLiteral)
->(StringLiteral) }
(Identifier)
(ParseError
(Import
(Identifier)
{ (StringLiteral)
->(StringLiteral) }))))

View File

@ -1,20 +1,8 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError { (StringLiteral)
(Identifier)) ->(StringLiteral) })
{ (StringLiteral)
->(StringLiteral) }
(ParseError
(Identifier))
{ (StringLiteral)
->(StringLiteral) }
(Identifier)
(ParseError
(Import
(Identifier)
{ (StringLiteral)
->(StringLiteral) }))))

View File

@ -1,17 +1,7 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError (StringLiteral))
(Identifier))
(StringLiteral)
(ParseError
(Identifier))
(StringLiteral)
(Identifier)
(ParseError
(Import
(Identifier)
(StringLiteral)))))

View File

@ -1,17 +1,7 @@
(Program (ParseError
(Module (Module
(Identifier)) (Identifier))
(Function (Identifier)
(Identifier) (Args)
(Args) (Identifier)
(ParseError (StringLiteral))
(Identifier))
(StringLiteral)
(ParseError
(Identifier))
(StringLiteral)
(Identifier)
(ParseError
(Import
(Identifier)
(StringLiteral)))))