diff --git a/.circleci/config.pkl b/.circleci/config.pkl index fa2c14b5..0a299a1e 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -17,8 +17,8 @@ amends "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.circleci@1.2.0#/PklCI.pkl" import "jobs/BuildNativeJob.pkl" -import "jobs/GradleCheckJob.pkl" import "jobs/DeployJob.pkl" +import "jobs/GradleCheckJob.pkl" import "jobs/SimpleGradleJob.pkl" local prbJobs: Listing = gradleCheckJobs.keys.toListing() @@ -130,18 +130,21 @@ jobs { [jobName] = job.job } ["bench"] = new SimpleGradleJob { command = "bench:jmh" }.job - ["gradle-compatibility"] = new SimpleGradleJob { - name = "gradle compatibility" - command = #""" - :pkl-gradle:build \ - :pkl-gradle:compatibilityTestReleases - """# - }.job + ["gradle-compatibility"] = + new SimpleGradleJob { + name = "gradle compatibility" + command = + #""" + :pkl-gradle:build \ + :pkl-gradle:compatibilityTestReleases + """# + }.job ["deploy-snapshot"] = new DeployJob { command = "publishToSonatype" }.job - ["deploy-release"] = new DeployJob { - isRelease = true - command = "publishToSonatype closeAndReleaseSonatypeStagingRepository" - }.job + ["deploy-release"] = + new DeployJob { + isRelease = true + command = "publishToSonatype closeAndReleaseSonatypeStagingRepository" + }.job ["github-release"] { docker { new { image = "maniator/gh:v2.40.1" } @@ -150,7 +153,8 @@ jobs { new AttachWorkspaceStep { at = "." } new RunStep { name = "Publish release on GitHub" - command = #""" + command = + #""" # exclude build_artifacts.txt from publish rm -f */build/executable/*.build_artifacts.txt find */build/executable/* -type d | xargs rm -rf diff --git a/.circleci/jobs/BuildNativeJob.pkl b/.circleci/jobs/BuildNativeJob.pkl index ccef5570..83a7ff4c 100644 --- a/.circleci/jobs/BuildNativeJob.pkl +++ b/.circleci/jobs/BuildNativeJob.pkl @@ -19,7 +19,7 @@ extends "GradleJob.pkl" import "package://pkg.pkl-lang.org/pkl-pantry/com.circleci.v2@1.5.0#/Config.pkl" /// The architecture to use -arch: "amd64"|"aarch64" +arch: "amd64" | "aarch64" /// Whether to link to musl. Otherwise, links to glibc. musl: Boolean = false @@ -44,40 +44,45 @@ local setupLinuxEnvironment: Config.RunStep = new { name = "Set up environment" shell = "#!/bin/bash -exo pipefail" - command = new Listing { - #""" - sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \ - && microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \ - && microdnf clean all \ - && rm -rf /var/cache/dnf + command = + new Listing { + #""" + sed -ie '/\[ol8_codeready_builder\]/,/^$/s/enabled=0/enabled=1/g' /etc/yum.repos.d/oracle-linux-ol8.repo \ + && microdnf -y install util-linux tree coreutils-single findutils curl tar gzip git zlib-devel gcc-c++ make openssl glibc-langpack-en libstdc++-static \ + && microdnf clean all \ + && rm -rf /var/cache/dnf - # install jdk - curl -Lf \ - https://github.com/adoptium/temurin\#(module.majorJdkVersion)-binaries/releases/download/\#(module.jdkGitHubReleaseName)/OpenJDK\#(module.majorJdkVersion)U-jdk_\#(if (arch == "amd64") "x64" else "aarch64")_linux_hotspot_\#(module.jdkVersionAlt).tar.gz -o /tmp/jdk.tar.gz + # install jdk + curl -Lf \ + https://github.com/adoptium/temurin\#(module.majorJdkVersion)-binaries/releases/download/\#(module + .jdkGitHubReleaseName)/OpenJDK\#(module.majorJdkVersion)U-jdk_\#(if (arch == "amd64") + "x64" + else + "aarch64")_linux_hotspot_\#(module.jdkVersionAlt).tar.gz -o /tmp/jdk.tar.gz - mkdir /jdk \ - && cd /jdk \ - && cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC . + mkdir /jdk \ + && cd /jdk \ + && cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC . - mkdir -p ~/staticdeps/bin + mkdir -p ~/staticdeps/bin - cp /usr/lib/gcc/\#(if (arch == "amd64") "x86_64" else "aarch64")-redhat-linux/8/libstdc++.a ~/staticdeps + cp /usr/lib/gcc/\#(if (arch == "amd64") "x86_64" else "aarch64")-redhat-linux/8/libstdc++.a ~/staticdeps - # install zlib - if [[ ! -f ~/staticdeps/include/zlib.h ]]; then - curl -Lf https://github.com/madler/zlib/releases/download/v\#(zlibVersion)/zlib-\#(zlibVersion).tar.gz -o /tmp/zlib.tar.gz + # install zlib + if [[ ! -f ~/staticdeps/include/zlib.h ]]; then + curl -Lf https://github.com/madler/zlib/releases/download/v\#(zlibVersion)/zlib-\#(zlibVersion).tar.gz -o /tmp/zlib.tar.gz - mkdir -p /tmp/dep_zlib-\#(zlibVersion) \ - && cd /tmp/dep_zlib-\#(zlibVersion) \ - && cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \ - && echo "zlib-\#(zlibVersion): configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \ - && echo "zlib-\#(zlibVersion): make..." && make -s -j4 \ - && echo "zlib-\#(zlibVersion): make install..." && make -s install \ - && rm -rf /tmp/dep_zlib-\#(zlibVersion) - fi - """# - // don't need musl on aarch because GraalVM only supports musl builds on x86 - when (arch == "amd64") { + mkdir -p /tmp/dep_zlib-\#(zlibVersion) \ + && cd /tmp/dep_zlib-\#(zlibVersion) \ + && cat /tmp/zlib.tar.gz | tar --strip-components=1 -xzC . \ + && echo "zlib-\#(zlibVersion): configure..." && ./configure --static --prefix="$HOME"/staticdeps > /dev/null \ + && echo "zlib-\#(zlibVersion): make..." && make -s -j4 \ + && echo "zlib-\#(zlibVersion): make install..." && make -s install \ + && rm -rf /tmp/dep_zlib-\#(zlibVersion) + fi + """# + // don't need musl on aarch because GraalVM only supports musl builds on x86 + when (arch == "amd64") { #""" # install musl if [[ ! -f ~/staticdeps/bin/x86_64-linux-musl-gcc ]]; then @@ -95,25 +100,28 @@ local setupLinuxEnvironment: Config.RunStep = ln -s ~/staticdeps/bin/musl-gcc ~/staticdeps/bin/x86_64-linux-musl-gcc fi """# - } - }.join("\n\n") + } + }.join("\n\n") } -local setupMacEnvironment: Config.RunStep = - new { - name = "Set up environment" - shell = "#!/bin/bash -exo pipefail" - command = - #""" - # install jdk - curl -Lf \ - https://github.com/adoptium/temurin\#(module.majorJdkVersion)-binaries/releases/download/\#(module.jdkGitHubReleaseName)/OpenJDK\#(module.majorJdkVersion)U-jdk_\#(if (arch == "amd64") "x64" else "aarch64")_mac_hotspot_\#(module.jdkVersionAlt).tar.gz -o /tmp/jdk.tar.gz +local setupMacEnvironment: Config.RunStep = new { + name = "Set up environment" + shell = "#!/bin/bash -exo pipefail" + command = + #""" + # install jdk + curl -Lf \ + https://github.com/adoptium/temurin\#(module.majorJdkVersion)-binaries/releases/download/\#(module + .jdkGitHubReleaseName)/OpenJDK\#(module.majorJdkVersion)U-jdk_\#(if (arch == "amd64") + "x64" + else + "aarch64")_mac_hotspot_\#(module.jdkVersionAlt).tar.gz -o /tmp/jdk.tar.gz - mkdir $HOME/jdk \ - && cd $HOME/jdk \ - && cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC . - """# - } + mkdir $HOME/jdk \ + && cd $HOME/jdk \ + && cat /tmp/jdk.tar.gz | tar --strip-components=1 -xzC . + """# +} steps { when (os == "linux") { @@ -134,7 +142,8 @@ steps { when (arch == "amd64") { new Config.RunStep { name = "Installing Rosetta 2" - command = """ + command = + """ /usr/sbin/softwareupdate --install-rosetta --agree-to-license """ } @@ -146,7 +155,8 @@ steps { when (module.os == "windows") { shell = "bash.exe" } - command = #""" + command = + #""" export PATH=~/staticdeps/bin:$PATH ./gradlew \#(module.gradleArgs) \#(project):buildNative """# diff --git a/.circleci/jobs/GradleJob.pkl b/.circleci/jobs/GradleJob.pkl index 75dcae3a..d39c391b 100644 --- a/.circleci/jobs/GradleJob.pkl +++ b/.circleci/jobs/GradleJob.pkl @@ -22,14 +22,12 @@ import "package://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.uri@1.0.3#/URI.pk isRelease: Boolean = false /// The OS to run on -os: "macOS"|"linux"|"windows" +os: "macOS" | "linux" | "windows" /// The version of Java to use. -javaVersion: "17.0"|"21.0" +javaVersion: "17.0" | "21.0" -fixed javaVersionFull = - if (javaVersion == "17.0") "17.0.9+9" - else "21.0.5+11" +fixed javaVersionFull = if (javaVersion == "17.0") "17.0.9+9" else "21.0.5+11" fixed jdkVersionAlt = javaVersionFull.replaceLast("+", "_") @@ -38,21 +36,24 @@ fixed majorJdkVersion = javaVersionFull.split(".").first fixed jdkGitHubReleaseName = let (ver = // 17.0.9+9 is missing some binaries (see https://github.com/adoptium/adoptium-support/issues/994) - if (javaVersionFull == "17.0.9+9" && os == "windows") "jdk-17.0.9+9.1" - else "jdk-\(javaVersionFull)" + if (javaVersionFull == "17.0.9+9" && os == "windows") + "jdk-17.0.9+9.1" + else + "jdk-\(javaVersionFull)" ) URI.encodeComponent(ver) -fixed gradleArgs = new Listing { - "--info" - "--stacktrace" - "-DtestReportsDir=${HOME}/test-results" - "-DpklMultiJdkTesting=true" - when (isRelease) { - "-DreleaseBuild=true" - } - ...extraGradleArgs -}.join(" ") +fixed gradleArgs = + new Listing { + "--info" + "--stacktrace" + "-DtestReportsDir=${HOME}/test-results" + "-DpklMultiJdkTesting=true" + when (isRelease) { + "-DreleaseBuild=true" + } + ...extraGradleArgs + }.join(" ") extraGradleArgs: Listing @@ -84,7 +85,8 @@ job: Config.Job = new { new Config.RunStep { name = "Set up environment" shell = "bash.exe" - command = #""" + command = + #""" # install jdk curl -Lf \ https://github.com/adoptium/temurin\#(majorJdkVersion)-binaries/releases/download/\#(jdkGitHubReleaseName)/OpenJDK\#(majorJdkVersion)U-jdk_x64_windows_hotspot_\#(jdkVersionAlt).zip -o /tmp/jdk.zip diff --git a/.circleci/jobs/SimpleGradleJob.pkl b/.circleci/jobs/SimpleGradleJob.pkl index 8661b1a5..37507473 100644 --- a/.circleci/jobs/SimpleGradleJob.pkl +++ b/.circleci/jobs/SimpleGradleJob.pkl @@ -28,7 +28,8 @@ javaVersion = "21.0" steps { new Config.RunStep { name = module.name - command = """ + command = + """ ./gradlew \(module.gradleArgs) \(module.command) """ } diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflectedDeclaration.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflectedDeclaration.pcf index 1096b081..d7da3ccd 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflectedDeclaration.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflectedDeclaration.pcf @@ -13,9 +13,9 @@ alias { members = List(new { referent { location { - line = 1060 + line = 1082 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1060" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1082" } docComment = """ A boolean value, either [true] or [false]. @@ -304,9 +304,9 @@ alias { allProperties = Map() methods = Map("xor", new { location { - line = 1070 + line = 1092 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1070" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1092" } docComment = """ Tells if exactly one of [this] and [other] is [true] (exclusive or). @@ -328,9 +328,9 @@ alias { }) }, "implies", new { location { - line = 1083 + line = 1105 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1083" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1105" } docComment = """ Tells if [this] implies [other] (logical consequence). @@ -404,9 +404,9 @@ alias { }) }, "xor", new { location { - line = 1070 + line = 1092 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1070" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1092" } docComment = """ Tells if exactly one of [this] and [other] is [true] (exclusive or). @@ -428,9 +428,9 @@ alias { }) }, "implies", new { location { - line = 1083 + line = 1105 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1083" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1105" } docComment = """ Tells if [this] implies [other] (logical consequence). @@ -458,9 +458,9 @@ alias { }, new { referent { location { - line = 1096 + line = 1118 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1096" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1118" } docComment = """ A sequence of Unicode characters (code points). @@ -746,9 +746,9 @@ alias { } properties = Map("length", new { location { - line = 1107 + line = 1129 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1107" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1129" } docComment = """ The number of characters in this string. @@ -778,9 +778,9 @@ alias { }) }, "lastIndex", new { location { - line = 1120 + line = 1142 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1120" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1142" } docComment = """ The index of the last character in this string (same as `length - 1`). @@ -802,9 +802,9 @@ alias { allAnnotations = List() }, "isEmpty", new { location { - line = 1130 + line = 1152 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1130" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1152" } docComment = """ Tells whether this string is empty. @@ -823,9 +823,9 @@ alias { allAnnotations = List() }, "isBlank", new { location { - line = 1141 + line = 1163 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1141" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1163" } docComment = """ Tells if all characters in this string have Unicode property "White_Space". @@ -845,9 +845,9 @@ alias { allAnnotations = List() }, "isRegex", new { location { - line = 1144 + line = 1166 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1144" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1166" } docComment = "Tells if this string is a valid regular expression according to [Regex]." annotations = List() @@ -857,9 +857,9 @@ alias { allAnnotations = List() }, "isBase64", new { location { - line = 1154 + line = 1176 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1154" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1176" } docComment = """ Tells if this is a valid base64-encoded string. @@ -881,9 +881,9 @@ alias { }) }, "md5", new { location { - line = 1161 + line = 1183 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1161" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1183" } docComment = """ The [MD5](https://en.wikipedia.org/wiki/MD5) @@ -899,9 +899,9 @@ alias { allAnnotations = List() }, "sha1", new { location { - line = 1167 + line = 1189 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1167" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1189" } docComment = """ The [SHA-1](https://en.wikipedia.org/wiki/SHA-1) @@ -916,9 +916,9 @@ alias { allAnnotations = List() }, "sha256", new { location { - line = 1172 + line = 1194 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1172" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1194" } docComment = """ The [SHA-256](https://en.wikipedia.org/wiki/SHA-2) @@ -932,9 +932,9 @@ alias { allAnnotations = List() }, "sha256Int", new { location { - line = 1176 + line = 1198 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1176" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1198" } docComment = """ The first 64 bits of the [SHA-256](https://en.wikipedia.org/wiki/SHA-2) @@ -947,9 +947,9 @@ alias { allAnnotations = List() }, "base64", new { location { - line = 1179 + line = 1201 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1179" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1201" } docComment = "The Base64 encoding of this string's UTF-8 byte sequence." annotations = List() @@ -959,9 +959,9 @@ alias { allAnnotations = List() }, "base64Decoded", new { location { - line = 1187 + line = 1209 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1187" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1209" } docComment = """ The inverse of [base64]. @@ -978,9 +978,9 @@ alias { allAnnotations = List() }, "base64DecodedBytes", new { location { - line = 1196 + line = 1218 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1196" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1218" } docComment = """ Converts this base64-format string into [Bytes]. @@ -1001,9 +1001,9 @@ alias { }) }, "chars", new { location { - line = 1204 + line = 1226 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1204" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1226" } docComment = """ The Unicode characters in this string. @@ -1020,9 +1020,9 @@ alias { allAnnotations = List() }, "codePoints", new { location { - line = 1212 + line = 1234 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1212" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1234" } docComment = """ The Unicode code points in this string. @@ -1040,9 +1040,9 @@ alias { }) allProperties = Map("length", new { location { - line = 1107 + line = 1129 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1107" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1129" } docComment = """ The number of characters in this string. @@ -1072,9 +1072,9 @@ alias { }) }, "lastIndex", new { location { - line = 1120 + line = 1142 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1120" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1142" } docComment = """ The index of the last character in this string (same as `length - 1`). @@ -1096,9 +1096,9 @@ alias { allAnnotations = List() }, "isEmpty", new { location { - line = 1130 + line = 1152 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1130" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1152" } docComment = """ Tells whether this string is empty. @@ -1117,9 +1117,9 @@ alias { allAnnotations = List() }, "isBlank", new { location { - line = 1141 + line = 1163 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1141" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1163" } docComment = """ Tells if all characters in this string have Unicode property "White_Space". @@ -1139,9 +1139,9 @@ alias { allAnnotations = List() }, "isRegex", new { location { - line = 1144 + line = 1166 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1144" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1166" } docComment = "Tells if this string is a valid regular expression according to [Regex]." annotations = List() @@ -1151,9 +1151,9 @@ alias { allAnnotations = List() }, "isBase64", new { location { - line = 1154 + line = 1176 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1154" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1176" } docComment = """ Tells if this is a valid base64-encoded string. @@ -1175,9 +1175,9 @@ alias { }) }, "md5", new { location { - line = 1161 + line = 1183 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1161" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1183" } docComment = """ The [MD5](https://en.wikipedia.org/wiki/MD5) @@ -1193,9 +1193,9 @@ alias { allAnnotations = List() }, "sha1", new { location { - line = 1167 + line = 1189 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1167" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1189" } docComment = """ The [SHA-1](https://en.wikipedia.org/wiki/SHA-1) @@ -1210,9 +1210,9 @@ alias { allAnnotations = List() }, "sha256", new { location { - line = 1172 + line = 1194 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1172" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1194" } docComment = """ The [SHA-256](https://en.wikipedia.org/wiki/SHA-2) @@ -1226,9 +1226,9 @@ alias { allAnnotations = List() }, "sha256Int", new { location { - line = 1176 + line = 1198 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1176" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1198" } docComment = """ The first 64 bits of the [SHA-256](https://en.wikipedia.org/wiki/SHA-2) @@ -1241,9 +1241,9 @@ alias { allAnnotations = List() }, "base64", new { location { - line = 1179 + line = 1201 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1179" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1201" } docComment = "The Base64 encoding of this string's UTF-8 byte sequence." annotations = List() @@ -1253,9 +1253,9 @@ alias { allAnnotations = List() }, "base64Decoded", new { location { - line = 1187 + line = 1209 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1187" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1209" } docComment = """ The inverse of [base64]. @@ -1272,9 +1272,9 @@ alias { allAnnotations = List() }, "base64DecodedBytes", new { location { - line = 1196 + line = 1218 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1196" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1218" } docComment = """ Converts this base64-format string into [Bytes]. @@ -1295,9 +1295,9 @@ alias { }) }, "chars", new { location { - line = 1204 + line = 1226 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1204" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1226" } docComment = """ The Unicode characters in this string. @@ -1314,9 +1314,9 @@ alias { allAnnotations = List() }, "codePoints", new { location { - line = 1212 + line = 1234 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1212" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1234" } docComment = """ The Unicode code points in this string. @@ -1334,9 +1334,9 @@ alias { }) methods = Map("getOrNull", new { location { - line = 1224 + line = 1246 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1224" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1246" } docComment = """ Returns the character at [index], or [null] if [index] is out of range. @@ -1359,9 +1359,9 @@ alias { }) }, "substring", new { location { - line = 1238 + line = 1260 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1238" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1260" } docComment = """ Returns the substring from [start] until [exclusiveEnd]. @@ -1388,9 +1388,9 @@ alias { }) }, "substringOrNull", new { location { - line = 1256 + line = 1278 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1256" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1278" } docComment = """ Returns the substring from [start] until [exclusiveEnd]. @@ -1421,9 +1421,9 @@ alias { }) }, "repeat", new { location { - line = 1266 + line = 1288 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1266" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1288" } docComment = """ Concatenates [count] copies of this string. @@ -1444,9 +1444,9 @@ alias { }) }, "contains", new { location { - line = 1269 + line = 1291 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1269" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1291" } docComment = "Tells whether this string contains [pattern]." annotations = List() @@ -1458,9 +1458,9 @@ alias { }) }, "matches", new { location { - line = 1273 + line = 1295 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1273" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1295" } docComment = "Tells whether this string matches [regex] in its entirety." annotations = List(new { @@ -1476,9 +1476,9 @@ alias { }) }, "startsWith", new { location { - line = 1276 + line = 1298 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1276" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1298" } docComment = "Tells whether this string starts with [pattern]." annotations = List() @@ -1490,9 +1490,9 @@ alias { }) }, "endsWith", new { location { - line = 1279 + line = 1301 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1279" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1301" } docComment = "Tells whether this string ends with [pattern]." annotations = List() @@ -1504,9 +1504,9 @@ alias { }) }, "indexOf", new { location { - line = 1285 + line = 1307 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1285" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1307" } docComment = """ Returns the zero-based index of the first occurrence of [pattern] @@ -1523,9 +1523,9 @@ alias { }) }, "indexOfOrNull", new { location { - line = 1289 + line = 1311 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1289" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1311" } docComment = """ Returns the zero-based index of the first occurrence of [pattern] @@ -1540,9 +1540,9 @@ alias { }) }, "lastIndexOf", new { location { - line = 1295 + line = 1317 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1295" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1317" } docComment = """ Returns the zero-based index of the last occurrence of [pattern] @@ -1559,9 +1559,9 @@ alias { }) }, "lastIndexOfOrNull", new { location { - line = 1299 + line = 1321 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1299" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1321" } docComment = """ Returns the zero-based index of the last occurrence of [pattern] @@ -1576,9 +1576,9 @@ alias { }) }, "take", new { location { - line = 1305 + line = 1327 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1305" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1327" } docComment = """ Returns the first [n] characters of this string. @@ -1598,9 +1598,9 @@ alias { }) }, "takeWhile", new { location { - line = 1308 + line = 1330 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1308" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1330" } docComment = "Returns the longest prefix of this string that satisfies [predicate]." annotations = List() @@ -1612,9 +1612,9 @@ alias { }) }, "takeLast", new { location { - line = 1313 + line = 1335 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1313" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1335" } docComment = """ Returns the last [n] characters of this string. @@ -1630,9 +1630,9 @@ alias { }) }, "takeLastWhile", new { location { - line = 1316 + line = 1338 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1316" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1338" } docComment = "Returns the longest suffix of this string that satisfies [predicate]." annotations = List() @@ -1644,9 +1644,9 @@ alias { }) }, "drop", new { location { - line = 1322 + line = 1344 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1322" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1344" } docComment = """ Removes the first [n] characters of this string. @@ -1666,9 +1666,9 @@ alias { }) }, "dropWhile", new { location { - line = 1326 + line = 1348 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1326" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1348" } docComment = "Removes the longest prefix of this string that satisfies [predicate]." annotations = List(new { @@ -1684,9 +1684,9 @@ alias { }) }, "dropLast", new { location { - line = 1332 + line = 1354 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1332" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1354" } docComment = """ Removes the last [n] characters of this string. @@ -1706,9 +1706,9 @@ alias { }) }, "dropLastWhile", new { location { - line = 1336 + line = 1358 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1336" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1358" } docComment = "Removes the longest suffix of this string that satisfies [predicate]." annotations = List(new { @@ -1724,9 +1724,9 @@ alias { }) }, "replaceFirst", new { location { - line = 1341 + line = 1363 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1341" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1363" } docComment = """ Replaces the first occurrence of [pattern] in this string with [replacement]. @@ -1744,9 +1744,9 @@ alias { }) }, "replaceLast", new { location { - line = 1346 + line = 1368 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1346" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1368" } docComment = """ Replaces the last occurrence of [pattern] in this string with [replacement]. @@ -1764,9 +1764,9 @@ alias { }) }, "replaceAll", new { location { - line = 1351 + line = 1373 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1351" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1373" } docComment = """ Replaces all occurrences of [pattern] in this string with [replacement]. @@ -1784,9 +1784,9 @@ alias { }) }, "replaceFirstMapped", new { location { - line = 1356 + line = 1378 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1356" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1378" } docComment = """ Replaces the first occurrence of [pattern] in this string with the return value of [mapper]. @@ -1804,9 +1804,9 @@ alias { }) }, "replaceLastMapped", new { location { - line = 1361 + line = 1386 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1361" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1386" } docComment = """ Replaces the last occurrence of [pattern] in this string with the return value of [mapper]. @@ -1824,9 +1824,9 @@ alias { }) }, "replaceAllMapped", new { location { - line = 1366 + line = 1394 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1366" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1394" } docComment = """ Replaces all occurrences of [pattern] in this string with the return value of [mapper]. @@ -1844,9 +1844,9 @@ alias { }) }, "replaceRange", new { location { - line = 1371 + line = 1402 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1371" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1402" } docComment = """ Replaces the characters between [start] and [exclusiveEnd] with [replacement]. @@ -1866,9 +1866,9 @@ alias { }) }, "toUpperCase", new { location { - line = 1374 + line = 1405 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1374" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1405" } docComment = "Performs a locale-independent character-by-character conversion of this string to uppercase." annotations = List() @@ -1878,9 +1878,9 @@ alias { parameters = Map() }, "toLowerCase", new { location { - line = 1377 + line = 1408 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1377" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1408" } docComment = "Performs a locale-independent character-by-character conversion of this string to lowercase." annotations = List() @@ -1890,9 +1890,9 @@ alias { parameters = Map() }, "reverse", new { location { - line = 1380 + line = 1411 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1380" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1411" } docComment = "Reverses the order of characters in this string." annotations = List() @@ -1902,9 +1902,9 @@ alias { parameters = Map() }, "trim", new { location { - line = 1384 + line = 1415 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1384" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1415" } docComment = "Removes any leading and trailing characters with Unicode property \"White_Space\" from this string." annotations = List(new { @@ -1918,9 +1918,9 @@ alias { parameters = Map() }, "trimStart", new { location { - line = 1388 + line = 1419 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1388" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1419" } docComment = "Removes any leading characters with Unicode property \"White_Space\" from this string." annotations = List(new { @@ -1938,9 +1938,9 @@ alias { parameters = Map() }, "trimEnd", new { location { - line = 1392 + line = 1423 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1392" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1423" } docComment = "Removes any trailing characters with Unicode property \"White_Space\" from this string." annotations = List(new { @@ -1958,9 +1958,9 @@ alias { parameters = Map() }, "padStart", new { location { - line = 1398 + line = 1429 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1398" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1429" } docComment = """ Increases the length of this string to [width] by adding leading [char]s. @@ -1982,9 +1982,9 @@ alias { }) }, "padEnd", new { location { - line = 1404 + line = 1435 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1404" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1435" } docComment = """ Increases the length of this string to [width] by adding trailing [char]s. @@ -2006,9 +2006,9 @@ alias { }) }, "split", new { location { - line = 1407 + line = 1438 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1407" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1438" } docComment = "Splits this string around matches of [pattern]." annotations = List() @@ -2020,9 +2020,9 @@ alias { }) }, "splitLimit", new { location { - line = 1422 + line = 1453 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1422" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1453" } docComment = """ Splits this string matches of [pattern], up to [limit] substrings. @@ -2051,9 +2051,9 @@ alias { }) }, "capitalize", new { location { - line = 1432 + line = 1463 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1432" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1463" } docComment = """ Converts the first character of this string to title case. @@ -2072,9 +2072,9 @@ alias { parameters = Map() }, "decapitalize", new { location { - line = 1442 + line = 1473 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1442" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1473" } docComment = """ Converts the first character of this string to lower case. @@ -2093,9 +2093,9 @@ alias { parameters = Map() }, "toInt", new { location { - line = 1448 + line = 1479 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1448" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1479" } docComment = """ Parses this string as a signed decimal (base 10) integer. @@ -2110,9 +2110,9 @@ alias { parameters = Map() }, "toIntOrNull", new { location { - line = 1454 + line = 1485 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1454" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1485" } docComment = """ Parses this string as a signed decimal (base 10) integer. @@ -2127,9 +2127,9 @@ alias { parameters = Map() }, "toFloat", new { location { - line = 1459 + line = 1490 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1459" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1490" } docComment = """ Parses this string as a floating point number. @@ -2143,9 +2143,9 @@ alias { parameters = Map() }, "toFloatOrNull", new { location { - line = 1464 + line = 1495 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1464" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1495" } docComment = """ Parses this string as a floating point number. @@ -2159,9 +2159,9 @@ alias { parameters = Map() }, "toBoolean", new { location { - line = 1469 + line = 1500 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1469" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1500" } docComment = """ Parses `"true"` to [true] and `"false"` to [false] (case-insensitive). @@ -2175,9 +2175,9 @@ alias { parameters = Map() }, "toBooleanOrNull", new { location { - line = 1474 + line = 1505 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1474" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1505" } docComment = """ Parses `"true"` to [true] and `"false"` to [false] (case-insensitive). @@ -2191,9 +2191,9 @@ alias { parameters = Map() }, "encodeToBytes", new { location { - line = 1483 + line = 1514 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1483" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1514" } docComment = """ Returns the bytes of this string, encoded using [charset]. @@ -2264,9 +2264,9 @@ alias { }) }, "getOrNull", new { location { - line = 1224 + line = 1246 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1224" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1246" } docComment = """ Returns the character at [index], or [null] if [index] is out of range. @@ -2289,9 +2289,9 @@ alias { }) }, "substring", new { location { - line = 1238 + line = 1260 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1238" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1260" } docComment = """ Returns the substring from [start] until [exclusiveEnd]. @@ -2318,9 +2318,9 @@ alias { }) }, "substringOrNull", new { location { - line = 1256 + line = 1278 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1256" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1278" } docComment = """ Returns the substring from [start] until [exclusiveEnd]. @@ -2351,9 +2351,9 @@ alias { }) }, "repeat", new { location { - line = 1266 + line = 1288 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1266" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1288" } docComment = """ Concatenates [count] copies of this string. @@ -2374,9 +2374,9 @@ alias { }) }, "contains", new { location { - line = 1269 + line = 1291 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1269" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1291" } docComment = "Tells whether this string contains [pattern]." annotations = List() @@ -2388,9 +2388,9 @@ alias { }) }, "matches", new { location { - line = 1273 + line = 1295 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1273" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1295" } docComment = "Tells whether this string matches [regex] in its entirety." annotations = List(new { @@ -2406,9 +2406,9 @@ alias { }) }, "startsWith", new { location { - line = 1276 + line = 1298 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1276" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1298" } docComment = "Tells whether this string starts with [pattern]." annotations = List() @@ -2420,9 +2420,9 @@ alias { }) }, "endsWith", new { location { - line = 1279 + line = 1301 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1279" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1301" } docComment = "Tells whether this string ends with [pattern]." annotations = List() @@ -2434,9 +2434,9 @@ alias { }) }, "indexOf", new { location { - line = 1285 + line = 1307 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1285" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1307" } docComment = """ Returns the zero-based index of the first occurrence of [pattern] @@ -2453,9 +2453,9 @@ alias { }) }, "indexOfOrNull", new { location { - line = 1289 + line = 1311 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1289" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1311" } docComment = """ Returns the zero-based index of the first occurrence of [pattern] @@ -2470,9 +2470,9 @@ alias { }) }, "lastIndexOf", new { location { - line = 1295 + line = 1317 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1295" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1317" } docComment = """ Returns the zero-based index of the last occurrence of [pattern] @@ -2489,9 +2489,9 @@ alias { }) }, "lastIndexOfOrNull", new { location { - line = 1299 + line = 1321 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1299" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1321" } docComment = """ Returns the zero-based index of the last occurrence of [pattern] @@ -2506,9 +2506,9 @@ alias { }) }, "take", new { location { - line = 1305 + line = 1327 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1305" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1327" } docComment = """ Returns the first [n] characters of this string. @@ -2528,9 +2528,9 @@ alias { }) }, "takeWhile", new { location { - line = 1308 + line = 1330 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1308" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1330" } docComment = "Returns the longest prefix of this string that satisfies [predicate]." annotations = List() @@ -2542,9 +2542,9 @@ alias { }) }, "takeLast", new { location { - line = 1313 + line = 1335 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1313" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1335" } docComment = """ Returns the last [n] characters of this string. @@ -2560,9 +2560,9 @@ alias { }) }, "takeLastWhile", new { location { - line = 1316 + line = 1338 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1316" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1338" } docComment = "Returns the longest suffix of this string that satisfies [predicate]." annotations = List() @@ -2574,9 +2574,9 @@ alias { }) }, "drop", new { location { - line = 1322 + line = 1344 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1322" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1344" } docComment = """ Removes the first [n] characters of this string. @@ -2596,9 +2596,9 @@ alias { }) }, "dropWhile", new { location { - line = 1326 + line = 1348 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1326" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1348" } docComment = "Removes the longest prefix of this string that satisfies [predicate]." annotations = List(new { @@ -2614,9 +2614,9 @@ alias { }) }, "dropLast", new { location { - line = 1332 + line = 1354 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1332" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1354" } docComment = """ Removes the last [n] characters of this string. @@ -2636,9 +2636,9 @@ alias { }) }, "dropLastWhile", new { location { - line = 1336 + line = 1358 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1336" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1358" } docComment = "Removes the longest suffix of this string that satisfies [predicate]." annotations = List(new { @@ -2654,9 +2654,9 @@ alias { }) }, "replaceFirst", new { location { - line = 1341 + line = 1363 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1341" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1363" } docComment = """ Replaces the first occurrence of [pattern] in this string with [replacement]. @@ -2674,9 +2674,9 @@ alias { }) }, "replaceLast", new { location { - line = 1346 + line = 1368 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1346" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1368" } docComment = """ Replaces the last occurrence of [pattern] in this string with [replacement]. @@ -2694,9 +2694,9 @@ alias { }) }, "replaceAll", new { location { - line = 1351 + line = 1373 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1351" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1373" } docComment = """ Replaces all occurrences of [pattern] in this string with [replacement]. @@ -2714,9 +2714,9 @@ alias { }) }, "replaceFirstMapped", new { location { - line = 1356 + line = 1378 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1356" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1378" } docComment = """ Replaces the first occurrence of [pattern] in this string with the return value of [mapper]. @@ -2734,9 +2734,9 @@ alias { }) }, "replaceLastMapped", new { location { - line = 1361 + line = 1386 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1361" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1386" } docComment = """ Replaces the last occurrence of [pattern] in this string with the return value of [mapper]. @@ -2754,9 +2754,9 @@ alias { }) }, "replaceAllMapped", new { location { - line = 1366 + line = 1394 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1366" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1394" } docComment = """ Replaces all occurrences of [pattern] in this string with the return value of [mapper]. @@ -2774,9 +2774,9 @@ alias { }) }, "replaceRange", new { location { - line = 1371 + line = 1402 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1371" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1402" } docComment = """ Replaces the characters between [start] and [exclusiveEnd] with [replacement]. @@ -2796,9 +2796,9 @@ alias { }) }, "toUpperCase", new { location { - line = 1374 + line = 1405 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1374" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1405" } docComment = "Performs a locale-independent character-by-character conversion of this string to uppercase." annotations = List() @@ -2808,9 +2808,9 @@ alias { parameters = Map() }, "toLowerCase", new { location { - line = 1377 + line = 1408 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1377" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1408" } docComment = "Performs a locale-independent character-by-character conversion of this string to lowercase." annotations = List() @@ -2820,9 +2820,9 @@ alias { parameters = Map() }, "reverse", new { location { - line = 1380 + line = 1411 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1380" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1411" } docComment = "Reverses the order of characters in this string." annotations = List() @@ -2832,9 +2832,9 @@ alias { parameters = Map() }, "trim", new { location { - line = 1384 + line = 1415 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1384" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1415" } docComment = "Removes any leading and trailing characters with Unicode property \"White_Space\" from this string." annotations = List(new { @@ -2848,9 +2848,9 @@ alias { parameters = Map() }, "trimStart", new { location { - line = 1388 + line = 1419 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1388" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1419" } docComment = "Removes any leading characters with Unicode property \"White_Space\" from this string." annotations = List(new { @@ -2868,9 +2868,9 @@ alias { parameters = Map() }, "trimEnd", new { location { - line = 1392 + line = 1423 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1392" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1423" } docComment = "Removes any trailing characters with Unicode property \"White_Space\" from this string." annotations = List(new { @@ -2888,9 +2888,9 @@ alias { parameters = Map() }, "padStart", new { location { - line = 1398 + line = 1429 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1398" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1429" } docComment = """ Increases the length of this string to [width] by adding leading [char]s. @@ -2912,9 +2912,9 @@ alias { }) }, "padEnd", new { location { - line = 1404 + line = 1435 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1404" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1435" } docComment = """ Increases the length of this string to [width] by adding trailing [char]s. @@ -2936,9 +2936,9 @@ alias { }) }, "split", new { location { - line = 1407 + line = 1438 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1407" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1438" } docComment = "Splits this string around matches of [pattern]." annotations = List() @@ -2950,9 +2950,9 @@ alias { }) }, "splitLimit", new { location { - line = 1422 + line = 1453 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1422" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1453" } docComment = """ Splits this string matches of [pattern], up to [limit] substrings. @@ -2981,9 +2981,9 @@ alias { }) }, "capitalize", new { location { - line = 1432 + line = 1463 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1432" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1463" } docComment = """ Converts the first character of this string to title case. @@ -3002,9 +3002,9 @@ alias { parameters = Map() }, "decapitalize", new { location { - line = 1442 + line = 1473 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1442" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1473" } docComment = """ Converts the first character of this string to lower case. @@ -3023,9 +3023,9 @@ alias { parameters = Map() }, "toInt", new { location { - line = 1448 + line = 1479 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1448" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1479" } docComment = """ Parses this string as a signed decimal (base 10) integer. @@ -3040,9 +3040,9 @@ alias { parameters = Map() }, "toIntOrNull", new { location { - line = 1454 + line = 1485 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1454" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1485" } docComment = """ Parses this string as a signed decimal (base 10) integer. @@ -3057,9 +3057,9 @@ alias { parameters = Map() }, "toFloat", new { location { - line = 1459 + line = 1490 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1459" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1490" } docComment = """ Parses this string as a floating point number. @@ -3073,9 +3073,9 @@ alias { parameters = Map() }, "toFloatOrNull", new { location { - line = 1464 + line = 1495 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1464" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1495" } docComment = """ Parses this string as a floating point number. @@ -3089,9 +3089,9 @@ alias { parameters = Map() }, "toBoolean", new { location { - line = 1469 + line = 1500 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1469" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1500" } docComment = """ Parses `"true"` to [true] and `"false"` to [false] (case-insensitive). @@ -3105,9 +3105,9 @@ alias { parameters = Map() }, "toBooleanOrNull", new { location { - line = 1474 + line = 1505 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1474" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1505" } docComment = """ Parses `"true"` to [true] and `"false"` to [false] (case-insensitive). @@ -3121,9 +3121,9 @@ alias { parameters = Map() }, "encodeToBytes", new { location { - line = 1483 + line = 1514 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1483" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1514" } docComment = """ Returns the bytes of this string, encoded using [charset]. @@ -3162,9 +3162,9 @@ rec { typeParameters = List() superclass { location { - line = 1777 + line = 1809 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1777" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1809" } docComment = """ Base class for objects whose members are described by a class definition. @@ -3177,9 +3177,9 @@ rec { typeParameters = List() superclass { location { - line = 1772 + line = 1804 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1772" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1804" } docComment = """ A composite value containing members (properties, elements, entries). @@ -3560,9 +3560,9 @@ rec { supertype { referent { location { - line = 1772 + line = 1804 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1772" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1804" } docComment = """ A composite value containing members (properties, elements, entries). @@ -3946,9 +3946,9 @@ rec { allProperties = Map() methods = Map("hasProperty", new { location { - line = 1779 + line = 1811 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1779" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1811" } docComment = "Tells if this object has a property with the given [name]." annotations = List() @@ -3960,9 +3960,9 @@ rec { }) }, "getProperty", new { location { - line = 1784 + line = 1816 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1784" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1816" } docComment = """ Returns the value of the property with the given [name]. @@ -3978,9 +3978,9 @@ rec { }) }, "getPropertyOrNull", new { location { - line = 1789 + line = 1821 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1789" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1821" } docComment = """ Returns the value of the property with the given [name]. @@ -3996,9 +3996,9 @@ rec { }) }, "toDynamic", new { location { - line = 1792 + line = 1824 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1792" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1824" } docComment = "Converts this object to a [Dynamic] object." annotations = List() @@ -4008,9 +4008,9 @@ rec { parameters = Map() }, "toMap", new { location { - line = 1795 + line = 1827 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1795" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1827" } docComment = "Converts this object to a [Map]." annotations = List() @@ -4070,9 +4070,9 @@ rec { }) }, "hasProperty", new { location { - line = 1779 + line = 1811 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1779" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1811" } docComment = "Tells if this object has a property with the given [name]." annotations = List() @@ -4084,9 +4084,9 @@ rec { }) }, "getProperty", new { location { - line = 1784 + line = 1816 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1784" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1816" } docComment = """ Returns the value of the property with the given [name]. @@ -4102,9 +4102,9 @@ rec { }) }, "getPropertyOrNull", new { location { - line = 1789 + line = 1821 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1789" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1821" } docComment = """ Returns the value of the property with the given [name]. @@ -4120,9 +4120,9 @@ rec { }) }, "toDynamic", new { location { - line = 1792 + line = 1824 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1792" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1824" } docComment = "Converts this object to a [Dynamic] object." annotations = List() @@ -4132,9 +4132,9 @@ rec { parameters = Map() }, "toMap", new { location { - line = 1795 + line = 1827 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1795" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1827" } docComment = "Converts this object to a [Map]." annotations = List() @@ -4147,9 +4147,9 @@ rec { supertype { referent { location { - line = 1777 + line = 1809 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1777" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1809" } docComment = """ Base class for objects whose members are described by a class definition. @@ -4162,9 +4162,9 @@ rec { typeParameters = List() superclass { location { - line = 1772 + line = 1804 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1772" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1804" } docComment = """ A composite value containing members (properties, elements, entries). @@ -4545,9 +4545,9 @@ rec { supertype { referent { location { - line = 1772 + line = 1804 column = 1 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1772" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1804" } docComment = """ A composite value containing members (properties, elements, entries). @@ -4931,9 +4931,9 @@ rec { allProperties = Map() methods = Map("hasProperty", new { location { - line = 1779 + line = 1811 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1779" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1811" } docComment = "Tells if this object has a property with the given [name]." annotations = List() @@ -4945,9 +4945,9 @@ rec { }) }, "getProperty", new { location { - line = 1784 + line = 1816 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1784" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1816" } docComment = """ Returns the value of the property with the given [name]. @@ -4963,9 +4963,9 @@ rec { }) }, "getPropertyOrNull", new { location { - line = 1789 + line = 1821 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1789" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1821" } docComment = """ Returns the value of the property with the given [name]. @@ -4981,9 +4981,9 @@ rec { }) }, "toDynamic", new { location { - line = 1792 + line = 1824 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1792" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1824" } docComment = "Converts this object to a [Dynamic] object." annotations = List() @@ -4993,9 +4993,9 @@ rec { parameters = Map() }, "toMap", new { location { - line = 1795 + line = 1827 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1795" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1827" } docComment = "Converts this object to a [Map]." annotations = List() @@ -5055,9 +5055,9 @@ rec { }) }, "hasProperty", new { location { - line = 1779 + line = 1811 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1779" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1811" } docComment = "Tells if this object has a property with the given [name]." annotations = List() @@ -5069,9 +5069,9 @@ rec { }) }, "getProperty", new { location { - line = 1784 + line = 1816 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1784" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1816" } docComment = """ Returns the value of the property with the given [name]. @@ -5087,9 +5087,9 @@ rec { }) }, "getPropertyOrNull", new { location { - line = 1789 + line = 1821 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1789" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1821" } docComment = """ Returns the value of the property with the given [name]. @@ -5105,9 +5105,9 @@ rec { }) }, "toDynamic", new { location { - line = 1792 + line = 1824 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1792" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1824" } docComment = "Converts this object to a [Dynamic] object." annotations = List() @@ -5117,9 +5117,9 @@ rec { parameters = Map() }, "toMap", new { location { - line = 1795 + line = 1827 column = 3 - displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1795" + displayUri = "https://github.com/apple/pkl/blob/$commitId/stdlib/base.pkl#L1827" } docComment = "Converts this object to a [Map]." annotations = List() @@ -5209,7 +5209,7 @@ rec { }) }, "hasProperty", new { location { - line = 1779 + line = 1811 column = 3 displayUri = "pkl:base" } @@ -5223,7 +5223,7 @@ rec { }) }, "getProperty", new { location { - line = 1784 + line = 1816 column = 3 displayUri = "pkl:base" } @@ -5241,7 +5241,7 @@ rec { }) }, "getPropertyOrNull", new { location { - line = 1789 + line = 1821 column = 3 displayUri = "pkl:base" } @@ -5259,7 +5259,7 @@ rec { }) }, "toDynamic", new { location { - line = 1792 + line = 1824 column = 3 displayUri = "pkl:base" } @@ -5271,7 +5271,7 @@ rec { parameters = Map() }, "toMap", new { location { - line = 1795 + line = 1827 column = 3 displayUri = "pkl:base" } diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err b/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err index ac788fb4..3241b2b8 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err @@ -1,9 +1,9 @@ –– Pkl Error –– -Expected value of type `*RemoteDependency|Project(isValidLoadDependency)`, but got a different `pkl.Project`. +Expected value of type `*RemoteDependency | Project(isValidLoadDependency)`, but got a different `pkl.Project`. Value: new ModuleClass { package = null; tests {}; dependencies {}; evaluatorSetting... -xxx | dependencies: Mapping - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +xxx | dependencies: Mapping + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ at pkl.Project#dependencies (pkl:Project) * Value is not of type `Project(isValidLoadDependency)` because: diff --git a/stdlib/DocPackageInfo.pkl b/stdlib/DocPackageInfo.pkl index 4a77abbf..42b2dd69 100644 --- a/stdlib/DocPackageInfo.pkl +++ b/stdlib/DocPackageInfo.pkl @@ -26,7 +26,7 @@ /// * amends this template /// * is named _doc-package-info.pkl_ /// * is passed to the _pkldoc_ command together with the modules to generate documentation for. -/// +/// /// Each module to generate documentation must declare a module name that starts with a package [name]. /// For example, the following are valid module declarations for package _com.example_: /// * `module com.example.Birds` @@ -66,11 +66,11 @@ @ModuleInfo { minPklVersion = "0.30.0" } module pkl.DocPackageInfo +// used by doc comments +import "pkl:DocPackageInfo" +import "pkl:Project" import "pkl:reflect" import "pkl:semver" -// used by doc comments -import "pkl:Project" -import "pkl:DocPackageInfo" /// The name of this package. name: PackageName @@ -173,19 +173,20 @@ class PackageDependency { } /// A package name. -typealias PackageName = - String(!contains("/")) +typealias PackageName = String(!contains("/")) /// A package version. -typealias PackageVersion = - String(semver.isValid(this)) +typealias PackageVersion = String(semver.isValid(this)) @Unlisted -fixed overview: String(!isBlank) = moduleMirror.docComment ?? - throw(""" +fixed overview: String(!isBlank) = + moduleMirror.docComment + ?? throw( + """ Missing overview documentation for package `\(name)`. To fix this problem, add a doc comment to `doc-package-info.pkl` (above `amends "pkl:DocPackageInfo"`). - """) + """ + ) @Unlisted fixed overviewImports: Map = moduleMirror.imports diff --git a/stdlib/EvaluatorSettings.pkl b/stdlib/EvaluatorSettings.pkl index 679cbdb6..a0719336 100644 --- a/stdlib/EvaluatorSettings.pkl +++ b/stdlib/EvaluatorSettings.pkl @@ -75,7 +75,7 @@ allowedResources: Listing? /// - `"auto"`: Format if the process' stdin, stdout, or stderr are connected to a console. /// - `"always"`: Always format @Since { version = "0.27.0" } -color: ("never"|"auto"|"always")? +color: ("never" | "auto" | "always")? /// Disables the file system cache for `package:` modules. /// @@ -116,21 +116,17 @@ externalResourceReaders: Mapping? /// - `"compact"`: All structures passed to trace() will be emitted on a single line. /// - `"pretty"`: All structures passed to trace() will be indented and emitted across multiple lines. @Since { version = "0.30.0" } -traceMode: ("compact"|"pretty")? +traceMode: ("compact" | "pretty")? -const local hostnameRegex = Regex(#"https?://([^/?#]*)"#) +local const hostnameRegex = Regex(#"https?://([^/?#]*)"#) -const local hasNonEmptyHostname = (it: String) -> +local const hasNonEmptyHostname = (it: String) -> let (hostname = hostnameRegex.findMatchesIn(it).getOrNull(0)?.groups?.getOrNull(1)?.value) hostname != null && hostname.length > 0 /// A key or value in [Http.rewrites]. @Since { version = "0.29.0" } -typealias HttpRewrite = String( - startsWith(Regex("https?://")), - endsWith("/"), - hasNonEmptyHostname -) +typealias HttpRewrite = String(startsWith(Regex("https?://")), endsWith("/"), hasNonEmptyHostname) /// Settings that control how Pkl talks to HTTP(S) servers. class Http { @@ -226,7 +222,7 @@ class Proxy { @Since { version = "0.27.0" } class ExternalReader { /// The external reader executable. - /// + /// /// Will be spawned with the same environment variables and working directory as the Pkl process. /// Executable is resolved according to the operating system's process spawning rules. /// On macOS, Linux, and Windows platforms, this may be: diff --git a/stdlib/Project.pkl b/stdlib/Project.pkl index 6ae26d71..93f1f7e2 100644 --- a/stdlib/Project.pkl +++ b/stdlib/Project.pkl @@ -41,7 +41,7 @@ /// 2. Set [projectFileUri] to the enclosing module's URI. /// This is necessary to determine the correct project directory, as well as for resolving /// local project dependencies correctly. -/// +/// /// The [newInstance()] helper method exists as a convenient way to set this when embedding /// project definitions. /// @@ -95,11 +95,11 @@ tests: Listing(isDistinct) /// Tells if the project is a local module named `PklProject`, is not self, and has a [package] section local isValidLoadDependency = (it: Project) -> isUriLocal(projectFileUri, it.projectFileUri) - && it.projectFileUri.endsWith("/PklProject") - && it != module - && it.package != null + && it.projectFileUri.endsWith("/PklProject") + && it != module + && it.package != null -const local function isUriLocal(uri1: Uri, uri2: Uri): Boolean = +local const function isUriLocal(uri1: Uri, uri2: Uri): Boolean = // This is an imperfect check; should also check that the URIs have the same authority. // We should improve this if/when there is a URI library in the stdlib. uri1.substring(0, uri1.indexOf(":")) == uri2.substring(0, uri2.indexOf(":")) @@ -125,7 +125,7 @@ const local function isUriLocal(uri1: Uri, uri2: Uri): Boolean = /// /// ``` /// import "@birds/canary.pkl" // Import a module from the `birds` dependency -/// +/// /// birdIndex = read("@birds/index.txt") // Read a file from the `birds` dependency /// ``` /// @@ -139,7 +139,7 @@ const local function isUriLocal(uri1: Uri, uri2: Uri): Boolean = /// /// 1. `GET https://example.com/foo@0.5.0` to retrieve the metadata JSON file. /// 2. Given the metadata JSON file, make a GET request to the package URI ZIP archive. -/// +/// /// If this project is published as a package, these dependencies are included within the published /// package metadata. /// @@ -149,7 +149,7 @@ const local function isUriLocal(uri1: Uri, uri2: Uri): Boolean = /// This is useful when structuring a single repository that publishes multiple packages. /// /// To specify a local project dependency, import the relative `PklProject` file. -/// +/// /// The local project dependency must define its own [package]. /// /// Example: @@ -176,7 +176,7 @@ const local function isUriLocal(uri1: Uri, uri2: Uri): Boolean = /// 1. Gather all dependencies, both direct and transitive. /// 2. For each package's major version, determine the highest declared minor version. /// 3. Write each resolved dependency to sibling file `PklProject.deps.json`. -dependencies: Mapping +dependencies: Mapping local isFileBasedProject = projectFileUri.startsWith("file:") @@ -196,12 +196,12 @@ local isFileBasedProject = projectFileUri.startsWith("file:") /// - [modulePath][EvaluatorSettings.modulePath] /// - [rootDir][EvaluatorSettings.rootDir] /// - [moduleCacheDir][EvaluatorSettings.moduleCacheDir] -/// +/// /// For each of these, relative paths are resolved against the project's enclosing directory. evaluatorSettings: EvaluatorSettingsModule( (modulePath != null).implies(isFileBasedProject), (rootDir != null).implies(isFileBasedProject), - (moduleCacheDir != null).implies(isFileBasedProject) + (moduleCacheDir != null).implies(isFileBasedProject), ) /// The URI of the PklProject file. @@ -224,11 +224,12 @@ function newInstance(enclosingModule: Module): Project = new { projectFileUri = reflect.Module(enclosingModule).uri } -const local hasVersion = (it: Uri) -> +local const hasVersion = (it: Uri) -> let (versionSep = it.lastIndexOf("@")) - if (versionSep == -1) false - else let (version = it.drop(versionSep + 1)) - semver.parseOrNull(version) != null + if (versionSep == -1) + false + else + let (version = it.drop(versionSep + 1)) semver.parseOrNull(version) != null typealias PackageUri = Uri(startsWith("package:"), hasVersion) @@ -368,7 +369,7 @@ class Package { /// ``` /// license = "Apache-2.0" /// ``` - license: (CommonSpdxLicenseIdentifier|String)? + license: (CommonSpdxLicenseIdentifier | String)? /// The full text of the license associated with this package. licenseText: String? @@ -412,30 +413,30 @@ typealias EvaluatorSettings = EvaluatorSettingsModule /// Common software licenses in the [SPDX License List](https://spdx.org/licenses/). typealias CommonSpdxLicenseIdentifier = "Apache-2.0" - |"MIT" - |"BSD-2-Clause" - |"BSD-3-Clause" - |"ISC" - |"GPL-3.0" - |"GPL-2.0" - |"MPL-2.0" - |"MPL-1.1" - |"MPL-1.0" - |"AGPL-1.0-only" - |"AGPL-1.0-or-later" - |"AGPL-3.0-only" - |"AGPL-3.0-or-later" - |"LGPL-2.0-only" - |"LGPL-2.0-or-later" - |"LGPL-2.1-only" - |"LGPL-2.1-or-later" - |"LGPL-3.0-only" - |"LGPL-3.0-or-later" - |"EPL-1.0" - |"EPL-2.0" - |"UPL-1.0" - |"BSL-1.0" - |"Unlicense" + | "MIT" + | "BSD-2-Clause" + | "BSD-3-Clause" + | "ISC" + | "GPL-3.0" + | "GPL-2.0" + | "MPL-2.0" + | "MPL-1.1" + | "MPL-1.0" + | "AGPL-1.0-only" + | "AGPL-1.0-or-later" + | "AGPL-3.0-only" + | "AGPL-3.0-or-later" + | "LGPL-2.0-only" + | "LGPL-2.0-or-later" + | "LGPL-2.1-only" + | "LGPL-2.1-or-later" + | "LGPL-3.0-only" + | "LGPL-3.0-or-later" + | "EPL-1.0" + | "EPL-2.0" + | "UPL-1.0" + | "BSL-1.0" + | "Unlicense" @Unlisted @Since { version = "0.27.0" } diff --git a/stdlib/base.pkl b/stdlib/base.pkl index 08202cb7..8435a0b7 100644 --- a/stdlib/base.pkl +++ b/stdlib/base.pkl @@ -21,8 +21,8 @@ module pkl.base import "pkl:jsonnet" -import "pkl:xml" import "pkl:protobuf" +import "pkl:xml" /// The top type of the type hierarchy. /// @@ -96,15 +96,26 @@ abstract external class Module { value = outer renderer = let (format = read?("prop:pkl.outputFormat") ?? "pcf") - if (format == "json") new JsonRenderer {} - else if (format == "jsonnet") new jsonnet.Renderer {} - else if (format == "pcf") new PcfRenderer {} - else if (format == "plist") new PListRenderer {} - else if (format == "properties") new PropertiesRenderer {} - else if (format == "textproto") new protobuf.Renderer {} - else if (format == "xml") new xml.Renderer {} - else if (format == "yaml") new YamlRenderer {} - else throw("Unknown output format: `\(format)`. Supported formats are `json`, `jsonnet`, `pcf`, `plist`, `properties`, `textproto`, `xml`, `yaml`.") + if (format == "json") + new JsonRenderer {} + else if (format == "jsonnet") + new jsonnet.Renderer {} + else if (format == "pcf") + new PcfRenderer {} + else if (format == "plist") + new PListRenderer {} + else if (format == "properties") + new PropertiesRenderer {} + else if (format == "textproto") + new protobuf.Renderer {} + else if (format == "xml") + new xml.Renderer {} + else if (format == "yaml") + new YamlRenderer {} + else + throw( + "Unknown output format: `\(format)`. Supported formats are `json`, `jsonnet`, `pcf`, `plist`, `properties`, `textproto`, `xml`, `yaml`." + ) text = renderer.renderDocument(value) bytes = text.encodeToBytes("UTF-8") } @@ -179,7 +190,18 @@ class SourceCode extends Annotation { /// - `"x = 42"` is valid source code for language `"Pkl"`. /// - `"42"` is valid source code for language `"PklExpr"`. /// - `"42"` is valid source code for language `"Pkl"` with [prefix] `"x = "`. - language: "Go"|"HTML"|"Java"|"JavaScript"|"Markdown"|"Pkl"|"PklExpr"|"Python"|"Ruby"|"SQL"|"Swift"|String + language: "Go" + | "HTML" + | "Java" + | "JavaScript" + | "Markdown" + | "Pkl" + | "PklExpr" + | "Python" + | "Ruby" + | "SQL" + | "Swift" + | String /// A source code prefix to help tools understand the source code. /// @@ -307,7 +329,7 @@ abstract class ValueRenderer { /// Paths are matched against path specs component-wise in reverse order. /// For example, paths `server.timeout` and `racks[*].server.timeout` /// both match path spec `server.timeout`, whereas path `server.timeout.millis` does not. - converters: Mapping Any> + converters: Mapping Any> /// The file extension associated with this output format, /// or [null] if this format does not have an extension. @@ -426,7 +448,7 @@ class YamlRenderer extends ValueRenderer { /// At present, the mode only affects which String values are quoted in YAML. /// For example, `x = "yes"` is rendered as `x: 'yes'` in modes `"compat"` and `"1.1"`, /// and as `x: yes` in mode `"1.2"`. - mode: "compat"|"1.1"|"1.2" = "compat" + mode: "compat" | "1.1" | "1.2" = "compat" /// The number of spaces to use for indenting output. indentWidth: Int(this > 1) = 2 @@ -965,7 +987,7 @@ typealias UInt32 = Int(isBetween(0, 4294967295)) typealias UInt = Int(isPositive) /// A value that can be compared to another value of the same type with `<`, `>`, `<=`, and `>=`. -typealias Comparable = String|Number|Duration|DataSize +typealias Comparable = String | Number | Duration | DataSize /// A 64-bit floating-point number conforming to the IEEE 754 binary64 format. /// @@ -1266,37 +1288,37 @@ external class String extends Any { external function repeat(count: UInt): String /// Tells whether this string contains [pattern]. - external function contains(pattern: String|Regex): Boolean + external function contains(pattern: String | Regex): Boolean /// Tells whether this string matches [regex] in its entirety. @AlsoKnownAs { names { "test" } } external function matches(regex: Regex): Boolean /// Tells whether this string starts with [pattern]. - external function startsWith(pattern: String|Regex): Boolean + external function startsWith(pattern: String | Regex): Boolean /// Tells whether this string ends with [pattern]. - external function endsWith(pattern: String|Regex): Boolean + external function endsWith(pattern: String | Regex): Boolean /// Returns the zero-based index of the first occurrence of [pattern] /// in this string. /// /// Throws if [pattern] does not occur in this string. - external function indexOf(pattern: String|Regex): Int + external function indexOf(pattern: String | Regex): Int /// Returns the zero-based index of the first occurrence of [pattern] /// in this string, or [null] if [pattern] does not occur in this string. - external function indexOfOrNull(pattern: String|Regex): Int? + external function indexOfOrNull(pattern: String | Regex): Int? /// Returns the zero-based index of the last occurrence of [pattern] /// in this string. /// /// Throws if [pattern] does not occur in this string. - external function lastIndexOf(pattern: String|Regex): Int + external function lastIndexOf(pattern: String | Regex): Int /// Returns the zero-based index of the last occurrence of [pattern] /// in this string, or [null] if [pattern] does not occur in this string. - external function lastIndexOfOrNull(pattern: String|Regex): Int? + external function lastIndexOfOrNull(pattern: String | Regex): Int? /// Returns the first [n] characters of this string. /// @@ -1338,32 +1360,41 @@ external class String extends Any { /// Replaces the first occurrence of [pattern] in this string with [replacement]. /// /// Returns this string unchanged if [pattern] does not occur in this string. - external function replaceFirst(pattern: String|Regex, replacement: String): String + external function replaceFirst(pattern: String | Regex, replacement: String): String /// Replaces the last occurrence of [pattern] in this string with [replacement]. /// /// Returns this string unchanged if [pattern] does not occur in this string. - external function replaceLast(pattern: String|Regex, replacement: String): String + external function replaceLast(pattern: String | Regex, replacement: String): String /// Replaces all occurrences of [pattern] in this string with [replacement]. /// /// Returns this string unchanged if [pattern] does not occur in this string. - external function replaceAll(pattern: String|Regex, replacement: String): String + external function replaceAll(pattern: String | Regex, replacement: String): String /// Replaces the first occurrence of [pattern] in this string with the return value of [mapper]. /// /// Returns this string unchanged if [pattern] does not occur in this string. - external function replaceFirstMapped(pattern: String|Regex, mapper: (RegexMatch) -> String): String + external function replaceFirstMapped( + pattern: String | Regex, + mapper: (RegexMatch) -> String, + ): String /// Replaces the last occurrence of [pattern] in this string with the return value of [mapper]. /// /// Returns this string unchanged if [pattern] does not occur in this string. - external function replaceLastMapped(pattern: String|Regex, mapper: (RegexMatch) -> String): String + external function replaceLastMapped( + pattern: String | Regex, + mapper: (RegexMatch) -> String, + ): String /// Replaces all occurrences of [pattern] in this string with the return value of [mapper]. /// /// Returns this string unchanged if [pattern] does not occur in this string. - external function replaceAllMapped(pattern: String|Regex, mapper: (RegexMatch) -> String): String + external function replaceAllMapped( + pattern: String | Regex, + mapper: (RegexMatch) -> String, + ): String /// Replaces the characters between [start] and [exclusiveEnd] with [replacement]. /// @@ -1404,10 +1435,10 @@ external class String extends Any { external function padEnd(width: Int, char: Char) /// Splits this string around matches of [pattern]. - external function split(pattern: String|Regex): List + external function split(pattern: String | Regex): List /// Splits this string matches of [pattern], up to [limit] substrings. - /// + /// /// Returns a [List] with at most [limit] elements. /// If the limit has been reached, the last entry will contain the un-split remainder of this string. /// @@ -1418,8 +1449,8 @@ external class String extends Any { /// "a.b.c".splitLimit(".", 50) == List("a", "b", "c") /// "a.b:c".splitLimit(Regex("[.:]"), 3) == List("a", "b", "c") /// ``` - @Since { version = "0.27.0" } - external function splitLimit(pattern: String|Regex, limit: Int(this > 0)): List + @Since { version = "0.27.0" } + external function splitLimit(pattern: String | Regex, limit: Int(this > 0)): List /// Converts the first character of this string to title case. /// @@ -1489,7 +1520,7 @@ external class String extends Any { /// * `"UTF-16"`: /// * `"ISO-8859-1"` (also known as latin1): @Since { version = "0.29.0" } -typealias Charset = "UTF-8"|"UTF-16"|"ISO-8859-1" +typealias Charset = "UTF-8" | "UTF-16" | "ISO-8859-1" /// A string representing a [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier). typealias Uri = String @@ -1556,7 +1587,7 @@ class RegexMatch { } /// The unit of a [Duration]. -typealias DurationUnit = "ns"|"us"|"ms"|"s"|"min"|"h"|"d" +typealias DurationUnit = "ns" | "us" | "ms" | "s" | "min" | "h" | "d" /// A quantity of elapsed time, represented as a [value] (e.g. `30.5`) and [unit] (e.g. `min`). external class Duration extends Any { @@ -1630,7 +1661,8 @@ external class Duration extends Any { } /// The unit of a [DataSize]. -typealias DataSizeUnit = "b"|"kb"|"kib"|"mb"|"mib"|"gb"|"gib"|"tb"|"tib"|"pb"|"pib" +typealias DataSizeUnit = + "b" | "kb" | "kib" | "mb" | "mib" | "gb" | "gib" | "tb" | "tib" | "pb" | "pib" /// A quantity of binary data, represented as a [value] (e.g. `30.5`) and [unit] (e.g. `mb`). external class DataSize extends Any { @@ -1894,7 +1926,7 @@ class Listing extends Object { /// Returns the element at [index]. /// /// Returns [default] applied to [index] if [index] is outside the bounds of this listing. - /// + /// /// This is equivalent to `getOrNull(index) ?? default.apply(index)`. @Since { version = "0.29.0" } external function getOrDefault(index: Int): Element @@ -1989,13 +2021,13 @@ class Listing extends Object { external function distinctBy(selector: (Element) -> Any): Listing /// Tells if [predicate] holds for every element of this listing. - /// + /// /// Returns [true] for an empty listing. @Since { version = "0.27.0" } external function every(predicate: (Element) -> Boolean): Boolean /// Tells if [predicate] holds for at least one element of this listing. - /// + /// /// Returns [false] for an empty listing. @Since { version = "0.27.0" } external function any(predicate: (Element) -> Boolean): Boolean @@ -2018,7 +2050,10 @@ class Listing extends Object { /// Folds this listing in iteration order using [operator], starting with [initial]. /// /// The first parameter of [operator] is the zero-based index of the current element. - external function foldIndexed(initial: Result, operator: (Int, Result, Element) -> Result): Result + external function foldIndexed( + initial: Result, + operator: (Int, Result, Element) -> Result, + ): Result /// Converts the elements of this listing to strings and concatenates them inserting [separator] between elements. external function join(separator: String): String @@ -2052,9 +2087,9 @@ class Mapping extends Object { /// Tells if this mapping contains [key]. external function containsKey(key: Any): Boolean - + /// Tells if this mapping contains an entry with the given [value]. - @Since { version = "0.27.0" } + @Since { version = "0.27.0" } external function containsValue(value: Any): Boolean /// Returns the value associated with [key] or [null] if this mapping does not contain [key]. @@ -2066,20 +2101,20 @@ class Mapping extends Object { /// not contain [key]. /// /// This is equivalent to `getOrNull(key) ?? default.apply(key)`. - @Since { version = "0.29.0" } + @Since { version = "0.29.0" } external function getOrDefault(key: Any): Value /// Folds the entries of this mapping in iteration order using [operator], starting with [initial]. external function fold(initial: Result, operator: (Result, Key, Value) -> Result): Result - + /// Tells if [predicate] holds for every entry of this mapping. - /// + /// /// Returns [true] for an empty mapping. @Since { version = "0.27.0" } external function every(predicate: (Key, Value) -> Boolean): Boolean - + /// Tells if [predicate] holds for at least one entry of this mapping. - /// + /// /// Returns [false] for an empty mapping. @Since { version = "0.27.0" } external function any(predicate: (Key, Value) -> Boolean): Boolean @@ -2119,13 +2154,15 @@ external class Function3 extends Fu } /// A function literal with four parameters. -external class Function4 extends Function { +external class Function4 + extends Function { @AlsoKnownAs { names { "call"; "invoke" } } external function apply(p1: Param1, p2: Param2, p3: Param3, p4: Param4): Result } /// A function literal with five parameters. -external class Function5 extends Function { +external class Function5 + extends Function { @AlsoKnownAs { names { "call"; "invoke" } } external function apply(p1: Param1, p2: Param2, p3: Param3, p4: Param4, p5: Param5): Result } @@ -2157,7 +2194,7 @@ external const function Undefined(): nothing const function TODO(): nothing = throw("TODO") /// Creates a null value that turns into [defaultValue] when amended. -external const function Null(defaultValue: Object|Function): Null +external const function Null(defaultValue: Object | Function): Null /// Constructs a [Pair]. external const function Pair(first: First, second: Second): Pair @@ -2312,7 +2349,9 @@ abstract external class Collection extends Any { /// Same as [split()] but returns [null] if [index] is outside range `0`..[length]. abstract function splitOrNull(index: Int): Pair, Collection>? - abstract function partition(predicate: (Element) -> Boolean): Pair, Collection> + abstract function partition( + predicate: (Element) -> Boolean, + ): Pair, Collection> /// The zero-based index of the first occurrence of [element] in this collection. /// @@ -2384,11 +2423,11 @@ abstract external class Collection extends Any { /// List(4, 6, 8).findIndex((n) -> n.isEven) == 0 /// import("pkl:test").catch(() -> List(5, 7, 9).findLast((n) -> n.isEven)) /// ``` - @AlsoKnownAs { names { "indexWhere" }} + @AlsoKnownAs { names { "indexWhere" } } abstract function findIndex(predicate: (Element) -> Boolean): Int /// Same as [findIndex()] but returns [null] if [predicate] does not hold for any element in this collection. - @AlsoKnownAs { names { "indexWhere" }} + @AlsoKnownAs { names { "indexWhere" } } abstract function findIndexOrNull(predicate: (Element) -> Boolean): Int? /// The index of the last element for which [predicate] returns [true]. @@ -2401,11 +2440,11 @@ abstract external class Collection extends Any { /// List(4, 6, 8).findLastIndex((n) -> n.isEven) == 2 /// import("pkl:test").catch(() -> List(5, 7, 9).findLastIndex((n) -> n.isEven)) /// ``` - @AlsoKnownAs { names { "lastIndexWhere" }} + @AlsoKnownAs { names { "lastIndexWhere" } } abstract function findLastIndex(predicate: (Element) -> Boolean): Int /// Same as [findLastIndex()] but returns [null] if [predicate] does not hold for any element in this collection. - @AlsoKnownAs { names { "lastIndexWhere" }} + @AlsoKnownAs { names { "lastIndexWhere" } } abstract function findLastIndexOrNull(predicate: (Element) -> Boolean): Int? /// The number of elements for which [predicate] returns [true]. @@ -2510,7 +2549,9 @@ abstract external class Collection extends Any { /// List(1, 2, 3).mapNonNull((n) -> if (n.isOdd) null else n + 2) == List(4) /// ``` @AlsoKnownAs { names { "filterMap" } } - abstract function mapNonNull(transform: (Element) -> Result): Collection + abstract function mapNonNull( + transform: (Element) -> Result, + ): Collection /// Transforms this collection by applying [transform] to each element and removing resulting [null] elements. /// @@ -2522,7 +2563,9 @@ abstract external class Collection extends Any { /// List(1, 2, 3, 4, null).mapNonNullIndexed((i, n) -> if (n?.isOdd ?? true) null else n * i) == List(2, 12) /// ``` @Since { version = "0.29.0" } - abstract function mapNonNullIndexed(transform: (Int, Element) -> Result): Collection + abstract function mapNonNullIndexed( + transform: (Int, Element) -> Result, + ): Collection /// Applies a collection-generating [transform] to each element in this collection /// and concatenates the resulting collections. @@ -2536,7 +2579,9 @@ abstract external class Collection extends Any { /// [transform] takes two arguments: the index of the element, and the element itself. /// /// Throws if [transform] produces a non-collection value. - abstract function flatMapIndexed(transform: (Int, Element) -> Collection): Collection + abstract function flatMapIndexed( + transform: (Int, Element) -> Collection, + ): Collection /// Concatenates the elements in this collection, each of which must itself be a collection. /// @@ -2547,7 +2592,7 @@ abstract external class Collection extends Any { /// Adds [element] to this collection. /// /// For [List], [element] is appended. - abstract function add(element: Other): Collection + abstract function add(element: Other): Collection /// Returns the first [n] elements in this collection. @AlsoKnownAs { names { "limit" } } @@ -2588,15 +2633,18 @@ abstract external class Collection extends Any { /// Folds this collection in iteration order using [operator], starting with [initial]. /// /// The first parameter of [operator] is the zero-based index of the current element. - abstract function foldIndexed(initial: Result, operator: (Int, Result, Element) -> Result): Result + abstract function foldIndexed( + initial: Result, + operator: (Int, Result, Element) -> Result, + ): Result /// Folds this collection in iteration order using [operator], starting with the first element. /// /// Throws if this collection is empty. - abstract function reduce(operator: (Element|Result, Element) -> Result): Result + abstract function reduce(operator: (Element | Result, Element) -> Result): Result /// Same as [reduce()] but returns [null] if this collection is empty. - abstract function reduceOrNull(operator: (Element|Result, Element) -> Result): Result? + abstract function reduceOrNull(operator: (Element | Result, Element) -> Result): Result? /// Groups the elements in this collection according to keys returned by [selector]. abstract function groupBy(selector: (Element) -> Key): Map> @@ -2659,10 +2707,12 @@ abstract external class Collection extends Any { /// [comparator] should return [true] if its first argument is less than its second argument, and [false] otherwise. /// /// Throws if this collection is empty. - abstract function maxWith(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): Element + abstract function maxWith(comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int): Element /// Same as [maxWith()] but returns [null] if this collection is empty. - abstract function maxWithOrNull(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): Element? + abstract function maxWithOrNull( + comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int, + ): Element? /// Sorts this collection of [Comparable] elements in ascending order. /// @@ -2687,7 +2737,9 @@ abstract external class Collection extends Any { /// ``` /// List(1, 2, 3).sortWith((a, b) -> a > b)) == List(3, 2, 1) /// ``` - abstract function sortWith(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): Collection + abstract function sortWith( + comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int, + ): Collection /// Reverses the order of elements in this collection. abstract function reverse(): Collection @@ -2725,7 +2777,10 @@ abstract external class Collection extends Any { abstract function toSet(): Set /// Converts this collection to a map by extracting a key and value from each element using the given functions. - abstract function toMap(keyExtractor: (Element) -> Key, valueExtractor: (Element) -> Value): Map + abstract function toMap( + keyExtractor: (Element) -> Key, + valueExtractor: (Element) -> Value, + ): Map /// Converts this collection to a [Listing]. abstract function toListing(): Listing @@ -2959,8 +3014,12 @@ external class List extends Collection { external function mapIndexed(transform: (Int, Element) -> Result): List @Since { version = "0.29.0" } - external function mapNonNullIndexed(transform: (Int, Element) -> Result): List - external function flatMapIndexed(transform: (Int, Element) -> Collection): List + external function mapNonNullIndexed( + transform: (Int, Element) -> Result, + ): List + external function flatMapIndexed( + transform: (Int, Element) -> Collection, + ): List external function filterIsInstance(clazz: Class): List @@ -3013,27 +3072,35 @@ external class List extends Collection { external function every(predicate: (Element) -> Boolean): Boolean external function any(predicate: (Element) -> Boolean): Boolean - external function add(element: Other): List + external function add(element: Other): List /// Replaces the element at [index] with [replacement]. /// /// Throws if [index] is outside the bounds of this list. - external function replace(index: Int, replacement: Other): List + external function replace(index: Int, replacement: Other): List /// Replaces the element at [index] with [replacement]. /// /// Returns [null] if [index] is outside the bounds of this list. - external function replaceOrNull(index: Int, replacement: Other): List? + external function replaceOrNull(index: Int, replacement: Other): List? /// Replaces the elements between indices [range] and [exclusiveEnd] with [replacement]. /// /// Throws if [range] or [exclusiveEnd] is outside the bounds of this list. - external function replaceRange(start: Int, exclusiveEnd: Int, replacement: Collection): List + external function replaceRange( + start: Int, + exclusiveEnd: Int, + replacement: Collection, + ): List /// Replaces the elements between indices [range] and [exclusiveEnd] with [replacement]. /// /// Returns [null] if [range] or [exclusiveEnd] is outside the bounds of this list. - external function replaceRangeOrNull(start: Int, exclusiveEnd: Int, replacement: Collection): List? + external function replaceRangeOrNull( + start: Int, + exclusiveEnd: Int, + replacement: Collection, + ): List? external function find(predicate: (Element) -> Boolean): Element external function findOrNull(predicate: (Element) -> Boolean): Element? @@ -3067,10 +3134,13 @@ external class List extends Collection { external function fold(initial: Result, operator: (Result, Element) -> Result): Result external function foldBack(initial: Result, operator: (Element, Result) -> Result): Result - external function foldIndexed(initial: Result, operator: (Int, Result, Element) -> Result): Result + external function foldIndexed( + initial: Result, + operator: (Int, Result, Element) -> Result, + ): Result - external function reduce(operator: (Element|Result, Element) -> Result): Result - external function reduceOrNull(operator: (Element|Result, Element) -> Result): Result? + external function reduce(operator: (Element | Result, Element) -> Result): Result + external function reduceOrNull(operator: (Element | Result, Element) -> Result): Result? external function groupBy(selector: (Element) -> Key): Map> @@ -3108,7 +3178,10 @@ external class List extends Collection { external function toSet(): Set - external function toMap(keyExtractor: (Element) -> Key, valueExtractor: (Element) -> Value): Map + external function toMap( + keyExtractor: (Element) -> Key, + valueExtractor: (Element) -> Value, + ): Map external function toListing(): Listing @@ -3176,8 +3249,12 @@ external class Set extends Collection { external function mapIndexed(transform: (Int, Element) -> Result): Set @Since { version = "0.29.0" } - external function mapNonNullIndexed(transform: (Int, Element) -> Result): Set - external function flatMapIndexed(transform: (Int, Element) -> Collection): Set + external function mapNonNullIndexed( + transform: (Int, Element) -> Result, + ): Set + external function flatMapIndexed( + transform: (Int, Element) -> Collection, + ): Set external function filterIsInstance(clazz: Class): Set @@ -3186,7 +3263,7 @@ external class Set extends Collection { external function every(predicate: (Element) -> Boolean): Boolean external function any(predicate: (Element) -> Boolean): Boolean - external function add(element: Other): Set + external function add(element: Other): Set external function find(predicate: (Element) -> Boolean): Element external function findOrNull(predicate: (Element) -> Boolean): Element? @@ -3208,10 +3285,13 @@ external class Set extends Collection { external function fold(initial: Result, operator: (Result, Element) -> Result): Result external function foldBack(initial: Result, operator: (Element, Result) -> Result): Result - external function foldIndexed(initial: Result, operator: (Int, Result, Element) -> Result): Result + external function foldIndexed( + initial: Result, + operator: (Int, Result, Element) -> Result, + ): Result - external function reduce(operator: (Element|Result, Element) -> Result): Result - external function reduceOrNull(operator: (Element|Result, Element) -> Result): Result? + external function reduce(operator: (Element | Result, Element) -> Result): Result + external function reduceOrNull(operator: (Element | Result, Element) -> Result): Result? external function groupBy(selector: (Element) -> Key): Map> @@ -3223,8 +3303,10 @@ external class Set extends Collection { external function minBy(selector: (Element) -> Int): Element external function minByOrNull(selector: (Element) -> Int): Element? - external function minWith(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): Element - external function minWithOrNull(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): Element? + external function minWith(comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int): Element + external function minWithOrNull( + comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int, + ): Element? external max: Element external maxOrNull: Element? @@ -3232,12 +3314,16 @@ external class Set extends Collection { external function maxBy(selector: (Element) -> Int): Element external function maxByOrNull(selector: (Element) -> Int): Element? - external function maxWith(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): Element - external function maxWithOrNull(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): Element? + external function maxWith(comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int): Element + external function maxWithOrNull( + comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int, + ): Element? external function sort(): List external function sortBy(selector: (Element) -> Comparable): List - external function sortWith(comparator: (Element, Element) -> Boolean|/*Deprecated*/Int): List + external function sortWith( + comparator: (Element, Element) -> Boolean | /*Deprecated*/ Int, + ): List external function reverse(): List @@ -3249,7 +3335,10 @@ external class Set extends Collection { external function toSet(): Set - external function toMap(keyExtractor: (Element) -> Key, valueExtractor: (Element) -> Value): Map + external function toMap( + keyExtractor: (Element) -> Key, + valueExtractor: (Element) -> Value, + ): Map external function toListing(): Listing @@ -3257,7 +3346,7 @@ external class Set extends Collection { /// The intersection of this set and [other]. external function intersect(other: Set): Set - + /// The difference of this set and [other]. external function difference(other: Set): Set } @@ -3271,7 +3360,7 @@ external class Set extends Collection { /// Map("name", "Pigeon", "age", 42).keys == Set("name", "age") /// Map("name", "Pigeon", "age", 42).values == Set("Pigeon", 42) /// ``` -external const function Map(keysAndValues: VarArgs): Map +external const function Map(keysAndValues: VarArgs): Map /// A mapping from keys to values. /// @@ -3313,7 +3402,10 @@ external class Map extends Any { external function containsValue(value: Any): Boolean /// Adds or updates [key] to [value]. - external function put(key: NewKey, value: NewValue): Map + external function put( + key: NewKey, + value: NewValue, + ): Map /// Removes the map entry with the given key. /// @@ -3327,7 +3419,9 @@ external class Map extends Any { external function fold(initial: Result, operator: (Result, Key, Value) -> Result): Result /// Transforms the entries of this map using [transform]. - external function map(transform: (Key, Value) -> Pair): Map + external function map( + transform: (Key, Value) -> Pair, + ): Map /// Transforms the keys of this map using [transform]. external function mapKeys(transform: (Key, Value) -> NewKey): Map @@ -3336,7 +3430,9 @@ external class Map extends Any { external function mapValues(transform: (Key, Value) -> NewValue): Map /// Applies a map-generating [transform] to each map entry and concatenates the resulting maps. - external function flatMap(transform: (Key, Value) -> Map): Map + external function flatMap( + transform: (Key, Value) -> Map, + ): Map /// Tells if [predicate] holds for every entry of this map. /// diff --git a/stdlib/json.pkl b/stdlib/json.pkl index 25b59b71..054d7d49 100644 --- a/stdlib/json.pkl +++ b/stdlib/json.pkl @@ -45,15 +45,15 @@ class Parser { /// Value converters to apply to parsed values. /// /// For further information see [PcfRenderer.converters]. - converters: Mapping unknown> + converters: Mapping unknown> /// Parses [source] as a JSON document. /// /// Throws if an error occurs during parsing. /// /// If [source] is a [Resource], the resource URI is included in parse error messages. - external function parse(source: Resource|String): Value + external function parse(source: Resource | String): Value } /// Pkl representation of a JSON value. -typealias Value = Null|Boolean|Number|String|Listing|Dynamic|Mapping +typealias Value = Null | Boolean | Number | String | Listing | Dynamic | Mapping diff --git a/stdlib/jsonnet.pkl b/stdlib/jsonnet.pkl index b1797e7f..bb15a223 100644 --- a/stdlib/jsonnet.pkl +++ b/stdlib/jsonnet.pkl @@ -78,7 +78,7 @@ class Renderer extends ValueRenderer { /// If non-empty, renders object fields and array elements on separate lines, /// and strings containing newlines as `|||` multiline text blocks, /// with the given leading line [indent]. - indent: String|/*Deprecated*/Null = " " + indent: String | /*Deprecated*/ Null = " " /// Whether to omit Jsonnet object fields whose value is `null`. omitNullProperties: Boolean = true diff --git a/stdlib/math.pkl b/stdlib/math.pkl index fbe801df..bbbf000f 100644 --- a/stdlib/math.pkl +++ b/stdlib/math.pkl @@ -79,7 +79,6 @@ external minPositiveFloat: Float /// [1]: https://en.wikipedia.org/wiki/E_(mathematical_constant) external e: Float - /// The number [π][1]. /// /// [1]: https://en.wikipedia.org/wiki/Pi diff --git a/stdlib/platform.pkl b/stdlib/platform.pkl index 03dba2d5..66967c5c 100644 --- a/stdlib/platform.pkl +++ b/stdlib/platform.pkl @@ -66,7 +66,7 @@ class VirtualMachine { /// The operating system of a platform. class OperatingSystem { /// The name of this operating system. - name: "macOS"|"Linux"|"Windows"|String + name: "macOS" | "Linux" | "Windows" | String /// The version of this operating system. version: String diff --git a/stdlib/reflect.pkl b/stdlib/reflect.pkl index 3b421918..1267a6fa 100644 --- a/stdlib/reflect.pkl +++ b/stdlib/reflect.pkl @@ -216,7 +216,7 @@ external class Module extends Declaration { /// A class or type alias declaration. abstract external class TypeDeclaration extends Declaration { /// The class or type alias reflected upon. - abstract hidden reflectee: base.Class|base.TypeAlias + abstract hidden reflectee: base.Class | base.TypeAlias /// The module enclosing this type declaration. /// @@ -298,7 +298,7 @@ external class Property extends Declaration { allModifiers: Set /// The annotations of this module, appended with any from the containing class's superclasses. - /// + /// /// Annotations are ordered starting with the current class and walking up the class hierarchy. @Since { version = "0.30.0" } allAnnotations: List @@ -341,13 +341,13 @@ external class TypeParameter { } /// A modifier of a [Declaration]. -typealias Modifier = "abstract"|"external"|"hidden"|"open"|"fixed"|"const" +typealias Modifier = "abstract" | "external" | "hidden" | "open" | "fixed" | "const" /// The variance of a [TypeParameter]. /// /// An "in" type parameter is contravariant. /// An "out" type parameter is covariant. -typealias Variance = "in"|"out" +typealias Variance = "in" | "out" /// A type as it occurs, say, in a type annotation. abstract external class Type { diff --git a/stdlib/semver.pkl b/stdlib/semver.pkl index 34f25093..de1dc288 100644 --- a/stdlib/semver.pkl +++ b/stdlib/semver.pkl @@ -47,7 +47,8 @@ function Version(version: String): Version = /// ``` function parseOrNull(version: String): Version? = let (groups = versionRegex.matchEntire(version)?.groups) - if (groups == null) null + if (groups == null) + null else new Version { major = groups[1].value.toInt() @@ -99,9 +100,15 @@ class Version { /// - `"1.0.0-0.3.7"` /// - `"1.0.0-x.7.z.92"` /// - `"1.0.0-x-y-z.–"` - preRelease: String(matches(Regex(#"(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*"#)))? + preRelease: String( + matches( + Regex( + #"(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*"#, + ), + ), + )? - hidden fixed preReleaseIdentifiers: List = + hidden fixed preReleaseIdentifiers: List = if (preRelease == null) List() else preRelease.split(".").map((it) -> it.toIntOrNull() ?? it) /// Build metadata MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version. @@ -119,8 +126,7 @@ class Version { /// Note: Unlike `==`, [equals()] and comparison methods such as [isLessThan()] ignore [build]. build: String(matches(Regex(#"[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*"#)))? - hidden fixed buildIdentifiers: List = - if (build == null) List() else build.split(".") + hidden fixed buildIdentifiers: List = if (build == null) List() else build.split(".") /// Tells whether this version is equal to [other] according to semantic versioning rules. /// @@ -160,23 +166,19 @@ class Version { major < other.major || major == other.major && minor < other.minor || major == other.major && minor == other.minor && patch < other.patch - || - major == other.major - && minor == other.minor - && patch == other.patch - && isPreReleaseLessThan(other) + || major == other.major + && minor == other.minor + && patch == other.patch + && isPreReleaseLessThan(other) /// Tells whether this version is less than or equal to [other] according to semantic versioning rules. - function isLessThanOrEquals(other: Version): Boolean = - isLessThan(other) || equals(other) + function isLessThanOrEquals(other: Version): Boolean = isLessThan(other) || equals(other) /// Tells whether this version is greater than [other] according to semantic versioning rules. - function isGreaterThan(other: Version): Boolean = - other.isLessThan(this) + function isGreaterThan(other: Version): Boolean = other.isLessThan(this) /// Tells whether this version is greater than or equal to [other] according to semantic versioning rules. - function isGreaterThanOrEquals(other: Version): Boolean = - other.isLessThanOrEquals(this) + function isGreaterThanOrEquals(other: Version): Boolean = other.isLessThanOrEquals(this) /// A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes. function isNormal(): Boolean = preRelease == null && build == null @@ -187,24 +189,39 @@ class Version { /// Strips [preRelease] and [build] from this version. function toNormal(): Version = (this) { preRelease = null; build = null } - function toString() = "\(major).\(minor).\(patch)\(if (preRelease != null) "-\(preRelease)" else "")\(if (build != null) "+\(build)" else "")" + function toString() = + "\(major).\(minor).\(patch)\(if (preRelease != null) "-\(preRelease)" else "")\(if (build != null) "+\(build)" else "")" local function isPreReleaseLessThan(other: Version): Boolean = - if (preRelease == null) false - else if (other.preRelease == null) true - else if (preRelease == other.preRelease) false + if (preRelease == null) + false + else if (other.preRelease == null) + true + else if (preRelease == other.preRelease) + false else - let (result = preReleaseIdentifiers - .zip(other.preReleaseIdentifiers) - .fold(null, (result, next) -> - if (result != null) result - else - if (next.first == next.second) null - else if (next.first.getClass() == next.second.getClass()) next.first < next.second - else next.first is Int - ) - ) if (result != null) result else preReleaseIdentifiers.length < other.preReleaseIdentifiers.length + let (result = + preReleaseIdentifiers + .zip(other.preReleaseIdentifiers) + .fold(null, (result, next) -> + if (result != null) + result + else if (next.first == next.second) + null + else if (next.first.getClass() == next.second.getClass()) + next.first < next.second + else + next.first is Int + ) + ) + if (result != null) + result + else + preReleaseIdentifiers.length < other.preReleaseIdentifiers.length } // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string -local versionRegex = Regex(#"(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"#) +local versionRegex = + Regex( + #"(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"#, + ) diff --git a/stdlib/shell.pkl b/stdlib/shell.pkl index 7281bda8..a5bc1511 100644 --- a/stdlib/shell.pkl +++ b/stdlib/shell.pkl @@ -28,10 +28,7 @@ function escapeWithSingleQuotes(str: String): String = else if (acc.last.last != "'" && ch != "'") acc.replace(acc.lastIndex, acc.last.add(ch)) else - acc.add(List(ch))) - let (grouped = str.chars.fold(List(), processChar)) - grouped - .map((chSeq) -> - if (chSeq == List("'")) #"\'"# - else "'\(chSeq.join(""))'") - .join("") + acc.add(List(ch)) + ) + let (grouped = str.chars.fold(List(), processChar)) + grouped.map((chSeq) -> if (chSeq == List("'")) #"\'"# else "'\(chSeq.join(""))'").join("") diff --git a/stdlib/xml.pkl b/stdlib/xml.pkl index 62321772..3e335e4e 100644 --- a/stdlib/xml.pkl +++ b/stdlib/xml.pkl @@ -39,13 +39,13 @@ class Renderer extends ValueRenderer { indent: String = " " /// The XML version to use. - xmlVersion: *"1.0"|"1.1" + xmlVersion: *"1.0" | "1.1" /// The name of the XML document's root element. rootElementName: String(!isEmpty) = "root" /// The attributes of the XML document's root element. - rootElementAttributes: Mapping + rootElementAttributes: Mapping external function renderDocument(value: Any): String @@ -83,12 +83,12 @@ function Element(_name: String(!isEmpty)): Dynamic = new { } /// Creates an [Inline] directive for [_value]. -function Inline(_value: Object|Collection|Map): Inline = new { value = _value } +function Inline(_value: Object | Collection | Map): Inline = new { value = _value } /// Inlines the members of [value] into the enclosing XML element, /// without rendering an XML element for [value] itself. class Inline { - value: Object|Collection|Map + value: Object | Collection | Map } /// Creates an XML [Comment] with the given [_text]. diff --git a/stdlib/yaml.pkl b/stdlib/yaml.pkl index 56d90b7f..aefd6b52 100644 --- a/stdlib/yaml.pkl +++ b/stdlib/yaml.pkl @@ -50,7 +50,7 @@ class Parser { /// - `"compat"` - YAML 1.1 _or_ 1.2 (default) /// - `"1.1"` - YAML 1.1 /// - `"1.2"` - YAML 1.2 (Core schema) - mode: "compat"|"1.1"|"1.2" = "compat" + mode: "compat" | "1.1" | "1.2" = "compat" /// Determines what the parser produces when parsing YAML `!!map` types. /// @@ -64,7 +64,7 @@ class Parser { /// Value converters to apply to parsed values. /// /// For further information see [PcfRenderer.converters]. - converters: Mapping unknown> + converters: Mapping unknown> /// The maximum number of aliases for collection nodes. /// @@ -77,15 +77,15 @@ class Parser { /// Throws if an error occurs during parsing, or if [source] contains multiple YAML documents. /// /// If [source] is a [Resource], the resource URI is included in parse error messages. - external function parse(source: Resource|String): Value + external function parse(source: Resource | String): Value /// Parses all YAML documents contained in [source]. /// /// Throws if an error occurs during parsing. /// /// If [source] is a [Resource], the resource URI is included in parse error messages. - external function parseAll(source: Resource|String): List + external function parseAll(source: Resource | String): List } /// Pkl representation of a YAML value. -typealias Value = Null|Boolean|Number|String|Listing|Dynamic|Mapping +typealias Value = Null | Boolean | Number | String | Listing | Dynamic | Mapping