Barest beginning of named struct implementation
This commit is contained in:
parent
16bf166fa9
commit
3b19fc5aa9
@ -150,7 +150,7 @@ impl Expression {
|
|||||||
TupleLiteral(exprs) => Expr::Tuple(exprs.iter().map(|e| e.node().reduce(symbol_table)).collect()),
|
TupleLiteral(exprs) => Expr::Tuple(exprs.iter().map(|e| e.node().reduce(symbol_table)).collect()),
|
||||||
IfExpression { discriminator, body } => reduce_if_expression(discriminator, body, symbol_table),
|
IfExpression { discriminator, body } => reduce_if_expression(discriminator, body, symbol_table),
|
||||||
Lambda { params, body, .. } => reduce_lambda(params, 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,
|
Index { .. } => Expr::UnimplementedSigilValue,
|
||||||
WhileExpression { .. } => Expr::UnimplementedSigilValue,
|
WhileExpression { .. } => Expr::UnimplementedSigilValue,
|
||||||
ForExpression { .. } => Expr::UnimplementedSigilValue,
|
ForExpression { .. } => Expr::UnimplementedSigilValue,
|
||||||
@ -167,6 +167,10 @@ fn reduce_lambda(params: &Vec<FormalParam>, body: &Block, symbol_table: &SymbolT
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn reduce_named_struct(name: &Rc<String>, fields: &Vec<(Rc<String>, Meta<Expression>)>) -> Expr {
|
||||||
|
panic!()
|
||||||
|
}
|
||||||
|
|
||||||
fn reduce_call_expression(func: &Meta<Expression>, arguments: &Vec<Meta<InvocationArgument>>, symbol_table: &SymbolTable) -> Expr {
|
fn reduce_call_expression(func: &Meta<Expression>, arguments: &Vec<Meta<InvocationArgument>>, symbol_table: &SymbolTable) -> Expr {
|
||||||
Expr::Call {
|
Expr::Call {
|
||||||
f: Box::new(func.node().reduce(symbol_table)),
|
f: Box::new(func.node().reduce(symbol_table)),
|
||||||
|
Loading…
Reference in New Issue
Block a user