CPython completely parses a file and begins to run it afterwards(?). Is it also possible get every line executed before the parser continues or run the whole program line by line to get something like this running:
print('not yet')
exit()
print('but here is a SyntaxError incoming'
My goal would be to make a vanilla module that tries to fix SyntaxErrors of the file it is imported into in some way like:
import SyntaxFixer from SyntaxFixer
SyntaxFixer.run() #this line would have to be executed
print( #before this line to fix it, or terminate the program befor a SyntaxError could be thrown
I know that the C reference is quite extensive about the definitions of its behaviour, or when the behaviour is undefined, but I couldn't find a similar definition for Python that would make my project impossible. I want to get it to work with CPython, as this is the default and most used implementation.