Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Feb 5, 2025
1 parent fa53ee9 commit b93a38f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 23 deletions.
3 changes: 1 addition & 2 deletions src/wasm-lib/kcl/src/execution/exec_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,9 +1640,8 @@ impl JsonSchema for FunctionParam<'_> {

#[cfg(test)]
mod test {
use crate::parsing::ast::types::{DefaultParamVal, Identifier, Parameter};

use super::*;
use crate::parsing::ast::types::{DefaultParamVal, Identifier, Parameter};

#[test]
fn test_assign_args_to_params() {
Expand Down
19 changes: 9 additions & 10 deletions src/wasm-lib/kcl/src/execution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
use std::{path::PathBuf, sync::Arc};

use anyhow::Result;
pub use artifact::{Artifact, ArtifactCommand, ArtifactGraph, ArtifactId};
pub use cache::bust_cache;
use cache::OldAstState;
pub use cad_op::Operation;
pub use exec_ast::FunctionParam;
pub use geometry::*;
pub(crate) use import::{import_foreign, send_to_engine as send_import_to_engine, ZOO_COORD_SYSTEM};
use indexmap::IndexMap;
pub use kcl_value::{KclObjectFields, KclValue, UnitAngle, UnitLen};
use kcmc::{
each_cmd as mcmd,
ok_response::{output::TakeSnapshot, OkModelingCmdResponse},
websocket::{ModelingSessionData, OkWebSocketResponseData},
ImageFormat, ModelingCmd,
};
use kittycad_modeling_cmds as kcmc;
pub use memory::ProgramMemory;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
pub use state::{ExecState, IdGenerator, MetaSettings};

use crate::{
engine::EngineManager,
Expand All @@ -30,16 +39,6 @@ use crate::{
ExecError, KclErrorWithOutputs,
};

pub use artifact::{Artifact, ArtifactCommand, ArtifactGraph, ArtifactId};
pub use cache::bust_cache;
pub use cad_op::Operation;
pub use exec_ast::FunctionParam;
pub use geometry::*;
pub(crate) use import::{import_foreign, send_to_engine as send_import_to_engine, ZOO_COORD_SYSTEM};
pub use kcl_value::{KclObjectFields, KclValue, UnitAngle, UnitLen};
pub use memory::ProgramMemory;
pub use state::{ExecState, IdGenerator, MetaSettings};

pub(crate) mod annotations;
mod artifact;
pub(crate) mod cache;
Expand Down
3 changes: 1 addition & 2 deletions src/wasm-lib/kcl/src/parsing/ast/modify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use kcmc::{
};
use kittycad_modeling_cmds as kcmc;

use super::types::{CallExpressionKw, Identifier, LabeledArg, LiteralValue};
use crate::{
engine::EngineManager,
errors::{KclError, KclErrorDetails},
Expand All @@ -18,8 +19,6 @@ use crate::{
Program,
};

use super::types::{CallExpressionKw, Identifier, LabeledArg, LiteralValue};

type Point3d = kcmc::shared::Point3d<f64>;

#[derive(Debug)]
Expand Down
3 changes: 1 addition & 2 deletions src/wasm-lib/kcl/src/parsing/ast/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ use crate::{
docs::StdLibFn,
errors::KclError,
execution::{annotations, KclValue, Metadata, TagIdentifier},
parsing::ast::digest::Digest,
parsing::PIPE_OPERATOR,
parsing::{ast::digest::Digest, PIPE_OPERATOR},
source_range::{ModuleId, SourceRange},
};

Expand Down
3 changes: 1 addition & 2 deletions src/wasm-lib/kcl/src/settings/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,11 @@ mod tests {
use pretty_assertions::assert_eq;
use validator::Validate;

use crate::settings::types::CameraOrbitType;

use super::{
AppColor, AppSettings, AppTheme, AppearanceSettings, CameraProjectionType, CommandBarSettings, Configuration,
ModelingSettings, OnboardingStatus, ProjectSettings, Settings, TextEditorSettings, UnitLength,
};
use crate::settings::types::CameraOrbitType;

#[test]
// Test that we can deserialize a project file from the old format.
Expand Down
8 changes: 4 additions & 4 deletions src/wasm-lib/kcl/src/std/helix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::{
std::{axis_or_reference::Axis3dOrEdgeReference, Args},
};


/// Create a helix.
pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let angle_start = args.get_kw_arg("angleStart")?;
Expand All @@ -23,7 +22,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
let axis = args.get_kw_arg("axis")?;
let length = args.get_kw_arg_opt("length")?;

let value = inner_helix(revolutions,angle_start, ccw, radius, axis, length, exec_state, args).await?;
let value = inner_helix(revolutions, angle_start, ccw, radius, axis, length, exec_state, args).await?;
Ok(KclValue::Helix { value })
}

Expand Down Expand Up @@ -95,7 +94,6 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
unlabeled_first = false,
args = {
revolutions = { docs = "Number of revolutions."},
angle_start = { docs = "Start angle (in degrees)."},
ccw = { docs = "Is the helix rotation counter clockwise? The default is `false`.", include_in_snippet = false},
radius = { docs = "Radius of the helix."},
Expand All @@ -112,7 +110,9 @@ async fn inner_helix(
radius: f64,
axis: Axis3dOrEdgeReference,
length: Option<f64>,
exec_state: &mut ExecState, args: Args) -> Result<Box<HelixValue>, KclError> {
exec_state: &mut ExecState,
args: Args,
) -> Result<Box<HelixValue>, KclError> {
let id = exec_state.next_uuid();

let helix_result = Box::new(HelixValue {
Expand Down
1 change: 0 additions & 1 deletion src/wasm-lib/kcl/src/std/sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ pub async fn line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// |> line(end = [-10, 0], tag = $thirdLineOfBox)
/// |> close()
/// |> extrude(length = 5)
///
/// ```
#[stdlib {
name = "line",
Expand Down

0 comments on commit b93a38f

Please sign in to comment.