parsePsi
Parse code into a PSI tree, for analysis: the same statements under the same rules, with two changes the PSI converter forces. The parse is lazy, as the stock PSI parse is: a lambda's element type makes its PSI only out of a collapsed node, so an eagerly built lambda fails the first time anything asks it for its PSI. And the body gets a BLOCK of its own inside the initializer: KtScriptInitializer.body is the initializer's first expression child, so without one a body of two statements would convert as its first. Syntax errors stay in the tree as error elements, as in any PSI parse. collectDiagnostics never reports them: whoever shows diagnostics walks the tree for them, as the CLI's SyntaxErrorReporter does.