diff --git a/src/wasm-lib/kcl/src/execution/mod.rs b/src/wasm-lib/kcl/src/execution/mod.rs index 6cd44d079..d543b3e7f 100644 --- a/src/wasm-lib/kcl/src/execution/mod.rs +++ b/src/wasm-lib/kcl/src/execution/mod.rs @@ -3497,12 +3497,7 @@ shell({ faces = ['end'], thickness = 0.25 }, firstSketch)"#; }) .await; - assert!(result.is_some()); - - let result = result.unwrap(); - - assert_eq!(result.program, program_new.ast); - assert!(result.clear_scene); + assert!(result.is_none()); } // Changing the units with the exact same file should bust the cache. diff --git a/src/wasm-lib/kcl/src/parsing/ast/digest.rs b/src/wasm-lib/kcl/src/parsing/ast/digest.rs index 077eb9f06..463fc0b97 100644 --- a/src/wasm-lib/kcl/src/parsing/ast/digest.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/digest.rs @@ -3,11 +3,10 @@ use sha2::{Digest as DigestTrait, Sha256}; use super::types::{DefaultParamVal, ItemVisibility, LabelledExpression, VariableKind}; use crate::parsing::ast::types::{ ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryPart, BodyItem, CallExpression, CallExpressionKw, - CommentStyle, ElseIf, Expr, ExpressionStatement, FnArgType, FunctionExpression, Identifier, IfExpression, - ImportItem, ImportSelector, ImportStatement, KclNone, Literal, LiteralIdentifier, MemberExpression, MemberObject, - NonCodeMeta, NonCodeNode, NonCodeValue, ObjectExpression, ObjectProperty, Parameter, PipeExpression, - PipeSubstitution, Program, ReturnStatement, TagDeclarator, UnaryExpression, VariableDeclaration, - VariableDeclarator, + ElseIf, Expr, ExpressionStatement, FnArgType, FunctionExpression, Identifier, IfExpression, ImportItem, + ImportSelector, ImportStatement, KclNone, Literal, LiteralIdentifier, MemberExpression, MemberObject, + ObjectExpression, ObjectProperty, Parameter, PipeExpression, PipeSubstitution, Program, ReturnStatement, + TagDeclarator, UnaryExpression, VariableDeclaration, VariableDeclarator, }; /// Position-independent digest of the AST node. @@ -82,7 +81,6 @@ impl Program { if let Some(shebang) = &slf.shebang { hasher.update(&shebang.inner.content); } - hasher.update(slf.non_code_meta.compute_digest()); }); } @@ -234,53 +232,6 @@ impl ReturnStatement { }); } -impl CommentStyle { - fn digestable_id(&self) -> [u8; 2] { - match &self { - CommentStyle::Line => *b"//", - CommentStyle::Block => *b"/*", - } - } -} - -impl NonCodeNode { - compute_digest!(|slf, hasher| { - match &slf.value { - NonCodeValue::InlineComment { value, style } => { - hasher.update(value); - hasher.update(style.digestable_id()); - } - NonCodeValue::BlockComment { value, style } => { - hasher.update(value); - hasher.update(style.digestable_id()); - } - NonCodeValue::NewLineBlockComment { value, style } => { - hasher.update(value); - hasher.update(style.digestable_id()); - } - NonCodeValue::NewLine => { - hasher.update(b"\r\n"); - } - } - }); -} - -impl NonCodeMeta { - compute_digest!(|slf, hasher| { - let mut keys = slf.non_code_nodes.keys().copied().collect::>(); - keys.sort(); - - for key in keys.into_iter() { - hasher.update(key.to_ne_bytes()); - let nodes = slf.non_code_nodes.get_mut(&key).unwrap(); - hasher.update(nodes.len().to_ne_bytes()); - for node in nodes.iter_mut() { - hasher.update(node.compute_digest()); - } - } - }); -} - impl ExpressionStatement { compute_digest!(|slf, hasher| { hasher.update(slf.expression.compute_digest()); @@ -416,7 +367,6 @@ impl PipeExpression { for value in slf.body.iter_mut() { hasher.update(value.compute_digest()); } - hasher.update(slf.non_code_meta.compute_digest()); }); }