Add tracking of operations for the feature tree (#4746)
* Add operations tracking for the timeline * Change to only track certain stdlib functions as operations * Update gen files * Add operations to simulation snapshot tests * Add tracking of positional function calls * Fix generated field names to be camel case in TS * Fix generated TS field names to match and better docs * Fix order of ops with patternTransform * Fix sweep to be included * Add new expected test outputs * Add tracking for startSketchOn * Update ops output to include startSketchOn * Fix serde field name * Fix output field name * Add tracking of operations that fail * Add snapshots of operations even when there's a KCL execution error * Add ops output for error executions * Add operations output to executor error * Update op source ranges * Remove tracking of circle() and polygon() since they're not needed * Update output without circle and polygon * Fix to track patternCircular3d and patternLinear3d * Remove tracking for mirror2d * Update ops output * Fix to track the correct source range of function definitions --------- Co-authored-by: Frank Noirot <frank@zoo.dev>
This commit is contained in:
@ -9,6 +9,7 @@ describe('test kclErrToDiagnostic', () => {
|
||||
kind: 'semantic',
|
||||
msg: 'Semantic error',
|
||||
sourceRange: [0, 1, true],
|
||||
operations: [],
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
@ -16,6 +17,7 @@ describe('test kclErrToDiagnostic', () => {
|
||||
kind: 'type',
|
||||
msg: 'Type error',
|
||||
sourceRange: [4, 5, true],
|
||||
operations: [],
|
||||
},
|
||||
]
|
||||
const diagnostics = kclErrorsToDiagnostics(errors)
|
||||
|
@ -6,85 +6,94 @@ import { Diagnostic as LspDiagnostic } from 'vscode-languageserver-protocol'
|
||||
import { Text } from '@codemirror/state'
|
||||
import { EditorView } from 'codemirror'
|
||||
import { SourceRange } from 'lang/wasm'
|
||||
import { Operation } from 'wasm-lib/kcl/bindings/Operation'
|
||||
|
||||
type ExtractKind<T> = T extends { kind: infer K } ? K : never
|
||||
export class KCLError extends Error {
|
||||
kind: ExtractKind<RustKclError> | 'name'
|
||||
sourceRange: SourceRange
|
||||
msg: string
|
||||
operations: Operation[]
|
||||
|
||||
constructor(
|
||||
kind: ExtractKind<RustKclError> | 'name',
|
||||
msg: string,
|
||||
sourceRange: SourceRange
|
||||
sourceRange: SourceRange,
|
||||
operations: Operation[]
|
||||
) {
|
||||
super()
|
||||
this.kind = kind
|
||||
this.msg = msg
|
||||
this.sourceRange = sourceRange
|
||||
this.operations = operations
|
||||
Object.setPrototypeOf(this, KCLError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLLexicalError extends KCLError {
|
||||
constructor(msg: string, sourceRange: SourceRange) {
|
||||
super('lexical', msg, sourceRange)
|
||||
constructor(msg: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('lexical', msg, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLSyntaxError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLInternalError extends KCLError {
|
||||
constructor(msg: string, sourceRange: SourceRange) {
|
||||
super('internal', msg, sourceRange)
|
||||
constructor(msg: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('internal', msg, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLSyntaxError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLSyntaxError extends KCLError {
|
||||
constructor(msg: string, sourceRange: SourceRange) {
|
||||
super('syntax', msg, sourceRange)
|
||||
constructor(msg: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('syntax', msg, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLSyntaxError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLSemanticError extends KCLError {
|
||||
constructor(msg: string, sourceRange: SourceRange) {
|
||||
super('semantic', msg, sourceRange)
|
||||
constructor(msg: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('semantic', msg, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLSemanticError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLTypeError extends KCLError {
|
||||
constructor(msg: string, sourceRange: SourceRange) {
|
||||
super('type', msg, sourceRange)
|
||||
constructor(msg: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('type', msg, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLTypeError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLUnimplementedError extends KCLError {
|
||||
constructor(msg: string, sourceRange: SourceRange) {
|
||||
super('unimplemented', msg, sourceRange)
|
||||
constructor(msg: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('unimplemented', msg, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLUnimplementedError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLUnexpectedError extends KCLError {
|
||||
constructor(msg: string, sourceRange: SourceRange) {
|
||||
super('unexpected', msg, sourceRange)
|
||||
constructor(msg: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('unexpected', msg, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLUnexpectedError.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLValueAlreadyDefined extends KCLError {
|
||||
constructor(key: string, sourceRange: SourceRange) {
|
||||
super('name', `Key ${key} was already defined elsewhere`, sourceRange)
|
||||
constructor(key: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super(
|
||||
'name',
|
||||
`Key ${key} was already defined elsewhere`,
|
||||
sourceRange,
|
||||
operations
|
||||
)
|
||||
Object.setPrototypeOf(this, KCLValueAlreadyDefined.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
export class KCLUndefinedValueError extends KCLError {
|
||||
constructor(key: string, sourceRange: SourceRange) {
|
||||
super('name', `Key ${key} has not been defined`, sourceRange)
|
||||
constructor(key: string, sourceRange: SourceRange, operations: Operation[]) {
|
||||
super('name', `Key ${key} has not been defined`, sourceRange, operations)
|
||||
Object.setPrototypeOf(this, KCLUndefinedValueError.prototype)
|
||||
}
|
||||
}
|
||||
@ -100,11 +109,12 @@ export function lspDiagnosticsToKclErrors(
|
||||
return diagnostics
|
||||
.flatMap(
|
||||
({ range, message }) =>
|
||||
new KCLError('unexpected', message, [
|
||||
posToOffset(doc, range.start)!,
|
||||
posToOffset(doc, range.end)!,
|
||||
true,
|
||||
])
|
||||
new KCLError(
|
||||
'unexpected',
|
||||
message,
|
||||
[posToOffset(doc, range.start)!, posToOffset(doc, range.end)!, true],
|
||||
[]
|
||||
)
|
||||
)
|
||||
.sort((a, b) => {
|
||||
const c = a.sourceRange[0]
|
||||
|
@ -480,7 +480,8 @@ const theExtrude = startSketchOn('XY')
|
||||
new KCLError(
|
||||
'undefined_value',
|
||||
'memory item key `myVarZ` is not defined',
|
||||
[129, 135, true]
|
||||
[129, 135, true],
|
||||
[]
|
||||
)
|
||||
)
|
||||
})
|
||||
|
@ -43,6 +43,7 @@ import { Node } from 'wasm-lib/kcl/bindings/Node'
|
||||
import { CompilationError } from 'wasm-lib/kcl/bindings/CompilationError'
|
||||
import { SourceRange as RustSourceRange } from 'wasm-lib/kcl/bindings/SourceRange'
|
||||
import { getAllCurrentSettings } from 'lib/settings/settingsUtils'
|
||||
import { KclErrorWithOutputs } from 'wasm-lib/kcl/bindings/KclErrorWithOutputs'
|
||||
|
||||
export type { Configuration } from 'wasm-lib/kcl/bindings/Configuration'
|
||||
export type { Program } from '../wasm-lib/kcl/bindings/Program'
|
||||
@ -220,7 +221,8 @@ export const parse = (code: string | Error): ParseResult | Error => {
|
||||
return new KCLError(
|
||||
parsed.kind,
|
||||
parsed.msg,
|
||||
sourceRangeFromRust(parsed.sourceRanges[0])
|
||||
sourceRangeFromRust(parsed.sourceRanges[0]),
|
||||
[]
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -539,11 +541,12 @@ export const _executor = async (
|
||||
return execStateFromRaw(execState)
|
||||
} catch (e: any) {
|
||||
console.log(e)
|
||||
const parsed: RustKclError = JSON.parse(e.toString())
|
||||
const parsed: KclErrorWithOutputs = JSON.parse(e.toString())
|
||||
const kclError = new KCLError(
|
||||
parsed.kind,
|
||||
parsed.msg,
|
||||
sourceRangeFromRust(parsed.sourceRanges[0])
|
||||
parsed.error.kind,
|
||||
parsed.error.msg,
|
||||
sourceRangeFromRust(parsed.error.sourceRanges[0]),
|
||||
parsed.operations
|
||||
)
|
||||
|
||||
return Promise.reject(kclError)
|
||||
@ -602,7 +605,8 @@ export const modifyAstForSketch = async (
|
||||
const kclError = new KCLError(
|
||||
parsed.kind,
|
||||
parsed.msg,
|
||||
sourceRangeFromRust(parsed.sourceRanges[0])
|
||||
sourceRangeFromRust(parsed.sourceRanges[0]),
|
||||
[]
|
||||
)
|
||||
|
||||
console.log(kclError)
|
||||
@ -670,7 +674,8 @@ export function programMemoryInit(): ProgramMemory | Error {
|
||||
return new KCLError(
|
||||
parsed.kind,
|
||||
parsed.msg,
|
||||
sourceRangeFromRust(parsed.sourceRanges[0])
|
||||
sourceRangeFromRust(parsed.sourceRanges[0]),
|
||||
[]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,12 @@ struct StdlibMetadata {
|
||||
#[serde(default)]
|
||||
deprecated: bool,
|
||||
|
||||
/// Whether the function is displayed in the feature tree.
|
||||
/// If true, calls to the function will be available for display.
|
||||
/// If false, calls to the function will never be displayed.
|
||||
#[serde(default)]
|
||||
feature_tree_operation: bool,
|
||||
|
||||
/// If true, expects keyword arguments.
|
||||
/// If false, expects positional arguments.
|
||||
#[serde(default)]
|
||||
@ -244,6 +250,12 @@ fn do_stdlib_inner(
|
||||
quote! { false }
|
||||
};
|
||||
|
||||
let feature_tree_operation = if metadata.feature_tree_operation {
|
||||
quote! { true }
|
||||
} else {
|
||||
quote! { false }
|
||||
};
|
||||
|
||||
let uses_keyword_arguments = if metadata.keywords {
|
||||
quote! { true }
|
||||
} else {
|
||||
@ -470,6 +482,10 @@ fn do_stdlib_inner(
|
||||
#deprecated
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
#feature_tree_operation
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
#code_blocks
|
||||
}
|
||||
|
@ -118,6 +118,10 @@ impl crate::docs::StdLibFn for SomeFn {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["someFn()"];
|
||||
code_blocks
|
||||
|
@ -118,6 +118,10 @@ impl crate::docs::StdLibFn for SomeFn {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["someFn()"];
|
||||
code_blocks
|
||||
|
@ -156,6 +156,10 @@ impl crate::docs::StdLibFn for Show {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec![
|
||||
"This is another code block.\nyes sirrr.\nshow",
|
||||
|
@ -119,6 +119,10 @@ impl crate::docs::StdLibFn for Show {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["This is code.\nIt does other shit.\nshow"];
|
||||
code_blocks
|
||||
|
@ -157,6 +157,10 @@ impl crate::docs::StdLibFn for MyFunc {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec![
|
||||
"This is another code block.\nyes sirrr.\nmyFunc",
|
||||
|
@ -167,6 +167,10 @@ impl crate::docs::StdLibFn for LineTo {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec![
|
||||
"This is another code block.\nyes sirrr.\nlineTo",
|
||||
|
@ -156,6 +156,10 @@ impl crate::docs::StdLibFn for Min {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec![
|
||||
"This is another code block.\nyes sirrr.\nmin",
|
||||
|
@ -119,6 +119,10 @@ impl crate::docs::StdLibFn for Show {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["This is code.\nIt does other shit.\nshow"];
|
||||
code_blocks
|
||||
|
@ -119,6 +119,10 @@ impl crate::docs::StdLibFn for Import {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["This is code.\nIt does other shit.\nimport"];
|
||||
code_blocks
|
||||
|
@ -119,6 +119,10 @@ impl crate::docs::StdLibFn for Import {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["This is code.\nIt does other shit.\nimport"];
|
||||
code_blocks
|
||||
|
@ -119,6 +119,10 @@ impl crate::docs::StdLibFn for Import {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["This is code.\nIt does other shit.\nimport"];
|
||||
code_blocks
|
||||
|
@ -119,6 +119,10 @@ impl crate::docs::StdLibFn for Show {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["This is code.\nIt does other shit.\nshow"];
|
||||
code_blocks
|
||||
|
@ -111,6 +111,10 @@ impl crate::docs::StdLibFn for SomeFunction {
|
||||
false
|
||||
}
|
||||
|
||||
fn feature_tree_operation(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
let code_blocks = vec!["someFunction()"];
|
||||
code_blocks
|
||||
|
@ -165,6 +165,9 @@ pub trait StdLibFn: std::fmt::Debug + Send + Sync {
|
||||
/// If the function is deprecated.
|
||||
fn deprecated(&self) -> bool;
|
||||
|
||||
/// If the function should appear in the feature tree.
|
||||
fn feature_tree_operation(&self) -> bool;
|
||||
|
||||
/// Any example code blocks.
|
||||
fn examples(&self) -> Vec<String>;
|
||||
|
||||
|
@ -3,6 +3,7 @@ use thiserror::Error;
|
||||
use tower_lsp::lsp_types::{Diagnostic, DiagnosticSeverity};
|
||||
|
||||
use crate::{
|
||||
execution::Operation,
|
||||
lsp::IntoDiagnostic,
|
||||
source_range::{ModuleId, SourceRange},
|
||||
};
|
||||
@ -18,6 +19,48 @@ pub enum ExecError {
|
||||
BadPng(String),
|
||||
}
|
||||
|
||||
/// How did the KCL execution fail, with extra state.
|
||||
#[cfg_attr(target_arch = "wasm32", expect(dead_code))]
|
||||
#[derive(Debug)]
|
||||
pub struct ExecErrorWithState {
|
||||
pub error: ExecError,
|
||||
pub exec_state: crate::ExecState,
|
||||
}
|
||||
|
||||
impl ExecErrorWithState {
|
||||
#[cfg_attr(target_arch = "wasm32", expect(dead_code))]
|
||||
pub fn new(error: ExecError, exec_state: crate::ExecState) -> Self {
|
||||
Self { error, exec_state }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ExecError> for ExecErrorWithState {
|
||||
fn from(error: ExecError) -> Self {
|
||||
Self {
|
||||
error,
|
||||
exec_state: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<KclError> for ExecErrorWithState {
|
||||
fn from(error: KclError) -> Self {
|
||||
Self {
|
||||
error: error.into(),
|
||||
exec_state: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ConnectionError> for ExecErrorWithState {
|
||||
fn from(error: ConnectionError) -> Self {
|
||||
Self {
|
||||
error: error.into(),
|
||||
exec_state: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// How did KCL client fail to connect to the engine
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum ConnectionError {
|
||||
@ -57,6 +100,21 @@ pub enum KclError {
|
||||
Internal(KclErrorDetails),
|
||||
}
|
||||
|
||||
#[derive(Error, Debug, Serialize, Deserialize, ts_rs::TS, Clone, PartialEq, Eq)]
|
||||
#[error("{error}")]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KclErrorWithOutputs {
|
||||
pub error: KclError,
|
||||
pub operations: Vec<Operation>,
|
||||
}
|
||||
|
||||
impl KclErrorWithOutputs {
|
||||
pub fn new(error: KclError, operations: Vec<Operation>) -> Self {
|
||||
Self { error, operations }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
#[error("{}", self.error.get_message())]
|
||||
pub struct Report {
|
||||
|
134
src/wasm-lib/kcl/src/execution/cad_op.rs
Normal file
134
src/wasm-lib/kcl/src/execution/cad_op.rs
Normal file
@ -0,0 +1,134 @@
|
||||
use indexmap::IndexMap;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{docs::StdLibFn, std::get_stdlib_fn, SourceRange};
|
||||
|
||||
/// A CAD modeling operation for display in the feature tree, AKA operations
|
||||
/// timeline.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Operation {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
StdLibCall {
|
||||
/// The standard library function being called.
|
||||
#[serde(flatten)]
|
||||
std_lib_fn: StdLibFnRef,
|
||||
/// The unlabeled argument to the function.
|
||||
unlabeled_arg: Option<OpArg>,
|
||||
/// The labeled keyword arguments to the function.
|
||||
labeled_args: IndexMap<String, OpArg>,
|
||||
/// The source range of the operation in the source code.
|
||||
source_range: SourceRange,
|
||||
/// True if the operation resulted in an error.
|
||||
#[serde(default, skip_serializing_if = "is_false")]
|
||||
is_error: bool,
|
||||
},
|
||||
#[serde(rename_all = "camelCase")]
|
||||
UserDefinedFunctionCall {
|
||||
/// The name of the user-defined function being called. Anonymous
|
||||
/// functions have no name.
|
||||
name: Option<String>,
|
||||
/// The location of the function being called so that there's enough
|
||||
/// info to go to its definition.
|
||||
function_source_range: SourceRange,
|
||||
/// The unlabeled argument to the function.
|
||||
unlabeled_arg: Option<OpArg>,
|
||||
/// The labeled keyword arguments to the function.
|
||||
labeled_args: IndexMap<String, OpArg>,
|
||||
/// The source range of the operation in the source code.
|
||||
source_range: SourceRange,
|
||||
},
|
||||
UserDefinedFunctionReturn,
|
||||
}
|
||||
|
||||
impl Operation {
|
||||
/// If the variant is `StdLibCall`, set the `is_error` field.
|
||||
pub(crate) fn set_std_lib_call_is_error(&mut self, is_err: bool) {
|
||||
match self {
|
||||
Self::StdLibCall { ref mut is_error, .. } => *is_error = is_err,
|
||||
Self::UserDefinedFunctionCall { .. } | Self::UserDefinedFunctionReturn => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An argument to a CAD modeling operation.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct OpArg {
|
||||
/// The KCL code expression for the argument. This is used in the UI so
|
||||
/// that the user can edit the expression.
|
||||
source_range: SourceRange,
|
||||
}
|
||||
|
||||
impl OpArg {
|
||||
pub(crate) fn new(source_range: SourceRange) -> Self {
|
||||
Self { source_range }
|
||||
}
|
||||
}
|
||||
|
||||
/// A reference to a standard library function. This exists to implement
|
||||
/// `PartialEq` and `Eq` for `Operation`.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct StdLibFnRef {
|
||||
// The following doc comment gets inlined into Operation, overriding what's
|
||||
// there, in the generated TS. We serialize to its name. Renaming the
|
||||
// field to "name" allows it to match the other variant.
|
||||
/// The standard library function being called.
|
||||
#[serde(
|
||||
rename = "name",
|
||||
serialize_with = "std_lib_fn_name",
|
||||
deserialize_with = "std_lib_fn_from_name"
|
||||
)]
|
||||
#[ts(type = "string", rename = "name")]
|
||||
pub std_lib_fn: Box<dyn StdLibFn>,
|
||||
}
|
||||
|
||||
impl StdLibFnRef {
|
||||
pub(crate) fn new(std_lib_fn: Box<dyn StdLibFn>) -> Self {
|
||||
Self { std_lib_fn }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Box<dyn StdLibFn>> for StdLibFnRef {
|
||||
fn from(std_lib_fn: &Box<dyn StdLibFn>) -> Self {
|
||||
Self::new(std_lib_fn.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for StdLibFnRef {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.std_lib_fn.name() == other.std_lib_fn.name()
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for StdLibFnRef {}
|
||||
|
||||
#[expect(clippy::borrowed_box, reason = "Explicit Box is needed for serde")]
|
||||
fn std_lib_fn_name<S>(std_lib_fn: &Box<dyn StdLibFn>, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
let name = std_lib_fn.name();
|
||||
serializer.serialize_str(&name)
|
||||
}
|
||||
|
||||
fn std_lib_fn_from_name<'de, D>(deserializer: D) -> Result<Box<dyn StdLibFn>, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
let s = String::deserialize(deserializer)?;
|
||||
if let Some(std_lib_fn) = get_stdlib_fn(&s) {
|
||||
Ok(std_lib_fn)
|
||||
} else {
|
||||
Err(serde::de::Error::custom(format!("not a KCL stdlib function: {}", s)))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_false(b: &bool) -> bool {
|
||||
!*b
|
||||
}
|
@ -19,6 +19,8 @@ use crate::{
|
||||
},
|
||||
};
|
||||
|
||||
use super::cad_op::{OpArg, Operation};
|
||||
|
||||
const FLOAT_TO_INT_MAX_DELTA: f64 = 0.01;
|
||||
|
||||
impl BinaryPart {
|
||||
@ -385,10 +387,45 @@ impl Node<CallExpressionKw> {
|
||||
);
|
||||
match ctx.stdlib.get_either(fn_name) {
|
||||
FunctionKind::Core(func) => {
|
||||
let op = if func.feature_tree_operation() {
|
||||
let op_labeled_args = args
|
||||
.kw_args
|
||||
.labeled
|
||||
.iter()
|
||||
.map(|(k, v)| (k.clone(), OpArg::new(v.source_range)))
|
||||
.collect();
|
||||
Some(Operation::StdLibCall {
|
||||
std_lib_fn: (&func).into(),
|
||||
unlabeled_arg: args.kw_args.unlabeled.as_ref().map(|arg| OpArg::new(arg.source_range)),
|
||||
labeled_args: op_labeled_args,
|
||||
source_range: callsite,
|
||||
is_error: false,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
// Attempt to call the function.
|
||||
let mut result = func.std_lib_fn()(exec_state, args).await?;
|
||||
update_memory_for_tags_of_geometry(&mut result, exec_state)?;
|
||||
Ok(result)
|
||||
let result = {
|
||||
// Don't early-return in this block.
|
||||
let result = func.std_lib_fn()(exec_state, args).await;
|
||||
|
||||
if let Some(mut op) = op {
|
||||
op.set_std_lib_call_is_error(result.is_err());
|
||||
// Track call operation. We do this after the call
|
||||
// since things like patternTransform may call user code
|
||||
// before running, and we will likely want to use the
|
||||
// return value. The call takes ownership of the args,
|
||||
// so we need to build the op before the call.
|
||||
exec_state.operations.push(op);
|
||||
}
|
||||
result
|
||||
};
|
||||
|
||||
let mut return_value = result?;
|
||||
update_memory_for_tags_of_geometry(&mut return_value, exec_state)?;
|
||||
|
||||
Ok(return_value)
|
||||
}
|
||||
FunctionKind::UserDefined => {
|
||||
let source_range = SourceRange::from(self);
|
||||
@ -397,6 +434,21 @@ impl Node<CallExpressionKw> {
|
||||
let func = exec_state.memory.get(fn_name, source_range)?.clone();
|
||||
let fn_dynamic_state = exec_state.dynamic_state.merge(&exec_state.memory);
|
||||
|
||||
// Track call operation.
|
||||
let op_labeled_args = args
|
||||
.kw_args
|
||||
.labeled
|
||||
.iter()
|
||||
.map(|(k, v)| (k.clone(), OpArg::new(v.source_range)))
|
||||
.collect();
|
||||
exec_state.operations.push(Operation::UserDefinedFunctionCall {
|
||||
name: Some(fn_name.clone()),
|
||||
function_source_range: func.function_def_source_range().unwrap_or_default(),
|
||||
unlabeled_arg: args.kw_args.unlabeled.as_ref().map(|arg| OpArg::new(arg.source_range)),
|
||||
labeled_args: op_labeled_args,
|
||||
source_range: callsite,
|
||||
});
|
||||
|
||||
let return_value = {
|
||||
let previous_dynamic_state = std::mem::replace(&mut exec_state.dynamic_state, fn_dynamic_state);
|
||||
let result = func
|
||||
@ -423,6 +475,9 @@ impl Node<CallExpressionKw> {
|
||||
})
|
||||
})?;
|
||||
|
||||
// Track return operation.
|
||||
exec_state.operations.push(Operation::UserDefinedFunctionReturn);
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
@ -433,6 +488,7 @@ impl Node<CallExpression> {
|
||||
#[async_recursion]
|
||||
pub async fn execute(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> {
|
||||
let fn_name = &self.callee.name;
|
||||
let callsite = SourceRange::from(self);
|
||||
|
||||
let mut fn_args: Vec<Arg> = Vec::with_capacity(self.arguments.len());
|
||||
|
||||
@ -446,14 +502,50 @@ impl Node<CallExpression> {
|
||||
let arg = Arg::new(value, SourceRange::from(arg_expr));
|
||||
fn_args.push(arg);
|
||||
}
|
||||
let fn_args = fn_args; // remove mutability
|
||||
|
||||
match ctx.stdlib.get_either(fn_name) {
|
||||
FunctionKind::Core(func) => {
|
||||
let op = if func.feature_tree_operation() {
|
||||
let op_labeled_args = func
|
||||
.args(false)
|
||||
.iter()
|
||||
.zip(&fn_args)
|
||||
.map(|(k, v)| (k.name.clone(), OpArg::new(v.source_range)))
|
||||
.collect();
|
||||
Some(Operation::StdLibCall {
|
||||
std_lib_fn: (&func).into(),
|
||||
unlabeled_arg: None,
|
||||
labeled_args: op_labeled_args,
|
||||
source_range: callsite,
|
||||
is_error: false,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
// Attempt to call the function.
|
||||
let args = crate::std::Args::new(fn_args, self.into(), ctx.clone());
|
||||
let mut result = func.std_lib_fn()(exec_state, args).await?;
|
||||
update_memory_for_tags_of_geometry(&mut result, exec_state)?;
|
||||
Ok(result)
|
||||
let result = {
|
||||
// Don't early-return in this block.
|
||||
let result = func.std_lib_fn()(exec_state, args).await;
|
||||
|
||||
if let Some(mut op) = op {
|
||||
op.set_std_lib_call_is_error(result.is_err());
|
||||
// Track call operation. We do this after the call
|
||||
// since things like patternTransform may call user code
|
||||
// before running, and we will likely want to use the
|
||||
// return value. The call takes ownership of the args,
|
||||
// so we need to build the op before the call.
|
||||
exec_state.operations.push(op);
|
||||
}
|
||||
result
|
||||
};
|
||||
|
||||
let mut return_value = result?;
|
||||
update_memory_for_tags_of_geometry(&mut return_value, exec_state)?;
|
||||
|
||||
Ok(return_value)
|
||||
}
|
||||
FunctionKind::UserDefined => {
|
||||
let source_range = SourceRange::from(self);
|
||||
@ -462,6 +554,16 @@ impl Node<CallExpression> {
|
||||
let func = exec_state.memory.get(fn_name, source_range)?.clone();
|
||||
let fn_dynamic_state = exec_state.dynamic_state.merge(&exec_state.memory);
|
||||
|
||||
// Track call operation.
|
||||
exec_state.operations.push(Operation::UserDefinedFunctionCall {
|
||||
name: Some(fn_name.clone()),
|
||||
function_source_range: func.function_def_source_range().unwrap_or_default(),
|
||||
unlabeled_arg: None,
|
||||
// TODO: Add the arguments for legacy positional parameters.
|
||||
labeled_args: Default::default(),
|
||||
source_range: callsite,
|
||||
});
|
||||
|
||||
let return_value = {
|
||||
let previous_dynamic_state = std::mem::replace(&mut exec_state.dynamic_state, fn_dynamic_state);
|
||||
let result = func.call_fn(fn_args, exec_state, ctx.clone()).await.map_err(|e| {
|
||||
@ -485,6 +587,9 @@ impl Node<CallExpression> {
|
||||
})
|
||||
})?;
|
||||
|
||||
// Track return operation.
|
||||
exec_state.operations.push(Operation::UserDefinedFunctionReturn);
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
|
@ -202,6 +202,15 @@ impl KclValue {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn function_def_source_range(&self) -> Option<SourceRange> {
|
||||
let KclValue::Function { expression, .. } = self else {
|
||||
return None;
|
||||
};
|
||||
// TODO: It would be nice if we could extract the source range starting
|
||||
// at the fn, but that's the variable declaration.
|
||||
Some(expression.as_source_range())
|
||||
}
|
||||
|
||||
pub(crate) fn get_solid_set(&self) -> Result<SolidSet> {
|
||||
match self {
|
||||
KclValue::Solid(e) => Ok(SolidSet::Solid(e.clone())),
|
||||
|
@ -24,6 +24,7 @@ pub use function_param::FunctionParam;
|
||||
pub use kcl_value::{KclObjectFields, KclValue};
|
||||
|
||||
pub(crate) mod cache;
|
||||
mod cad_op;
|
||||
mod exec_ast;
|
||||
mod function_param;
|
||||
mod kcl_value;
|
||||
@ -42,6 +43,9 @@ use crate::{
|
||||
ExecError, Program,
|
||||
};
|
||||
|
||||
// Re-exports.
|
||||
pub use cad_op::Operation;
|
||||
|
||||
/// State for executing a program.
|
||||
#[derive(Debug, Default, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
@ -65,6 +69,9 @@ pub struct ExecState {
|
||||
pub path_to_source_id: IndexMap<std::path::PathBuf, ModuleId>,
|
||||
/// Map from module ID to module info.
|
||||
pub module_infos: IndexMap<ModuleId, ModuleInfo>,
|
||||
/// Operations that have been performed in execution order, for display in
|
||||
/// the Feature Tree.
|
||||
pub operations: Vec<Operation>,
|
||||
}
|
||||
|
||||
impl ExecState {
|
||||
|
@ -81,7 +81,7 @@ mod wasm;
|
||||
|
||||
pub use coredump::CoreDump;
|
||||
pub use engine::{EngineManager, ExecutionKind};
|
||||
pub use errors::{CompilationError, ConnectionError, ExecError, KclError};
|
||||
pub use errors::{CompilationError, ConnectionError, ExecError, KclError, KclErrorWithOutputs};
|
||||
pub use execution::{
|
||||
cache::{CacheInformation, OldAstState},
|
||||
ExecState, ExecutorContext, ExecutorSettings,
|
||||
|
@ -91,7 +91,7 @@ async fn execute(test_name: &str, render_to_png: bool) {
|
||||
)
|
||||
.await;
|
||||
match exec_res {
|
||||
Ok((program_memory, png)) => {
|
||||
Ok((program_memory, ops, png)) => {
|
||||
if render_to_png {
|
||||
twenty_twenty::assert_image(format!("tests/{test_name}/rendered_model.png"), &png, 0.99);
|
||||
}
|
||||
@ -104,9 +104,12 @@ async fn execute(test_name: &str, render_to_png: bool) {
|
||||
".environments[].**[].z[]" => rounded_redaction(4),
|
||||
});
|
||||
});
|
||||
assert_snapshot(test_name, "Operations executed", || {
|
||||
insta::assert_json_snapshot!("ops", ops);
|
||||
});
|
||||
}
|
||||
Err(e) => {
|
||||
match e {
|
||||
match e.error {
|
||||
crate::errors::ExecError::Kcl(error) => {
|
||||
// Snapshot the KCL error with a fancy graphical report.
|
||||
// This looks like a Cargo compile error, with arrows pointing
|
||||
@ -122,6 +125,10 @@ async fn execute(test_name: &str, render_to_png: bool) {
|
||||
assert_snapshot(test_name, "Error from executing", || {
|
||||
insta::assert_snapshot!("execution_error", report);
|
||||
});
|
||||
|
||||
assert_snapshot(test_name, "Operations executed", || {
|
||||
insta::assert_json_snapshot!("ops", e.exec_state.operations);
|
||||
});
|
||||
}
|
||||
e => {
|
||||
// These kinds of errors aren't expected to occur. We don't
|
||||
|
@ -98,6 +98,7 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "chamfer",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_chamfer(
|
||||
data: ChamferData,
|
||||
|
@ -75,7 +75,8 @@ pub async fn extrude(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
|
||||
/// example = extrude(10, exampleSketch)
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "extrude"
|
||||
name = "extrude",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_extrude(
|
||||
length: f64,
|
||||
|
@ -119,6 +119,7 @@ pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "fillet",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_fillet(
|
||||
data: FilletData,
|
||||
|
@ -53,6 +53,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "helix",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_helix(
|
||||
data: HelixData,
|
||||
|
@ -177,6 +177,7 @@ pub async fn import(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "import",
|
||||
feature_tree_operation = true,
|
||||
tags = [],
|
||||
}]
|
||||
async fn inner_import(
|
||||
|
@ -111,6 +111,7 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "loft",
|
||||
feature_tree_operation = true,
|
||||
keywords = true,
|
||||
unlabeled_first = true,
|
||||
arg_docs = {
|
||||
|
@ -286,6 +286,7 @@ pub async fn pattern_transform_2d(exec_state: &mut ExecState, args: Args) -> Res
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "patternTransform",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_pattern_transform<'a>(
|
||||
total_instances: u32,
|
||||
@ -762,6 +763,7 @@ pub async fn pattern_linear_3d(exec_state: &mut ExecState, args: Args) -> Result
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "patternLinear3d",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_pattern_linear_3d(
|
||||
data: LinearPattern3dData,
|
||||
@ -981,6 +983,7 @@ pub async fn pattern_circular_3d(exec_state: &mut ExecState, args: Args) -> Resu
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "patternCircular3d",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_pattern_circular_3d(
|
||||
data: CircularPattern3dData,
|
||||
|
@ -142,6 +142,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
|
||||
#[stdlib {
|
||||
name = "offsetPlane",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_offset_plane(
|
||||
std_plane: StandardPlane,
|
||||
|
@ -242,6 +242,7 @@ pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "revolve",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_revolve(
|
||||
data: RevolveData,
|
||||
|
@ -176,6 +176,7 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "shell",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_shell(
|
||||
data: ShellData,
|
||||
@ -302,6 +303,7 @@ pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "hollow",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_hollow(
|
||||
thickness: f64,
|
||||
|
@ -1061,6 +1061,7 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "startSketchOn",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_start_sketch_on(
|
||||
data: SketchData,
|
||||
@ -2218,6 +2219,7 @@ pub async fn hole(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "hole",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_hole(
|
||||
hole_sketch: SketchSet,
|
||||
|
@ -79,6 +79,7 @@ pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "sweep",
|
||||
feature_tree_operation = true,
|
||||
}]
|
||||
async fn inner_sweep(
|
||||
data: SweepData,
|
||||
|
@ -3,7 +3,8 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::{
|
||||
execution::{new_zoo_client, ExecutorContext, ExecutorSettings, ProgramMemory},
|
||||
errors::ExecErrorWithState,
|
||||
execution::{new_zoo_client, ExecutorContext, ExecutorSettings, Operation, ProgramMemory},
|
||||
settings::types::UnitLength,
|
||||
ConnectionError, ExecError, Program,
|
||||
};
|
||||
@ -24,7 +25,10 @@ pub async fn execute_and_snapshot(
|
||||
) -> Result<image::DynamicImage, ExecError> {
|
||||
let ctx = new_context(units, true, project_directory).await?;
|
||||
let program = Program::parse_no_errs(code)?;
|
||||
do_execute_and_snapshot(&ctx, program).await.map(|(_state, snap)| snap)
|
||||
do_execute_and_snapshot(&ctx, program)
|
||||
.await
|
||||
.map(|(_state, snap)| snap)
|
||||
.map_err(|err| err.error)
|
||||
}
|
||||
|
||||
/// Executes a kcl program and takes a snapshot of the result.
|
||||
@ -33,11 +37,11 @@ pub async fn execute_and_snapshot_ast(
|
||||
ast: Program,
|
||||
units: UnitLength,
|
||||
project_directory: Option<PathBuf>,
|
||||
) -> Result<(ProgramMemory, image::DynamicImage), ExecError> {
|
||||
) -> Result<(ProgramMemory, Vec<Operation>, image::DynamicImage), ExecErrorWithState> {
|
||||
let ctx = new_context(units, true, project_directory).await?;
|
||||
do_execute_and_snapshot(&ctx, ast)
|
||||
.await
|
||||
.map(|(state, snap)| (state.memory, snap))
|
||||
.map(|(state, snap)| (state.memory, state.operations, snap))
|
||||
}
|
||||
|
||||
pub async fn execute_and_snapshot_no_auth(
|
||||
@ -47,17 +51,21 @@ pub async fn execute_and_snapshot_no_auth(
|
||||
) -> Result<image::DynamicImage, ExecError> {
|
||||
let ctx = new_context(units, false, project_directory).await?;
|
||||
let program = Program::parse_no_errs(code)?;
|
||||
do_execute_and_snapshot(&ctx, program).await.map(|(_state, snap)| snap)
|
||||
do_execute_and_snapshot(&ctx, program)
|
||||
.await
|
||||
.map(|(_state, snap)| snap)
|
||||
.map_err(|err| err.error)
|
||||
}
|
||||
|
||||
async fn do_execute_and_snapshot(
|
||||
ctx: &ExecutorContext,
|
||||
program: Program,
|
||||
) -> Result<(crate::execution::ExecState, image::DynamicImage), ExecError> {
|
||||
) -> Result<(crate::execution::ExecState, image::DynamicImage), ExecErrorWithState> {
|
||||
let mut exec_state = Default::default();
|
||||
let snapshot_png_bytes = ctx
|
||||
.execute_and_prepare_snapshot(&program, &mut exec_state)
|
||||
.await?
|
||||
.await
|
||||
.map_err(|err| ExecErrorWithState::new(err, exec_state.clone()))?
|
||||
.contents
|
||||
.0;
|
||||
|
||||
@ -65,7 +73,8 @@ async fn do_execute_and_snapshot(
|
||||
let img = image::ImageReader::new(std::io::Cursor::new(snapshot_png_bytes))
|
||||
.with_guessed_format()
|
||||
.map_err(|e| ExecError::BadPng(e.to_string()))
|
||||
.and_then(|x| x.decode().map_err(|e| ExecError::BadPng(e.to_string())))?;
|
||||
.and_then(|x| x.decode().map_err(|e| ExecError::BadPng(e.to_string())))
|
||||
.map_err(|err| ExecErrorWithState::new(err, exec_state.clone()))?;
|
||||
Ok((exec_state, img))
|
||||
}
|
||||
|
||||
|
1926
src/wasm-lib/kcl/tests/add_lots/ops.snap
Normal file
1926
src/wasm-lib/kcl/tests/add_lots/ops.snap
Normal file
File diff suppressed because it is too large
Load Diff
52
src/wasm-lib/kcl/tests/angled_line/ops.snap
Normal file
52
src/wasm-lib/kcl/tests/angled_line/ops.snap
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed angled_line.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
260,
|
||||
261,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
263,
|
||||
264,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
252,
|
||||
265,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
6
src/wasm-lib/kcl/tests/argument_error/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/argument_error/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed argument_error.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/array_elem_push/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/array_elem_push/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed array_elem_push.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/array_elem_push_fail/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/array_elem_push_fail/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed array_elem_push_fail.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/array_index_oob/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/array_index_oob/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed array_index_oob.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/array_range_expr/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/array_range_expr/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed array_range_expr.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed array_range_negative_expr.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
@ -0,0 +1,78 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed basic_fillet_cube_close_opposite.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
181,
|
||||
183,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
185,
|
||||
186,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
173,
|
||||
187,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
200,
|
||||
275,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
277,
|
||||
278,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
193,
|
||||
279,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
78
src/wasm-lib/kcl/tests/basic_fillet_cube_end/ops.snap
Normal file
78
src/wasm-lib/kcl/tests/basic_fillet_cube_end/ops.snap
Normal file
@ -0,0 +1,78 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed basic_fillet_cube_end.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
172,
|
||||
174,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
176,
|
||||
177,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
164,
|
||||
178,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
191,
|
||||
264,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
266,
|
||||
267,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
184,
|
||||
268,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
@ -0,0 +1,78 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed basic_fillet_cube_next_adjacent.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
190,
|
||||
192,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
194,
|
||||
195,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
182,
|
||||
196,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
209,
|
||||
280,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
282,
|
||||
283,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
202,
|
||||
284,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
@ -0,0 +1,78 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed basic_fillet_cube_previous_adjacent.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
190,
|
||||
192,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
194,
|
||||
195,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
182,
|
||||
196,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
209,
|
||||
284,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
286,
|
||||
287,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
202,
|
||||
288,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
78
src/wasm-lib/kcl/tests/basic_fillet_cube_start/ops.snap
Normal file
78
src/wasm-lib/kcl/tests/basic_fillet_cube_start/ops.snap
Normal file
@ -0,0 +1,78 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed basic_fillet_cube_start.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
172,
|
||||
174,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
176,
|
||||
177,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
164,
|
||||
178,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
191,
|
||||
229,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
231,
|
||||
232,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
184,
|
||||
233,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed big_number_angle_to_match_length_x.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
182,
|
||||
184,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
186,
|
||||
187,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
174,
|
||||
188,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed big_number_angle_to_match_length_y.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
182,
|
||||
184,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
186,
|
||||
187,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
174,
|
||||
188,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
104
src/wasm-lib/kcl/tests/circular_pattern3d_a_pattern/ops.snap
Normal file
104
src/wasm-lib/kcl/tests/circular_pattern3d_a_pattern/ops.snap
Normal file
@ -0,0 +1,104 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed circular_pattern3d_a_pattern.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
30,
|
||||
34,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
16,
|
||||
35,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
158,
|
||||
159,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
161,
|
||||
162,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
150,
|
||||
163,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
190,
|
||||
245,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid_set": {
|
||||
"sourceRange": [
|
||||
247,
|
||||
260,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "patternLinear3d",
|
||||
"sourceRange": [
|
||||
174,
|
||||
261,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
290,
|
||||
406,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid_set": {
|
||||
"sourceRange": [
|
||||
408,
|
||||
414,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "patternCircular3d",
|
||||
"sourceRange": [
|
||||
272,
|
||||
415,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
6
src/wasm-lib/kcl/tests/comparisons/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/comparisons/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed comparisons.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/comparisons_multiple/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/comparisons_multiple/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed comparisons_multiple.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/computed_var/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/computed_var/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed computed_var.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
52
src/wasm-lib/kcl/tests/cube/ops.snap
Normal file
52
src/wasm-lib/kcl/tests/cube/ops.snap
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed cube.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "cube",
|
||||
"functionSourceRange": [
|
||||
7,
|
||||
322,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
333,
|
||||
349,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
310,
|
||||
316,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
318,
|
||||
319,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
302,
|
||||
320,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
}
|
||||
]
|
6
src/wasm-lib/kcl/tests/double_map_fn/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/double_map_fn/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed double_map_fn.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
464
src/wasm-lib/kcl/tests/fillet-and-shell/ops.snap
Normal file
464
src/wasm-lib/kcl/tests/fillet-and-shell/ops.snap
Normal file
@ -0,0 +1,464 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed fillet-and-shell.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
764,
|
||||
768,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
750,
|
||||
769,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
963,
|
||||
973,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
975,
|
||||
976,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
955,
|
||||
977,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
990,
|
||||
1189,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
1191,
|
||||
1192,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
983,
|
||||
1193,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "m25Screw",
|
||||
"functionSourceRange": [
|
||||
1206,
|
||||
1442,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
1444,
|
||||
1573,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1247,
|
||||
1251,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
1233,
|
||||
1252,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"hole_sketch": {
|
||||
"sourceRange": [
|
||||
1350,
|
||||
1395,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch": {
|
||||
"sourceRange": [
|
||||
1397,
|
||||
1398,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "hole",
|
||||
"sourceRange": [
|
||||
1345,
|
||||
1399,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1415,
|
||||
1421,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1423,
|
||||
1424,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1407,
|
||||
1425,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "m25Screw",
|
||||
"functionSourceRange": [
|
||||
1206,
|
||||
1442,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
1575,
|
||||
1702,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1247,
|
||||
1251,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
1233,
|
||||
1252,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"hole_sketch": {
|
||||
"sourceRange": [
|
||||
1350,
|
||||
1395,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch": {
|
||||
"sourceRange": [
|
||||
1397,
|
||||
1398,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "hole",
|
||||
"sourceRange": [
|
||||
1345,
|
||||
1399,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1415,
|
||||
1421,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1423,
|
||||
1424,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1407,
|
||||
1425,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "m25Screw",
|
||||
"functionSourceRange": [
|
||||
1206,
|
||||
1442,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
1704,
|
||||
1829,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1247,
|
||||
1251,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
1233,
|
||||
1252,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"hole_sketch": {
|
||||
"sourceRange": [
|
||||
1350,
|
||||
1395,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch": {
|
||||
"sourceRange": [
|
||||
1397,
|
||||
1398,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "hole",
|
||||
"sourceRange": [
|
||||
1345,
|
||||
1399,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1415,
|
||||
1421,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1423,
|
||||
1424,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1407,
|
||||
1425,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "m25Screw",
|
||||
"functionSourceRange": [
|
||||
1206,
|
||||
1442,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
1831,
|
||||
1958,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1247,
|
||||
1251,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
1233,
|
||||
1252,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"hole_sketch": {
|
||||
"sourceRange": [
|
||||
1350,
|
||||
1395,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch": {
|
||||
"sourceRange": [
|
||||
1397,
|
||||
1398,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "hole",
|
||||
"sourceRange": [
|
||||
1345,
|
||||
1399,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1415,
|
||||
1421,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1423,
|
||||
1424,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1407,
|
||||
1425,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1966,
|
||||
2016,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid_set": {
|
||||
"sourceRange": [
|
||||
2018,
|
||||
2022,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "shell",
|
||||
"sourceRange": [
|
||||
1960,
|
||||
2023,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
71
src/wasm-lib/kcl/tests/function_sketch/ops.snap
Normal file
71
src/wasm-lib/kcl/tests/function_sketch/ops.snap
Normal file
@ -0,0 +1,71 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed function_sketch.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "box",
|
||||
"functionSourceRange": [
|
||||
6,
|
||||
205,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
215,
|
||||
228,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
42,
|
||||
46,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
28,
|
||||
47,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
182,
|
||||
183,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
185,
|
||||
186,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
174,
|
||||
187,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
}
|
||||
]
|
@ -0,0 +1,71 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed function_sketch_with_position.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "box",
|
||||
"functionSourceRange": [
|
||||
6,
|
||||
203,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
213,
|
||||
234,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
45,
|
||||
49,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
31,
|
||||
50,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
180,
|
||||
181,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
183,
|
||||
184,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
172,
|
||||
185,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
}
|
||||
]
|
78
src/wasm-lib/kcl/tests/helix_ccw/ops.snap
Normal file
78
src/wasm-lib/kcl/tests/helix_ccw/ops.snap
Normal file
@ -0,0 +1,78 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed helix_ccw.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
92,
|
||||
94,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
96,
|
||||
97,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
84,
|
||||
98,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
110,
|
||||
184,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
186,
|
||||
187,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "helix",
|
||||
"sourceRange": [
|
||||
104,
|
||||
188,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
59
src/wasm-lib/kcl/tests/i_shape/ops.snap
Normal file
59
src/wasm-lib/kcl/tests/i_shape/ops.snap
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed i_shape.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"hole_sketch": {
|
||||
"sourceRange": [
|
||||
2348,
|
||||
2353,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch": {
|
||||
"sourceRange": [
|
||||
2355,
|
||||
2356,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "hole",
|
||||
"sourceRange": [
|
||||
2343,
|
||||
2357,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
2371,
|
||||
2374,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
2376,
|
||||
2377,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
2363,
|
||||
2378,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
6
src/wasm-lib/kcl/tests/if_else/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/if_else/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed if_else.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/import_constant/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/import_constant/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed import_constant.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/import_cycle1/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/import_cycle1/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed import_cycle1.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/import_export/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/import_export/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed import_export.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/import_glob/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/import_glob/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed import_glob.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
27
src/wasm-lib/kcl/tests/import_side_effect/ops.snap
Normal file
27
src/wasm-lib/kcl/tests/import_side_effect/ops.snap
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed import_side_effect.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"isError": true,
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
95,
|
||||
99,
|
||||
1
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
81,
|
||||
100,
|
||||
1
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
6
src/wasm-lib/kcl/tests/index_of_array/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/index_of_array/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed index_of_array.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/invalid_index_fractional/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/invalid_index_fractional/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed invalid_index_fractional.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/invalid_index_negative/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/invalid_index_negative/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed invalid_index_negative.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/invalid_index_str/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/invalid_index_str/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed invalid_index_str.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/invalid_member_object/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/invalid_member_object/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed invalid_member_object.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed invalid_member_object_prop.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
52
src/wasm-lib/kcl/tests/kittycad_svg/ops.snap
Normal file
52
src/wasm-lib/kcl/tests/kittycad_svg/ops.snap
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed kittycad_svg.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
20,
|
||||
24,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
6,
|
||||
25,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
15826,
|
||||
15827,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
15829,
|
||||
15830,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
15818,
|
||||
15831,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
59
src/wasm-lib/kcl/tests/kw_fn/ops.snap
Normal file
59
src/wasm-lib/kcl/tests/kw_fn/ops.snap
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed kw_fn.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "increment",
|
||||
"functionSourceRange": [
|
||||
12,
|
||||
35,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
85,
|
||||
97,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "add",
|
||||
"functionSourceRange": [
|
||||
43,
|
||||
77,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": {
|
||||
"sourceRange": [
|
||||
110,
|
||||
111,
|
||||
0
|
||||
]
|
||||
},
|
||||
"labeledArgs": {
|
||||
"delta": {
|
||||
"sourceRange": [
|
||||
121,
|
||||
122,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"sourceRange": [
|
||||
106,
|
||||
123,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
}
|
||||
]
|
31
src/wasm-lib/kcl/tests/kw_fn_too_few_args/ops.snap
Normal file
31
src/wasm-lib/kcl/tests/kw_fn_too_few_args/ops.snap
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed kw_fn_too_few_args.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "add",
|
||||
"functionSourceRange": [
|
||||
6,
|
||||
31,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {
|
||||
"x": {
|
||||
"sourceRange": [
|
||||
49,
|
||||
50,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"sourceRange": [
|
||||
41,
|
||||
51,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
@ -0,0 +1,31 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed kw_fn_unlabeled_but_has_label.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "add",
|
||||
"functionSourceRange": [
|
||||
6,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {
|
||||
"x": {
|
||||
"sourceRange": [
|
||||
45,
|
||||
46,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"sourceRange": [
|
||||
37,
|
||||
47,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
59
src/wasm-lib/kcl/tests/kw_fn_with_defaults/ops.snap
Normal file
59
src/wasm-lib/kcl/tests/kw_fn_with_defaults/ops.snap
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed kw_fn_with_defaults.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "increment",
|
||||
"functionSourceRange": [
|
||||
12,
|
||||
45,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
53,
|
||||
65,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "increment",
|
||||
"functionSourceRange": [
|
||||
12,
|
||||
45,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": {
|
||||
"sourceRange": [
|
||||
88,
|
||||
89,
|
||||
0
|
||||
]
|
||||
},
|
||||
"labeledArgs": {
|
||||
"by": {
|
||||
"sourceRange": [
|
||||
96,
|
||||
98,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"sourceRange": [
|
||||
78,
|
||||
99,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
}
|
||||
]
|
104
src/wasm-lib/kcl/tests/linear_pattern3d_a_pattern/ops.snap
Normal file
104
src/wasm-lib/kcl/tests/linear_pattern3d_a_pattern/ops.snap
Normal file
@ -0,0 +1,104 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed linear_pattern3d_a_pattern.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
30,
|
||||
34,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
16,
|
||||
35,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
158,
|
||||
159,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
161,
|
||||
162,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
150,
|
||||
163,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
190,
|
||||
245,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid_set": {
|
||||
"sourceRange": [
|
||||
247,
|
||||
260,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "patternLinear3d",
|
||||
"sourceRange": [
|
||||
174,
|
||||
261,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
288,
|
||||
343,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid_set": {
|
||||
"sourceRange": [
|
||||
345,
|
||||
351,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "patternLinear3d",
|
||||
"sourceRange": [
|
||||
272,
|
||||
352,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
52
src/wasm-lib/kcl/tests/mike_stress_test/ops.snap
Normal file
52
src/wasm-lib/kcl/tests/mike_stress_test/ops.snap
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed mike_stress_test.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
74110,
|
||||
74111,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
74113,
|
||||
74114,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
74102,
|
||||
74115,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
52
src/wasm-lib/kcl/tests/neg_xz_plane/ops.snap
Normal file
52
src/wasm-lib/kcl/tests/neg_xz_plane/ops.snap
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed neg_xz_plane.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
29,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
141,
|
||||
146,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
148,
|
||||
149,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
133,
|
||||
150,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
6
src/wasm-lib/kcl/tests/non_string_key_of_object/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/non_string_key_of_object/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed non_string_key_of_object.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
6
src/wasm-lib/kcl/tests/object_prop_not_found/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/object_prop_not_found/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed object_prop_not_found.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
52
src/wasm-lib/kcl/tests/parametric/ops.snap
Normal file
52
src/wasm-lib/kcl/tests/parametric/ops.snap
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed parametric.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
242,
|
||||
246,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
228,
|
||||
247,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
458,
|
||||
463,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
465,
|
||||
466,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
450,
|
||||
467,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
33
src/wasm-lib/kcl/tests/parametric_with_tan_arc/ops.snap
Normal file
33
src/wasm-lib/kcl/tests/parametric_with_tan_arc/ops.snap
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed parametric_with_tan_arc.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
588,
|
||||
593,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
595,
|
||||
596,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
580,
|
||||
597,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
246
src/wasm-lib/kcl/tests/pentagon_fillet_sugar/ops.snap
Normal file
246
src/wasm-lib/kcl/tests/pentagon_fillet_sugar/ops.snap
Normal file
@ -0,0 +1,246 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed pentagon_fillet_sugar.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
154,
|
||||
158,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
140,
|
||||
159,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
389,
|
||||
403,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
405,
|
||||
406,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
381,
|
||||
407,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "circl",
|
||||
"functionSourceRange": [
|
||||
417,
|
||||
567,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
574,
|
||||
588,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
452,
|
||||
453,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
455,
|
||||
459,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
438,
|
||||
460,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
616,
|
||||
626,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
628,
|
||||
629,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
608,
|
||||
630,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
643,
|
||||
763,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
765,
|
||||
766,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
636,
|
||||
767,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "circl",
|
||||
"functionSourceRange": [
|
||||
417,
|
||||
567,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
773,
|
||||
786,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
452,
|
||||
453,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
455,
|
||||
459,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
438,
|
||||
460,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
814,
|
||||
824,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
826,
|
||||
827,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
806,
|
||||
828,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
841,
|
||||
961,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
963,
|
||||
964,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
834,
|
||||
965,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
71
src/wasm-lib/kcl/tests/pipe_as_arg/ops.snap
Normal file
71
src/wasm-lib/kcl/tests/pipe_as_arg/ops.snap
Normal file
@ -0,0 +1,71 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed pipe_as_arg.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "double",
|
||||
"functionSourceRange": [
|
||||
333,
|
||||
355,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
408,
|
||||
417,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "cube",
|
||||
"functionSourceRange": [
|
||||
7,
|
||||
322,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
394,
|
||||
426,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
310,
|
||||
316,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
318,
|
||||
319,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
302,
|
||||
320,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
}
|
||||
]
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed pipe_substitution_inside_function_called_from_pipeline.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
97
src/wasm-lib/kcl/tests/poop_chute/ops.snap
Normal file
97
src/wasm-lib/kcl/tests/poop_chute/ops.snap
Normal file
@ -0,0 +1,97 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed poop_chute.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
196,
|
||||
201,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
182,
|
||||
202,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
822,
|
||||
940,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch": {
|
||||
"sourceRange": [
|
||||
942,
|
||||
951,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "revolve",
|
||||
"sourceRange": [
|
||||
814,
|
||||
952,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
980,
|
||||
985,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
966,
|
||||
986,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1601,
|
||||
1621,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1623,
|
||||
1624,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1593,
|
||||
1625,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
6
src/wasm-lib/kcl/tests/property_of_object/ops.snap
Normal file
6
src/wasm-lib/kcl/tests/property_of_object/ops.snap
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed property_of_object.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[]
|
90
src/wasm-lib/kcl/tests/riddle_small/ops.snap
Normal file
90
src/wasm-lib/kcl/tests/riddle_small/ops.snap
Normal file
@ -0,0 +1,90 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed riddle_small.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "t",
|
||||
"functionSourceRange": [
|
||||
20,
|
||||
66,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
102,
|
||||
107,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "t",
|
||||
"functionSourceRange": [
|
||||
20,
|
||||
66,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
125,
|
||||
130,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
155,
|
||||
159,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
141,
|
||||
160,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
286,
|
||||
287,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
289,
|
||||
290,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
278,
|
||||
291,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
@ -0,0 +1,222 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
26,
|
||||
30,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
12,
|
||||
31,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
447,
|
||||
450,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
452,
|
||||
461,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
439,
|
||||
462,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
475,
|
||||
506,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
508,
|
||||
509,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
468,
|
||||
510,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
524,
|
||||
591,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
593,
|
||||
594,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
596,
|
||||
602,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "chamfer",
|
||||
"sourceRange": [
|
||||
516,
|
||||
603,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
617,
|
||||
648,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
650,
|
||||
651,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
653,
|
||||
659,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "chamfer",
|
||||
"sourceRange": [
|
||||
609,
|
||||
660,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
688,
|
||||
698,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
700,
|
||||
705,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
674,
|
||||
706,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1127,
|
||||
1137,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
1139,
|
||||
1144,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
1113,
|
||||
1145,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1563,
|
||||
1565,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1567,
|
||||
1576,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1555,
|
||||
1577,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
222
src/wasm-lib/kcl/tests/sketch-on-chamfer-two-times/ops.snap
Normal file
222
src/wasm-lib/kcl/tests/sketch-on-chamfer-two-times/ops.snap
Normal file
@ -0,0 +1,222 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed sketch-on-chamfer-two-times.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
26,
|
||||
30,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
12,
|
||||
31,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
447,
|
||||
450,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
452,
|
||||
461,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
439,
|
||||
462,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
475,
|
||||
506,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
508,
|
||||
509,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
468,
|
||||
510,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
524,
|
||||
555,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
557,
|
||||
558,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
560,
|
||||
566,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "chamfer",
|
||||
"sourceRange": [
|
||||
516,
|
||||
567,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
581,
|
||||
648,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
650,
|
||||
651,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
653,
|
||||
659,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "chamfer",
|
||||
"sourceRange": [
|
||||
573,
|
||||
660,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
688,
|
||||
698,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
700,
|
||||
705,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
674,
|
||||
706,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1127,
|
||||
1137,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
1139,
|
||||
1144,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
1113,
|
||||
1145,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1563,
|
||||
1565,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1567,
|
||||
1576,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1555,
|
||||
1577,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
135
src/wasm-lib/kcl/tests/sketch_in_object/ops.snap
Normal file
135
src/wasm-lib/kcl/tests/sketch_in_object/ops.snap
Normal file
@ -0,0 +1,135 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed sketch_in_object.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "test",
|
||||
"functionSourceRange": [
|
||||
7,
|
||||
161,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
393,
|
||||
399,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
35,
|
||||
39,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
21,
|
||||
40,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
415,
|
||||
418,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
420,
|
||||
421,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
407,
|
||||
422,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionCall",
|
||||
"name": "test2",
|
||||
"functionSourceRange": [
|
||||
171,
|
||||
387,
|
||||
0
|
||||
],
|
||||
"unlabeledArg": null,
|
||||
"labeledArgs": {},
|
||||
"sourceRange": [
|
||||
429,
|
||||
436,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
231,
|
||||
235,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
217,
|
||||
236,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"type": "UserDefinedFunctionReturn"
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
467,
|
||||
469,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
471,
|
||||
472,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
459,
|
||||
473,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
104
src/wasm-lib/kcl/tests/sketch_on_face/ops.snap
Normal file
104
src/wasm-lib/kcl/tests/sketch_on_face/ops.snap
Normal file
@ -0,0 +1,104 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed sketch_on_face.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
24,
|
||||
28,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
10,
|
||||
29,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
193,
|
||||
194,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
196,
|
||||
197,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
185,
|
||||
198,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
224,
|
||||
231,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
233,
|
||||
237,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
210,
|
||||
238,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
364,
|
||||
365,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
367,
|
||||
368,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
356,
|
||||
369,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
@ -0,0 +1,156 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed sketch_on_face_after_fillets_referencing_face.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1006,
|
||||
1010,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
992,
|
||||
1011,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1280,
|
||||
1285,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1287,
|
||||
1288,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1272,
|
||||
1289,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1302,
|
||||
1382,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
1384,
|
||||
1385,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
1295,
|
||||
1386,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1399,
|
||||
1491,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid": {
|
||||
"sourceRange": [
|
||||
1493,
|
||||
1494,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "fillet",
|
||||
"sourceRange": [
|
||||
1392,
|
||||
1495,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
1523,
|
||||
1530,
|
||||
0
|
||||
]
|
||||
},
|
||||
"tag": {
|
||||
"sourceRange": [
|
||||
1532,
|
||||
1537,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
1509,
|
||||
1538,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"length": {
|
||||
"sourceRange": [
|
||||
1740,
|
||||
1742,
|
||||
0
|
||||
]
|
||||
},
|
||||
"sketch_set": {
|
||||
"sourceRange": [
|
||||
1744,
|
||||
1745,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "extrude",
|
||||
"sourceRange": [
|
||||
1732,
|
||||
1746,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
}
|
||||
]
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user