{ "cases": [ { "code": "unknown-component", "expected": { "errors": [ { "code": "unknown-component", "component": "Chartt", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Chartt([1], [2])\n", "line": 3, "name": "unknown-component" }, { "code": "unknown-component", "expected": { "errors": [ { "code": "unknown-component", "component": "Graph", "line": 3, "statement": "root" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "root/0", "line": 2, "statement": "root" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([\n Text(\"kept\"),\n Graph(1)\n])\n", "line": 3, "name": "unknown-component-inline" }, { "code": "missing-required", "expected": { "errors": [ { "code": "missing-required", "component": "Card", "line": 3, "prop": "title", "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Card()\n", "line": 3, "name": "missing-required" }, { "code": "missing-required", "expected": { "errors": [ { "code": "missing-required", "component": "Text", "line": 3, "prop": "text", "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [ "words" ] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(words)\n", "line": 3, "name": "missing-required-never-written" }, { "code": "null-required", "expected": { "errors": [ { "code": "null-required", "component": "Text", "line": 3, "prop": "text", "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(null)\n", "line": 3, "name": "null-required" }, { "code": "type-mismatch", "expected": { "errors": [ { "code": "type-mismatch", "component": "Text", "line": 3, "prop": "text", "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(42)\n", "line": 3, "name": "type-mismatch-required" }, { "code": "type-mismatch", "expected": { "errors": [ { "code": "type-mismatch", "component": "Text", "line": 2, "prop": "size", "statement": "a" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a])\na = Text(\"kept\", \"big\")\n", "line": 2, "name": "type-mismatch-optional-left-out" }, { "code": "type-mismatch", "expected": { "errors": [ { "code": "type-mismatch", "component": "Card", "line": 2, "prop": "title", "statement": "a" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" } ], "orphans": [], "tree": { "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a])\na = Card(Text(\"no\"))\n", "line": 2, "name": "type-mismatch-widget-as-data" }, { "code": "type-mismatch", "expected": { "errors": [ { "code": "type-mismatch", "component": "Page", "line": 1, "prop": "children", "statement": "root" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" } ], "orphans": [], "tree": { "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page(a)\na = Text(\"no list\")\n", "line": 1, "name": "type-mismatch-bare-child" }, { "code": "type-mismatch", "expected": { "errors": [ { "code": "type-mismatch", "component": "Page", "line": 1, "prop": "children", "statement": "root" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, \"text\"])\na = Text(\"kept\")\n", "line": 1, "name": "type-mismatch-data-child" }, { "code": "excess-args", "expected": { "errors": [ { "code": "excess-args", "component": "Text", "line": 2, "statement": "a" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "size": { "type": "number", "value": 12.0 }, "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a])\na = Text(\"kept\", 12, \"extra\")\n", "line": 2, "name": "excess-args" }, { "code": "disallowed-child", "expected": { "errors": [ { "code": "disallowed-child", "component": "Text", "line": 4, "statement": "x" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "tabs", "line": 2, "statement": "tabs" }, { "key": "t1", "line": 3, "statement": "t1" } ], "orphans": [], "tree": { "children": [ { "children": [ { "name": "Tab", "props": { "title": { "type": "text", "value": "kept" } } } ], "name": "Tabs", "props": {} } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([tabs])\ntabs = Tabs([t1, x])\nt1 = Tab(\"kept\")\nx = Text(\"not a tab\")\n", "line": 4, "name": "disallowed-child" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "$count" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a])\na = Text(\"kept\")\n$count = 0\n", "line": 3, "name": "state-statement" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text($name)\n", "line": 3, "name": "state-in-a-prop" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "rows" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a])\na = Text(\"kept\")\nrows = Query(\"list\", {}, {rows: []})\n", "line": 3, "name": "query-statement" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(\"a\" + \"b\")\n", "line": 3, "name": "operator" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(x\n ? \"y\"\n : \"z\")\n", "line": 3, "name": "conditional" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(data.title)\n", "line": 3, "name": "member-access" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" }, { "key": "b", "line": 3, "statement": "b" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } }, { "name": "Text", "props": { "text": { "type": "text", "value": "n" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(\"n\", @Count([1, 2]))\n", "line": 3, "name": "builtin-function" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" }, { "key": "b", "line": 3, "statement": "b" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } }, { "name": "Button", "props": { "label": { "type": "text", "value": "x" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Button(\"x\", @Set($s, 1))\n", "line": 3, "name": "state-action" }, { "code": "not-declarative", "expected": { "errors": [ { "code": "not-declarative", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" }, { "key": "b", "line": 3, "statement": "b" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } }, { "name": "Button", "props": { "label": { "type": "text", "value": "x" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Button(\"x\", Action([@A(), @B()]))\n", "line": 3, "name": "action-sequence" }, { "code": "inline-reserved", "expected": { "errors": [ { "code": "inline-reserved", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" }, { "key": "b", "line": 3, "statement": "b" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } }, { "name": "Text", "props": { "text": { "type": "text", "value": "x" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a, b])\na = Text(\"kept\")\nb = Text(\"x\", Query(\"t\", {}, 1))\n", "line": 3, "name": "inline-reserved" }, { "code": "syntax", "expected": { "errors": [ { "code": "syntax", "line": 3, "statement": "b" } ], "incomplete": false, "nodes": [ { "key": "root", "line": 1, "statement": "root" }, { "key": "a", "line": 2, "statement": "a" } ], "orphans": [], "tree": { "children": [ { "name": "Text", "props": { "text": { "type": "text", "value": "kept" } } } ], "name": "Page", "props": {} }, "unresolved": [] }, "input": "root = Page([a])\na = Text(\"kept\")\nb = Text(\"x\" \"y\" +)\n", "line": 3, "name": "syntax" }, { "code": "no-root", "expected": { "errors": [ { "code": "no-root", "line": 0, "statement": "" } ], "incomplete": false, "nodes": [], "orphans": [], "tree": null, "unresolved": [] }, "input": "a = Text(\"nothing calls the root\")\n", "line": 0, "name": "no-root" }, { "code": "no-root", "expected": { "errors": [ { "code": "no-root", "line": 1, "statement": "root" } ], "incomplete": false, "nodes": [], "orphans": [], "tree": null, "unresolved": [] }, "input": "root = 42\n", "line": 1, "name": "root-not-a-widget" }, { "code": "parse-failed", "expected": { "errors": [ { "code": "parse-failed", "line": 0, "statement": "" } ], "incomplete": false, "nodes": [], "orphans": [], "tree": null, "unresolved": [] }, "input": "just some prose a model wrote\n", "line": 0, "name": "parse-failed" } ], "class": "L5" }