1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError (Identifier))+}
(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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError (Identifier))+}
(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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError (Identifier))-}
(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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError (Identifier))-}
(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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError { (Identifier)
(FunctionCall ->(Identifier) })
{ (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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError { (Identifier)
(FunctionCall ->(Identifier) })
{ (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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(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))
(Function
(Identifier) (Identifier)
(Args) (Args)
(ParseError
(FunctionCall
(Identifier))))
(Function
(Identifier)
(Args
(ParameterDecl
(Identifier)
(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) (Identifier)
(Args) (Args)
(Other "type_declaration"
(TypeDecl (TypeDecl
(Identifier) (Identifier)
(FunctionTy (FunctionTy
(Args (Args
(Identifier)) (Identifier))
(Identifier))) (Identifier)))
(TypeDecl
(Identifier) (Identifier)
(FunctionTy
(Args (Args
(Identifier) (Identifier)
(Identifier)) (Identifier)))+}
(Args
(ParameterDecl
(ChannelTy
(ParseError)
(Identifier)))))))))+}

View File

@ -1,24 +1,15 @@
{-(Program {-(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function
(Identifier) (Identifier)
(Args) (Args)
(Other "type_declaration"
(TypeDecl (TypeDecl
(Identifier) (Identifier)
(FunctionTy (FunctionTy
(Args (Args
(Identifier)) (Identifier))
(Identifier))) (Identifier)))
(TypeDecl
(Identifier) (Identifier)
(FunctionTy
(Args (Args
(Identifier) (Identifier)
(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) }
(FunctionTy
(Args
{ (Identifier)
->(Identifier) })
{ (Identifier)
->(Identifier) }))
(TypeDecl
{ (Identifier)
->(Identifier) }
(FunctionTy
(Args
{-(Identifier)-}
(Identifier) (Identifier)
{+(Identifier)+}) (FunctionTy
(Args (Args
{+(ParameterDecl (Identifier))
(ChannelTy (Identifier)))
(ParseError) (TypeDecl
(Identifier)))+} (Identifier)
{-(Identifier)-} (FunctionTy
{-(Identifier)-})))))) (Args
(Identifier)
(Identifier))
(Args
(Identifier)
(Identifier)))))))->(ParseError
(Module
(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) }
(FunctionTy
(Args
{ (Identifier)
->(Identifier) })
{ (Identifier)
->(Identifier) }))
(TypeDecl
{ (Identifier)
->(Identifier) }
(FunctionTy
(Args
{-(Identifier)-}
(Identifier) (Identifier)
{+(Identifier)+}) (FunctionTy
(Args (Args
{+(Identifier)+} (Identifier))
{+(Identifier)+} (Identifier)))
{-(ParameterDecl (TypeDecl
(ChannelTy (Identifier)
(ParseError) (FunctionTy
(Identifier)))-})))))) (Args
(Identifier)
(Identifier))
(Args
(Identifier)
(Identifier))))))) }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,20 +1,11 @@
{+(Program {+(ParseError
(Module (Module
(Identifier)) (Identifier))
(Function
(Identifier) (Identifier)
(Args) (Args)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
(NumberLiteral) (NumberLiteral)
(Identifier))) (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)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
(NumberLiteral) (NumberLiteral)
(Identifier))) (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)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
(NumberLiteral) (NumberLiteral)
(Identifier))) (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)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
(NumberLiteral) (NumberLiteral)
(Identifier))) (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)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
{ (NumberLiteral) { (NumberLiteral)
->(NumberLiteral) } ->(NumberLiteral) }
(Identifier))) (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)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
{ (NumberLiteral) { (NumberLiteral)
->(NumberLiteral) } ->(NumberLiteral) }
(Identifier))) (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)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
(NumberLiteral) (NumberLiteral)
(Identifier))) (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)
(Other "const_declaration"
(ParseError
(VarAssignment (VarAssignment
(Other "identifier_list" (Other "identifier_list"
(Identifier)) (Identifier))
(Other "expression_list" (Other "expression_list"
(NumberLiteral) (NumberLiteral)
(Identifier))) (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)
(ParseError
(Identifier))
(StringLiteral)
(ParseError
(Identifier))
(StringLiteral)
(Identifier) (Identifier)
(ParseError (StringLiteral))+}
(Import
(Identifier)
(StringLiteral)))))+}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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