Add more python error recovery tests
This commit is contained in:
parent
5aa2f4dc8c
commit
04381dcea3
1 changed files with 35 additions and 0 deletions
35
test/fixtures/error_corpus/python_errors.txt
vendored
35
test/fixtures/error_corpus/python_errors.txt
vendored
|
|
@ -39,6 +39,22 @@ d
|
|||
(expression_statement (identifier))))
|
||||
(expression_statement (identifier)))
|
||||
|
||||
========================================================
|
||||
stray if keyword in function definition
|
||||
========================================================
|
||||
|
||||
def a():
|
||||
if
|
||||
|
||||
---
|
||||
|
||||
(module
|
||||
(function_definition
|
||||
name: (identifier)
|
||||
parameters: (parameters)
|
||||
(ERROR)
|
||||
body: (block)))
|
||||
|
||||
========================================================
|
||||
incomplete if statement in function definition
|
||||
========================================================
|
||||
|
|
@ -74,3 +90,22 @@ def a():
|
|||
(ERROR (identifier))
|
||||
body: (block
|
||||
(expression_statement (string)))))
|
||||
|
||||
===========================================
|
||||
incomplete definition in class definition
|
||||
===========================================
|
||||
|
||||
class A:
|
||||
def
|
||||
|
||||
b
|
||||
|
||||
---
|
||||
|
||||
(module
|
||||
(class_definition
|
||||
name: (identifier)
|
||||
(ERROR)
|
||||
body: (block))
|
||||
(expression_statement
|
||||
(identifier)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue