aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/ast/parser.rs
diff options
context:
space:
mode:
authorTolmachev Igor <me@igorek.dev>2026-05-09 20:47:04 +0300
committerTolmachev Igor <me@igorek.dev>2026-05-09 20:47:04 +0300
commit160b64427d79290a59ac48c9babca064232d8dfd (patch)
tree0c2cc79f0a266761866ff325abdd4f2f0c7e7301 /compiler/src/ast/parser.rs
parent6be28381d6081dfb3a1dc9d1ec15062b67ba1ef9 (diff)
downloadcrisp-160b64427d79290a59ac48c9babca064232d8dfd.tar.gz
crisp-160b64427d79290a59ac48c9babca064232d8dfd.zip
Make project structure more consistentdev
Diffstat (limited to 'compiler/src/ast/parser.rs')
-rw-r--r--compiler/src/ast/parser.rs12
1 files changed, 6 insertions, 6 deletions
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 @@
1use std::iter::Peekable; 1use std::iter::Peekable;
2 2
3use crate::{ 3use crate::{
4 ast::{Atom, Error, Expr, Program}, 4 ast::{Ast, Atom, Error, Expr},
5 lexer::Token, 5 lex::Token,
6 span::{Pos, Span, Spanned}, 6 span::{Pos, Span, Spanned},
7}; 7};
8 8
@@ -174,13 +174,13 @@ where
174 Err(Spanned::new(Error::UnclosedLeftPar, left_par_span)) 174 Err(Spanned::new(Error::UnclosedLeftPar, left_par_span))
175 } 175 }
176 176
177 pub fn parse(mut self) -> Result<Program, Spanned<Error>> { 177 pub fn parse(mut self) -> Result<Ast, Spanned<Error>> {
178 let mut program = Vec::new(); 178 let mut ast = Vec::new();
179 179
180 while self.peek().is_some() { 180 while self.peek().is_some() {
181 program.push(self.parse_expr()?) 181 ast.push(self.parse_expr()?)
182 } 182 }
183 183
184 Ok(Program(program)) 184 Ok(Ast::new(ast))
185 } 185 }
186} 186}