From 3b19fc5aa924a7828c528992c4538bd640c7c9ea Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 5 Aug 2019 03:35:10 -0700 Subject: [PATCH] Barest beginning of named struct implementation --- schala-lang/language/src/reduced_ast.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/schala-lang/language/src/reduced_ast.rs b/schala-lang/language/src/reduced_ast.rs index de228b5..ae79e37 100644 --- a/schala-lang/language/src/reduced_ast.rs +++ b/schala-lang/language/src/reduced_ast.rs @@ -150,7 +150,7 @@ impl Expression { TupleLiteral(exprs) => Expr::Tuple(exprs.iter().map(|e| e.node().reduce(symbol_table)).collect()), IfExpression { discriminator, body } => reduce_if_expression(discriminator, body, symbol_table), Lambda { params, body, .. } => reduce_lambda(params, body, symbol_table), - NamedStruct { .. } => Expr::UnimplementedSigilValue, + NamedStruct { name, fields } => reduce_named_struct(name, fields), Index { .. } => Expr::UnimplementedSigilValue, WhileExpression { .. } => Expr::UnimplementedSigilValue, ForExpression { .. } => Expr::UnimplementedSigilValue, @@ -167,6 +167,10 @@ fn reduce_lambda(params: &Vec, body: &Block, symbol_table: &SymbolT }) } +fn reduce_named_struct(name: &Rc, fields: &Vec<(Rc, Meta)>) -> Expr { + panic!() +} + fn reduce_call_expression(func: &Meta, arguments: &Vec>, symbol_table: &SymbolTable) -> Expr { Expr::Call { f: Box::new(func.node().reduce(symbol_table)),