K2 Scripting: wrap script statements into blocks

(reuse anonymous initializers as block wrappers) so the top-level script
elements are all declarations now. Rename the property accordingly (
together with the previous commit).
It makes script more similar to the class and thus simplify e.g.
control flow analysis and resolve code.
This commit is contained in:
Ilya Chernikov
2023-11-22 16:40:51 +01:00
committed by Space Team
parent c9aee5bf09
commit eeb723eb01
20 changed files with 224 additions and 156 deletions
@@ -27,7 +27,7 @@ internal class KtFirScriptParameterSymbolPointer(
scriptPointer.restoreSymbol()?.firSymbol?.fir as? FirScript
} ?: return null
val parameter = script.parameters.find { it.name == parameterName } as? FirProperty ?: return null
val parameter = script.parameters.find { it.name == parameterName } ?: return null
return analysisSession.firSymbolBuilder.variableLikeBuilder.buildLocalVariableSymbol(parameter.symbol)
}