flowrs-engine/spec/conformance/flowrs/functions.flowrs
flowRS 2b6f30d348 flowRS engine, cut from flowRS f907e0756a7c
Built alone from an empty CARGO_HOME, its tests passed, and flowrsc checked, ran and exported a
document from the conformance corpus; the export built alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-10 08:54:33 -05:00

207 lines
3.8 KiB
Text

{
"format": 2,
"generator": "spec/conformance: a function and its calls",
"nodes": [
{
"id": 0,
"type_id": "FloatLiteral",
"properties": {
"value": "1.5"
},
"position": [
60.0,
60.0
],
"group": null
},
{
"id": 1,
"type_id": "Call",
"properties": {
"fn": "calibrate@1",
"gain": "2"
},
"position": [
280.0,
60.0
],
"group": null
},
{
"id": 2,
"type_id": "Call",
"properties": {
"fn": "calibrate@1",
"gain": "2",
"offset": "-0.1"
},
"position": [
280.0,
170.0
],
"group": null
},
{
"id": 3,
"type_id": "io.print",
"properties": {},
"position": [
500.0,
60.0
],
"group": null
}
],
"wires": [
{
"id": 0,
"from_node": 0,
"from_port": "value",
"to_node": 1,
"to_port": "raw",
"mode": "Copy"
},
{
"id": 1,
"from_node": 0,
"from_port": "value",
"to_node": 2,
"to_port": "raw",
"mode": "Copy"
},
{
"id": 2,
"from_node": 2,
"from_port": "volts",
"to_node": 3,
"to_port": "value",
"mode": "Move"
}
],
"groups": [],
"functions": [
{
"name": "calibrate",
"version": 1,
"nodes": [
{
"id": 0,
"type_id": "math.mul",
"properties": {},
"position": [
280.0,
60.0
],
"group": null
},
{
"id": 1,
"type_id": "math.add",
"properties": {},
"position": [
500.0,
60.0
],
"group": null
},
{
"id": 2,
"type_id": "FunctionInput",
"properties": {
"name": "raw",
"type": "f64"
},
"position": [
60.0,
60.0
],
"group": null
},
{
"id": 3,
"type_id": "FunctionInput",
"properties": {
"name": "gain",
"type": "f64"
},
"position": [
60.0,
170.0
],
"group": null
},
{
"id": 4,
"type_id": "FunctionInput",
"properties": {
"default": "0",
"name": "offset",
"type": "f64"
},
"position": [
60.0,
280.0
],
"group": null
},
{
"id": 5,
"type_id": "FunctionOutput",
"properties": {
"name": "volts",
"type": "f64@{unit=V}"
},
"position": [
720.0,
60.0
],
"group": null
}
],
"wires": [
{
"id": 0,
"from_node": 2,
"from_port": "value",
"to_node": 0,
"to_port": "a",
"mode": "Move"
},
{
"id": 1,
"from_node": 3,
"from_port": "value",
"to_node": 0,
"to_port": "b",
"mode": "Move"
},
{
"id": 2,
"from_node": 0,
"from_port": "product",
"to_node": 1,
"to_port": "a",
"mode": "Move"
},
{
"id": 3,
"from_node": 4,
"from_port": "value",
"to_node": 1,
"to_port": "b",
"mode": "Move"
},
{
"id": 4,
"from_node": 1,
"from_port": "sum",
"to_node": 5,
"to_port": "value",
"mode": "Move"
}
],
"groups": []
}
],
"widgets": {}
}