Importing a parser for a given language into the editor

Hello, we were trying to use the in-built python parser to detect syntax errors and were unable to understand how to pass the editor text to the python parser. Any direction for this would be really helpful!

Thank you!

Which Python parser do you mean? The Lezer parser in @codemirror/lang-python, or a separate one? If an editor is using a given language, you can access its parse tree with the syntaxTree function.

Thank you for you help, we were able to make use of the python parser!