Add mutable values

This commit is contained in:
Jeff 2024-08-14 01:03:46 -04:00
parent 17286896a8
commit 535e120256
2 changed files with 794 additions and 280 deletions

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,9 @@ use std::{
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use crate::{
parse, value::ValueInner, AbstractSyntaxTree, Analyzer, AssignmentOperator, BinaryOperator,
BuiltInFunctionError, Context, DustError, Identifier, Node, ParseError, Span, Statement,
Struct, StructType, Type, UnaryOperator, Value, ValueError,
parse, AbstractSyntaxTree, Analyzer, AssignmentOperator, BinaryOperator, BuiltInFunctionError,
Context, DustError, Identifier, Node, ParseError, Span, Statement, Struct, StructType, Type,
UnaryOperator, Value, ValueError,
};
/// Run the source code and return the result.
@ -688,8 +688,8 @@ impl Vm {
let condition_position = condition.position;
while let Some(condition_value) = self.run_statement(*condition.clone())? {
if let ValueInner::Boolean(condition_value) = condition_value.inner().as_ref() {
if !condition_value {
if let Some(condition) = condition_value.as_boolean() {
if !condition {
break;
}
} else {