Add more python error recovery tests

This commit is contained in:
Max Brunsfeld 2022-06-24 19:07:40 -07:00
parent 5aa2f4dc8c
commit 04381dcea3

View file

@ -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)))