Add mutable values
This commit is contained in:
parent
17286896a8
commit
535e120256
File diff suppressed because it is too large
Load Diff
@ -12,9 +12,9 @@ use std::{
|
|||||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
parse, value::ValueInner, AbstractSyntaxTree, Analyzer, AssignmentOperator, BinaryOperator,
|
parse, AbstractSyntaxTree, Analyzer, AssignmentOperator, BinaryOperator, BuiltInFunctionError,
|
||||||
BuiltInFunctionError, Context, DustError, Identifier, Node, ParseError, Span, Statement,
|
Context, DustError, Identifier, Node, ParseError, Span, Statement, Struct, StructType, Type,
|
||||||
Struct, StructType, Type, UnaryOperator, Value, ValueError,
|
UnaryOperator, Value, ValueError,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Run the source code and return the result.
|
/// Run the source code and return the result.
|
||||||
@ -688,8 +688,8 @@ impl Vm {
|
|||||||
let condition_position = condition.position;
|
let condition_position = condition.position;
|
||||||
|
|
||||||
while let Some(condition_value) = self.run_statement(*condition.clone())? {
|
while let Some(condition_value) = self.run_statement(*condition.clone())? {
|
||||||
if let ValueInner::Boolean(condition_value) = condition_value.inner().as_ref() {
|
if let Some(condition) = condition_value.as_boolean() {
|
||||||
if !condition_value {
|
if !condition {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user