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:
committed by
Space Team
parent
c9aee5bf09
commit
eeb723eb01
+3
-3
@@ -494,10 +494,10 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
|
||||
script.configure {
|
||||
+name
|
||||
+FieldList("declarations", statement, withReplace = true, useMutableOrEmpty = true).withTransform()
|
||||
+declarations.withTransform().withReplace()
|
||||
+symbol("FirScriptSymbol")
|
||||
+fieldList("parameters", variable, withReplace = false)
|
||||
+fieldList(contextReceiver, useMutableOrEmpty = true)
|
||||
+fieldList("parameters", property).withTransform()
|
||||
+fieldList(contextReceiver, useMutableOrEmpty = true).withTransform()
|
||||
+field("resultPropertyName", nameType, nullable = true)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user