@@ -20,23 +20,23 @@ interface INodeResolutionScope {
20
20
* All node references inside the body are resolved against this scope. Compared to runWithAlso, the existing scopes
21
21
* in the current context are not used, meaning they are replaced.
22
22
*/
23
- fun <T > runWithOnly (body : () -> T ): T = contextScope.computeWith(this , body)
23
+ fun <T > runWith (body : () -> T ): T = contextScope.computeWith(this , body)
24
24
25
25
/* *
26
26
* Does the same as runWithOnly, but with support for suspendable functions.
27
27
*/
28
- suspend fun <T > runWithOnlyInCoroutine (body : suspend () -> T ): T = contextScope.runInCoroutine(this , body)
28
+ suspend fun <T > runWithInCoroutine (body : suspend () -> T ): T = contextScope.runInCoroutine(this , body)
29
29
30
30
/* *
31
31
* All node references inside the body are resolved against this scope and if that fails against any other scope in
32
32
* the current context.
33
33
*/
34
- fun <T > runWithAlso (body : () -> T ): T = runWithAlso (this , body)
34
+ fun <T > runWithAdditionalScope (body : () -> T ): T = runWithAdditionalScope (this , body)
35
35
36
36
/* *
37
37
* Does the same as runWithAlso, but with support for suspendable functions.
38
38
*/
39
- suspend fun <T > runWithAlsoInCoroutine (body : suspend () -> T ): T = runWithAlsoInCoroutine (this , body)
39
+ suspend fun <T > runWithAdditionalScopeInCoroutine (body : suspend () -> T ): T = runWithAdditionalScopeInCoroutine (this , body)
40
40
41
41
companion object {
42
42
internal val contextScope = ContextValue <INodeResolutionScope >()
@@ -45,7 +45,7 @@ interface INodeResolutionScope {
45
45
return listOf (scopeToAdd) + (getCurrentScopes() - scopeToAdd)
46
46
}
47
47
48
- fun <T > runWithAlso (scope : INodeResolutionScope , body : () -> T ): T {
48
+ fun <T > runWithAdditionalScope (scope : INodeResolutionScope , body : () -> T ): T {
49
49
val newScopes = combineScopes(scope)
50
50
return when (newScopes.size) {
51
51
0 -> throw RuntimeException (" Impossible case" )
@@ -54,7 +54,7 @@ interface INodeResolutionScope {
54
54
}
55
55
}
56
56
57
- suspend fun <T > runWithAlsoInCoroutine (scope : INodeResolutionScope , body : suspend () -> T ): T {
57
+ suspend fun <T > runWithAdditionalScopeInCoroutine (scope : INodeResolutionScope , body : suspend () -> T ): T {
58
58
val newScopes = combineScopes(scope)
59
59
return when (newScopes.size) {
60
60
0 -> throw RuntimeException (" Impossible case" )
@@ -90,7 +90,7 @@ interface INodeResolutionScope {
90
90
return if (current.contains(scope)) {
91
91
body()
92
92
} else {
93
- scope.runWithAlso (body)
93
+ scope.runWithAdditionalScope (body)
94
94
}
95
95
}
96
96
}
0 commit comments