Skip to main content

Module parse

Module parse 

Source
Expand description

Parsing and rendering helpers for authored registration faces. 注册面创作文件的解析与渲染辅助函数。

The pure source-text transformations live in the kernel authoring module; this shim keeps the historical nichlink_run_method::authoring::parse path and re-implements the two filesystem-bound entry points as thin wrappers. 纯源码文本变换位于 kernel 的 authoring 模块;本 shim 保留 nichlink_run_method::authoring::parse 历史路径,并把两个绑定文件 系统的入口重新实现为薄包装。

Structs§

FaceParseError
Why authored face text was refused. 创作注册面文本被拒绝的原因。

Functions§

kind_from_source_text
Read the declared kind out of a registration-face source text. 从注册面源码文本中读取它声明的 kind。
literal_string_expr
Extract the string literal of an expression, rejecting anything else. 取出表达式的字符串字面量,其余写法一律拒绝。
module_name_from_path
The module name implied by a source file path: its file stem, or module when the stem is not valid UTF-8. 源文件路径隐含的模块名:文件主干名;主干不是合法 UTF-8 时为 module。
module_source_from_node_path
The source file a crate::… module path names, in this crate’s <dir>/<name>.rs layout; None when the path cannot name a file at all. crate::… 模块路径在本 crate 的 <dir>/<name>.rs 布局下指向的源文件;该路径根本无法 命名文件时为 None。
parse_admission_expression
Read an admission expression, accepting both the compact and constructor spellings. 读取 admission 表达式,同时接受紧凑写法与构造形式。
parse_admission_owned
Parse a compact admission value into its owned snapshot form. 将紧凑 admission 值解析为快照使用的拥有型形式。
parse_flow_expression
Parse a flow expression back into the editor’s compact form. 将 flow 表达式解析回编辑器使用的紧凑形式。
parse_flow_value
Parse the compact flow value into an owned contract for a reload snapshot. 将紧凑 flow 值解析为热重载快照使用的拥有型合同。
parse_optional_source
Accept or refuse an optional string field’s text, which is the same rule render_optional_source applies — minus the rendering. 接受或拒绝可选字符串字段的文本,与 render_optional_source 用的是同一条规则——只是 不做渲染。
parse_registration_rule_owned
Parse the compact registration-rule value into an owned rule. 将紧凑注册规范值解析为拥有型规则。
parse_requirements
Check that every requires entry uses the capability=>provider shape. 校验每条 requires 条目都使用 capability=>provider 形状。
parse_requirements_owned
Parse capability=>provider pairs into their owned snapshot form. 将 capability=>provider 对解析为快照使用的拥有型形式。
path_ends_with
Whether a Rust path expression ends with the given suffix. Rust 路径表达式是否以给定后缀结尾。
quoted_list_field
Read the quoted strings of one bracketed field, e.g. marker: ["a", "b"]. 读取一个方括号字段里的引号字符串,例如 marker: ["a", "b"]。
render_admission
Render a compact admission value as the Admission constructor expression. 将紧凑 admission 值渲染成 Admission 构造表达式。
render_expression_list
Render a runtime-check list back to the expression text the macro takes, refusing anything RuntimeCheckSpec cannot parse. 把运行期检查列表渲染回宏接受的表达式文本;RuntimeCheckSpec 解析不了的一律拒绝。
render_face_list
Render one comma-separated value as a quoted list field, indented and newline-terminated; an empty value renders as nothing at all. 把一个逗号分隔的取值渲染成带引号的列表字段(缩进且以换行结尾);取值为空时不渲染任何 内容。
render_flow_expression
Render the editor’s id|version|input|output form as a Rust expression. 将编辑器中的 id|version|input|output 形式渲染为 Rust 表达式。
render_flow_provider
Render an explicitly selected flow provider type. 渲染显式选择的数据流合同提供者类型。
render_literal_list
Render a comma-separated value as quoted literals joined by , , for inlining inside a bracketed list. 把逗号分隔的取值渲染成以 , 连接的带引号字面量,供内联进方括号列表。
render_optional_source
Render an optional string field: an empty value or none becomes None, anything else becomes Some("…") with the text escaped. 渲染可选字符串字段:空值或 none 变成 None,其余变成转义后的 Some("…")。
render_path_list
Render a comma-separated value as Rust paths joined by , , keeping the author’s spelling because the compiler resolves it. 把逗号分隔的取值渲染成以 , 连接的 Rust 路径,保留作者的写法,因为由编译器解析。
render_registration_rule
Render the compact registration-rule syntax as a const Rust expression. 将紧凑注册规范语法渲染成 const Rust 表达式。
render_requirements
Render capability=>provider pairs as a Rust requires: list. 把 capability=>provider 对渲染成 Rust 的 requires: 列表。
rule_syntax_from_text
Reduce a registry-rule source text to its compact syntax form. 将注册规则源码文本化简为紧凑语法形式。
split_csv_owned
Split a comma-separated list into trimmed, non-empty owned strings. 把逗号分隔的列表切成去空白、去空项的自有字符串。
trait_names_from_paths
Derive the human-facing trait labels from compiler-checked Rust paths. 从参与编译检查的 Rust 路径派生人类可读的 trait 名称。