Files
root 6f59181f09 Rename dynamic dval to any and add port spawn options
Keep the compile-time generic marker as *. Update the compiler, stdlib,
fixtures, documentation and editor grammars without a dynamic type alias.
Preserve native identifiers and historical work and patch records.

Replace the port_spawn environment argument with cwd/env options. Report
failed directory changes through EXIT 127 with cwd_failed.

Compile every API example and add a complete Pi RPC service example.
Service examples compile without execution or output blocks. Update ABI
versions and audited golden artifacts.
2026-10-15 02:50:33 +00:00

43 lines
1.9 KiB
Plaintext

#import "example.capy" as example
#exports CLI
// standalone comment
host function external(value : s32) s32
type Count = s64
type Callback = function(value : s32) s32
function defaults(value : s32 = 1, opt : any = {}) s32 { -> value }
struct P { x : s32; y : s32 = 0 }
function g(items : [s32], opt : any = {}, ...rest : as string) string {
var total : s64 = 0 // trailing comment
var callback : function(s32) s32 = function(value : s32) s32 { -> -value }
var nested := {
"outer": {
inner: {key: -1},
other: {}
},
empty: {}
}
var text := <> raw <?= string(total) ?> </>
print(<>
This markup deliberately exceeds one hundred columns and must never cause the containing call to split its opening or closing delimiters.
<?= string(total) ?>
</>)
var a := -1; var b := total * -2
if !(a < b) { return -a } else { total = total + 1 }
while total < 10 { total = total + 1 }
for value, key := items { if value == 0 { continue }; total = total + value; if total > 100 { break } }
for i := 0..10 { total = total + i }
print(...items)
print(items::type_name, opt.missing?, none, true && !false, 1.5, "escaped\\ntext")
print(function(value : s32) s32 { -> value + 1 }, items[0])
print("This argument deliberately exceeds one hundred columns so the formatter must split the call with each argument one tab deeper", nested: nested, value: items[0].member)
component_render("/components/theme/page.capy", request: context, body: component("/components/common/status-panel", heading: "Method not allowed"))
print("This single argument deliberately exceeds one hundred columns and must stay on the opening line with its closing parenthesis alone")
-> string(total)
}
function map_arguments(context : any)
{
publish_page_state(user: context.call["auth"]["user"], session: {name: session_name}, config: context.cfg, pagefacts: {format: "HTML", title: context.call["app"]["page_title"]})
var pair := {x: 1, y: [1, -2]}
var one := {a: 1}
}