docs: 添加 Rustdoc 注释

This commit is contained in:
爱特每羊队
2026-08-05 21:46:47 +08:00
parent bbdfca1a1c
commit f461235f04
158 changed files with 1440 additions and 15 deletions
@@ -1,3 +1,5 @@
//! break/continue 语句 emit:解析标签与最近循环的跳转目标。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
@@ -1,3 +1,5 @@
//! 表达式语句 emit:`emit_expression_statement` 求值并(按需)丢弃结果。
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
@@ -1,3 +1,5 @@
//! 标签语句 emit:`emit_labeled_statement` 登记 break/continue 标签作用域。
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
+2
View File
@@ -1,3 +1,5 @@
//! 基本语句域:表达式语句/return/空语句的分发与子模块聚合。
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
@@ -1,3 +1,5 @@
//! return 语句 emit:`emit_return_statement` 求值返回值并生成返回指令。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
+2
View File
@@ -1,3 +1,5 @@
//! 块语句 emit:`emit_block_statement` 压/弹作用域并顺序编译子语句(含域分发)。
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
+2
View File
@@ -1,3 +1,5 @@
//! 控制流语句 emit:`if` 条件分支(含 else)与域分发 `emit_control_domain`。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! 类声明语句 emit:`emit_class_declaration_statement` 声明类名并初始化类对象。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! 函数声明语句 emit:`emit_function_declaration_statement` 创建闭包并绑定函数名。
use crate::{CompileCtx, Emitter, ParamSpec};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! 声明语句域:变量/函数/类声明的分发与子模块聚合。
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
@@ -1,3 +1,5 @@
//! var/let/const 声明语句 emit:声明 + 初始化表达式,处理提升与解构 pattern。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! 异常语句域:throw/try 的分发与子模块聚合。
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
@@ -1,3 +1,5 @@
//! throw 语句 emit:`emit_throw_statement` 求值异常值并生成 THROW。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! try/catch/finally 语句 emit:`emit_try_statement` 生成 TRY_BEGIN 与处理入口。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! do-while 语句 emit:`emit_do_while_statement` 先执行体后测条件。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_parser::Statement;
@@ -1,3 +1,5 @@
//! for 语句 emit:`emit_for_statement` 含 init/test/update 三段与循环跳转。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! for-in 语句 emit:`emit_for_in_statement` 遍历可枚举属性名。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! for-of 语句 emit:`emit_for_of_statement` 迭代器协议遍历。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;
@@ -1,3 +1,5 @@
//! 迭代语句域:while/do-while/for/for-in/for-of 的分发与子模块聚合。
use crate::{CompileCtx, Emitter};
use oxide_parser::Statement;
@@ -1,3 +1,5 @@
//! while 语句 emit:`emit_while_statement` 先测条件后执行体。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_parser::Statement;
+2
View File
@@ -1,3 +1,5 @@
//! 语句编译域:`emit_statement` 分发到块/控制流/声明/异常/迭代等子模块。
pub mod basic;
pub mod block;
pub mod control;
+2
View File
@@ -1,3 +1,5 @@
//! switch 语句 emit:case 匹配链 + 穿落(fallthrough)与 default,见 `emit_switch_statement`。
use crate::{CompileCtx, Emitter};
use oxide_ir::inst::Inst;
use oxide_ir::operand::Operand;