Completed docs, added icon

This commit is contained in:
2023-05-28 17:24:56 +01:00
parent 6b71164aca
commit 6f5a9d05dd
28 changed files with 295 additions and 5 deletions

View File

@@ -19,7 +19,9 @@ use crate::utils::Substack;
/// A [Clause] with associated metadata
#[derive(Clone, Debug, PartialEq)]
pub struct Expr {
/// The actual value
pub value: Clause,
/// Information about the code that produced this value
pub location: Location,
}
@@ -87,7 +89,9 @@ pub enum PHClass {
/// Properties of a placeholder that matches unknown tokens in macros
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct Placeholder {
/// Identifier to pair placeholders in the pattern and template
pub name: Tok<String>,
/// The nature of the token set matched by this placeholder
pub class: PHClass,
}
@@ -321,8 +325,11 @@ impl InternedDisplay for Clause {
/// A substitution rule as read from the source
#[derive(Debug, Clone, PartialEq)]
pub struct Rule {
/// Tree fragment in the source code that activates this rule
pub pattern: Rc<Vec<Expr>>,
/// Influences the order in which rules are checked
pub prio: NotNan<f64>,
/// Tree fragment generated by this rule
pub template: Rc<Vec<Expr>>,
}
@@ -386,7 +393,9 @@ impl InternedDisplay for Rule {
/// A named constant
#[derive(Debug, Clone, PartialEq)]
pub struct Constant {
/// Used to reference the constant
pub name: Tok<String>,
/// The constant value inserted where the name is found
pub value: Expr,
}