oak_purescript/ast/mod.rs
1#![doc = include_str!("readme.md")]
2/// PureScript AST root node.
3#[derive(Debug, Clone)]
4pub struct PurescriptRoot {
5 /// The list of syntax elements in the PureScript source.
6 pub elements: Vec<Element>,
7}
8
9/// PureScript syntax elements.
10#[derive(Debug, Clone)]
11pub enum Element {
12 /// A module declaration.
13 Module(String),
14 /// An import statement.
15 Import(String),
16 /// A data type declaration.
17 DataDecl(String),
18 /// A function declaration.
19 FunctionDecl(String),
20 /// An identifier.
21 Identifier(String),
22 /// A keyword.
23 Keyword(String),
24 /// An operator.
25 Operator(String),
26 /// A string literal.
27 StringLiteral(String),
28 /// A number literal.
29 NumberLiteral(String),
30 /// A character literal.
31 CharLiteral(String),
32 /// A comment.
33 Comment(String),
34 /// Whitespace.
35 Whitespace(String),
36 /// A newline character.
37 Newline,
38}