From 71a58c12a2ff54e4ce00682a45ea5a1b2d92c989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sat, 14 Jan 2023 13:20:50 +0100 Subject: [PATCH] Parser - Accomodate AST class structure changes --- src/parser.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 4f615ae..b74acf3 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -2,8 +2,8 @@ use std::collections::HashSet; use crate::{ ast::{ - BinaryExpr, ClassDecl, ClassMemberDecl, ExprNode, FunDecl, GetExpr, ProgramNode, SetExpr, - StmtNode, VariableExpr, + BinaryExpr, ClassDecl, ClassMemberDecl, ClassMemberKind, ExprNode, FunDecl, GetExpr, + ProgramNode, SetExpr, StmtNode, VariableExpr, }, errors::{ErrorHandler, ErrorKind, SloxError, SloxResult}, tokens::{Token, TokenType}, @@ -238,11 +238,11 @@ impl Parser { )); } } - members.push(if static_token.is_some() { - ClassMemberDecl::StaticMethod(d) - } else { - ClassMemberDecl::Method(d) - }) + members.push(ClassMemberDecl { + kind: ClassMemberKind::Method, + is_static: static_token.is_some(), + fun_decl: d, + }); } _ => panic!("Function declaration expected"), }