From 610ba7fc402ecef61ab80596ffa0585c56f67b99 Mon Sep 17 00:00:00 2001 From: Erin Date: Wed, 13 Oct 2021 13:20:23 +0200 Subject: [PATCH] Change Cart AssignableKind to Index. --- ablescript/src/ast.rs | 2 +- ablescript/src/interpret.rs | 4 ++-- ablescript/src/parser.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ablescript/src/ast.rs b/ablescript/src/ast.rs index e11cb33..67cd235 100644 --- a/ablescript/src/ast.rs +++ b/ablescript/src/ast.rs @@ -47,7 +47,7 @@ pub struct Assignable { #[derive(Debug, PartialEq, Clone, Hash)] pub enum AssignableKind { Variable, - Cart { indices: Vec }, + Index { indices: Vec }, } #[derive(Debug, PartialEq, Clone, Hash)] diff --git a/ablescript/src/interpret.rs b/ablescript/src/interpret.rs index 33bb740..1c7f096 100644 --- a/ablescript/src/interpret.rs +++ b/ablescript/src/interpret.rs @@ -248,9 +248,9 @@ impl ExecEnv { let value = self.eval_expr(value)?; match assignable.kind { AssignableKind::Variable => { - &self.get_var_mut(&assignable.ident)?.value.replace(value); + self.get_var_mut(&assignable.ident)?.value.replace(value); } - AssignableKind::Cart { ref indices } => { + AssignableKind::Index { ref indices } => { let mut cell = self.get_var_rc(&assignable.ident)?; for index in indices { let index = self.eval_expr(index)?; diff --git a/ablescript/src/parser.rs b/ablescript/src/parser.rs index f01a9da..d850f60 100644 --- a/ablescript/src/parser.rs +++ b/ablescript/src/parser.rs @@ -412,7 +412,7 @@ impl<'source> Parser<'source> { indices.reverse(); Some(Assignable { ident: Ident::new(ident, buf.span), - kind: AssignableKind::Cart { indices }, + kind: AssignableKind::Index { indices }, }) }