docs: define interpreted runtime and typed resource presentation

This commit is contained in:
2026-10-08 00:55:00 +08:00
parent 941942c7e1
commit 861fef5ec0
19 changed files with 246 additions and 183 deletions
+5 -13
View File
@@ -21,7 +21,7 @@
```ebnf
program = { use-decl }, declaration, { declaration }, EOF ;
declaration = class-decl | function-decl | scene-decl ;
declaration = class-decl | function-decl ;
use-decl = "use", namespace-key ;
namespace-key = user-handle, ":", namespace-path ;
@@ -82,21 +82,13 @@ primary = identifier | string | number | symbol
相关说明:[表达式与绑定](../guide/08-expressions-and-bindings.md)、[数据读取](../guide/10-data-access.md)。
## 场景与渲染节点
## 界面值与资源访问
```ebnf
scene-decl = "export", "scene", identifier, "{", render-decl, "}" ;
render-decl = "render", "{", node, "}" ;
界面使用普通函数返回可渲染值表达,不增加 scene 声明、render 块或独立节点文法。顶级类型、界面值构造、组件参数及子节点组合的形式尚未定义,因此本附录不补写相应产生式,也不规定单根结构。
node = identifier, [ arguments ], [ children ] ;
arguments = "(", [ argument, { ",", argument } ], ")" ;
argument = [ identifier, ":" ], expression ;
children = "{", { node }, "}" ;
```
客户端访问与呈现是资源处理行为,不增加源码中的函数声明形式。访问定位和函数类型表达的具体写法待定,见[规范状态](specification-status.md#资源访问与呈现)。
render 内单根结构由产生式表达。组件是否接受子节点、参数是否合法以及 render 内可使用哪些表达式效果,属于语义规则。
相关说明:[场景与渲染树](../guide/11-scenes-and-render-trees.md)、[UI 组件](../guide/12-ui-components.md)。
相关说明:[资源访问与呈现](../guide/11-resource-access-and-presentation.md)、[UI 组件](../guide/12-ui-components.md)。
## 词法