mirror of
https://github.com/typst/typst
synced 2025-05-15 09:35:28 +08:00
Update comments 🔄
This commit is contained in:
parent
ed929dd10c
commit
f006636dd2
@ -36,19 +36,19 @@ pub enum Expr {
|
|||||||
Template(ExprTemplate),
|
Template(ExprTemplate),
|
||||||
/// A grouped expression: `(1 + 2)`.
|
/// A grouped expression: `(1 + 2)`.
|
||||||
Group(ExprGroup),
|
Group(ExprGroup),
|
||||||
/// A block expression: `{1 + 2}`.
|
/// A block expression: `{ #let x = 1; x + 2 }`.
|
||||||
Block(ExprBlock),
|
Block(ExprBlock),
|
||||||
/// A unary operation: `-x`.
|
/// A unary operation: `-x`.
|
||||||
Unary(ExprUnary),
|
Unary(ExprUnary),
|
||||||
/// A binary operation: `a + b`, `a / b`.
|
/// A binary operation: `a + b`.
|
||||||
Binary(ExprBinary),
|
Binary(ExprBinary),
|
||||||
/// An invocation of a function: `[foo ...]`, `foo(...)`.
|
/// An invocation of a function: `foo(...)`, `[foo ...]`.
|
||||||
Call(ExprCall),
|
Call(ExprCall),
|
||||||
/// A let expression: `let x = 1`.
|
/// A let expression: `#let x = 1`.
|
||||||
Let(ExprLet),
|
Let(ExprLet),
|
||||||
/// An if expression: `if x { y } else { z }`.
|
/// An if expression: `#if x { y } #else { z }`.
|
||||||
If(ExprIf),
|
If(ExprIf),
|
||||||
/// A for expression: `for x in y { z }`.
|
/// A for expression: `#for x #in y { z }`.
|
||||||
For(ExprFor),
|
For(ExprFor),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ pub type ExprTemplate = Tree;
|
|||||||
/// A grouped expression: `(1 + 2)`.
|
/// A grouped expression: `(1 + 2)`.
|
||||||
pub type ExprGroup = SpanBox<Expr>;
|
pub type ExprGroup = SpanBox<Expr>;
|
||||||
|
|
||||||
/// A block expression: `{1 + 2}`.
|
/// A block expression: `{ #let x = 1; x + 2 }`.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct ExprBlock {
|
pub struct ExprBlock {
|
||||||
/// The list of expressions contained in the block.
|
/// The list of expressions contained in the block.
|
||||||
@ -226,7 +226,7 @@ impl Pretty for UnOp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A binary operation: `a + b`, `a / b`.
|
/// A binary operation: `a + b`.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct ExprBinary {
|
pub struct ExprBinary {
|
||||||
/// The left-hand side of the operation: `a`.
|
/// The left-hand side of the operation: `a`.
|
||||||
@ -389,7 +389,7 @@ pub enum Associativity {
|
|||||||
Right,
|
Right,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An invocation of a function: `[foo ...]`, `foo(...)`.
|
/// An invocation of a function: `foo(...)`, `[foo ...]`.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct ExprCall {
|
pub struct ExprCall {
|
||||||
/// The callee of the function.
|
/// The callee of the function.
|
||||||
@ -478,7 +478,7 @@ impl Pretty for Argument {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A let expression: `let x = 1`.
|
/// A let expression: `#let x = 1`.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct ExprLet {
|
pub struct ExprLet {
|
||||||
/// The pattern to assign to.
|
/// The pattern to assign to.
|
||||||
@ -498,7 +498,7 @@ impl Pretty for ExprLet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An if expression: `if x { y } else { z }`.
|
/// An if expression: `#if x { y } #else { z }`.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct ExprIf {
|
pub struct ExprIf {
|
||||||
/// The condition which selects the body to evaluate.
|
/// The condition which selects the body to evaluate.
|
||||||
@ -522,7 +522,7 @@ impl Pretty for ExprIf {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A for expression: `for x in y { z }`.
|
/// A for expression: `#for x #in y { z }`.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct ExprFor {
|
pub struct ExprFor {
|
||||||
/// The pattern to assign to.
|
/// The pattern to assign to.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user