From 160b64427d79290a59ac48c9babca064232d8dfd Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Sat, 9 May 2026 20:47:04 +0300 Subject: Make project structure more consistent --- compiler/src/ast/parser.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler/src/ast/parser.rs') diff --git a/compiler/src/ast/parser.rs b/compiler/src/ast/parser.rs index 263e5b7..33b36be 100644 --- a/compiler/src/ast/parser.rs +++ b/compiler/src/ast/parser.rs @@ -1,8 +1,8 @@ use std::iter::Peekable; use crate::{ - ast::{Atom, Error, Expr, Program}, - lexer::Token, + ast::{Ast, Atom, Error, Expr}, + lex::Token, span::{Pos, Span, Spanned}, }; @@ -174,13 +174,13 @@ where Err(Spanned::new(Error::UnclosedLeftPar, left_par_span)) } - pub fn parse(mut self) -> Result> { - let mut program = Vec::new(); + pub fn parse(mut self) -> Result> { + let mut ast = Vec::new(); while self.peek().is_some() { - program.push(self.parse_expr()?) + ast.push(self.parse_expr()?) } - Ok(Program(program)) + Ok(Ast::new(ast)) } } -- cgit v1.3