joule-ui takes in OpenUI Lang 1.0 the way it takes in A2UI: a model writes a surface as a program, one widget a line, and joule-ui-lang builds a widget tree against the host's registry as the program streams. After every chunk a snapshot holds the tree as far as it can be built, each widget checked by joule-ui's own validate, and every error with its source line and reason code. State, queries, operators, conditionals, built-in functions and sequences of actions are parsed and refused not-declarative. A canonical writer turns a tree back into the language; it parses back to the same tree. - joule-ui-core: WidgetSchema::positional, the order a positional call passes props in (SPEC §3); absent from the wire form when undeclared. - joule-ui-interaction: begin_interaction and Pending::finish, the lifecycle's three phases in two steps for a host whose handler is asynchronous (SPEC §6); run_interaction is built on them and seals what it sealed before. - conformance/lang/v1: L1 statements, L2 ingest, L3 streaming, L4 the canonical form, L5 refusals, with an independent Python verifier written from §11. - docs/create.md: the design of Create. Co-Authored-By: Claude Opus 5.5 <[email protected]>
257 lines
5.6 KiB
JSON
257 lines
5.6 KiB
JSON
{
|
|
"cases": [
|
|
{
|
|
"incomplete": false,
|
|
"input": "root = Page([a])\na = Text(\"hi\")\n",
|
|
"name": "one-a-line",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 1,
|
|
"name": "root"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 2,
|
|
"name": "a"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "\n\nhello there\nroot = Page()\n= 3\n \nx = 1\n",
|
|
"name": "blank-lines-and-prose-lines",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 4,
|
|
"name": "root"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 7,
|
|
"name": "x"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "root = Page([\n a,\n b\n])\na = Text(\"a\")\nb = Text(\"b\")",
|
|
"name": "brackets-carry-over-lines",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 1,
|
|
"name": "root"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 5,
|
|
"name": "a"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 6,
|
|
"name": "b"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "a = Text(\"line one\nline two\")\nroot = Page([a])",
|
|
"name": "string-carries-over-lines",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 1,
|
|
"name": "a"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 3,
|
|
"name": "root"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "x = c\n ? 1\n : 2\nroot = Page()",
|
|
"name": "ternary-continues-on-a-question-line",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 1,
|
|
"name": "x"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 4,
|
|
"name": "root"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "x = c ? 1 :\n 2\nroot = Page()",
|
|
"name": "ternary-empty-branch-continues",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 1,
|
|
"name": "x"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 3,
|
|
"name": "root"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "$s = 1\nq = Query(\"t\", {}, {})\nm = Mutation(\"u\", {})\n$w = Query(\"t\", {}, {})\nroot = Page()",
|
|
"name": "state-query-mutation-kinds",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "state",
|
|
"line": 1,
|
|
"name": "$s"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "query",
|
|
"line": 2,
|
|
"name": "q"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "mutation",
|
|
"line": 3,
|
|
"name": "m"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "query",
|
|
"line": 4,
|
|
"name": "$w"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 5,
|
|
"name": "root"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "root = Page([a])\na = Text(\"x\" 1 +)\nb = 1 2\n",
|
|
"name": "syntax-error-is-a-statement-of-its-own",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 1,
|
|
"name": "root"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "syntax",
|
|
"line": 2,
|
|
"name": "a"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "syntax",
|
|
"line": 3,
|
|
"name": "b"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "Here it is:\n```openui-lang\nroot = Page([a])\n```\nand a note\n```\na = Text(\"in a second fence\")\n```\n",
|
|
"name": "fenced-with-prose",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 3,
|
|
"name": "root"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 7,
|
|
"name": "a"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "root = Page([a]) // the page\n# a heading comment\na = Text(\"#not a comment // nor this\")\n",
|
|
"name": "comments",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 1,
|
|
"name": "root"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 3,
|
|
"name": "a"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": false,
|
|
"input": "]]>openui:content?library=pack%401\nroot = Page([a])\na = Text(\"x\")\n]]>openui:context\n{\"formState\": {}}\n]]>openui:end\n",
|
|
"name": "markers",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 2,
|
|
"name": "root"
|
|
},
|
|
{
|
|
"complete": true,
|
|
"kind": "value",
|
|
"line": 3,
|
|
"name": "a"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"incomplete": true,
|
|
"input": "root = Page([a\na = Text(\"open",
|
|
"name": "unterminated-at-end",
|
|
"statements": [
|
|
{
|
|
"complete": true,
|
|
"kind": "syntax",
|
|
"line": 1,
|
|
"name": "root"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"class": "L1"
|
|
}
|