@greenpandastudios/aug-cli 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/bin/aug.mjs +3 -0
- package/docs/api/crypto.md +351 -0
- package/docs/api/io.md +207 -0
- package/docs/api/json.md +21 -0
- package/docs/api/memory.md +109 -0
- package/docs/api/time.md +54 -0
- package/docs/api/web.md +184 -0
- package/docs/assets/benchmarks/execution.svg +2978 -0
- package/docs/assets/benchmarks/http.svg +1674 -0
- package/docs/assets/benchmarks/improvements.svg +2315 -0
- package/docs/assets/benchmarks/memory.svg +1891 -0
- package/docs/benchmark-baseline.json +1087 -0
- package/docs/benchmark-results.json +91123 -0
- package/docs/benchmarks.json +38 -0
- package/docs/compatibility.md +42 -0
- package/docs/concurrency-implementation.md +18 -0
- package/docs/diagnostics.md +97 -0
- package/docs/docker.md +35 -0
- package/docs/example-projects.json +26 -0
- package/docs/examples/approved-design/counters.md +253 -0
- package/docs/examples/approved-design/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/approved-design/domain/app.md +165 -0
- package/docs/examples/approved-design/domain/export.md +83 -0
- package/docs/examples/approved-design/domain/models.md +80 -0
- package/docs/examples/approved-design/domain/numbers.md +248 -0
- package/docs/examples/approved-design/index.md +39 -0
- package/docs/examples/approved-design/main-yaml.md +24 -0
- package/docs/examples/approved-design/main.md +215 -0
- package/docs/examples/benchmark/index.md +33 -0
- package/docs/examples/benchmark/main-yaml.md +17 -0
- package/docs/examples/benchmark/main.md +117 -0
- package/docs/examples/cli-args/index.md +32 -0
- package/docs/examples/cli-args/main.md +107 -0
- package/docs/examples/collections/index.md +32 -0
- package/docs/examples/collections/main.md +118 -0
- package/docs/examples/collections-benchmark/index.md +34 -0
- package/docs/examples/collections-benchmark/main.md +115 -0
- package/docs/examples/cpu-benchmark/index.md +34 -0
- package/docs/examples/cpu-benchmark/main.md +90 -0
- package/docs/examples/developer-workflow/calculator.md +357 -0
- package/docs/examples/developer-workflow/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/developer-workflow/index.md +37 -0
- package/docs/examples/developer-workflow/logging/console.md +124 -0
- package/docs/examples/developer-workflow/logging/export.md +70 -0
- package/docs/examples/developer-workflow/logging/logger.md +111 -0
- package/docs/examples/developer-workflow/main.md +172 -0
- package/docs/examples/drop/index.md +33 -0
- package/docs/examples/drop/main.md +85 -0
- package/docs/examples/drop/resource.md +95 -0
- package/docs/examples/errors/errors.md +85 -0
- package/docs/examples/errors/index.md +33 -0
- package/docs/examples/errors/main.md +92 -0
- package/docs/examples/ffi/index.md +33 -0
- package/docs/examples/ffi/main.md +75 -0
- package/docs/examples/ffi/native.md +93 -0
- package/docs/examples/generic-di/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/generic-di/index.md +33 -0
- package/docs/examples/generic-di/main.md +111 -0
- package/docs/examples/generic-di/types.md +180 -0
- package/docs/examples/generics/index.md +33 -0
- package/docs/examples/generics/main.md +120 -0
- package/docs/examples/generics/types.md +189 -0
- package/docs/examples/hello/app/export.md +67 -0
- package/docs/examples/hello/app/greeter.md +190 -0
- package/docs/examples/hello/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/hello/index.md +37 -0
- package/docs/examples/hello/logging/console.md +121 -0
- package/docs/examples/hello/logging/export.md +71 -0
- package/docs/examples/hello/logging/logger.md +120 -0
- package/docs/examples/hello/main.md +115 -0
- package/docs/examples/http-benchmark/index.md +35 -0
- package/docs/examples/http-benchmark/main.md +79 -0
- package/docs/examples/http-benchmark/routes.md +88 -0
- package/docs/examples/index.md +60 -0
- package/docs/examples/interceptors/app.md +250 -0
- package/docs/examples/interceptors/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/interceptors/index.md +35 -0
- package/docs/examples/interceptors/interceptors.md +284 -0
- package/docs/examples/interceptors/logging.md +155 -0
- package/docs/examples/interceptors/main.md +162 -0
- package/docs/examples/json-benchmark/data.md +71 -0
- package/docs/examples/json-benchmark/dependencies/august/0.19.0/json/contracts.md +103 -0
- package/docs/examples/json-benchmark/index.md +35 -0
- package/docs/examples/json-benchmark/main.md +131 -0
- package/docs/examples/new-syntax/console.md +118 -0
- package/docs/examples/new-syntax/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/new-syntax/greeter.md +145 -0
- package/docs/examples/new-syntax/index.md +36 -0
- package/docs/examples/new-syntax/logger.md +111 -0
- package/docs/examples/new-syntax/main.md +135 -0
- package/docs/examples/new-syntax/math.md +79 -0
- package/docs/examples/oidc-login/client/contracts.md +151 -0
- package/docs/examples/oidc-login/client/endpoints.md +263 -0
- package/docs/examples/oidc-login/client/export.md +107 -0
- package/docs/examples/oidc-login/client/login.md +515 -0
- package/docs/examples/oidc-login/client/logout.md +249 -0
- package/docs/examples/oidc-login/client/protocol.md +595 -0
- package/docs/examples/oidc-login/client/session.md +297 -0
- package/docs/examples/oidc-login/client/views.md +144 -0
- package/docs/examples/oidc-login/common/export.md +115 -0
- package/docs/examples/oidc-login/common/headers.md +162 -0
- package/docs/examples/oidc-login/common/keys.md +336 -0
- package/docs/examples/oidc-login/common/settings.md +116 -0
- package/docs/examples/oidc-login/common/views.md +103 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/contracts.md +925 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/jose.md +434 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/json/contracts.md +103 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/memory/store.md +374 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/time/contracts.md +150 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/web/contracts.md +532 -0
- package/docs/examples/oidc-login/index.md +57 -0
- package/docs/examples/oidc-login/main-yaml.md +28 -0
- package/docs/examples/oidc-login/main.md +283 -0
- package/docs/examples/oidc-login/provider/authorization.md +457 -0
- package/docs/examples/oidc-login/provider/contracts.md +267 -0
- package/docs/examples/oidc-login/provider/credentials.md +148 -0
- package/docs/examples/oidc-login/provider/discovery.md +215 -0
- package/docs/examples/oidc-login/provider/export.md +131 -0
- package/docs/examples/oidc-login/provider/token.md +364 -0
- package/docs/examples/oidc-login/provider/userinfo.md +228 -0
- package/docs/examples/oidc-login/provider/views.md +137 -0
- package/docs/examples/ownership/counter.md +140 -0
- package/docs/examples/ownership/index.md +33 -0
- package/docs/examples/ownership/main.md +90 -0
- package/docs/examples/ownership-transfer/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/ownership-transfer/index.md +33 -0
- package/docs/examples/ownership-transfer/main.md +125 -0
- package/docs/examples/ownership-transfer/resource.md +150 -0
- package/docs/examples/packages-app/dependencies/packages/@example/aug-math/0.1.0/arithmetic.md +117 -0
- package/docs/examples/packages-app/index.md +34 -0
- package/docs/examples/packages-app/main-yaml.md +18 -0
- package/docs/examples/packages-app/main.md +80 -0
- package/docs/examples/packages-math/aug-package-json.md +24 -0
- package/docs/examples/packages-math/index.md +36 -0
- package/docs/examples/packages-math/package-json.md +25 -0
- package/docs/examples/packages-math/src/arithmetic.md +121 -0
- package/docs/examples/packages-math/src/export.md +63 -0
- package/docs/examples/startup-benchmark/index.md +34 -0
- package/docs/examples/startup-benchmark/main.md +68 -0
- package/docs/examples/visibility/counter.md +142 -0
- package/docs/examples/visibility/index.md +33 -0
- package/docs/examples/visibility/main.md +96 -0
- package/docs/examples.json +47 -0
- package/docs/getting-started.md +5 -0
- package/docs/grammar.md +136 -0
- package/docs/implementation-map.md +106 -0
- package/docs/index.md +46 -0
- package/docs/language-conformance.md +30 -0
- package/docs/language-constructs.md +1461 -0
- package/docs/language-design-audit.md +147 -0
- package/docs/maintaining-docs.md +43 -0
- package/docs/packages.md +184 -0
- package/docs/performance.md +535 -0
- package/docs/production-readiness.md +39 -0
- package/docs/reference.md +361 -0
- package/docs/release-review.md +23 -0
- package/docs/releasing.md +79 -0
- package/docs/roadmap.md +13 -0
- package/docs/specifications.md +86 -0
- package/docs/testing.md +120 -0
- package/docs/tooling.md +197 -0
- package/docs/web-implementation-plan.md +39 -0
- package/docs/web-library-gaps.md +27 -0
- package/docs/web.md +197 -0
- package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/approved-design/.aug-spec/manifest.json +14 -0
- package/examples/approved-design/counters.aug +22 -0
- package/examples/approved-design/counters.aug.md +177 -0
- package/examples/approved-design/domain/app.aug +12 -0
- package/examples/approved-design/domain/app.aug.md +97 -0
- package/examples/approved-design/domain/export.aug +5 -0
- package/examples/approved-design/domain/export.aug.md +25 -0
- package/examples/approved-design/domain/models.aug +2 -0
- package/examples/approved-design/domain/models.aug.md +30 -0
- package/examples/approved-design/domain/numbers.aug +29 -0
- package/examples/approved-design/domain/numbers.aug.md +141 -0
- package/examples/approved-design/main.aug +26 -0
- package/examples/approved-design/main.aug.md +108 -0
- package/examples/approved-design/main.yaml +8 -0
- package/examples/benchmark/.aug-spec/manifest.json +7 -0
- package/examples/benchmark/main.aug +17 -0
- package/examples/benchmark/main.aug.md +43 -0
- package/examples/benchmark/main.yaml +1 -0
- package/examples/cli-args/.aug-spec/manifest.json +7 -0
- package/examples/cli-args/main.aug +15 -0
- package/examples/cli-args/main.aug.md +38 -0
- package/examples/collections/.aug-spec/manifest.json +7 -0
- package/examples/collections/main.aug +18 -0
- package/examples/collections/main.aug.md +43 -0
- package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/developer-workflow/.aug-spec/manifest.json +13 -0
- package/examples/developer-workflow/calculator.aug +55 -0
- package/examples/developer-workflow/calculator.aug.md +228 -0
- package/examples/developer-workflow/logging/console.aug +8 -0
- package/examples/developer-workflow/logging/console.aug.md +67 -0
- package/examples/developer-workflow/logging/export.aug +2 -0
- package/examples/developer-workflow/logging/export.aug.md +19 -0
- package/examples/developer-workflow/logging/logger.aug +6 -0
- package/examples/developer-workflow/logging/logger.aug.md +57 -0
- package/examples/developer-workflow/main.aug +25 -0
- package/examples/developer-workflow/main.aug.md +79 -0
- package/examples/drop/.aug-spec/manifest.json +8 -0
- package/examples/drop/main.aug +3 -0
- package/examples/drop/main.aug.md +35 -0
- package/examples/drop/resource.aug +8 -0
- package/examples/drop/resource.aug.md +44 -0
- package/examples/errors/.aug-spec/manifest.json +8 -0
- package/examples/errors/errors.aug +6 -0
- package/examples/errors/errors.aug.md +33 -0
- package/examples/errors/main.aug +7 -0
- package/examples/errors/main.aug.md +36 -0
- package/examples/ffi/.aug-spec/manifest.json +8 -0
- package/examples/ffi/main.aug +2 -0
- package/examples/ffi/main.aug.md +27 -0
- package/examples/ffi/native.aug +6 -0
- package/examples/ffi/native.aug.md +43 -0
- package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/generic-di/.aug-spec/manifest.json +10 -0
- package/examples/generic-di/main.aug +9 -0
- package/examples/generic-di/main.aug.md +49 -0
- package/examples/generic-di/types.aug +17 -0
- package/examples/generic-di/types.aug.md +124 -0
- package/examples/generics/.aug-spec/manifest.json +8 -0
- package/examples/generics/main.aug +9 -0
- package/examples/generics/main.aug.md +58 -0
- package/examples/generics/types.aug +19 -0
- package/examples/generics/types.aug.md +132 -0
- package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/hello/.aug-spec/manifest.json +14 -0
- package/examples/hello/app/export.aug +1 -0
- package/examples/hello/app/export.aug.md +17 -0
- package/examples/hello/app/greeter.aug +22 -0
- package/examples/hello/app/greeter.aug.md +109 -0
- package/examples/hello/logging/console.aug +7 -0
- package/examples/hello/logging/console.aug.md +65 -0
- package/examples/hello/logging/export.aug +2 -0
- package/examples/hello/logging/export.aug.md +19 -0
- package/examples/hello/logging/logger.aug +9 -0
- package/examples/hello/logging/logger.aug.md +59 -0
- package/examples/hello/main.aug +9 -0
- package/examples/hello/main.aug.md +49 -0
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/interceptors/.aug-spec/manifest.json +12 -0
- package/examples/interceptors/app.aug +28 -0
- package/examples/interceptors/app.aug.md +162 -0
- package/examples/interceptors/interceptors.aug +40 -0
- package/examples/interceptors/interceptors.aug.md +180 -0
- package/examples/interceptors/logging.aug +12 -0
- package/examples/interceptors/logging.aug.md +96 -0
- package/examples/interceptors/main.aug +22 -0
- package/examples/interceptors/main.aug.md +76 -0
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/new-syntax/.aug-spec/manifest.json +13 -0
- package/examples/new-syntax/console.aug +7 -0
- package/examples/new-syntax/console.aug.md +63 -0
- package/examples/new-syntax/greeter.aug +10 -0
- package/examples/new-syntax/greeter.aug.md +89 -0
- package/examples/new-syntax/logger.aug +6 -0
- package/examples/new-syntax/logger.aug.md +57 -0
- package/examples/new-syntax/main.aug +12 -0
- package/examples/new-syntax/main.aug.md +64 -0
- package/examples/new-syntax/math.aug +3 -0
- package/examples/new-syntax/math.aug.md +29 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug +73 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug.md +791 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug +68 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug.md +266 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug +6 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug.md +55 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug +45 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug.md +250 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug +11 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug.md +96 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug +58 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug.md +420 -0
- package/examples/oidc-login/.aug-spec/manifest.json +40 -0
- package/examples/oidc-login/README.md +29 -0
- package/examples/oidc-login/client/contracts.aug +7 -0
- package/examples/oidc-login/client/contracts.aug.md +80 -0
- package/examples/oidc-login/client/endpoints.aug +21 -0
- package/examples/oidc-login/client/endpoints.aug.md +161 -0
- package/examples/oidc-login/client/export.aug +7 -0
- package/examples/oidc-login/client/export.aug.md +29 -0
- package/examples/oidc-login/client/login.aug +58 -0
- package/examples/oidc-login/client/login.aug.md +331 -0
- package/examples/oidc-login/client/logout.aug +18 -0
- package/examples/oidc-login/client/logout.aug.md +150 -0
- package/examples/oidc-login/client/protocol.aug +106 -0
- package/examples/oidc-login/client/protocol.aug.md +326 -0
- package/examples/oidc-login/client/session.aug +34 -0
- package/examples/oidc-login/client/session.aug.md +155 -0
- package/examples/oidc-login/client/views.aug +21 -0
- package/examples/oidc-login/client/views.aug.md +68 -0
- package/examples/oidc-login/common/export.aug +9 -0
- package/examples/oidc-login/common/export.aug.md +33 -0
- package/examples/oidc-login/common/headers.aug +11 -0
- package/examples/oidc-login/common/headers.aug.md +79 -0
- package/examples/oidc-login/common/keys.aug +37 -0
- package/examples/oidc-login/common/keys.aug.md +207 -0
- package/examples/oidc-login/common/settings.aug +4 -0
- package/examples/oidc-login/common/settings.aug.md +47 -0
- package/examples/oidc-login/common/views.aug +16 -0
- package/examples/oidc-login/common/views.aug.md +34 -0
- package/examples/oidc-login/main.aug +39 -0
- package/examples/oidc-login/main.aug.md +166 -0
- package/examples/oidc-login/main.yaml +12 -0
- package/examples/oidc-login/provider/authorization.aug +59 -0
- package/examples/oidc-login/provider/authorization.aug.md +264 -0
- package/examples/oidc-login/provider/contracts.aug +15 -0
- package/examples/oidc-login/provider/contracts.aug.md +193 -0
- package/examples/oidc-login/provider/credentials.aug +10 -0
- package/examples/oidc-login/provider/credentials.aug.md +64 -0
- package/examples/oidc-login/provider/discovery.aug +13 -0
- package/examples/oidc-login/provider/discovery.aug.md +133 -0
- package/examples/oidc-login/provider/export.aug +13 -0
- package/examples/oidc-login/provider/export.aug.md +41 -0
- package/examples/oidc-login/provider/token.aug +37 -0
- package/examples/oidc-login/provider/token.aug.md +223 -0
- package/examples/oidc-login/provider/userinfo.aug +26 -0
- package/examples/oidc-login/provider/userinfo.aug.md +104 -0
- package/examples/oidc-login/provider/views.aug +18 -0
- package/examples/oidc-login/provider/views.aug.md +63 -0
- package/examples/ownership/.aug-spec/manifest.json +8 -0
- package/examples/ownership/counter.aug +14 -0
- package/examples/ownership/counter.aug.md +85 -0
- package/examples/ownership/main.aug +4 -0
- package/examples/ownership/main.aug.md +38 -0
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/ownership-transfer/.aug-spec/manifest.json +10 -0
- package/examples/ownership-transfer/main.aug +9 -0
- package/examples/ownership-transfer/main.aug.md +63 -0
- package/examples/ownership-transfer/resource.aug +16 -0
- package/examples/ownership-transfer/resource.aug.md +89 -0
- package/examples/packages/README.md +15 -0
- package/examples/packages/app/.aug-spec/manifest.json +9 -0
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug +9 -0
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug.md +63 -0
- package/examples/packages/app/main.aug +2 -0
- package/examples/packages/app/main.aug.md +33 -0
- package/examples/packages/app/main.yaml +2 -0
- package/examples/packages/math/.aug-spec/manifest.json +8 -0
- package/examples/packages/math/README.md +3 -0
- package/examples/packages/math/aug-package.json +8 -0
- package/examples/packages/math/package.json +9 -0
- package/examples/packages/math/src/arithmetic.aug +8 -0
- package/examples/packages/math/src/arithmetic.aug.md +63 -0
- package/examples/packages/math/src/export.aug +1 -0
- package/examples/packages/math/src/export.aug.md +17 -0
- package/examples/visibility/.aug-spec/manifest.json +8 -0
- package/examples/visibility/counter.aug +14 -0
- package/examples/visibility/counter.aug.md +87 -0
- package/examples/visibility/main.aug +7 -0
- package/examples/visibility/main.aug.md +39 -0
- package/package.json +50 -0
- package/runtime/aug_crypto.c +121 -0
- package/runtime/aug_html.c +93 -0
- package/runtime/aug_http.c +829 -0
- package/runtime/aug_json.c +165 -0
- package/runtime/aug_runtime.c +792 -0
- package/runtime/aug_runtime.h +245 -0
- package/runtime/aug_tasks.c +172 -0
- package/runtime/aug_time.c +5 -0
- package/runtime/aug_values.c +80 -0
- package/scripts/bootstrap-native.mjs +121 -0
- package/scripts/native-dependencies.lock.json +65 -0
- package/scripts/native-home.mjs +11 -0
- package/src/actions.js +109 -0
- package/src/ast.js +19 -0
- package/src/builtins.js +93 -0
- package/src/checker.js +2896 -0
- package/src/cli.js +344 -0
- package/src/codegen.js +1159 -0
- package/src/config.js +149 -0
- package/src/continuation.js +110 -0
- package/src/di.js +24 -0
- package/src/documentation.js +27 -0
- package/src/editor.js +782 -0
- package/src/effects.js +29 -0
- package/src/fixes.js +222 -0
- package/src/formatter.js +296 -0
- package/src/freshness.js +154 -0
- package/src/help.js +212 -0
- package/src/html.js +27 -0
- package/src/http-policies.js +90 -0
- package/src/inference.js +16 -0
- package/src/interceptors.js +70 -0
- package/src/javadoc.js +67 -0
- package/src/lexer.js +199 -0
- package/src/libraries.js +31 -0
- package/src/lsp.js +180 -0
- package/src/native.js +144 -0
- package/src/navigation.js +162 -0
- package/src/openapi.js +220 -0
- package/src/ownership.js +232 -0
- package/src/package-manager.js +299 -0
- package/src/parser.js +1155 -0
- package/src/policies.js +130 -0
- package/src/project-init.js +19 -0
- package/src/project.js +292 -0
- package/src/schemas.js +62 -0
- package/src/semantic.js +255 -0
- package/src/spec.js +738 -0
- package/src/testing.js +186 -0
- package/src/types.js +10 -0
|
@@ -0,0 +1,1461 @@
|
|
|
1
|
+
---
|
|
2
|
+
generated: true
|
|
3
|
+
source: src/help.ts and src/builtins.ts
|
|
4
|
+
editLink: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Language constructs
|
|
8
|
+
|
|
9
|
+
This reference uses the same help as VS Code hover and completion. See [the guide](reference.md) for complete, compiler-checked examples.
|
|
10
|
+
|
|
11
|
+
## -
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
left - right
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Subtract numbers. Unary `-` negates a number.
|
|
18
|
+
|
|
19
|
+
## ->
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
->
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This token is reserved for future syntax and is not currently valid AugScript.
|
|
26
|
+
|
|
27
|
+
## ,
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
first, second
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Separate parameters, arguments, type arguments, or interfaces.
|
|
34
|
+
|
|
35
|
+
## ;
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
statement;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Optional statement separator. Newlines, a closing block brace, or end of file also terminate statements. Use semicolons to separate several statements on one line. Expressions continue inside parentheses and collection literals, or after an unfinished operator.
|
|
42
|
+
|
|
43
|
+
## :
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
if condition: ... or {1: "apples"}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
After a block header, introduce a body indented with tabs or spaces. Dedenting ends that body. Each block may independently use braces or indentation. In a map literal, separate a key from its value; collection and parenthesis continuation indentation has no block meaning.
|
|
50
|
+
|
|
51
|
+
## !
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
Use not
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Symbolic boolean negation is rejected. The migration fix preserves grouping when replacing ! with not.
|
|
58
|
+
|
|
59
|
+
## !=
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
left != right
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Compare values for inequality; the result is `bool`.
|
|
66
|
+
|
|
67
|
+
## ?
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
optional Type
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Type? is rejected. Use optional Type for a value or null; omitted optional inputs and fields also become null. The migration fix upgrades the spelling.
|
|
74
|
+
|
|
75
|
+
## .
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
receiver.member
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Access a method or property. A member starting with `_` is private to its declaring type; other members are public. Mutable access still follows borrow rules.
|
|
82
|
+
|
|
83
|
+
## (
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
(1, 2)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Start a tuple, grouped expression, call argument list, function parameters, or class header. A comma creates a tuple; a single expression without a comma is grouping.
|
|
90
|
+
|
|
91
|
+
## )
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
( ... )
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
End a tuple, grouped expression, argument list, parameter list, or class header.
|
|
98
|
+
|
|
99
|
+
## [
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
[1, 2] or [Validator(y=x)]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Start a list literal, or an interceptor annotation immediately before a callable declaration. Lists infer one element type. Interceptor mappings connect processor labels to target labels; stacked annotations enter in written order.
|
|
106
|
+
|
|
107
|
+
## ]
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
[ ... ]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
End a list literal or interceptor annotation.
|
|
114
|
+
|
|
115
|
+
## {
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
{1, 2} or {1: "apples"}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Start a set literal, map literal, or statement block. Comma-separated values create a Set; key: value pairs create a Map. Empty {} needs a declared Set or Map type. Classes, interfaces, interceptors, tests, functions, and control flow use braces for blocks.
|
|
122
|
+
|
|
123
|
+
## }
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
{ ... }
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
End a block, set literal, or map literal.
|
|
130
|
+
|
|
131
|
+
## @code
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
{@code expression}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Show an inline fragment as code in generated editor help.
|
|
138
|
+
|
|
139
|
+
## @deprecated
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
@deprecated reason
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Explain why this declaration should no longer be used.
|
|
146
|
+
|
|
147
|
+
## @exception
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
@exception ErrorType description
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Alias of `@throws`.
|
|
154
|
+
|
|
155
|
+
## @inheritDoc
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
{@inheritDoc}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Insert documentation from the implemented or extended interface method.
|
|
162
|
+
|
|
163
|
+
## @link
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
{@link Type}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Show a related declaration name as code in generated editor help.
|
|
170
|
+
|
|
171
|
+
## @param
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
@param name description
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Document a parameter in the Javadoc comment immediately before a class, function, or method. The text appears in hover and signature help.
|
|
178
|
+
|
|
179
|
+
## @return
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
@return description
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Document the returned value of a function or method.
|
|
186
|
+
|
|
187
|
+
## @returns
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
@returns description
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Alias of `@return`.
|
|
194
|
+
|
|
195
|
+
## @see
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
@see OtherSymbol
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Point readers to related declarations or documentation.
|
|
202
|
+
|
|
203
|
+
## @throws
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
@throws ErrorType description
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Document a declared error and when it is raised.
|
|
210
|
+
|
|
211
|
+
## *
|
|
212
|
+
|
|
213
|
+
```text
|
|
214
|
+
left * right
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Multiply numbers.
|
|
218
|
+
|
|
219
|
+
## /
|
|
220
|
+
|
|
221
|
+
```text
|
|
222
|
+
left / right
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Divide numbers. Integer division truncates toward zero. A potentially zero divisor raises checked ArithmeticError; a literal nonzero divisor needs no error clause. MIN/-1 wraps to MIN.
|
|
226
|
+
|
|
227
|
+
## &&
|
|
228
|
+
|
|
229
|
+
```text
|
|
230
|
+
Use and
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Symbolic boolean operators are rejected. Replace && with and; the right side is skipped when the left side is false.
|
|
234
|
+
|
|
235
|
+
## +
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
left + right
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Add numbers or join strings.
|
|
242
|
+
|
|
243
|
+
## <
|
|
244
|
+
|
|
245
|
+
```text
|
|
246
|
+
left < right
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Compare compatible numbers. Inside type arguments, `<` starts a generic argument list.
|
|
250
|
+
|
|
251
|
+
## <=
|
|
252
|
+
|
|
253
|
+
```text
|
|
254
|
+
left <= right
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Compare compatible numbers; the result is `bool`.
|
|
258
|
+
|
|
259
|
+
## =
|
|
260
|
+
|
|
261
|
+
```text
|
|
262
|
+
name = value;
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Assign a value. `to` is an equivalent assignment spelling: `name to value;` or `Type name to value;`. Use `own Type name to value;` for exclusive ownership.
|
|
266
|
+
|
|
267
|
+
## ==
|
|
268
|
+
|
|
269
|
+
```text
|
|
270
|
+
left == right
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Compare values for equality; the result is `bool`.
|
|
274
|
+
|
|
275
|
+
## =>
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
Use initialize
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The arrow constructor spelling is rejected. Put initialize { ... } or its indented form inside the class or record. The editor migration fix moves the body and preserves behavior.
|
|
282
|
+
|
|
283
|
+
## >
|
|
284
|
+
|
|
285
|
+
```text
|
|
286
|
+
left > right
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Compare compatible numbers. Inside type arguments, `>` ends a generic argument list.
|
|
290
|
+
|
|
291
|
+
## >=
|
|
292
|
+
|
|
293
|
+
```text
|
|
294
|
+
left >= right
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Compare compatible numbers; the result is `bool`.
|
|
298
|
+
|
|
299
|
+
## ||
|
|
300
|
+
|
|
301
|
+
```text
|
|
302
|
+
Use or
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Symbolic boolean operators are rejected. Replace || with or; the right side is skipped when the left side is true.
|
|
306
|
+
|
|
307
|
+
## always
|
|
308
|
+
|
|
309
|
+
```text
|
|
310
|
+
try: ... always: ...
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Run cleanup on success, checked errors, returns and cancellation. Cancellation bypasses ordinary catch blocks; cleanup runs before the scope ends.
|
|
314
|
+
|
|
315
|
+
## and
|
|
316
|
+
|
|
317
|
+
```text
|
|
318
|
+
left and right
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Logical AND on bool values. Skip the right operand when the left operand is false. Also join named imports, checked errors, contracts, and grouped task waits. Comparisons and not bind before and; and binds before or.
|
|
322
|
+
|
|
323
|
+
## arguments
|
|
324
|
+
|
|
325
|
+
```text
|
|
326
|
+
arguments() returns List<string>
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Composition arguments. Other callables receive the Arguments capability.
|
|
330
|
+
|
|
331
|
+
## ArithmeticError
|
|
332
|
+
|
|
333
|
+
```text
|
|
334
|
+
ArithmeticError implements Error
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Checked failure for division by zero. int arithmetic otherwise wraps in the signed 64-bit range.
|
|
338
|
+
|
|
339
|
+
## around
|
|
340
|
+
|
|
341
|
+
```text
|
|
342
|
+
around(Type input) returns Type { return next(); }
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
The required entry point of an interceptor. Its parameters select target arguments, and its result must fit the target return type. Omit `returns` for void. It may validate, override mapped arguments, inspect the result, throw a checked error, or return early. Declare generic parameters on the interceptor header. Helper methods can be declared alongside around.
|
|
346
|
+
|
|
347
|
+
## as
|
|
348
|
+
|
|
349
|
+
```text
|
|
350
|
+
lock shared as state: ...
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Name a local value, lock view, or HTTP endpoint. wait for accepts as or to for result names.
|
|
354
|
+
|
|
355
|
+
## assert
|
|
356
|
+
|
|
357
|
+
```text
|
|
358
|
+
assert(condition=bool) returns void
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Assert a bool in a test case or its setup. Catching an assertion failure cannot make the case pass; every case must execute an assertion.
|
|
362
|
+
|
|
363
|
+
## bind
|
|
364
|
+
|
|
365
|
+
```text
|
|
366
|
+
Use implement Interface with Implementation
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
This old binding spelling is rejected. Use implement Interface with Implementation. The editor migration fix or aug migrate --write upgrades old source without changing its binding contract.
|
|
370
|
+
|
|
371
|
+
## body
|
|
372
|
+
|
|
373
|
+
```text
|
|
374
|
+
User input from body
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Decode a concrete JSON data type. Malformed JSON returns 400; valid JSON with a wrong schema returns 422; wrong media type returns 415; body limits return 413.
|
|
378
|
+
|
|
379
|
+
## bool
|
|
380
|
+
|
|
381
|
+
```text
|
|
382
|
+
bool
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Boolean type used by conditions and logical operators.
|
|
386
|
+
|
|
387
|
+
## borrow
|
|
388
|
+
|
|
389
|
+
```text
|
|
390
|
+
borrow value { ... }
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Take exclusive mutable access for the duration of this block. Ordinary reads need no borrow. Managed List, Set, and Map mutations require one. Starting a child that reads the value suspends this mutation right until wait for the child.
|
|
394
|
+
|
|
395
|
+
```text
|
|
396
|
+
borrow items { items.append(value=1) }
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## Bytes
|
|
400
|
+
|
|
401
|
+
```text
|
|
402
|
+
Bytes
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
Immutable length-aware binary data. text() validates UTF-8; base64url() emits canonical unpadded URL-safe base64.
|
|
406
|
+
|
|
407
|
+
## C
|
|
408
|
+
|
|
409
|
+
```text
|
|
410
|
+
extern C name(...);
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Selects C as the foreign function interface for an `extern` declaration.
|
|
414
|
+
|
|
415
|
+
## c_int
|
|
416
|
+
|
|
417
|
+
```text
|
|
418
|
+
c_int
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Signed 32-bit C int. Convert explicitly with c_int(value=number), which raises ConversionError on overflow. It widens to int without loss. AugScript int maps to int64_t at the C boundary.
|
|
422
|
+
|
|
423
|
+
## capability
|
|
424
|
+
|
|
425
|
+
```text
|
|
426
|
+
capability Console { write(string value) uses Console.write }
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Declare an interface for an external effect. Import the standard Console, FileReader, FileWriter and Arguments contracts from august.io, select adapters in main, and receive them through resolve parameters. Operations remain visible in uses clauses and can be replaced in tests.
|
|
430
|
+
|
|
431
|
+
## catch
|
|
432
|
+
|
|
433
|
+
```text
|
|
434
|
+
catch Error error { ... }
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Handle a thrown error from the preceding `try` block. The caught value is available under the name after its type.
|
|
438
|
+
|
|
439
|
+
## changes
|
|
440
|
+
|
|
441
|
+
```text
|
|
442
|
+
increment() changes self
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Declare observable mutation of self or a borrowed input. Callers must provide mutable access. Ordinary functions and methods are pure by default; changing a local variable or a fresh local object does not change caller-owned state.
|
|
446
|
+
|
|
447
|
+
## class
|
|
448
|
+
|
|
449
|
+
```text
|
|
450
|
+
No class keyword
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Class declarations start with their name and must include `implements`: `Worker() implements IWorker { ... }`. Members starting with `_` are private to the class; other members are public. A private header field still accepts its labeled constructor argument. Remove the old `class` prefix.
|
|
454
|
+
|
|
455
|
+
## composition
|
|
456
|
+
|
|
457
|
+
```text
|
|
458
|
+
composition Services: implement Logger with Adapter
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Group static bindings behind an explicitly imported module declaration. Include the composition in main before executable statements; its own file must import every referenced contract and implementation.
|
|
462
|
+
|
|
463
|
+
## Compress
|
|
464
|
+
|
|
465
|
+
```text
|
|
466
|
+
[Compress]
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
Negotiate gzip from Accept-Encoding, respecting q=0. Buffered output and each bounded stream item are compressed with standard gzip members. Adds Content-Encoding and Vary; backpressure remains active.
|
|
470
|
+
|
|
471
|
+
## ConversionError
|
|
472
|
+
|
|
473
|
+
```text
|
|
474
|
+
ConversionError implements Error
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Checked failure when c_int(value=number) cannot fit the signed 32-bit C int range. Catch it or declare unless ConversionError.
|
|
478
|
+
|
|
479
|
+
## cookie
|
|
480
|
+
|
|
481
|
+
```text
|
|
482
|
+
optional string session from cookie "session"
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
Bind one named cookie. Missing input is distinct from an empty string, and repeated cookies are rejected.
|
|
486
|
+
|
|
487
|
+
## Cors
|
|
488
|
+
|
|
489
|
+
```text
|
|
490
|
+
[Cors(origins=["https://example.test"], headers=["content-type"], credentials=true)]
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
Allow exact literal HTTP(S) origins and explicit request header names. OPTIONS preflight checks the selected method and headers. Wildcard origins cannot use credentials. Valid responses include CORS and Vary headers; disallowed origins return 403.
|
|
494
|
+
|
|
495
|
+
## Data
|
|
496
|
+
|
|
497
|
+
```text
|
|
498
|
+
Data
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
A constraint for deeply immutable data: primitives, immutable records and frozen data collections. Behavioral objects cannot satisfy it.
|
|
502
|
+
|
|
503
|
+
## else
|
|
504
|
+
|
|
505
|
+
```text
|
|
506
|
+
else { ... }
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
Run this block when the preceding `if` condition is false.
|
|
510
|
+
|
|
511
|
+
## endpoint
|
|
512
|
+
|
|
513
|
+
```text
|
|
514
|
+
endpoint GET "/users/{id}" as getUser(int id from path) returns User
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
Declare a typed HTTP route. Inputs name their wire source; dependencies use resolve. Main explicitly selects which endpoints to serve.
|
|
518
|
+
|
|
519
|
+
## Error
|
|
520
|
+
|
|
521
|
+
```text
|
|
522
|
+
Error
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Root throwable interface. User defined error classes implement `Error`; `catch Error` handles any throwable type.
|
|
526
|
+
|
|
527
|
+
## everything
|
|
528
|
+
|
|
529
|
+
```text
|
|
530
|
+
import everything from logging
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
Import every public declaration defined by a sibling file, or every public export listed in a folder’s export.aug. Private names and transitive imports are excluded. Name conflicts are compile errors. Explicit named imports make dependencies easier to understand.
|
|
534
|
+
|
|
535
|
+
## exit
|
|
536
|
+
|
|
537
|
+
```text
|
|
538
|
+
exit(status=int) returns void
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
Exit from main with a status from 0 to 255 after cancellation and cleanup.
|
|
542
|
+
|
|
543
|
+
## export
|
|
544
|
+
|
|
545
|
+
```text
|
|
546
|
+
export Name from sibling;
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
Expose a public sibling declaration to other folders. Names, modules, and folders starting with `_` are private and cannot be exported. Export declarations belong only in `export.aug`.
|
|
550
|
+
|
|
551
|
+
```text
|
|
552
|
+
export Logger from logger;
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
## extends
|
|
556
|
+
|
|
557
|
+
```text
|
|
558
|
+
interface Child extends Parent, Other { ... }
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
Inherit methods from one or more interfaces. Class inheritance is not supported.
|
|
562
|
+
|
|
563
|
+
## extern
|
|
564
|
+
|
|
565
|
+
```text
|
|
566
|
+
extern C name(Type arg) returns Type
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
Declare a C function. Calls require unsafe and external callables declare uses C.name. int maps to int64_t, c_int to signed 32-bit int, float to double, bool to C bool, and string to a temporary UTF-8 const char pointer. Foreign code must respect the declared ABI and cannot retain managed pointers.
|
|
570
|
+
|
|
571
|
+
## false
|
|
572
|
+
|
|
573
|
+
```text
|
|
574
|
+
false
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
Boolean false. and and or evaluate the right side only when needed. Conditions require bool values.
|
|
578
|
+
|
|
579
|
+
## FileError
|
|
580
|
+
|
|
581
|
+
```text
|
|
582
|
+
FileError
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
Built in checked error from text file operations. Catch it or declare `unless FileError`.
|
|
586
|
+
|
|
587
|
+
## fixture
|
|
588
|
+
|
|
589
|
+
```text
|
|
590
|
+
fixture example() returns Data: ...
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
Declare reusable test data through an ordinary checked function. Other files must import the fixture explicitly. Its dependencies and capabilities follow the same header contract rules as other functions.
|
|
594
|
+
|
|
595
|
+
## float
|
|
596
|
+
|
|
597
|
+
```text
|
|
598
|
+
float
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
Floating point number type. Arithmetic supports `+`, `-`, `*`, and `/`.
|
|
602
|
+
|
|
603
|
+
## folder
|
|
604
|
+
|
|
605
|
+
```text
|
|
606
|
+
export folder child;
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
Expose a public child folder through the current folder’s `export.aug`. A folder starting with `_` cannot be exported.
|
|
610
|
+
|
|
611
|
+
## for
|
|
612
|
+
|
|
613
|
+
```text
|
|
614
|
+
for item in items: ...
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
Traverse a List, Set, homogeneous Tuple, or Map. Map entries are tuples, so for (key, value) in map unpacks them. Iteration snapshots the collection in insertion order and gives elements read-only access.
|
|
618
|
+
|
|
619
|
+
## form
|
|
620
|
+
|
|
621
|
+
```text
|
|
622
|
+
Login input from form
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
Decode named application/x-www-form-urlencoded fields into a record. Unknown or repeated scalar fields are rejected. Typed handle actions supply form data with input from form.
|
|
626
|
+
|
|
627
|
+
## freeze
|
|
628
|
+
|
|
629
|
+
```text
|
|
630
|
+
freeze ownValue as immutableValue
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
Consume owned mutable data and share one deeply frozen object. Surviving aliases cannot mutate it. Literal data can be frozen directly.
|
|
634
|
+
|
|
635
|
+
## fresh
|
|
636
|
+
|
|
637
|
+
```text
|
|
638
|
+
implement Counter with CounterImpl fresh
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
Construct a new instance for each resolution. Stateful bindings use this lifetime by default, including objects that retain stateful dependencies.
|
|
642
|
+
|
|
643
|
+
## from
|
|
644
|
+
|
|
645
|
+
```text
|
|
646
|
+
import Name from module;
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
Names the source of an import or export. Dotted paths cross folders; each crossed folder must expose the next one with `export folder child;`. A module starting with `_` is private.
|
|
650
|
+
|
|
651
|
+
## function
|
|
652
|
+
|
|
653
|
+
```text
|
|
654
|
+
No function keyword
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
Functions and methods start with their name: `greet(string name) { ... }` or `greet(string name) returns string;`. Remove the old `function` prefix. Parameters use `Type name` order and callers use labels. Omit `returns` for a `void` result.
|
|
658
|
+
|
|
659
|
+
## handle
|
|
660
|
+
|
|
661
|
+
```text
|
|
662
|
+
handle updateUser(id=userId, input from form)
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
Describe a deferred call to a served endpoint. Inputs are checked against wire parameters; DI is resolved when the HTTP request runs. onSubmit and onClick accept HttpAction values, with automatic request transport.
|
|
666
|
+
|
|
667
|
+
## header
|
|
668
|
+
|
|
669
|
+
```text
|
|
670
|
+
optional string authorization from header "authorization"
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
Bind a case-insensitive HTTP field. Repeated scalar headers are rejected. Headers.all preserves repeated fields explicitly.
|
|
674
|
+
|
|
675
|
+
## Headers
|
|
676
|
+
|
|
677
|
+
```text
|
|
678
|
+
Headers
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
Immutable HTTP fields. with adds a checked field; get and all read case-insensitively. Duplicate Set-Cookie values remain separate.
|
|
682
|
+
|
|
683
|
+
## Html
|
|
684
|
+
|
|
685
|
+
```text
|
|
686
|
+
Html
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
Checked server markup produced with JSX elements and components. Interpolated text and attributes are escaped automatically.
|
|
690
|
+
|
|
691
|
+
## HttpAction
|
|
692
|
+
|
|
693
|
+
```text
|
|
694
|
+
HttpAction
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
An immutable deferred HTTP call created with handle endpoint(...). Bind it to a form onSubmit or button onClick. The browser sends the request; endpoint dependencies and application logic run on the server.
|
|
698
|
+
|
|
699
|
+
## HttpRequest
|
|
700
|
+
|
|
701
|
+
```text
|
|
702
|
+
HttpRequest
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
A request supplied through from request. Its method, path, headers and bounded body are explicit. form<T>() allows protocol-specific form errors.
|
|
706
|
+
|
|
707
|
+
## HttpResponse
|
|
708
|
+
|
|
709
|
+
```text
|
|
710
|
+
HttpResponse<T>
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
A typed HTTP body with explicit status and headers. HttpResponse(body=value, status=201, headers=headers) constructs a response. Status literals range from 200 to 599; a dynamic status requires handling or declaring HttpError.
|
|
714
|
+
|
|
715
|
+
## HttpTestClient
|
|
716
|
+
|
|
717
|
+
```text
|
|
718
|
+
test endpoint getUser client: ...
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
A suite-supplied HTTP pipeline client. request(method="GET", path="/users/1", headers=..., body=...) returns HttpResponse<Bytes>. It exercises routing, decoding, request DI, policies, and serialization without a listening socket. Streaming collection is bounded by web.response_limit. Each it case runs with fresh test bindings.
|
|
722
|
+
|
|
723
|
+
## if
|
|
724
|
+
|
|
725
|
+
```text
|
|
726
|
+
if condition: ...
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
Run a block when its condition is bool. Use braces or a trailing colon and an indented body. Tabs or spaces are accepted; mixed indentation prefixes are rejected.
|
|
730
|
+
|
|
731
|
+
## implement
|
|
732
|
+
|
|
733
|
+
```text
|
|
734
|
+
implement Interface with Implementation
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
Register an implementation in main or test setup. Stateless bindings are shared by default; stateful bindings are fresh. Choose shared mutable or scoped mutable explicitly when retaining mutable state. Headers supply all construction dependencies; binding order is independent and cycles are checked.
|
|
738
|
+
|
|
739
|
+
## implements
|
|
740
|
+
|
|
741
|
+
```text
|
|
742
|
+
Name() implements Interface { ... }
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
Marks a declaration as a class and lists the interfaces it satisfies. Every class needs at least one interface. Method signatures must match. Conflicting default implementations require an override. Put constructor work in an initialize block inside the class.
|
|
746
|
+
|
|
747
|
+
## import
|
|
748
|
+
|
|
749
|
+
```text
|
|
750
|
+
import Logger and ConsoleLogger from logging
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
Bring public declarations into this file. Use `and` for several names, or `import everything from logging` for all public sibling declarations or folder exports. Imported dependencies are never re-exported implicitly. Names or modules starting with `_` stay private. A sibling module uses its filename without `.aug`; a folder exposes only names listed in `export.aug`.
|
|
754
|
+
|
|
755
|
+
## in
|
|
756
|
+
|
|
757
|
+
```text
|
|
758
|
+
interface Consumer<in T>
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
Declare a contravariant interface type parameter. It may occur only in checked input positions. User-defined types are otherwise invariant. The same word is used by for iteration.
|
|
762
|
+
|
|
763
|
+
## include
|
|
764
|
+
|
|
765
|
+
```text
|
|
766
|
+
include Services
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
Expand an explicitly imported composition into the application root. Duplicate bindings and dependency cycles are checked after all includes are collected.
|
|
770
|
+
|
|
771
|
+
## IndexError
|
|
772
|
+
|
|
773
|
+
```text
|
|
774
|
+
IndexError implements Error
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
Checked failure for an invalid List.get position. Catch it, declare unless IndexError, or use List.at for a nullable lookup.
|
|
778
|
+
|
|
779
|
+
## initialize
|
|
780
|
+
|
|
781
|
+
```text
|
|
782
|
+
initialize: ...
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
Run constructor work once after header inputs and local fields are initialized, before returning the class or record. Put this block inside the declaration, before class methods. Construction stays pure. Records can validate inputs and raise declared unless errors, but cannot replace immutable fields.
|
|
786
|
+
|
|
787
|
+
## input
|
|
788
|
+
|
|
789
|
+
```text
|
|
790
|
+
handle createUser(input from form)
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
Read named form controls into the endpoint’s record input when a browser submits the action. Labels, scalar conversion, optional fields, and server schema validation follow the endpoint contract.
|
|
794
|
+
|
|
795
|
+
## int
|
|
796
|
+
|
|
797
|
+
```text
|
|
798
|
+
int
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
Signed 64-bit integer, from -9223372036854775808 to 9223372036854775807. Literals retain their exact value. Addition, subtraction, multiplication and MIN/-1 division wrap modulo 2^64. Dynamic division requires ArithmeticError handling. Mixed float arithmetic may lose integer precision.
|
|
802
|
+
|
|
803
|
+
## interceptor
|
|
804
|
+
|
|
805
|
+
```text
|
|
806
|
+
interceptor Name<T>(resolve Dependency dependency) { around(...) returns T { ... } }
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
Declare a reusable wrapper for functions, methods, or class construction. Apply it with `[Name]` or `[Name(y=x)]`. Inputs match target labels automatically; explicit mappings rename them. Tags enter in written order and results unwind in reverse. Each layer creates a fresh instance; dependencies are forwarded from the target header. Effective contracts include every layer’s changes, capabilities, errors, and dependencies. Generic types are inferred from the target. Interceptors follow normal imports, exports, and underscore privacy.
|
|
810
|
+
|
|
811
|
+
## interface
|
|
812
|
+
|
|
813
|
+
```text
|
|
814
|
+
interface Name extends Parent { ... }
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
Declare a contract. Interfaces may extend several interfaces and may provide default method bodies. A class must implement every method without a default. Method signatures start with their name, for example `log(string message);`.
|
|
818
|
+
|
|
819
|
+
## it
|
|
820
|
+
|
|
821
|
+
```text
|
|
822
|
+
it TEST_NAME { assert(condition) }
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
Define a test case within a when group. Names may be identifiers or quoted descriptions. Group setup variables are visible, but other cases are not. Failed assertions and uncaught errors fail this case; the runner continues with the remaining cases. A case that executes no assertions fails.
|
|
826
|
+
|
|
827
|
+
## Json
|
|
828
|
+
|
|
829
|
+
```text
|
|
830
|
+
Json
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
Immutable JSON data. Parse with august.json, decode concrete records with decode<T>(), and stringify with lossless integer handling.
|
|
834
|
+
|
|
835
|
+
## List
|
|
836
|
+
|
|
837
|
+
```text
|
|
838
|
+
List<T>
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
Ordered collection: `[1, 2]` infers List<int>. A typed declaration supplies empty or nested literal types: `List<int> numbers = []`. `List<T>(...)` also accepts positional elements. `append(value=...)` requires mutable access; `get(index=...)` reads; `length()` returns its size.
|
|
842
|
+
|
|
843
|
+
## lock
|
|
844
|
+
|
|
845
|
+
```text
|
|
846
|
+
lock sharedValue as state: ...
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
Grant exclusive mutation of Shared<T> for a short block. Waiting, starting tasks, nested locks and I/O are forbidden inside. Unlocking is guaranteed on return or error.
|
|
850
|
+
|
|
851
|
+
## LogRequest
|
|
852
|
+
|
|
853
|
+
```text
|
|
854
|
+
[LogRequest(logger=logger)]
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
Map a resolve RequestLogger parameter and declare uses logger.complete. Observe the final status and monotonic duration after output finishes, or status 499 on disconnect. Layers complete in reverse written order.
|
|
858
|
+
|
|
859
|
+
## Map
|
|
860
|
+
|
|
861
|
+
```text
|
|
862
|
+
Map<K,V>
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
Hash map: `{1: "apples", 2: "pears"}` infers Map<int, string>. A typed declaration supplies empty types: `Map<int, string> fruit = {}`. Duplicate keys keep the last value. `set(key=..., value=...)` requires mutable access; `get(key=...)` returns optional V; `contains(key=...)` and `length()` read. Primitive keys and tuples compare by value; other objects use identity.
|
|
866
|
+
|
|
867
|
+
## match
|
|
868
|
+
|
|
869
|
+
```text
|
|
870
|
+
match value: when ...
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
Choose a checked case. Cover true and false for bool, null and some for nullable values, or add else. Concrete class cases narrow the named value. Duplicate and unreachable cases are rejected.
|
|
874
|
+
|
|
875
|
+
## missing
|
|
876
|
+
|
|
877
|
+
```text
|
|
878
|
+
null
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
The missing keyword is rejected. Use null. An omitted optional value and an explicit null have the same language value; there is no separate missing state.
|
|
882
|
+
|
|
883
|
+
## mutable
|
|
884
|
+
|
|
885
|
+
```text
|
|
886
|
+
Counter(mutable int initial to _count)
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
Declare mutable class storage. Header fields are otherwise read-only after construction. An explicit public argument label can initialize private storage with Type label to _field. Mutating methods declare changes self and callers provide mutable access.
|
|
890
|
+
|
|
891
|
+
## next
|
|
892
|
+
|
|
893
|
+
```text
|
|
894
|
+
next(mappedLabel=value) returns TargetResult
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
Continue to the next interceptor layer or the original function/constructor. Available only inside an interceptor around body. `next()` forwards original arguments unchanged; optional labeled overrides use the interceptor parameter names and map back to the target. Unselected arguments are forwarded automatically. The compiler requires at most one next call on each execution path. Target errors propagate through the chain; additional errors declared by around become checked errors of the tagged callable.
|
|
898
|
+
|
|
899
|
+
## not
|
|
900
|
+
|
|
901
|
+
```text
|
|
902
|
+
not count == 0
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
Negate a bool expression. Comparisons bind before not, so not count == 0 means not (count == 0). not binds before and and or. Use parentheses to negate only one comparison operand. Symbolic ! is rejected; != remains inequality.
|
|
906
|
+
|
|
907
|
+
## null
|
|
908
|
+
|
|
909
|
+
```text
|
|
910
|
+
null
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
The absent value of optional Type. Omitted optional inputs also become null. Narrow local values with if value != null, an early return guard, or match null/some before calling members. Fields remain conservative because another alias may change their value.
|
|
914
|
+
|
|
915
|
+
## optional
|
|
916
|
+
|
|
917
|
+
```text
|
|
918
|
+
optional T value
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
Allow a value of T or null. Omitted optional inputs and fields become null. Match null and some, or check != null, before reading the value. This is the only optional type spelling; Type? is rejected.
|
|
922
|
+
|
|
923
|
+
## or
|
|
924
|
+
|
|
925
|
+
```text
|
|
926
|
+
left or right
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
Logical OR on bool values. Skip the right operand when the left operand is true. This is the lowest-precedence boolean operator. Symbolic || is rejected.
|
|
930
|
+
|
|
931
|
+
## out
|
|
932
|
+
|
|
933
|
+
```text
|
|
934
|
+
interface Producer<out T>
|
|
935
|
+
```
|
|
936
|
+
|
|
937
|
+
Declare a covariant interface type parameter. It may occur only in checked output positions. Mutable containers are invariant; classes and interceptors cannot declare variance.
|
|
938
|
+
|
|
939
|
+
## own
|
|
940
|
+
|
|
941
|
+
```text
|
|
942
|
+
own Type name to expression;
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
Give a value exclusive ownership and deterministic cleanup at scope exit. Owned values cannot be copied; they can move into `own` parameters, fields, or returns. `=` is also accepted.
|
|
946
|
+
|
|
947
|
+
```text
|
|
948
|
+
own Resource resource to Resource();
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
## pass
|
|
952
|
+
|
|
953
|
+
```text
|
|
954
|
+
pass
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
An empty body. Use it inside an indented interface, class, function, or statement block. It performs no operation. Empty braced blocks may use {} instead.
|
|
958
|
+
|
|
959
|
+
## path
|
|
960
|
+
|
|
961
|
+
```text
|
|
962
|
+
int id from path
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
Bind a required path placeholder by name. A label after the source can select a different wire name: int userId from path "id".
|
|
966
|
+
|
|
967
|
+
## print
|
|
968
|
+
|
|
969
|
+
```text
|
|
970
|
+
print(value=any) returns void
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
Composition and test output. Other callables receive Console and declare uses console.write.
|
|
974
|
+
|
|
975
|
+
## pure
|
|
976
|
+
|
|
977
|
+
```text
|
|
978
|
+
extern C value pure operation(...)
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
A trusted native value adapter promises no effects or mutation. The foreign call still belongs inside unsafe; its declared errors remain checked.
|
|
982
|
+
|
|
983
|
+
## query
|
|
984
|
+
|
|
985
|
+
```text
|
|
986
|
+
optional string search from query
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
Bind one query parameter. Omitted optional input becomes null; repeated scalar parameters are rejected.
|
|
990
|
+
|
|
991
|
+
## RateLimit
|
|
992
|
+
|
|
993
|
+
```text
|
|
994
|
+
[RateLimit(requests=100, seconds=60)]
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
A bounded per-endpoint, per-peer fixed-window request limit. Uses the transport peer address, never an untrusted forwarding header. Rejected requests return 429 before body decoding. The table has 2048 entries and rejects new identities when full.
|
|
998
|
+
|
|
999
|
+
## read_file
|
|
1000
|
+
|
|
1001
|
+
```text
|
|
1002
|
+
read_file(path=string) returns string unless FileError
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
Root-only UTF-8 text input. Other callables receive FileReader. Invalid Unicode and NUL raise FileError.
|
|
1006
|
+
|
|
1007
|
+
## record
|
|
1008
|
+
|
|
1009
|
+
```text
|
|
1010
|
+
record Point(int x, int y)
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
Declare deeply immutable data with labeled construction and structural equality/hashing. Records contain primitives, tuples and other records. An initialize block validates inputs; declare rejected inputs with unless ErrorType.
|
|
1014
|
+
|
|
1015
|
+
## request
|
|
1016
|
+
|
|
1017
|
+
```text
|
|
1018
|
+
HttpRequest request from request
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
Receive the immutable raw request when a protocol requires its own binding and error responses.
|
|
1022
|
+
|
|
1023
|
+
## RequireLogin
|
|
1024
|
+
|
|
1025
|
+
```text
|
|
1026
|
+
[RequireLogin(authentication=auth)]
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
Verify credentials before typed body decoding. Map auth to an explicit resolve Authentication parameter and declare uses auth.authenticate. null produces 401; the adapter validates the credential. HTTP policies precede custom parameter interceptors.
|
|
1030
|
+
|
|
1031
|
+
## RequirePermission
|
|
1032
|
+
|
|
1033
|
+
```text
|
|
1034
|
+
[RequirePermission(authentication=auth, authorization=permissions, permission="users.read")]
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
Authenticate the request and authorize one literal permission before decoding. Both dependencies are explicit resolve parameters; declare their authenticate and authorize effects. Missing credentials produce 401 and a denied permission produces 403.
|
|
1038
|
+
|
|
1039
|
+
## resolve
|
|
1040
|
+
|
|
1041
|
+
```text
|
|
1042
|
+
resolve Logger logger; resolve app to program
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
Declare a dependency in a class or callable header. Callers omit its argument and forward the matching header dependency. Only main and test setup retrieve bindings directly with resolve app to program. Assignment-form resolve is rejected. Scoped dependencies require a scope block.
|
|
1046
|
+
|
|
1047
|
+
## return
|
|
1048
|
+
|
|
1049
|
+
```text
|
|
1050
|
+
return expression;
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
Finish the current function or method and give its result to the caller. A `void` function can use `return;`.
|
|
1054
|
+
|
|
1055
|
+
## returns
|
|
1056
|
+
|
|
1057
|
+
```text
|
|
1058
|
+
name() returns Type
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
Specify a function or method return type. Without this clause, the result is `void`; the body may end without `return` or use `return;`. Returning a value requires a declared return type. `returns own Type` transfers ownership to the caller.
|
|
1062
|
+
|
|
1063
|
+
## scope
|
|
1064
|
+
|
|
1065
|
+
```text
|
|
1066
|
+
scope: ...
|
|
1067
|
+
```
|
|
1068
|
+
|
|
1069
|
+
Create a local DI and child-task lifetime. Children join before dependencies are reclaimed; unhandled failures cancel siblings. Scoped references cannot escape. Nested scopes have independent caches.
|
|
1070
|
+
|
|
1071
|
+
## scoped
|
|
1072
|
+
|
|
1073
|
+
```text
|
|
1074
|
+
implement Counter with CounterImpl scoped mutable
|
|
1075
|
+
```
|
|
1076
|
+
|
|
1077
|
+
Cache a binding within a composition scope. Nested scope blocks have independent caches and restore the parent cache on exit. Stateful caching requires the explicit mutable choice.
|
|
1078
|
+
|
|
1079
|
+
## serve
|
|
1080
|
+
|
|
1081
|
+
```text
|
|
1082
|
+
serve getUser and createUser on port 8080
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
Start the native HTTP server with explicitly imported endpoints. Each request receives a separate DI and task scope.
|
|
1086
|
+
|
|
1087
|
+
## ServerEvent
|
|
1088
|
+
|
|
1089
|
+
```text
|
|
1090
|
+
ServerEvent<T>
|
|
1091
|
+
```
|
|
1092
|
+
|
|
1093
|
+
One SSE event containing concrete JSON data, plus optional id, event, and retry milliseconds. CR, LF and NUL are rejected in metadata. The endpoint streams ServerEvent<T> and yields each event under transport backpressure.
|
|
1094
|
+
|
|
1095
|
+
## Set
|
|
1096
|
+
|
|
1097
|
+
```text
|
|
1098
|
+
Set<T>
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
Hash set of unique values: `{1, 2, 1}` infers Set<int> with two items. Use `Set<int> numbers = {}` or `Set<int>()` for an empty set. `add(value=...)` requires mutable access; `contains(value=...)` and `length()` read. Primitive values and immutable tuples use value equality; other objects use identity.
|
|
1102
|
+
|
|
1103
|
+
## shared
|
|
1104
|
+
|
|
1105
|
+
```text
|
|
1106
|
+
implement Logger with Adapter shared
|
|
1107
|
+
```
|
|
1108
|
+
|
|
1109
|
+
Cache one stateless binding for the process. Sharing stateful instances requires an explicit shared mutable choice. A process binding cannot retain a scoped dependency.
|
|
1110
|
+
|
|
1111
|
+
## Shared
|
|
1112
|
+
|
|
1113
|
+
```text
|
|
1114
|
+
Shared<T>
|
|
1115
|
+
```
|
|
1116
|
+
|
|
1117
|
+
Synchronized mutable state. Construction takes a fresh or owned value. Read and mutate the value only through lock shared as state. A child borrowing an owned Shared<T> pins the wrapper until it finishes; the parent cannot move it into another owner while the child uses it.
|
|
1118
|
+
|
|
1119
|
+
## some
|
|
1120
|
+
|
|
1121
|
+
```text
|
|
1122
|
+
when some value: ...
|
|
1123
|
+
```
|
|
1124
|
+
|
|
1125
|
+
Match the present case of a nullable value and introduce a read-only non-null name within the case body. Pair it with when null to cover absence explicitly.
|
|
1126
|
+
|
|
1127
|
+
## start
|
|
1128
|
+
|
|
1129
|
+
```text
|
|
1130
|
+
task = start loadUsers()
|
|
1131
|
+
```
|
|
1132
|
+
|
|
1133
|
+
Start a child task in a scope. Receiver and arguments evaluate immediately. Scheduled errors are checked at waits and implicit scope joins; an unhandled child error cancels siblings. A captured object cannot be mutated or moved by the parent while the child uses it. When start runs inside a loop, waiting for one result does not release captures from other iterations; the enclosing scope joins them all.
|
|
1134
|
+
|
|
1135
|
+
## streams
|
|
1136
|
+
|
|
1137
|
+
```text
|
|
1138
|
+
endpoint GET "/events" as events() streams ServerEvent<Event>
|
|
1139
|
+
```
|
|
1140
|
+
|
|
1141
|
+
Declare a bounded streaming HTTP response. Yield values in wire order; disconnect cancels the request scope.
|
|
1142
|
+
|
|
1143
|
+
## string
|
|
1144
|
+
|
|
1145
|
+
```text
|
|
1146
|
+
string
|
|
1147
|
+
```
|
|
1148
|
+
|
|
1149
|
+
Immutable valid Unicode encoded as UTF-8, without embedded NUL. Invalid literals are compile errors and invalid text files raise FileError. The + operator joins strings. C string pointers live only for the unsafe call.
|
|
1150
|
+
|
|
1151
|
+
## Task
|
|
1152
|
+
|
|
1153
|
+
```text
|
|
1154
|
+
Task<T>
|
|
1155
|
+
```
|
|
1156
|
+
|
|
1157
|
+
A child computation owned by a scope. wait for reads its result; the scope joins children before releasing dependencies.
|
|
1158
|
+
|
|
1159
|
+
## test
|
|
1160
|
+
|
|
1161
|
+
```text
|
|
1162
|
+
test Calculator subject: ... or test add: ... or test endpoint getUser client: ...
|
|
1163
|
+
```
|
|
1164
|
+
|
|
1165
|
+
Declare tests beside the class, function, or endpoint. Class suites initialize their subject; function suites omit a subject. Endpoint suites receive a native pipeline client. Parameterized it cases use for (inputs) in tuple rows. Tests are omitted from production executables; aug test selects groups/cases and --coverage records statement lines.
|
|
1166
|
+
|
|
1167
|
+
## throw
|
|
1168
|
+
|
|
1169
|
+
```text
|
|
1170
|
+
throw error;
|
|
1171
|
+
```
|
|
1172
|
+
|
|
1173
|
+
Raise a value whose class implements `Error`. The enclosing function must declare the error or the call must be handled by a matching `catch`.
|
|
1174
|
+
|
|
1175
|
+
## throws
|
|
1176
|
+
|
|
1177
|
+
```text
|
|
1178
|
+
Use unless
|
|
1179
|
+
```
|
|
1180
|
+
|
|
1181
|
+
This old error-contract spelling is rejected. Replace `throws FileError` with `unless FileError`. Javadoc `@throws` remains supported.
|
|
1182
|
+
|
|
1183
|
+
## Timeout
|
|
1184
|
+
|
|
1185
|
+
```text
|
|
1186
|
+
[Timeout(milliseconds=5000)]
|
|
1187
|
+
```
|
|
1188
|
+
|
|
1189
|
+
Bound the request and its streaming producer with a monotonic deadline. Before output, return 504. After headers, terminate the stream. Cancellation joins children and runs always cleanup; native C operations finish before cancellation can be observed.
|
|
1190
|
+
|
|
1191
|
+
## to
|
|
1192
|
+
|
|
1193
|
+
```text
|
|
1194
|
+
destination to value
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
Alternative to = in assignments, typed declarations, labeled call arguments and interceptor mappings. Type publicLabel to _storage separates a public constructor input from private storage. resolve app to program retrieves a binding using its declared lifetime. Configure assignment in main.yaml for consistent formatting.
|
|
1198
|
+
|
|
1199
|
+
## true
|
|
1200
|
+
|
|
1201
|
+
```text
|
|
1202
|
+
true
|
|
1203
|
+
```
|
|
1204
|
+
|
|
1205
|
+
Boolean true. Conditions and logical operators require `bool`.
|
|
1206
|
+
|
|
1207
|
+
## try
|
|
1208
|
+
|
|
1209
|
+
```text
|
|
1210
|
+
try { ... } catch Error error { ... }
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
Run statements that may throw checked errors. Add a `catch` for each error, or use `catch Error` for any throwable error.
|
|
1214
|
+
|
|
1215
|
+
## Tuple
|
|
1216
|
+
|
|
1217
|
+
```text
|
|
1218
|
+
Tuple<T1, T2, ...>
|
|
1219
|
+
```
|
|
1220
|
+
|
|
1221
|
+
Fixed immutable positions: `(1, 2)` infers Tuple<int, int>, `(1, "apple")` infers Tuple<int, string>. `(1)` is grouping, `(1,)` is a singleton tuple, and `()` is empty. `get(index=0)` requires a constant index so its result type is known. `length()` reads its size. Tuples compare by their items; contained objects remain managed references.
|
|
1222
|
+
|
|
1223
|
+
## unless
|
|
1224
|
+
|
|
1225
|
+
```text
|
|
1226
|
+
load(bool fail) returns string unless FileError
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1229
|
+
Declare checked failures a function may raise instead of returning its result. Callers must catch the failures or declare them with unless too. Separate several types with `and` or commas; `unless Error` accepts any error type. The statement that raises an error remains `throw`.
|
|
1230
|
+
|
|
1231
|
+
## unsafe
|
|
1232
|
+
|
|
1233
|
+
```text
|
|
1234
|
+
unsafe { ... }
|
|
1235
|
+
```
|
|
1236
|
+
|
|
1237
|
+
Permit calls to declared `extern C` functions within this block. The compiler does not verify the safety of foreign code.
|
|
1238
|
+
|
|
1239
|
+
## uses
|
|
1240
|
+
|
|
1241
|
+
```text
|
|
1242
|
+
save(resolve FileWriter files, string path) uses files.write unless FileError
|
|
1243
|
+
```
|
|
1244
|
+
|
|
1245
|
+
Declare the external capability operations this callable may use. Interfaces, public standalone functions, default methods and interceptor around methods keep explicit contracts. Class implementations and private helpers infer uses when omitted; hover, explain and API docs show the result. An explicit uses clause remains an upper bound. Effects are checked through calls and interceptor layers; implementations cannot exceed their interface contract. changes and unless remain explicit, and construction stays pure.
|
|
1246
|
+
|
|
1247
|
+
## void
|
|
1248
|
+
|
|
1249
|
+
```text
|
|
1250
|
+
void
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
No return value. A function can omit `returns void`.
|
|
1254
|
+
|
|
1255
|
+
## wait
|
|
1256
|
+
|
|
1257
|
+
```text
|
|
1258
|
+
wait for usersTask and ordersTask as users and orders
|
|
1259
|
+
```
|
|
1260
|
+
|
|
1261
|
+
Wait for scoped tasks without changing result order. A List<Task<T>> produces List<T> and joins every child in the list. Waiting for one dynamically selected task leaves possible siblings captured until their scope joins them. A wait may encounter an unhandled sibling failure. Grouped waits observe all selected children before rethrowing the first failure. Waiting for I/O suspends a task.
|
|
1262
|
+
|
|
1263
|
+
## when
|
|
1264
|
+
|
|
1265
|
+
```text
|
|
1266
|
+
when GROUP_NAME { implement Dependency with Fake; ... }
|
|
1267
|
+
```
|
|
1268
|
+
|
|
1269
|
+
Group related test cases and declare their test dependencies. Names may be identifiers or quoted descriptions. Put bindings first, then setup statements, then it cases. Each case re-runs setup with fresh bindings in a separate native process; production bindings and startup code do not run.
|
|
1270
|
+
|
|
1271
|
+
## while
|
|
1272
|
+
|
|
1273
|
+
```text
|
|
1274
|
+
while condition { ... }
|
|
1275
|
+
```
|
|
1276
|
+
|
|
1277
|
+
Repeat a block while its condition remains `bool`.
|
|
1278
|
+
|
|
1279
|
+
## with
|
|
1280
|
+
|
|
1281
|
+
```text
|
|
1282
|
+
implement key with Class;
|
|
1283
|
+
```
|
|
1284
|
+
|
|
1285
|
+
Separates a binding key from its implementing class. The class must satisfy an interface key.
|
|
1286
|
+
|
|
1287
|
+
## write_file
|
|
1288
|
+
|
|
1289
|
+
```text
|
|
1290
|
+
write_file(path=string, content=string) returns void unless FileError
|
|
1291
|
+
```
|
|
1292
|
+
|
|
1293
|
+
Root-only UTF-8 text output. Other callables receive FileWriter.
|
|
1294
|
+
|
|
1295
|
+
## yield
|
|
1296
|
+
|
|
1297
|
+
```text
|
|
1298
|
+
yield value
|
|
1299
|
+
```
|
|
1300
|
+
|
|
1301
|
+
Send a value from a streaming endpoint. Backpressure suspends the producer until the transport can accept it.
|
|
1302
|
+
|
|
1303
|
+
## HttpTestClient operations
|
|
1304
|
+
|
|
1305
|
+
### HttpTestClient.request
|
|
1306
|
+
|
|
1307
|
+
Run this suite’s endpoint through native routing, typed binding, request-scoped DI, policies, and response serialization. No listening socket is opened. Streaming output is collected up to the configured response limit.
|
|
1308
|
+
|
|
1309
|
+
## HttpRequest operations
|
|
1310
|
+
|
|
1311
|
+
### HttpRequest.form
|
|
1312
|
+
|
|
1313
|
+
Decode a form record inside a handler so protocol-specific error responses can be returned.
|
|
1314
|
+
|
|
1315
|
+
## Headers operations
|
|
1316
|
+
|
|
1317
|
+
### Headers.with
|
|
1318
|
+
|
|
1319
|
+
Return new headers with one additional validated field. Header names ignore case; duplicate values remain separate.
|
|
1320
|
+
|
|
1321
|
+
### Headers.get
|
|
1322
|
+
|
|
1323
|
+
Read the first case-insensitive header value, or null.
|
|
1324
|
+
|
|
1325
|
+
### Headers.all
|
|
1326
|
+
|
|
1327
|
+
Read every value of this header in wire order.
|
|
1328
|
+
|
|
1329
|
+
## Json operations
|
|
1330
|
+
|
|
1331
|
+
### Json.stringify
|
|
1332
|
+
|
|
1333
|
+
Serialize this JSON value with checked UTF-8 escaping and exact int64 values.
|
|
1334
|
+
|
|
1335
|
+
### Json.get
|
|
1336
|
+
|
|
1337
|
+
Read an object member. An absent member or JSON null returns null.
|
|
1338
|
+
|
|
1339
|
+
### Json.require
|
|
1340
|
+
|
|
1341
|
+
Read a required object member or raise JsonError.
|
|
1342
|
+
|
|
1343
|
+
### Json.string
|
|
1344
|
+
|
|
1345
|
+
Require a JSON string.
|
|
1346
|
+
|
|
1347
|
+
### Json.integer
|
|
1348
|
+
|
|
1349
|
+
Require an exact signed 64-bit JSON integer.
|
|
1350
|
+
|
|
1351
|
+
### Json.boolean
|
|
1352
|
+
|
|
1353
|
+
Require a JSON bool.
|
|
1354
|
+
|
|
1355
|
+
### Json.items
|
|
1356
|
+
|
|
1357
|
+
Read an immutable JSON array.
|
|
1358
|
+
|
|
1359
|
+
### Json.decode
|
|
1360
|
+
|
|
1361
|
+
Decode a checked record or data type: json.decode<Profile>(). Unknown fields, type mismatches, and validation errors are rejected.
|
|
1362
|
+
|
|
1363
|
+
## string operations
|
|
1364
|
+
|
|
1365
|
+
### string.isToken
|
|
1366
|
+
|
|
1367
|
+
Require an ASCII RFC 3986 unreserved token with a bounded length.
|
|
1368
|
+
|
|
1369
|
+
### string.length
|
|
1370
|
+
|
|
1371
|
+
Read the number of UTF-8 bytes. Unicode text is preserved losslessly.
|
|
1372
|
+
|
|
1373
|
+
### string.bytes
|
|
1374
|
+
|
|
1375
|
+
Encode this string as immutable UTF-8 bytes.
|
|
1376
|
+
|
|
1377
|
+
### string.split
|
|
1378
|
+
|
|
1379
|
+
Split at an exact separator, preserving empty parts.
|
|
1380
|
+
|
|
1381
|
+
### string.startsWith
|
|
1382
|
+
|
|
1383
|
+
Test an exact prefix.
|
|
1384
|
+
|
|
1385
|
+
## Bytes operations
|
|
1386
|
+
|
|
1387
|
+
### Bytes.length
|
|
1388
|
+
|
|
1389
|
+
Read the number of elements.
|
|
1390
|
+
|
|
1391
|
+
### Bytes.text
|
|
1392
|
+
|
|
1393
|
+
Decode UTF-8 strictly. Invalid input raises ConversionError; embedded NUL is preserved.
|
|
1394
|
+
|
|
1395
|
+
### Bytes.base64url
|
|
1396
|
+
|
|
1397
|
+
Encode immutable bytes as unpadded RFC 4648 URL-safe base64.
|
|
1398
|
+
|
|
1399
|
+
## List operations
|
|
1400
|
+
|
|
1401
|
+
### List.append
|
|
1402
|
+
|
|
1403
|
+
Append an element with exclusive mutable access. Read-only and owned aliases cannot be stored here.
|
|
1404
|
+
|
|
1405
|
+
### List.get
|
|
1406
|
+
|
|
1407
|
+
Read a zero-based position. An invalid index raises checked IndexError. Reference results grant reading.
|
|
1408
|
+
|
|
1409
|
+
### List.at
|
|
1410
|
+
|
|
1411
|
+
Read a zero-based position, returning null when it is absent. Narrow the result before using it.
|
|
1412
|
+
|
|
1413
|
+
### List.length
|
|
1414
|
+
|
|
1415
|
+
Read the number of elements.
|
|
1416
|
+
|
|
1417
|
+
## Set operations
|
|
1418
|
+
|
|
1419
|
+
### Set.add
|
|
1420
|
+
|
|
1421
|
+
Insert a unique element with exclusive mutable access.
|
|
1422
|
+
|
|
1423
|
+
### Set.contains
|
|
1424
|
+
|
|
1425
|
+
Test structural or identity equality with a stored element.
|
|
1426
|
+
|
|
1427
|
+
### Set.length
|
|
1428
|
+
|
|
1429
|
+
Read the number of elements.
|
|
1430
|
+
|
|
1431
|
+
## Map operations
|
|
1432
|
+
|
|
1433
|
+
### Map.take
|
|
1434
|
+
|
|
1435
|
+
Remove and return an entry under exclusive access. An absent key returns null.
|
|
1436
|
+
|
|
1437
|
+
### Map.set
|
|
1438
|
+
|
|
1439
|
+
Insert or replace an entry with exclusive mutable access.
|
|
1440
|
+
|
|
1441
|
+
### Map.get
|
|
1442
|
+
|
|
1443
|
+
Read a value by key; an absent key returns null. contains distinguishes an absent key from a stored null.
|
|
1444
|
+
|
|
1445
|
+
### Map.contains
|
|
1446
|
+
|
|
1447
|
+
Check for a key, including entries whose value is null.
|
|
1448
|
+
|
|
1449
|
+
### Map.length
|
|
1450
|
+
|
|
1451
|
+
Read the number of elements.
|
|
1452
|
+
|
|
1453
|
+
## Tuple operations
|
|
1454
|
+
|
|
1455
|
+
### Tuple.get
|
|
1456
|
+
|
|
1457
|
+
Read a statically checked constant position. Prefer tuple destructuring when reading several positions.
|
|
1458
|
+
|
|
1459
|
+
### Tuple.length
|
|
1460
|
+
|
|
1461
|
+
Read the number of elements.
|