From a0eb5f5ea2c9e88f839a785df6b0aee95772805e Mon Sep 17 00:00:00 2001 From: pavelpozdeev Date: Mon, 13 Jan 2025 15:40:13 +0300 Subject: [PATCH] initial --- incremental-cj/runtime/src/animations/GlobalTimer.cj | 4 ++-- incremental-cj/runtime/src/core/MemoScope.cj | 2 +- incremental-cj/runtime/src/core/ParameterImpl.cj | 2 +- incremental-cj/runtime/src/core/ScopeImpl.cj | 2 +- incremental-cj/runtime/src/core/StateImpl.cj | 2 +- incremental-cj/runtime/src/core/node.cj | 2 +- incremental-cj/runtime/src/util/ValueTracker.cj | 6 +++--- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/incremental-cj/runtime/src/animations/GlobalTimer.cj b/incremental-cj/runtime/src/animations/GlobalTimer.cj index 57d5d944c..7ef5406d7 100644 --- a/incremental-cj/runtime/src/animations/GlobalTimer.cj +++ b/incremental-cj/runtime/src/animations/GlobalTimer.cj @@ -37,8 +37,8 @@ public func createAnimationTimer(initial: ?UInt64): MutableState { throw IllegalStateException("the global animation timer is already initialized") } return namedState(GLOBAL_ANIMATION_TIMER) { - if (let Some(initial) <- initial) { - initial + if (let Some(value) <- initial) { + value } else { 0 } diff --git a/incremental-cj/runtime/src/core/MemoScope.cj b/incremental-cj/runtime/src/core/MemoScope.cj index 40f76d345..978174d6a 100644 --- a/incremental-cj/runtime/src/core/MemoScope.cj +++ b/incremental-cj/runtime/src/core/MemoScope.cj @@ -48,7 +48,7 @@ public func getParameter(scope: MemoScope, index: Int64, va } public func getParameter(scope: MemoScope, index: Int64, value: Value, name: ?String): State { - if (let Some(scope) <- scope as ManagedScope) { + if (let Some(scope) <- (scope as ManagedScope)) { return scope.param(index, value, name) } else { throw IllegalStateException("unexpected scope provided") diff --git a/incremental-cj/runtime/src/core/ParameterImpl.cj b/incremental-cj/runtime/src/core/ParameterImpl.cj index dba93f690..95bda99a2 100644 --- a/incremental-cj/runtime/src/core/ParameterImpl.cj +++ b/incremental-cj/runtime/src/core/ParameterImpl.cj @@ -68,7 +68,7 @@ class ParameterImpl <: UniqueObject & MutableState { if (this.modified) { sb.append(",modified") } - if (let Some(value) <- this.value as ToString) { + if (let Some(value) <- (this.value as ToString)) { sb.append("=") sb.append(value.toString()) } diff --git a/incremental-cj/runtime/src/core/ScopeImpl.cj b/incremental-cj/runtime/src/core/ScopeImpl.cj index 8f9acaebe..f9fdada1a 100644 --- a/incremental-cj/runtime/src/core/ScopeImpl.cj +++ b/incremental-cj/runtime/src/core/ScopeImpl.cj @@ -34,7 +34,7 @@ abstract class ManagedScope <: Dependency & TreeNode & Equatable 0) { - this.params = Array(paramCount, item: None) + this.params = Array(paramCount, repeat: None) } } diff --git a/incremental-cj/runtime/src/core/StateImpl.cj b/incremental-cj/runtime/src/core/StateImpl.cj index d67f69997..5ea94849f 100644 --- a/incremental-cj/runtime/src/core/StateImpl.cj +++ b/incremental-cj/runtime/src/core/StateImpl.cj @@ -170,7 +170,7 @@ class StateImpl <: AbstractState & MutableState { } else { this.current } - if (let Some(value) <- content as ToString) { + if (let Some(value) <- (content as ToString)) { sb.append("=") sb.append(value.toString()) } diff --git a/incremental-cj/runtime/src/core/node.cj b/incremental-cj/runtime/src/core/node.cj index d654f40da..a53996639 100644 --- a/incremental-cj/runtime/src/core/node.cj +++ b/incremental-cj/runtime/src/core/node.cj @@ -58,7 +58,7 @@ public func contextNode(kind: UInt32, getErrorMessage: () -> String): */ public func contextNode(getErrorMessage: () -> String): TreeNode where TreeNode <: IncrementalNode { if (let Some(node) <- getManagedScope(getErrorMessage).nodeRef) { - if (let Some(node) <- node as TreeNode) { + if (let Some(node) <- (node as TreeNode)) { return node } else { throw IllegalStateException("context node has unexpected type: ${getErrorMessage()}") diff --git a/incremental-cj/runtime/src/util/ValueTracker.cj b/incremental-cj/runtime/src/util/ValueTracker.cj index d83f669f3..514d638e0 100644 --- a/incremental-cj/runtime/src/util/ValueTracker.cj +++ b/incremental-cj/runtime/src/util/ValueTracker.cj @@ -36,11 +36,11 @@ public func equalValues(v1: Value, v2: Value): Bool { if (v1 is Unit && v2 is Unit) { return true } - if (let Some(e) <- v1 as Equatable) { + if (let Some(e) <- (v1 as Equatable)) { return e == v2 // Value is Equatable } - if (let Some(o1) <- v1 as Object) { - if (let Some(o2) <- v2 as Object) { + if (let Some(o1) <- (v1 as Object)) { + if (let Some(o2) <- (v2 as Object)) { return refEq(o1, o2) } } -- Gitee