diff --git a/.gradle/8.14/checksums/checksums.lock b/.gradle/8.14/checksums/checksums.lock new file mode 100644 index 0000000..1b1a269 Binary files /dev/null and b/.gradle/8.14/checksums/checksums.lock differ diff --git a/.gradle/8.14/checksums/md5-checksums.bin b/.gradle/8.14/checksums/md5-checksums.bin new file mode 100644 index 0000000..535eae4 Binary files /dev/null and b/.gradle/8.14/checksums/md5-checksums.bin differ diff --git a/.gradle/8.14/checksums/sha1-checksums.bin b/.gradle/8.14/checksums/sha1-checksums.bin new file mode 100644 index 0000000..fff7a1a Binary files /dev/null and b/.gradle/8.14/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.14/executionHistory/executionHistory.bin b/.gradle/8.14/executionHistory/executionHistory.bin new file mode 100644 index 0000000..59f3673 Binary files /dev/null and b/.gradle/8.14/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.14/executionHistory/executionHistory.lock b/.gradle/8.14/executionHistory/executionHistory.lock new file mode 100644 index 0000000..e4cdbb4 Binary files /dev/null and b/.gradle/8.14/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.14/fileChanges/last-build.bin b/.gradle/8.14/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/8.14/fileChanges/last-build.bin differ diff --git a/.gradle/8.14/fileHashes/fileHashes.bin b/.gradle/8.14/fileHashes/fileHashes.bin new file mode 100644 index 0000000..25aaaaa Binary files /dev/null and b/.gradle/8.14/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.14/fileHashes/fileHashes.lock b/.gradle/8.14/fileHashes/fileHashes.lock new file mode 100644 index 0000000..c944882 Binary files /dev/null and b/.gradle/8.14/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.14/fileHashes/resourceHashesCache.bin b/.gradle/8.14/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..0dab93a Binary files /dev/null and b/.gradle/8.14/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/8.14/gc.properties b/.gradle/8.14/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..38b5338 Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..1649cac --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed Aug 12 02:33:48 MSK 2026 +gradle.version=8.14 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..630b15c Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..4428f2f Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..f6efed7 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + kotlin("jvm") version "2.2.20" + id("org.jetbrains.kotlin.plugin.compose") version "2.2.20" + id("org.jetbrains.compose") version "1.11.1" +} + +repositories { + mavenCentral() + google() +} + +dependencies { + implementation(compose.desktop.currentOs) +} + +compose.desktop { + application { + mainClass = "MainKt" + } +} diff --git a/build/classes/kotlin/main/CalculatorState.class b/build/classes/kotlin/main/CalculatorState.class new file mode 100644 index 0000000..ce965c7 Binary files /dev/null and b/build/classes/kotlin/main/CalculatorState.class differ diff --git a/build/classes/kotlin/main/ComposableSingletons$MainKt$lambda$45682630$1$1$1.class b/build/classes/kotlin/main/ComposableSingletons$MainKt$lambda$45682630$1$1$1.class new file mode 100644 index 0000000..9993a8b Binary files /dev/null and b/build/classes/kotlin/main/ComposableSingletons$MainKt$lambda$45682630$1$1$1.class differ diff --git a/build/classes/kotlin/main/ComposableSingletons$MainKt$lambda$45682630$1$2$1.class b/build/classes/kotlin/main/ComposableSingletons$MainKt$lambda$45682630$1$2$1.class new file mode 100644 index 0000000..f409508 Binary files /dev/null and b/build/classes/kotlin/main/ComposableSingletons$MainKt$lambda$45682630$1$2$1.class differ diff --git a/build/classes/kotlin/main/ComposableSingletons$MainKt.class b/build/classes/kotlin/main/ComposableSingletons$MainKt.class new file mode 100644 index 0000000..1c14031 Binary files /dev/null and b/build/classes/kotlin/main/ComposableSingletons$MainKt.class differ diff --git a/build/classes/kotlin/main/META-INF/calc-compose.kotlin_module b/build/classes/kotlin/main/META-INF/calc-compose.kotlin_module new file mode 100644 index 0000000..985eba9 Binary files /dev/null and b/build/classes/kotlin/main/META-INF/calc-compose.kotlin_module differ diff --git a/build/classes/kotlin/main/MainKt.class b/build/classes/kotlin/main/MainKt.class new file mode 100644 index 0000000..56ab8ca Binary files /dev/null and b/build/classes/kotlin/main/MainKt.class differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab new file mode 100644 index 0000000..bdf584a Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream new file mode 100644 index 0000000..288f13b Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len new file mode 100644 index 0000000..c4a5886 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len new file mode 100644 index 0000000..2a17e6e Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at new file mode 100644 index 0000000..61d8bf0 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i new file mode 100644 index 0000000..9e15cd1 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab new file mode 100644 index 0000000..bdf584a Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream new file mode 100644 index 0000000..bd055a2 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len new file mode 100644 index 0000000..4b05c55 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len new file mode 100644 index 0000000..2a17e6e Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at new file mode 100644 index 0000000..53b2d29 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i new file mode 100644 index 0000000..d18f078 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab new file mode 100644 index 0000000..bdf584a Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream new file mode 100644 index 0000000..bd055a2 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len new file mode 100644 index 0000000..4b05c55 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len new file mode 100644 index 0000000..2a17e6e Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at new file mode 100644 index 0000000..2f6f3d5 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i new file mode 100644 index 0000000..d18f078 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab new file mode 100644 index 0000000..b7a7566 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream new file mode 100644 index 0000000..30f4fa0 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len new file mode 100644 index 0000000..c14ff15 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len new file mode 100644 index 0000000..ec8f944 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at new file mode 100644 index 0000000..b9ac1f6 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i new file mode 100644 index 0000000..1f4516f Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab new file mode 100644 index 0000000..bdf584a Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream new file mode 100644 index 0000000..05d57dd Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len new file mode 100644 index 0000000..c0f177d Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len new file mode 100644 index 0000000..2a17e6e Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at new file mode 100644 index 0000000..46d6744 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i new file mode 100644 index 0000000..61f679b Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab new file mode 100644 index 0000000..8960826 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream new file mode 100644 index 0000000..7e204cb Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len new file mode 100644 index 0000000..75ae93b Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len new file mode 100644 index 0000000..a9f80ae Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at new file mode 100644 index 0000000..18dca41 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i new file mode 100644 index 0000000..05d4c2f Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab new file mode 100644 index 0000000..bdf584a Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream new file mode 100644 index 0000000..288f13b Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len new file mode 100644 index 0000000..c4a5886 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len new file mode 100644 index 0000000..2a17e6e Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at new file mode 100644 index 0000000..8777ef6 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i new file mode 100644 index 0000000..9e15cd1 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/counters.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/counters.tab new file mode 100644 index 0000000..166c057 --- /dev/null +++ b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/counters.tab @@ -0,0 +1,2 @@ +1 +0 \ No newline at end of file diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab new file mode 100644 index 0000000..bdf584a Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream new file mode 100644 index 0000000..288f13b Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len new file mode 100644 index 0000000..c4a5886 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len new file mode 100644 index 0000000..2a17e6e Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at new file mode 100644 index 0000000..5875372 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i new file mode 100644 index 0000000..9e15cd1 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab new file mode 100644 index 0000000..8aad32b Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream new file mode 100644 index 0000000..08e7df1 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len new file mode 100644 index 0000000..b7da01d Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len new file mode 100644 index 0000000..2a17e6e Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at new file mode 100644 index 0000000..eb6eba3 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len new file mode 100644 index 0000000..1b1cb4d Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab new file mode 100644 index 0000000..dab9ad9 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream new file mode 100644 index 0000000..3eb03c4 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len new file mode 100644 index 0000000..34d31bd Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len new file mode 100644 index 0000000..986df87 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at new file mode 100644 index 0000000..5ce05b4 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i new file mode 100644 index 0000000..ab5be81 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i differ diff --git a/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len new file mode 100644 index 0000000..131e265 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len differ diff --git a/build/kotlin/compileKotlin/cacheable/last-build.bin b/build/kotlin/compileKotlin/cacheable/last-build.bin new file mode 100644 index 0000000..75d02e9 Binary files /dev/null and b/build/kotlin/compileKotlin/cacheable/last-build.bin differ diff --git a/build/kotlin/compileKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin b/build/kotlin/compileKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin new file mode 100644 index 0000000..36557d0 Binary files /dev/null and b/build/kotlin/compileKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin differ diff --git a/build/libs/calc-compose.jar b/build/libs/calc-compose.jar new file mode 100644 index 0000000..ead3c23 Binary files /dev/null and b/build/libs/calc-compose.jar differ diff --git a/build/tmp/jar/MANIFEST.MF b/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..377a6ce --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx3g -Dfile.encoding=UTF-8 +kotlin.code.style=official diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..1b33c55 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ca025c8 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..23d15a9 --- /dev/null +++ b/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..5eed7ee --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..021484f --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "calc-compose" diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt new file mode 100644 index 0000000..328455b --- /dev/null +++ b/src/main/kotlin/Main.kt @@ -0,0 +1,300 @@ +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Text +import androidx.compose.material.darkColors +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.input.key.Key +import androidx.compose.ui.input.key.KeyEvent +import androidx.compose.ui.input.key.KeyEventType +import androidx.compose.ui.input.key.isShiftPressed +import androidx.compose.ui.input.key.key +import androidx.compose.ui.input.key.type +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.window.Window +import androidx.compose.ui.window.application +import androidx.compose.ui.window.rememberWindowState +import kotlin.math.abs +import kotlin.math.floor + +private const val CLEAR = "C" +private const val EQUALS = "=" +private const val BACKSPACE = "⌫" +private const val DOT = "." +private const val MINUS = "−" +private const val PLUS = "+" +private const val TIMES = "×" +private const val DIVIDE = "÷" + +private const val MAX_DISPLAY_LENGTH = 15 + +private val BackgroundColor = Color(0xFF1C1C1E) +private val DisplayColor = Color(0xFF2C2C2E) +private val DigitColor = Color(0xFF3A3A3C) +private val OperatorColor = Color(0xFFFF9F0A) +private val UtilityColor = Color(0xFFA5A5A5) +private val EqualsColor = Color(0xFF34C759) +private val TextOnDark = Color(0xFFFFFFFF) +private val TextOnBright = Color(0xFF111111) + +fun main() = application { + val calculator = CalculatorState() + Window( + onCloseRequest = ::exitApplication, + title = "Калькулятор", + state = rememberWindowState(width = 360.dp, height = 520.dp), + resizable = false, + onPreviewKeyEvent = calculator::onKeyEvent + ) { + CalculatorApp(calculator) + } +} + +class CalculatorState { + var display: String by mutableStateOf("0") + private set + var accumulator: Double? by mutableStateOf(null) + private set + var pendingOp: String? by mutableStateOf(null) + private set + var freshInput: Boolean by mutableStateOf(true) + private set + + fun onKeyEvent(event: KeyEvent): Boolean { + if (event.type != KeyEventType.KeyDown) return false + val action = keyToAction(event) ?: return false + press(action) + return true + } + + fun press(action: String) { + when (action) { + CLEAR -> { + display = "0" + accumulator = null + pendingOp = null + freshInput = true + } + + BACKSPACE -> { + if (freshInput) { + accumulator = null + pendingOp = null + } else if (display.length > 1) { + display = display.dropLast(1) + } else { + display = "0" + freshInput = true + } + } + + DOT -> { + if (display == "Error") return + if (freshInput) { + display = "0." + freshInput = false + } else if (!display.contains(".")) { + display += DOT + } + } + + PLUS, MINUS, TIMES, DIVIDE -> { + if (display == "Error") { + accumulator = null + display = "0" + } + val current = display.toDoubleOrNull() ?: 0.0 + val op = pendingOp + if (op != null && !freshInput) { + val result = applyOperation(accumulator ?: current, op, current) + display = formatNumber(result) + accumulator = if (display == "Error") null else result + } else { + accumulator = current + } + pendingOp = action + freshInput = true + } + + EQUALS -> { + val current = display.toDoubleOrNull() + val op = pendingOp + val acc = accumulator + if (current != null && op != null && acc != null) { + display = formatNumber(applyOperation(acc, op, current)) + } + accumulator = null + pendingOp = null + freshInput = true + } + + else -> { + if (display == "Error") { + display = action + freshInput = false + } else if (freshInput) { + display = action + freshInput = false + } else if (display == "0") { + display = action + } else if (display.length < MAX_DISPLAY_LENGTH) { + display += action + } + } + } + } +} + +private fun keyToAction(event: KeyEvent): String? = when (event.key) { + Key.Zero, Key.NumPad0 -> "0" + Key.One, Key.NumPad1 -> "1" + Key.Two, Key.NumPad2 -> "2" + Key.Three, Key.NumPad3 -> "3" + Key.Four, Key.NumPad4 -> "4" + Key.Five, Key.NumPad5 -> "5" + Key.Six, Key.NumPad6 -> "6" + Key.Seven, Key.NumPad7 -> "7" + Key.Eight, Key.NumPad8 -> "8" + Key.Nine, Key.NumPad9 -> "9" + Key.NumPadAdd, Key.Plus -> PLUS + Key.NumPadSubtract, Key.Minus -> MINUS + Key.NumPadMultiply, Key.Multiply -> TIMES + Key.NumPadDivide, Key.Slash -> DIVIDE + Key.NumPadDot, Key.Period -> DOT + Key.Comma -> DOT + Key.Equals -> if (event.isShiftPressed) PLUS else EQUALS + Key.Enter, Key.NumPadEnter -> EQUALS + Key.Backspace -> BACKSPACE + Key.Escape, Key.Delete -> CLEAR + else -> null +} + +private fun formatNumber(value: Double): String { + if (value.isNaN() || value.isInfinite()) return "Error" + val v = if (value == -0.0) 0.0 else value + if (v == floor(v) && abs(v) < 1e15) { + return v.toLong().toString() + } + return v.toString() +} + +private fun applyOperation(a: Double, op: String, b: Double): Double = when (op) { + PLUS -> a + b + MINUS -> a - b + TIMES -> a * b + DIVIDE -> a / b + else -> b +} + +@Composable +fun CalculatorApp(calculator: CalculatorState) { + MaterialTheme(colors = darkColors(background = BackgroundColor)) { + Column( + modifier = Modifier.fillMaxSize().background(BackgroundColor).padding(12.dp), + verticalArrangement = Arrangement.spacedBy(12.dp) + ) { + DisplayPanel(calculator.display) + + Column(modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.spacedBy(12.dp)) { + GridRow(listOf("7", "8", "9", DIVIDE), calculator, Modifier.weight(1f)) + GridRow(listOf("4", "5", "6", TIMES), calculator, Modifier.weight(1f)) + GridRow(listOf("1", "2", "3", MINUS), calculator, Modifier.weight(1f)) + GridRow(listOf("0", DOT, BACKSPACE, PLUS), calculator, Modifier.weight(1f)) + Row( + modifier = Modifier.fillMaxWidth().weight(1f), + horizontalArrangement = Arrangement.spacedBy(12.dp) + ) { + CalculatorButton(CLEAR, UtilityColor, calculator, Modifier.weight(1f).fillMaxHeight()) + CalculatorButton(EQUALS, EqualsColor, calculator, Modifier.weight(1f).fillMaxHeight()) + } + } + } + } +} + +@Composable +private fun DisplayPanel(text: String) { + Box( + modifier = Modifier.fillMaxWidth().height(88.dp).clip(RoundedCornerShape(12.dp)) + .background(DisplayColor).padding(horizontal = 16.dp, vertical = 8.dp), + contentAlignment = Alignment.CenterEnd + ) { + Text( + text = text, + color = TextOnDark, + fontSize = 38.sp, + fontWeight = FontWeight.Medium, + textAlign = TextAlign.End, + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + } +} + +@Composable +private fun GridRow(labels: List, calculator: CalculatorState, modifier: Modifier = Modifier) { + Row( + modifier = modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(12.dp) + ) { + labels.forEach { label -> + val isOperator = label == PLUS || label == MINUS || label == TIMES || label == DIVIDE + CalculatorButton( + label = label, + background = if (isOperator) OperatorColor else DigitColor, + calculator = calculator, + modifier = Modifier.weight(1f).fillMaxHeight() + ) + } + } +} + +@Composable +private fun CalculatorButton( + label: String, + background: Color, + calculator: CalculatorState, + modifier: Modifier = Modifier +) { + val textColor = if (background == OperatorColor || background == UtilityColor || background == EqualsColor) { + TextOnBright + } else { + TextOnDark + } + Box( + modifier = modifier + .clip(RoundedCornerShape(12.dp)) + .background(background) + .clickable { calculator.press(label) }, + contentAlignment = Alignment.Center + ) { + Text( + text = label, + color = textColor, + fontSize = 26.sp, + fontWeight = FontWeight.Bold, + textAlign = TextAlign.Center + ) + } +}