wright 0.10.1

The wright programming language compiler and tooling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Primary expressions in Qright source code.

use super::{literal::Literal, parentheses::ParenthesesExpression};
use crate::parser::ast::path::Path;

/// A primary expression is a special type of low-level expression that can appear in places where other expressions
/// (such as blocks or conditionals) are not allowed.
#[derive(Debug)]
pub enum Primary<'src> {
    /// A literal in source code.
    Literal(Literal<'src>),
    /// A path to an item/symbol/constant value.
    ///
    /// This includes identifiers as single element paths.
    Path(Path<'src>),
    /// An expression in parentheses.
    Parentheses(ParenthesesExpression<'src>),
}