diff --git a/src/ast.rs b/src/ast.rs index cdf6b4d..7cc381b 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -1,8 +1,8 @@ #[derive(Debug, Clone)] -struct Ident(String); +pub struct Ident(pub String); #[derive(Debug, Clone)] -enum NumLit { +pub enum NumLit { /// - `0b_0001_1011` /// - `-0b10` Bin(i64, String), @@ -17,7 +17,7 @@ enum NumLit { } #[derive(Debug, Clone)] -enum TableLitElem { +pub enum TableLitElem { /// `a` Positional(Box), @@ -28,18 +28,18 @@ enum TableLitElem { /// # foo /// # bar /// ``` - MultlineString(String), + BlockString(Vec), } /// `'{ a, foo: b }` #[derive(Debug, Clone)] -struct TableLit { - elems: Vec, - trailing_comma: bool, +pub struct TableLit { + pub elems: Vec, + pub trailing_comma: bool, } #[derive(Debug, Clone)] -enum Lit { +pub enum Lit { /// `nil` Nil, @@ -60,7 +60,7 @@ enum Lit { } #[derive(Debug, Clone)] -enum TableConstrElem { +pub enum TableConstrElem { /// See [`TableLitElem`]. Lit(TableLitElem), @@ -70,13 +70,13 @@ enum TableConstrElem { /// `{ a, b, foo: c, [d]: e }` #[derive(Debug, Clone)] -struct TableConstr { - elems: Vec, - trailing_comma: bool, +pub struct TableConstr { + pub elems: Vec, + pub trailing_comma: bool, } #[derive(Debug, Clone, Copy)] -enum BinOp { +pub enum BinOp { /// `+` Add, /// `-` @@ -98,7 +98,7 @@ enum BinOp { } #[derive(Debug, Clone)] -enum Expr { +pub enum Expr { Lit(Lit), /// See [`TableConstr`]. @@ -143,4 +143,4 @@ enum Expr { /// The contents of a program file are just a table literal without the /// surrounding `'{` and `}`. #[derive(Debug, Clone)] -struct Program(TableLit); +pub struct Program(pub TableLit);