Compare commits

...

8 Commits

Author SHA1 Message Date
f650281855 KCL: Fix duplicate 'type' key 2024-10-17 20:37:05 -07:00
9f6999829a Fix broken digest code (#4206)
I broke the typescript bindings in https://github.com/KittyCAD/modeling-app/pull/4193 -- basically the `digest: Option<Digest>` fields previously allowed Typescript to not set a value for the `digest` key at all, but somehow my change made it required in the Typescript.

Fix is to apply `#[ts(optional)]`, see docs at https://docs.rs/ts-rs/latest/ts_rs/trait.TS.html#struct-field-attributes
2024-10-17 20:36:40 -07:00
a14bbaa237 Update machine-api spec (#4205)
* YOYO NEW API SPEC!

* New machine-api types

* empty

* Update .codespellrc

* Update .codespellrc

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2024-10-17 20:01:34 -07:00
0706624381 KCL: Refactor array-indexing code (#4173)
Neater code, and better error messages.
2024-10-17 16:29:27 -07:00
ef0ae5e06e Add syntax highlighting for comparison operators (#4182)
* Add syntax highlighting for comparison operators

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* Confirm

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-10-17 23:29:13 +00:00
a010743abb KCL: Skip serializing default values for AST nodes (#4193)
This will make our snapshots and JSON representations easier to read (making our tests less verbose).
2024-10-17 16:22:40 -07:00
057ee479c3 Update machine-api spec (#4201)
* YOYO NEW API SPEC!

* New machine-api types

* empt

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
2024-10-17 16:03:55 -07:00
7218efc489 Fix weird machine api behavior/add status (#4186)
* YOYO NEW API SPEC!

* fies

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add status

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* pass disabled

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* disabled

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add nozzle diameter

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* ypdates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update types

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update types

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update types

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Paul Tagliamonte <paul@zoo.dev>
2024-10-17 15:30:46 -07:00
94 changed files with 2021 additions and 2744 deletions

View File

@ -1,3 +1,3 @@
[codespell]
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast,ue,afterall
skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock
skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock,./openapi/*.json,./src/lib/machine-api.d.ts

View File

@ -82652,7 +82652,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start"
],
"properties": {
@ -83209,7 +83208,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start",
"type"
],
@ -86410,7 +86408,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start"
],
"properties": {
@ -86967,7 +86964,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start",
"type"
],
@ -90172,7 +90168,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start"
],
"properties": {
@ -90729,7 +90724,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start",
"type"
],
@ -114786,7 +114780,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start"
],
"properties": {
@ -115343,7 +115336,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start",
"type"
],
@ -118937,7 +118929,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start"
],
"properties": {
@ -119494,7 +119485,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start",
"type"
],
@ -122695,7 +122685,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start"
],
"properties": {
@ -123252,7 +123241,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start",
"type"
],
@ -126451,7 +126439,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start"
],
"properties": {
@ -127008,7 +126995,6 @@
"required": [
"body",
"end",
"nonCodeMeta",
"start",
"type"
],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

2
interface.d.ts vendored
View File

@ -67,7 +67,7 @@ export interface IElectronAPI {
}
}
kittycad: (access: string, args: any) => any
listMachines: () => Promise<MachinesListing>
listMachines: (machineApiIp: string) => Promise<MachinesListing>
getMachineApiIp: () => Promise<string | null>
onUpdateDownloadStart: (
callback: (value: { version: string }) => void

View File

@ -36,38 +36,297 @@
"description": "Extra machine-specific information regarding a connected machine.",
"oneOf": [
{
"additionalProperties": false,
"properties": {
"Moonraker": {
"type": "object"
"type": {
"enum": [
"moonraker"
],
"type": "string"
}
},
"required": [
"Moonraker"
"type"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"Usb": {
"type": "object"
"type": {
"enum": [
"usb"
],
"type": "string"
}
},
"required": [
"Usb"
"type"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"Bambu": {
"type": "object"
"current_stage": {
"allOf": [
{
"$ref": "#/components/schemas/Stage"
}
],
"description": "The current stage of the machine as defined by Bambu which can include errors, etc.",
"nullable": true
},
"nozzle_diameter": {
"allOf": [
{
"$ref": "#/components/schemas/NozzleDiameter"
}
],
"description": "The nozzle diameter of the machine."
},
"type": {
"enum": [
"bambu"
],
"type": "string"
}
},
"required": [
"Bambu"
"nozzle_diameter",
"type"
],
"type": "object"
}
]
},
"FdmHardwareConfiguration": {
"description": "Configuration for a FDM-based printer.",
"properties": {
"filaments": {
"description": "The filaments the printer has access to.",
"items": {
"$ref": "#/components/schemas/Filament"
},
"type": "array"
},
"nozzle_diameter": {
"description": "Diameter of the extrusion nozzle, in mm.",
"format": "double",
"type": "number"
}
},
"required": [
"filaments",
"nozzle_diameter"
],
"type": "object"
},
"Filament": {
"description": "Information about the filament being used in a FDM printer.",
"properties": {
"color": {
"description": "The color (as hex without the `#`) of the filament, this is likely specific to the manufacturer.",
"maxLength": 6,
"minLength": 6,
"nullable": true,
"type": "string"
},
"material": {
"allOf": [
{
"$ref": "#/components/schemas/FilamentMaterial"
}
],
"description": "The material that the filament is made of."
},
"name": {
"description": "The name of the filament, this is likely specfic to the manufacturer.",
"nullable": true,
"type": "string"
}
},
"required": [
"material"
],
"type": "object"
},
"FilamentMaterial": {
"description": "The material that the filament is made of.",
"oneOf": [
{
"description": "Polylactic acid based plastics",
"properties": {
"type": {
"enum": [
"pla"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "Pla support",
"properties": {
"type": {
"enum": [
"pla_support"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "acrylonitrile butadiene styrene based plastics",
"properties": {
"type": {
"enum": [
"abs"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "polyethylene terephthalate glycol based plastics",
"properties": {
"type": {
"enum": [
"petg"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "unsuprisingly, nylon based",
"properties": {
"type": {
"enum": [
"nylon"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "thermoplastic polyurethane based urethane material",
"properties": {
"type": {
"enum": [
"tpu"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "polyvinyl alcohol based material",
"properties": {
"type": {
"enum": [
"pva"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "high impact polystyrene based material",
"properties": {
"type": {
"enum": [
"hips"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "composite material with stuff in other stuff, something like PLA mixed with carbon fiber, kevlar, or fiberglass",
"properties": {
"type": {
"enum": [
"composite"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
]
},
"HardwareConfiguration": {
"description": "The hardware configuration of a machine.",
"oneOf": [
{
"description": "No configuration is possible. This isn't the same conceptually as an `Option<HardwareConfiguration>`, because this indicates we positively know there is no possible configuration changes that are possible with this method of manufcture.",
"properties": {
"type": {
"enum": [
"none"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"description": "Hardware configuration specific to FDM based printers",
"properties": {
"config": {
"allOf": [
{
"$ref": "#/components/schemas/FdmHardwareConfiguration"
}
],
"description": "The configuration for the FDM printer."
},
"type": {
"enum": [
"fdm"
],
"type": "string"
}
},
"required": [
"config",
"type"
],
"type": "object"
}
@ -85,6 +344,14 @@
"description": "Additional, per-machine information which is specific to the underlying machine type.",
"nullable": true
},
"hardware_configuration": {
"allOf": [
{
"$ref": "#/components/schemas/HardwareConfiguration"
}
],
"description": "Information about how the Machine is currently configured."
},
"id": {
"description": "Machine Identifier (ID) for the specific Machine.",
"type": "string"
@ -114,6 +381,12 @@
"description": "Maximum part size that can be manufactured by this device. This may be some sort of theoretical upper bound, getting close to this limit seems like maybe a bad idea.\n\nThis may be `None` if the maximum size is not knowable by the Machine API.\n\nWhat \"close\" means is up to you!",
"nullable": true
},
"progress": {
"description": "Progress of the current print, if printing.",
"format": "double",
"nullable": true,
"type": "number"
},
"state": {
"allOf": [
{
@ -124,6 +397,7 @@
}
},
"required": [
"hardware_configuration",
"id",
"machine_type",
"make_model",
@ -157,57 +431,111 @@
"oneOf": [
{
"description": "If a print state can not be resolved at this time, an Unknown may be returned.",
"enum": [
"Unknown"
],
"type": "string"
},
{
"description": "Idle, and ready for another job.",
"enum": [
"Idle"
],
"type": "string"
},
{
"description": "Running a job -- 3D printing or CNC-ing a part.",
"enum": [
"Running"
],
"type": "string"
},
{
"description": "Machine is currently offline or unreachable.",
"enum": [
"Offline"
],
"type": "string"
},
{
"description": "Job is underway but halted, waiting for some action to take place.",
"enum": [
"Paused"
],
"type": "string"
},
{
"description": "Job is finished, but waiting manual action to move back to Idle.",
"enum": [
"Complete"
],
"type": "string"
},
{
"additionalProperties": false,
"description": "The printer has failed and is in an unknown state that may require manual attention to resolve. The inner value is a human readable description of what specifically has failed.",
"properties": {
"Failed": {
"nullable": true,
"state": {
"enum": [
"unknown"
],
"type": "string"
}
},
"required": [
"Failed"
"state"
],
"type": "object"
},
{
"description": "Idle, and ready for another job.",
"properties": {
"state": {
"enum": [
"idle"
],
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
{
"description": "Running a job -- 3D printing or CNC-ing a part.",
"properties": {
"state": {
"enum": [
"running"
],
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
{
"description": "Machine is currently offline or unreachable.",
"properties": {
"state": {
"enum": [
"offline"
],
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
{
"description": "Job is underway but halted, waiting for some action to take place.",
"properties": {
"state": {
"enum": [
"paused"
],
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
{
"description": "Job is finished, but waiting manual action to move back to Idle.",
"properties": {
"state": {
"enum": [
"complete"
],
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
},
{
"description": "The printer has failed and is in an unknown state that may require manual attention to resolve. The inner value is a human readable description of what specifically has failed.",
"properties": {
"message": {
"description": "A human-readable message describing the failure.",
"nullable": true,
"type": "string"
},
"state": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"state"
],
"type": "object"
}
@ -219,21 +547,54 @@
{
"description": "Use light to cure a resin to build up layers.",
"enum": [
"Stereolithography"
"stereolithography"
],
"type": "string"
},
{
"description": "Fused Deposition Modeling, layers of melted plastic.",
"enum": [
"FusedDeposition"
"fused_deposition"
],
"type": "string"
},
{
"description": "\"Computer numerical control\" - machine that grinds away material from a hunk of material to construct a part.",
"enum": [
"Cnc"
"cnc"
],
"type": "string"
}
]
},
"NozzleDiameter": {
"description": "A nozzle diameter.",
"oneOf": [
{
"description": "0.2mm.",
"enum": [
"0.2"
],
"type": "string"
},
{
"description": "0.4mm.",
"enum": [
"0.4"
],
"type": "string"
},
{
"description": "0.6mm.",
"enum": [
"0.6"
],
"type": "string"
},
{
"description": "0.8mm.",
"enum": [
"0.8"
],
"type": "string"
}
@ -284,6 +645,15 @@
"machine_id": {
"description": "The machine id to print to.",
"type": "string"
},
"slicer_configuration": {
"allOf": [
{
"$ref": "#/components/schemas/SlicerConfiguration"
}
],
"description": "Requested design-specific slicer configurations.",
"nullable": true
}
},
"required": [
@ -292,6 +662,283 @@
],
"type": "object"
},
"SlicerConfiguration": {
"description": "The slicer configuration is a set of parameters that are passed to the slicer to control how the gcode is generated.",
"properties": {
"filament_idx": {
"description": "The filament to use for the print.",
"format": "uint",
"minimum": 0,
"nullable": true,
"type": "integer"
}
},
"type": "object"
},
"Stage": {
"description": "The print stage. These come from: https://github.com/SoftFever/OrcaSlicer/blob/431978baf17961df90f0d01871b0ad1d839d7f5d/src/slic3r/GUI/DeviceManager.cpp#L78",
"oneOf": [
{
"description": "Nothing.",
"enum": [
"nothing"
],
"type": "string"
},
{
"description": "Empty.",
"enum": [
"empty"
],
"type": "string"
},
{
"description": "Auto bed leveling.",
"enum": [
"auto_bed_leveling"
],
"type": "string"
},
{
"description": "Heatbed preheating.",
"enum": [
"heatbed_preheating"
],
"type": "string"
},
{
"description": "Sweeping XY mech mode.",
"enum": [
"sweeping_xy_mech_mode"
],
"type": "string"
},
{
"description": "Changing filament.",
"enum": [
"changing_filament"
],
"type": "string"
},
{
"description": "M400 pause.",
"enum": [
"m400_pause"
],
"type": "string"
},
{
"description": "Paused due to filament runout.",
"enum": [
"paused_due_to_filament_runout"
],
"type": "string"
},
{
"description": "Heating hotend.",
"enum": [
"heating_hotend"
],
"type": "string"
},
{
"description": "Calibrating extrusion.",
"enum": [
"calibrating_extrusion"
],
"type": "string"
},
{
"description": "Scanning bed surface.",
"enum": [
"scanning_bed_surface"
],
"type": "string"
},
{
"description": "Inspecting first layer.",
"enum": [
"inspecting_first_layer"
],
"type": "string"
},
{
"description": "Identifying build plate type.",
"enum": [
"identifying_build_plate_type"
],
"type": "string"
},
{
"description": "Calibrating micro lidar.",
"enum": [
"calibrating_micro_lidar"
],
"type": "string"
},
{
"description": "Homing toolhead.",
"enum": [
"homing_toolhead"
],
"type": "string"
},
{
"description": "Cleaning nozzle tip.",
"enum": [
"cleaning_nozzle_tip"
],
"type": "string"
},
{
"description": "Checking extruder temperature.",
"enum": [
"checking_extruder_temperature"
],
"type": "string"
},
{
"description": "Printing was paused by the user.",
"enum": [
"printing_was_paused_by_the_user"
],
"type": "string"
},
{
"description": "Pause of front cover falling.",
"enum": [
"pause_of_front_cover_falling"
],
"type": "string"
},
{
"description": "Calibrating micro lidar.",
"enum": [
"calibrating_micro_lidar2"
],
"type": "string"
},
{
"description": "Calibrating extrusion flow.",
"enum": [
"calibrating_extrusion_flow"
],
"type": "string"
},
{
"description": "Paused due to nozzle temperature malfunction.",
"enum": [
"paused_due_to_nozzle_temperature_malfunction"
],
"type": "string"
},
{
"description": "Paused due to heat bed temperature malfunction.",
"enum": [
"paused_due_to_heat_bed_temperature_malfunction"
],
"type": "string"
},
{
"description": "Filament unloading.",
"enum": [
"filament_unloading"
],
"type": "string"
},
{
"description": "Skip step pause.",
"enum": [
"skip_step_pause"
],
"type": "string"
},
{
"description": "Filament loading.",
"enum": [
"filament_loading"
],
"type": "string"
},
{
"description": "Motor noise calibration.",
"enum": [
"motor_noise_calibration"
],
"type": "string"
},
{
"description": "Paused due to AMS lost.",
"enum": [
"paused_due_to_ams_lost"
],
"type": "string"
},
{
"description": "Paused due to low speed of the heat break fan.",
"enum": [
"paused_due_to_low_speed_of_the_heat_break_fan"
],
"type": "string"
},
{
"description": "Paused due to chamber temperature control error.",
"enum": [
"paused_due_to_chamber_temperature_control_error"
],
"type": "string"
},
{
"description": "Cooling chamber.",
"enum": [
"cooling_chamber"
],
"type": "string"
},
{
"description": "Paused by the Gcode inserted by the user.",
"enum": [
"paused_by_the_gcode_inserted_by_the_user"
],
"type": "string"
},
{
"description": "Motor noise showoff.",
"enum": [
"motor_noise_showoff"
],
"type": "string"
},
{
"description": "Nozzle filament covered detected pause.",
"enum": [
"nozzle_filament_covered_detected_pause"
],
"type": "string"
},
{
"description": "Cutter error pause.",
"enum": [
"cutter_error_pause"
],
"type": "string"
},
{
"description": "First layer error pause.",
"enum": [
"first_layer_error_pause"
],
"type": "string"
},
{
"description": "Nozzle clog pause.",
"enum": [
"nozzle_clog_pause"
],
"type": "string"
}
]
},
"Volume": {
"description": "Set of three values to represent the extent of a 3-D Volume. This contains the width, depth, and height values, generally used to represent some maximum or minimum.\n\nAll measurements are in millimeters.",
"properties": {

View File

@ -11,6 +11,8 @@ export const NetworkMachineIndicator = ({
}) => {
const machineCount = machineManager.machineCount()
const reason = machineManager.noMachinesReason()
const machines = machineManager.machines
console.log('react machines', machines)
return isDesktop() ? (
<Popover className="relative">
@ -46,20 +48,29 @@ export const NetworkMachineIndicator = ({
</div>
{machineCount > 0 && (
<ul className="divide-y divide-chalkboard-20 dark:divide-chalkboard-80">
{Object.entries(machineManager.machines).map(
([hostname, machine]) => (
<li key={hostname} className={'px-2 py-4 gap-1 last:mb-0 '}>
<p className="">
{machine.make_model.model ||
machine.make_model.manufacturer ||
'Unknown Machine'}
{machines.map((machine) => {
return (
<li key={machine.id} className={'px-2 py-4 gap-1 last:mb-0 '}>
<p className="">{machine.id.toUpperCase()}</p>
<p className="text-chalkboard-60 dark:text-chalkboard-50 text-xs">
{machine.make_model.model}
</p>
<p className="text-chalkboard-60 dark:text-chalkboard-50 text-xs">
Hostname {hostname}
{machine.state.state.toUpperCase()}
{machine.state.state === 'failed' && machine.state.message
? ': ' + machine.state.message
: ''}
</p>
{machine.extra &&
machine.extra.type === 'bambu' &&
machine.extra.nozzle_diameter && (
<p className="text-chalkboard-60 dark:text-chalkboard-50 text-xs">
Nozzle Diameter: {machine.extra.nozzle_diameter}
</p>
)}
</li>
)
)}
})}
</ul>
)}
</Popover.Panel>

View File

@ -11,7 +11,7 @@ export const kclHighlight = styleTags({
nil: t.null,
'AddOp MultOp ExpOp': t.arithmeticOperator,
BangOp: t.logicOperator,
CompOp: t.logicOperator,
CompOp: t.compareOperator,
'Equals Arrow': t.definitionOperator,
PipeOperator: t.controlOperator,
String: t.string,

View File

@ -90,7 +90,7 @@ commaSep1NoTrailingComma<term> { term ("," term)* }
MultOp { "/" | "*" | "\\" }
ExpOp { "^" }
BangOp { "!" }
CompOp { $[<>] "="? | "!=" | "==" }
CompOp { "==" | "!=" | "<=" | ">=" | "<" | ">" }
Equals { "=" }
Arrow { "=>" }
PipeOperator { "|>" }

View File

@ -40,9 +40,7 @@ export class KclManager {
nonCodeMeta: {
nonCodeNodes: {},
start: [],
digest: null,
},
digest: null,
}
private _execState: ExecState = emptyExecState()
private _programMemory: ProgramMemory = ProgramMemory.empty()
@ -208,9 +206,7 @@ export class KclManager {
nonCodeMeta: {
nonCodeNodes: {},
start: [],
digest: null,
},
digest: null,
}
}

File diff suppressed because it is too large Load Diff

View File

@ -172,7 +172,6 @@ const sk2 = startSketchOn('XY')
start: 114,
type: 'TagDeclarator',
value: 'p',
digest: null,
},
id: expect.any(String),
sourceRange: [95, 117],
@ -223,7 +222,6 @@ const sk2 = startSketchOn('XY')
start: 114,
type: 'TagDeclarator',
value: 'p',
digest: null,
},
__geoMeta: {
id: expect.any(String),
@ -266,7 +264,6 @@ const sk2 = startSketchOn('XY')
start: 417,
type: 'TagDeclarator',
value: 'o',
digest: null,
},
id: expect.any(String),
sourceRange: [399, 420],
@ -317,7 +314,6 @@ const sk2 = startSketchOn('XY')
start: 417,
type: 'TagDeclarator',
value: 'o',
digest: null,
},
__geoMeta: {
id: expect.any(String),

View File

@ -73,7 +73,6 @@ const newVar = myVar + 1`
start: 89,
type: 'TagDeclarator',
value: 'myPath',
digest: null,
},
},
{
@ -99,7 +98,6 @@ const newVar = myVar + 1`
start: 143,
type: 'TagDeclarator',
value: 'rightPath',
digest: null,
},
},
])
@ -201,7 +199,6 @@ const newVar = myVar + 1`
start: 109,
type: 'TagDeclarator',
value: 'myPath',
digest: null,
},
},
{

View File

@ -100,15 +100,15 @@ describe('Testing findUniqueName', () => {
it('should find a unique name', () => {
const result = findUniqueName(
JSON.stringify([
{ type: 'Identifier', name: 'yo01', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo02', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo03', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo04', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo05', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo06', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo07', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo08', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo09', start: 0, end: 0, digest: null },
{ type: 'Identifier', name: 'yo01', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo02', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo03', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo04', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo05', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo06', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo07', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo08', start: 0, end: 0 },
{ type: 'Identifier', name: 'yo09', start: 0, end: 0 },
] satisfies Identifier[]),
'yo',
2
@ -123,8 +123,7 @@ describe('Testing addSketchTo', () => {
body: [],
start: 0,
end: 0,
nonCodeMeta: { nonCodeNodes: {}, start: [], digest: null },
digest: null,
nonCodeMeta: { nonCodeNodes: {}, start: [] },
},
'yz'
)

View File

@ -241,7 +241,6 @@ export function mutateObjExpProp(
value: updateWith,
start: 0,
end: 0,
digest: null,
})
}
}
@ -579,7 +578,6 @@ export function createLiteral(value: string | number): Literal {
end: 0,
value,
raw: `${value}`,
digest: null,
}
}
@ -588,7 +586,7 @@ export function createTagDeclarator(value: string): TagDeclarator {
type: 'TagDeclarator',
start: 0,
end: 0,
digest: null,
value,
}
}
@ -598,7 +596,7 @@ export function createIdentifier(name: string): Identifier {
type: 'Identifier',
start: 0,
end: 0,
digest: null,
name,
}
}
@ -608,7 +606,6 @@ export function createPipeSubstitution(): PipeSubstitution {
type: 'PipeSubstitution',
start: 0,
end: 0,
digest: null,
}
}
@ -624,12 +621,11 @@ export function createCallExpressionStdLib(
type: 'Identifier',
start: 0,
end: 0,
digest: null,
name,
},
optional: false,
arguments: args,
digest: null,
}
}
@ -645,12 +641,11 @@ export function createCallExpression(
type: 'Identifier',
start: 0,
end: 0,
digest: null,
name,
},
optional: false,
arguments: args,
digest: null,
}
}
@ -661,7 +656,7 @@ export function createArrayExpression(
type: 'ArrayExpression',
start: 0,
end: 0,
digest: null,
nonCodeMeta: nonCodeMetaEmpty(),
elements,
}
@ -674,7 +669,7 @@ export function createPipeExpression(
type: 'PipeExpression',
start: 0,
end: 0,
digest: null,
body,
nonCodeMeta: nonCodeMetaEmpty(),
}
@ -690,13 +685,13 @@ export function createVariableDeclaration(
type: 'VariableDeclaration',
start: 0,
end: 0,
digest: null,
declarations: [
{
type: 'VariableDeclarator',
start: 0,
end: 0,
digest: null,
id: createIdentifier(varName),
init,
},
@ -713,14 +708,14 @@ export function createObjectExpression(properties: {
type: 'ObjectExpression',
start: 0,
end: 0,
digest: null,
nonCodeMeta: nonCodeMetaEmpty(),
properties: Object.entries(properties).map(([key, value]) => ({
type: 'ObjectProperty',
start: 0,
end: 0,
key: createIdentifier(key),
digest: null,
value,
})),
}
@ -734,7 +729,7 @@ export function createUnaryExpression(
type: 'UnaryExpression',
start: 0,
end: 0,
digest: null,
operator,
argument,
}
@ -749,7 +744,7 @@ export function createBinaryExpression([left, operator, right]: [
type: 'BinaryExpression',
start: 0,
end: 0,
digest: null,
operator,
left,
right,
@ -1139,5 +1134,5 @@ export async function deleteFromSelection(
}
const nonCodeMetaEmpty = () => {
return { nonCodeNodes: {}, start: [], digest: null }
return { nonCodeNodes: {}, start: [] }
}

View File

@ -1823,11 +1823,10 @@ export const updateStartProfileAtArgs: SketchLineHelper['updateArgs'] = ({
start: 0,
end: 0,
body: [],
digest: null,
nonCodeMeta: {
start: [],
nonCodeNodes: [],
digest: null,
},
},
pathToNode,

View File

@ -190,10 +190,17 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
options: () => {
return Object.entries(machineManager.machines).map(
([_, machine]) => ({
name: `${machine.id} (${
machine.make_model.model || machine.make_model.manufacturer
}) via ${machineManager.machineApiIp || 'the local network'}`,
name:
`${machine.id} (${
machine.make_model.model || machine.make_model.manufacturer
}) (${machine.state.state})` +
(machine.extra &&
machine.extra.type === 'bambu' &&
machine.extra.nozzle_diameter
? ` - Nozzle Diameter: ${machine.extra.nozzle_diameter}`
: ''),
isCurrent: false,
disabled: machine.state.state !== 'idle',
value: machine as components['schemas']['MachineInfoResponse'],
})
)

View File

@ -119,18 +119,96 @@ export interface components {
/** @description Extra machine-specific information regarding a connected machine. */
ExtraMachineInfoResponse:
| {
Moonraker: Record<string, never>
/** @enum {string} */
type: 'moonraker'
}
| {
Usb: Record<string, never>
/** @enum {string} */
type: 'usb'
}
| {
Bambu: Record<string, never>
/** @description The current stage of the machine as defined by Bambu which can include errors, etc. */
current_stage?: components['schemas']['Stage'] | null
/** @description The nozzle diameter of the machine. */
nozzle_diameter: components['schemas']['NozzleDiameter']
/** @enum {string} */
type: 'bambu'
}
/** @description Configuration for a FDM-based printer. */
FdmHardwareConfiguration: {
/** @description The filaments the printer has access to. */
filaments: components['schemas']['Filament'][]
/**
* Format: double
* @description Diameter of the extrusion nozzle, in mm.
*/
nozzle_diameter: number
}
/** @description Information about the filament being used in a FDM printer. */
Filament: {
/** @description The color (as hex without the `#`) of the filament, this is likely specific to the manufacturer. */
color?: string | null
/** @description The material that the filament is made of. */
material: components['schemas']['FilamentMaterial']
/** @description The name of the filament, this is likely specfic to the manufacturer. */
name?: string | null
}
/** @description The material that the filament is made of. */
FilamentMaterial:
| {
/** @enum {string} */
type: 'pla'
}
| {
/** @enum {string} */
type: 'pla_support'
}
| {
/** @enum {string} */
type: 'abs'
}
| {
/** @enum {string} */
type: 'petg'
}
| {
/** @enum {string} */
type: 'nylon'
}
| {
/** @enum {string} */
type: 'tpu'
}
| {
/** @enum {string} */
type: 'pva'
}
| {
/** @enum {string} */
type: 'hips'
}
| {
/** @enum {string} */
type: 'composite'
}
/** @description The hardware configuration of a machine. */
HardwareConfiguration:
| {
/** @enum {string} */
type: 'none'
}
| {
/** @description The configuration for the FDM printer. */
config: components['schemas']['FdmHardwareConfiguration']
/** @enum {string} */
type: 'fdm'
}
/** @description Information regarding a connected machine. */
MachineInfoResponse: {
/** @description Additional, per-machine information which is specific to the underlying machine type. */
extra?: components['schemas']['ExtraMachineInfoResponse'] | null
/** @description Information about how the Machine is currently configured. */
hardware_configuration: components['schemas']['HardwareConfiguration']
/** @description Machine Identifier (ID) for the specific Machine. */
id: string
/** @description Information regarding the method of manufacture. */
@ -143,6 +221,11 @@ export interface components {
*
* What "close" means is up to you! */
max_part_volume?: components['schemas']['Volume'] | null
/**
* Format: double
* @description Progress of the current print, if printing.
*/
progress?: number | null
/** @description Status of the printer -- be it printing, idle, or unreachable. This may dictate if a machine is capable of taking a new job. */
state: components['schemas']['MachineState']
}
@ -157,17 +240,40 @@ export interface components {
}
/** @description Current state of the machine -- be it printing, idle or offline. This can be used to determine if a printer is in the correct state to take a new job. */
MachineState:
| 'Unknown'
| 'Idle'
| 'Running'
| 'Offline'
| 'Paused'
| 'Complete'
| {
Failed: string | null
/** @enum {string} */
state: 'unknown'
}
| {
/** @enum {string} */
state: 'idle'
}
| {
/** @enum {string} */
state: 'running'
}
| {
/** @enum {string} */
state: 'offline'
}
| {
/** @enum {string} */
state: 'paused'
}
| {
/** @enum {string} */
state: 'complete'
}
| {
/** @description A human-readable message describing the failure. */
message?: string | null
/** @enum {string} */
state: 'failed'
}
/** @description Specific technique by which this Machine takes a design, and produces a real-world 3D object. */
MachineType: 'Stereolithography' | 'FusedDeposition' | 'Cnc'
MachineType: 'stereolithography' | 'fused_deposition' | 'cnc'
/** @description A nozzle diameter. */
NozzleDiameter: '0.2' | '0.4' | '0.6' | '0.8'
/** @description The response from the `/ping` endpoint. */
Pong: {
/** @description The pong response. */
@ -186,7 +292,56 @@ export interface components {
job_name: string
/** @description The machine id to print to. */
machine_id: string
/** @description Requested design-specific slicer configurations. */
slicer_configuration?: components['schemas']['SlicerConfiguration'] | null
}
/** @description The slicer configuration is a set of parameters that are passed to the slicer to control how the gcode is generated. */
SlicerConfiguration: {
/**
* Format: uint
* @description The filament to use for the print.
*/
filament_idx?: number | null
}
/** @description The print stage. These come from: https://github.com/SoftFever/OrcaSlicer/blob/431978baf17961df90f0d01871b0ad1d839d7f5d/src/slic3r/GUI/DeviceManager.cpp#L78 */
Stage:
| 'nothing'
| 'empty'
| 'auto_bed_leveling'
| 'heatbed_preheating'
| 'sweeping_xy_mech_mode'
| 'changing_filament'
| 'm400_pause'
| 'paused_due_to_filament_runout'
| 'heating_hotend'
| 'calibrating_extrusion'
| 'scanning_bed_surface'
| 'inspecting_first_layer'
| 'identifying_build_plate_type'
| 'calibrating_micro_lidar'
| 'homing_toolhead'
| 'cleaning_nozzle_tip'
| 'checking_extruder_temperature'
| 'printing_was_paused_by_the_user'
| 'pause_of_front_cover_falling'
| 'calibrating_micro_lidar2'
| 'calibrating_extrusion_flow'
| 'paused_due_to_nozzle_temperature_malfunction'
| 'paused_due_to_heat_bed_temperature_malfunction'
| 'filament_unloading'
| 'skip_step_pause'
| 'filament_loading'
| 'motor_noise_calibration'
| 'paused_due_to_ams_lost'
| 'paused_due_to_low_speed_of_the_heat_break_fan'
| 'paused_due_to_chamber_temperature_control_error'
| 'cooling_chamber'
| 'paused_by_the_gcode_inserted_by_the_user'
| 'motor_noise_showoff'
| 'nozzle_filament_covered_detected_pause'
| 'cutter_error_pause'
| 'first_layer_error_pause'
| 'nozzle_clog_pause'
/** @description Set of three values to represent the extent of a 3-D Volume. This contains the width, depth, and height values, generally used to represent some maximum or minimum.
*
* All measurements are in millimeters. */

View File

@ -85,7 +85,11 @@ export class MachineManager {
return
}
this._machines = await window.electron.listMachines()
if (this._machineApiIp === null) {
return
}
this._machines = await window.electron.listMachines(this._machineApiIp)
}
private async updateMachineApiIp(): Promise<void> {

View File

@ -238,6 +238,7 @@ ipcMain.handle('find_machine_api', () => {
const ip = service.addresses[0]
const port = service.port
// We want to return the ip address of the machine API.
console.log(`Machine API found at ${ip}:${port}`)
resolve(`${ip}:${port}`)
}
)

View File

@ -77,11 +77,12 @@ const kittycad = (access: string, args: any) =>
// We could probably do this from the renderer side, but I fear CORS will
// bite our butts.
const listMachines = async (): Promise<MachinesListing> => {
const machineApi = await ipcRenderer.invoke('find_machine_api')
if (!machineApi) return []
return fetch(`http://${machineApi}/machines`).then((resp) => resp.json())
const listMachines = async (
machineApiAddr: string
): Promise<MachinesListing> => {
return fetch(`http://${machineApiAddr}/machines`).then((resp) => {
return resp.json()
})
}
const getMachineApiIp = async (): Promise<String | null> =>

View File

@ -53,8 +53,11 @@ pub struct Program {
pub start: usize,
pub end: usize,
pub body: Vec<BodyItem>,
#[serde(default, skip_serializing_if = "NonCodeMeta::is_empty")]
pub non_code_meta: NonCodeMeta,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -491,7 +494,7 @@ impl From<&BodyItem> for SourceRange {
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)]
#[databake(path = kcl_lib::ast::types)]
#[ts(export)]
#[serde(tag = "type")]
#[serde(untagged)]
pub enum Expr {
Literal(Box<Literal>),
Identifier(Box<Identifier>),
@ -837,6 +840,8 @@ pub struct NonCodeNode {
pub end: usize,
pub value: NonCodeValue,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -981,6 +986,8 @@ pub struct NonCodeMeta {
pub non_code_nodes: HashMap<usize, Vec<NonCodeNode>>,
pub start: Vec<NonCodeNode>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1053,6 +1060,8 @@ pub struct ImportItem {
pub start: usize,
pub end: usize,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1105,6 +1114,8 @@ pub struct ImportStatement {
pub path: String,
pub raw_path: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1146,6 +1157,8 @@ pub struct ExpressionStatement {
pub end: usize,
pub expression: Expr,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1162,6 +1175,8 @@ pub struct CallExpression {
pub arguments: Vec<Expr>,
pub optional: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1321,6 +1336,8 @@ pub struct VariableDeclaration {
pub visibility: ItemVisibility,
pub kind: VariableKind, // Change to enum if there are specific values
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1575,6 +1592,8 @@ pub struct VariableDeclarator {
/// The value of the variable.
pub init: Expr,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1606,6 +1625,8 @@ pub struct Literal {
pub value: LiteralValue,
pub raw: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1662,6 +1683,8 @@ pub struct Identifier {
pub end: usize,
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1703,6 +1726,8 @@ pub struct TagDeclarator {
#[serde(rename = "value")]
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1821,6 +1846,8 @@ pub struct PipeSubstitution {
pub start: usize,
pub end: usize,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1859,6 +1886,8 @@ pub struct ArrayExpression {
#[serde(default, skip_serializing_if = "NonCodeMeta::is_empty")]
pub non_code_meta: NonCodeMeta,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -1934,6 +1963,8 @@ pub struct ArrayRangeExpression {
/// Is the `end_element` included in the range?
pub end_inclusive: bool,
// TODO (maybe) comments on range components?
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2000,6 +2031,8 @@ pub struct ObjectExpression {
#[serde(default, skip_serializing_if = "NonCodeMeta::is_empty")]
pub non_code_meta: NonCodeMeta,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2067,6 +2100,8 @@ pub struct ObjectProperty {
pub key: Identifier,
pub value: Expr,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2197,6 +2232,8 @@ pub struct MemberExpression {
pub property: LiteralIdentifier,
pub computed: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2256,6 +2293,8 @@ pub struct BinaryExpression {
pub left: BinaryPart,
pub right: BinaryPart,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2438,6 +2477,8 @@ pub struct UnaryExpression {
pub operator: UnaryOperator,
pub argument: BinaryPart,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2513,8 +2554,11 @@ pub struct PipeExpression {
// TODO: Only the first body expression can be any Value.
// The rest will be CallExpression, and the AST type should reflect this.
pub body: Vec<Expr>,
#[serde(default, skip_serializing_if = "NonCodeMeta::is_empty")]
pub non_code_meta: NonCodeMeta,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2650,6 +2694,8 @@ pub struct Parameter {
/// Is the parameter optional?
pub optional: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2665,6 +2711,8 @@ pub struct FunctionExpression {
#[serde(skip)]
pub return_type: Option<FnArgType>,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}
@ -2751,6 +2799,8 @@ pub struct ReturnStatement {
pub end: usize,
pub argument: Expr,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional)]
pub digest: Option<Digest>,
}

View File

@ -65,93 +65,9 @@ impl MemberExpression {
}))
}
}
pub fn get_result(&self, exec_state: &mut ExecState) -> Result<KclValue, KclError> {
#[derive(Debug)]
enum Property {
Number(usize),
String(String),
}
impl Property {
fn type_name(&self) -> &'static str {
match self {
Property::Number(_) => "number",
Property::String(_) => "string",
}
}
}
let property_src: SourceRange = self.property.clone().into();
let property_sr = vec![property_src];
let property: Property = match self.property.clone() {
LiteralIdentifier::Identifier(identifier) => {
let name = identifier.name;
if !self.computed {
// Treat the property as a literal
Property::String(name.to_string())
} else {
// Actually evaluate memory to compute the property.
let prop = exec_state.memory.get(&name, property_src)?;
let KclValue::UserVal(prop) = prop else {
return Err(KclError::Semantic(KclErrorDetails {
source_ranges: property_sr,
message: format!(
"{name} is not a valid property/index, you can only use a string or int (>= 0) here",
),
}));
};
match prop.value {
JValue::Number(ref num) => {
num
.as_u64()
.and_then(|x| usize::try_from(x).ok())
.map(Property::Number)
.ok_or_else(|| {
KclError::Semantic(KclErrorDetails {
source_ranges: property_sr,
message: format!(
"{name}'s value is not a valid property/index, you can only use a string or int (>= 0) here",
),
})
})?
}
JValue::String(ref x) => Property::String(x.to_owned()),
_ => {
return Err(KclError::Semantic(KclErrorDetails {
source_ranges: property_sr,
message: format!(
"{name} is not a valid property/index, you can only use a string to get the property of an object, or an int (>= 0) to get an item in an array",
),
}));
}
}
}
}
LiteralIdentifier::Literal(literal) => {
let value = literal.value.clone();
match value {
LiteralValue::IInteger(x) => {
if let Ok(x) = u64::try_from(x) {
Property::Number(x.try_into().unwrap())
} else {
return Err(KclError::Semantic(KclErrorDetails {
source_ranges: property_sr,
message: format!("{x} is not a valid index, indices must be whole numbers >= 0"),
}));
}
}
LiteralValue::String(s) => Property::String(s),
_ => {
return Err(KclError::Semantic(KclErrorDetails {
source_ranges: vec![self.into()],
message: "Only strings or ints (>= 0) can be properties/indexes".to_owned(),
}));
}
}
}
};
let property = Property::try_from(self.computed, self.property.clone(), exec_state, self.into())?;
let object = match &self.object {
// TODO: Don't use recursion here, use a loop.
MemberObject::MemberExpression(member_expr) => member_expr.get_result(exec_state)?,
@ -783,3 +699,105 @@ impl IfExpression {
.map(|expr| expr.unwrap())
}
}
#[derive(Debug)]
enum Property {
Number(usize),
String(String),
}
impl Property {
fn try_from(
computed: bool,
value: LiteralIdentifier,
exec_state: &ExecState,
sr: SourceRange,
) -> Result<Self, KclError> {
let property_sr = vec![sr];
let property_src: SourceRange = value.clone().into();
match value {
LiteralIdentifier::Identifier(identifier) => {
let name = identifier.name;
if !computed {
// Treat the property as a literal
Ok(Property::String(name.to_string()))
} else {
// Actually evaluate memory to compute the property.
let prop = exec_state.memory.get(&name, property_src)?;
let KclValue::UserVal(prop) = prop else {
return Err(KclError::Semantic(KclErrorDetails {
source_ranges: property_sr,
message: format!(
"{name} is not a valid property/index, you can only use a string or int (>= 0) here",
),
}));
};
jvalue_to_prop(&prop.value, property_sr, &name)
}
}
LiteralIdentifier::Literal(literal) => {
let value = literal.value.clone();
match value {
LiteralValue::IInteger(x) => {
if let Ok(x) = u64::try_from(x) {
Ok(Property::Number(x.try_into().unwrap()))
} else {
Err(KclError::Semantic(KclErrorDetails {
source_ranges: property_sr,
message: format!("{x} is not a valid index, indices must be whole numbers >= 0"),
}))
}
}
LiteralValue::String(s) => Ok(Property::String(s)),
_ => Err(KclError::Semantic(KclErrorDetails {
source_ranges: vec![sr],
message: "Only strings or ints (>= 0) can be properties/indexes".to_owned(),
})),
}
}
}
}
}
fn jvalue_to_prop(value: &JValue, property_sr: Vec<SourceRange>, name: &str) -> Result<Property, KclError> {
let make_err = |message: String| {
Err::<Property, _>(KclError::Semantic(KclErrorDetails {
source_ranges: property_sr,
message,
}))
};
const MUST_BE_POSINT: &str = "indices must be whole positive numbers";
const TRY_INT: &str = "try using the int() function to make this a whole number";
match value {
JValue::Number(ref num) => {
let maybe_uint = num.as_u64().and_then(|x| usize::try_from(x).ok());
if let Some(uint) = maybe_uint {
Ok(Property::Number(uint))
} else if let Some(iint) = num.as_i64() {
make_err(format!("'{iint}' is not a valid index, {MUST_BE_POSINT}"))
} else if let Some(fnum) = num.as_f64() {
if fnum < 0.0 {
make_err(format!("'{fnum}' is not a valid index, {MUST_BE_POSINT}"))
} else if fnum.fract() == 0.0 {
make_err(format!("'{fnum:.1}' is stored as a fractional number but indices must be whole numbers, {TRY_INT}"))
} else {
make_err(format!("'{fnum}' is not a valid index, {MUST_BE_POSINT}, {TRY_INT}"))
}
} else {
make_err(format!("'{num}' is not a valid index, {MUST_BE_POSINT}"))
}
}
JValue::String(ref x) => Ok(Property::String(x.to_owned())),
_ => {
make_err(format!("{name} is not a valid property/index, you can only use a string to get the property of an object, or an int (>= 0) to get an item in an array"))
}
}
}
impl Property {
fn type_name(&self) -> &'static str {
match self {
Property::Number(_) => "number",
Property::String(_) => "string",
}
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "Literal",
@ -22,8 +21,6 @@ expression: actual
"start": 4,
"end": 5,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "Literal",
@ -22,8 +21,6 @@ expression: actual
"start": 2,
"end": 3,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "Literal",
@ -22,8 +21,6 @@ expression: actual
"start": 3,
"end": 4,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "BinaryExpression",
@ -28,8 +27,7 @@ expression: actual
"start": 4,
"end": 5,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
"right": {
"type": "Literal",
@ -37,10 +35,7 @@ expression: actual
"start": 8,
"end": 9,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
},
"digest": null
"raw": "3"
}
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "BinaryExpression",
@ -28,8 +27,7 @@ expression: actual
"start": 6,
"end": 7,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
"right": {
"type": "Literal",
@ -37,10 +35,7 @@ expression: actual
"start": 10,
"end": 11,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
},
"digest": null
"raw": "3"
}
}
}

View File

@ -19,8 +19,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "BinaryExpression",
@ -34,8 +33,7 @@ expression: actual
"start": 6,
"end": 7,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
"right": {
"type": "Literal",
@ -43,12 +41,9 @@ expression: actual
"start": 10,
"end": 11,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
},
"digest": null
"raw": "3"
}
}
},
"right": {
"type": "Literal",
@ -56,8 +51,6 @@ expression: actual
"start": 16,
"end": 17,
"value": 4,
"raw": "4",
"digest": null
},
"digest": null
"raw": "4"
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "BinaryExpression",
@ -34,8 +33,7 @@ expression: actual
"start": 6,
"end": 7,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
"right": {
"type": "Literal",
@ -43,10 +41,8 @@ expression: actual
"start": 10,
"end": 11,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
"raw": "3"
}
},
"right": {
"type": "Literal",
@ -54,10 +50,7 @@ expression: actual
"start": 16,
"end": 17,
"value": 4,
"raw": "4",
"digest": null
},
"digest": null
},
"digest": null
"raw": "4"
}
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "BinaryExpression",
@ -40,8 +39,7 @@ expression: actual
"start": 7,
"end": 8,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
"right": {
"type": "Literal",
@ -49,10 +47,8 @@ expression: actual
"start": 11,
"end": 12,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
"raw": "3"
}
},
"right": {
"type": "Literal",
@ -60,10 +56,8 @@ expression: actual
"start": 17,
"end": 18,
"value": 4,
"raw": "4",
"digest": null
},
"digest": null
"raw": "4"
}
},
"right": {
"type": "Literal",
@ -71,10 +65,7 @@ expression: actual
"start": 21,
"end": 22,
"value": 5,
"raw": "5",
"digest": null
},
"digest": null
},
"digest": null
"raw": "5"
}
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "BinaryExpression",
@ -28,8 +27,7 @@ expression: actual
"start": 8,
"end": 9,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
"right": {
"type": "Literal",
@ -37,10 +35,7 @@ expression: actual
"start": 12,
"end": 13,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
},
"digest": null
"raw": "3"
}
}
}

View File

@ -30,28 +30,23 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 8,
"name": "distance",
"digest": null
"name": "distance"
},
"right": {
"type": "Identifier",
"type": "Identifier",
"start": 11,
"end": 12,
"name": "p",
"digest": null
},
"digest": null
"name": "p"
}
},
"right": {
"type": "Identifier",
"type": "Identifier",
"start": 15,
"end": 18,
"name": "FOS",
"digest": null
},
"digest": null
"name": "FOS"
}
},
"right": {
"type": "Literal",
@ -59,10 +54,8 @@ expression: actual
"start": 21,
"end": 22,
"value": 6,
"raw": "6",
"digest": null
},
"digest": null
"raw": "6"
}
},
"right": {
"type": "BinaryExpression",
@ -75,18 +68,14 @@ expression: actual
"type": "Identifier",
"start": 26,
"end": 36,
"name": "sigmaAllow",
"digest": null
"name": "sigmaAllow"
},
"right": {
"type": "Identifier",
"type": "Identifier",
"start": 39,
"end": 44,
"name": "width",
"digest": null
},
"digest": null
},
"digest": null
"name": "width"
}
}
}

View File

@ -13,8 +13,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
"right": {
"type": "Literal",
@ -22,8 +21,6 @@ expression: actual
"start": 7,
"end": 8,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
"raw": "3"
}
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 15,
"name": "boxSketch",
"digest": null
"name": "boxSketch"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 18,
"end": 143,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 18,
"end": 39,
@ -38,43 +35,34 @@ expression: actual
"type": "Identifier",
"start": 18,
"end": 31,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 32,
"end": 38,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 33,
"end": 34,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 36,
"end": 37,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 47,
"end": 63,
@ -82,50 +70,39 @@ expression: actual
"type": "Identifier",
"start": 47,
"end": 51,
"name": "line",
"digest": null
"name": "line"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 52,
"end": 59,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 53,
"end": 54,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 56,
"end": 58,
"value": 10,
"raw": "10",
"digest": null
"raw": "10"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 61,
"end": 62,
"digest": null
"end": 62
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 71,
"end": 96,
@ -133,18 +110,15 @@ expression: actual
"type": "Identifier",
"start": 71,
"end": 84,
"name": "tangentialArc",
"digest": null
"name": "tangentialArc"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 85,
"end": 92,
"elements": [
{
"type": "UnaryExpression",
"type": "UnaryExpression",
"start": 86,
"end": 88,
@ -155,36 +129,27 @@ expression: actual
"start": 87,
"end": 88,
"value": 5,
"raw": "5",
"digest": null
},
"digest": null
"raw": "5"
}
},
{
"type": "Literal",
"type": "Literal",
"start": 90,
"end": 91,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 94,
"end": 95,
"digest": null
"end": 95
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 104,
"end": 121,
@ -192,27 +157,22 @@ expression: actual
"type": "Identifier",
"start": 104,
"end": 108,
"name": "line",
"digest": null
"name": "line"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 109,
"end": 117,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 110,
"end": 111,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
},
{
"type": "UnaryExpression",
"type": "UnaryExpression",
"start": 113,
"end": 116,
@ -223,27 +183,20 @@ expression: actual
"start": 114,
"end": 116,
"value": 15,
"raw": "15",
"digest": null
},
"digest": null
"raw": "15"
}
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 119,
"end": 120,
"digest": null
"end": 120
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 129,
"end": 143,
@ -251,49 +204,29 @@ expression: actual
"type": "Identifier",
"start": 129,
"end": 136,
"name": "extrude",
"digest": null
"name": "extrude"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 137,
"end": 139,
"value": 10,
"raw": "10",
"digest": null
"raw": "10"
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 141,
"end": 142,
"digest": null
"end": 142
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 8,
"name": "sg",
"digest": null
"name": "sg"
},
"init": {
"type": "UnaryExpression",
"type": "UnaryExpression",
"start": 11,
"end": 17,
@ -34,22 +32,12 @@ expression: actual
"type": "Identifier",
"start": 12,
"end": 17,
"name": "scale",
"digest": null
},
"digest": null
},
"digest": null
"name": "scale"
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 23,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 23,
@ -20,12 +19,10 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 6,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 7,
"end": 22,
@ -38,26 +35,21 @@ expression: actual
"type": "Identifier",
"start": 9,
"end": 11,
"name": "to",
"digest": null
"name": "to"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 13,
"end": 20,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 14,
"end": 15,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "UnaryExpression",
"type": "UnaryExpression",
"start": 17,
"end": 19,
@ -68,30 +60,17 @@ expression: actual
"start": 18,
"end": 19,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,46 +20,31 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 13,
"name": "myArray",
"digest": null
"name": "myArray"
},
"init": {
"type": "ArrayRangeExpression",
"type": "ArrayRangeExpression",
"start": 16,
"end": 23,
"startElement": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
"endElement": {
"type": "Literal",
"type": "Literal",
"start": 20,
"end": 22,
"value": 10,
"raw": "10",
"digest": null
"raw": "10"
},
"endInclusive": true,
"digest": null
},
"digest": null
"endInclusive": true
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 8,
"end": 24,
"name": "firstPrimeNumber",
"digest": null
"name": "firstPrimeNumber"
},
"init": {
"type": "FunctionExpression",
"type": "FunctionExpression",
"start": 27,
"end": 57,
@ -39,31 +37,19 @@ expression: actual
"start": 43,
"end": 51,
"argument": {
"type": "Literal",
"type": "Literal",
"start": 50,
"end": 51,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
},
"digest": null
]
}
}
}
],
"kind": "fn",
"digest": null
"kind": "fn"
},
{
"type": "ExpressionStatement",
@ -71,7 +57,6 @@ expression: actual
"start": 62,
"end": 80,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 62,
"end": 80,
@ -79,20 +64,11 @@ expression: actual
"type": "Identifier",
"start": 62,
"end": 78,
"name": "firstPrimeNumber",
"digest": null
"name": "firstPrimeNumber"
},
"arguments": [],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 3,
"end": 8,
"name": "thing",
"digest": null
"name": "thing"
},
"init": {
"type": "FunctionExpression",
"type": "FunctionExpression",
"start": 11,
"end": 49,
@ -35,11 +33,9 @@ expression: actual
"type": "Identifier",
"start": 12,
"end": 17,
"name": "param",
"digest": null
"name": "param"
},
"optional": false,
"digest": null
"optional": false
}
],
"body": {
@ -52,31 +48,19 @@ expression: actual
"start": 32,
"end": 43,
"argument": {
"type": "Literal",
"type": "Literal",
"start": 39,
"end": 43,
"value": true,
"raw": "true",
"digest": null
},
"digest": null
"raw": "true"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
},
"digest": null
]
}
}
}
],
"kind": "fn",
"digest": null
"kind": "fn"
},
{
"type": "ExpressionStatement",
@ -84,7 +68,6 @@ expression: actual
"start": 54,
"end": 66,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 54,
"end": 66,
@ -92,30 +75,19 @@ expression: actual
"type": "Identifier",
"start": 54,
"end": 59,
"name": "thing",
"digest": null
"name": "thing"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 60,
"end": 65,
"value": false,
"raw": "false",
"digest": null
"raw": "false"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 14,
"name": "mySketch",
"digest": null
"name": "mySketch"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 17,
"end": 165,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 17,
"end": 37,
@ -38,43 +35,34 @@ expression: actual
"type": "Identifier",
"start": 17,
"end": 30,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 31,
"end": 36,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 32,
"end": 33,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 34,
"end": 35,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 49,
"end": 75,
@ -82,58 +70,45 @@ expression: actual
"type": "Identifier",
"start": 49,
"end": 55,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 56,
"end": 62,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 57,
"end": 58,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 60,
"end": 61,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 64,
"end": 65,
"digest": null
"end": 65
},
{
"type": "TagDeclarator",
"type": "TagDeclarator",
"start": 67,
"end": 74,
"value": "myPath",
"digest": null
"value": "myPath"
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 87,
"end": 104,
@ -141,50 +116,39 @@ expression: actual
"type": "Identifier",
"start": 87,
"end": 93,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 94,
"end": 100,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 95,
"end": 96,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
{
"type": "Literal",
"type": "Literal",
"start": 98,
"end": 99,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 102,
"end": 103,
"digest": null
"end": 103
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 116,
"end": 145,
@ -192,58 +156,45 @@ expression: actual
"type": "Identifier",
"start": 116,
"end": 122,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 123,
"end": 129,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 124,
"end": 125,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
{
"type": "Literal",
"type": "Literal",
"start": 127,
"end": 128,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 131,
"end": 132,
"digest": null
"end": 132
},
{
"type": "TagDeclarator",
"type": "TagDeclarator",
"start": 134,
"end": 144,
"value": "rightPath",
"digest": null
"value": "rightPath"
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 157,
"end": 165,
@ -251,40 +202,22 @@ expression: actual
"type": "Identifier",
"start": 157,
"end": 162,
"name": "close",
"digest": null
"name": "close"
},
"arguments": [
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 163,
"end": 164,
"digest": null
"end": 164
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 14,
"name": "mySketch",
"digest": null
"name": "mySketch"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 17,
"end": 70,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 17,
"end": 37,
@ -38,43 +35,34 @@ expression: actual
"type": "Identifier",
"start": 17,
"end": 30,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 31,
"end": 36,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 32,
"end": 33,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 34,
"end": 35,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 41,
"end": 58,
@ -82,50 +70,39 @@ expression: actual
"type": "Identifier",
"start": 41,
"end": 47,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 48,
"end": 54,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 49,
"end": 50,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
{
"type": "Literal",
"type": "Literal",
"start": 52,
"end": 53,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 56,
"end": 57,
"digest": null
"end": 57
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 62,
"end": 70,
@ -133,40 +110,22 @@ expression: actual
"type": "Identifier",
"start": 62,
"end": 67,
"name": "close",
"digest": null
"name": "close"
},
"arguments": [
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 68,
"end": 69,
"digest": null
"end": 69
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 11,
"name": "myBox",
"digest": null
"name": "myBox"
},
"init": {
"type": "CallExpression",
"type": "CallExpression",
"start": 14,
"end": 30,
@ -32,33 +30,21 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 27,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "Identifier",
"type": "Identifier",
"start": 28,
"end": 29,
"name": "p",
"digest": null
"name": "p"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 11,
"name": "myBox",
"digest": null
"name": "myBox"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 14,
"end": 29,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 14,
"end": 18,
@ -38,25 +35,20 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "f",
"digest": null
"name": "f"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 16,
"end": 17,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 22,
"end": 29,
@ -64,49 +56,29 @@ expression: actual
"type": "Identifier",
"start": 22,
"end": 23,
"name": "g",
"digest": null
"name": "g"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 24,
"end": 25,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 27,
"end": 28,
"digest": null
"end": 28
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 11,
"name": "myBox",
"digest": null
"name": "myBox"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 14,
"end": 49,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 14,
"end": 30,
@ -38,24 +35,19 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 27,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "Identifier",
"type": "Identifier",
"start": 28,
"end": 29,
"name": "p",
"digest": null
"name": "p"
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 34,
"end": 49,
@ -63,66 +55,42 @@ expression: actual
"type": "Identifier",
"start": 34,
"end": 38,
"name": "line",
"digest": null
"name": "line"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 39,
"end": 45,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 40,
"end": 41,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Identifier",
"type": "Identifier",
"start": 43,
"end": 44,
"name": "l",
"digest": null
"name": "l"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 47,
"end": 48,
"digest": null
"end": 48
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 22,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 22,
@ -20,12 +19,10 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 6,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 7,
"end": 21,
@ -38,52 +35,35 @@ expression: actual
"type": "Identifier",
"start": 9,
"end": 11,
"name": "to",
"digest": null
"name": "to"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 13,
"end": 19,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 14,
"end": 15,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
},
"digest": null
]
}
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 36,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 36,
@ -20,12 +19,10 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 6,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 7,
"end": 35,
@ -38,37 +35,29 @@ expression: actual
"type": "Identifier",
"start": 9,
"end": 11,
"name": "to",
"digest": null
"name": "to"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 13,
"end": 19,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 14,
"end": 15,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
},
"digest": null
]
}
},
{
"type": "ObjectProperty",
@ -78,52 +67,35 @@ expression: actual
"type": "Identifier",
"start": 21,
"end": 25,
"name": "from",
"digest": null
"name": "from"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 27,
"end": 33,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 28,
"end": 29,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
{
"type": "Literal",
"type": "Literal",
"start": 31,
"end": 32,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
}
],
"digest": null
},
"digest": null
]
}
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 19,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 19,
@ -20,12 +19,10 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 6,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 7,
"end": 18,
@ -38,52 +35,35 @@ expression: actual
"type": "Identifier",
"start": 8,
"end": 10,
"name": "to",
"digest": null
"name": "to"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 11,
"end": 17,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 12,
"end": 13,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 15,
"end": 16,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
},
"digest": null
]
}
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 35,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 35,
@ -20,12 +19,10 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 6,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 7,
"end": 34,
@ -38,37 +35,29 @@ expression: actual
"type": "Identifier",
"start": 9,
"end": 11,
"name": "to",
"digest": null
"name": "to"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 13,
"end": 19,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 14,
"end": 15,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
},
"digest": null
]
}
},
{
"type": "ObjectProperty",
@ -78,52 +67,35 @@ expression: actual
"type": "Identifier",
"start": 21,
"end": 25,
"name": "from",
"digest": null
"name": "from"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 27,
"end": 33,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 28,
"end": 29,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
{
"type": "Literal",
"type": "Literal",
"start": 31,
"end": 32,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
}
],
"digest": null
},
"digest": null
]
}
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 35,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 35,
@ -20,12 +19,10 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 6,
"name": "lineTo",
"digest": null
"name": "lineTo"
},
"arguments": [
{
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 7,
"end": 34,
@ -38,37 +35,29 @@ expression: actual
"type": "Identifier",
"start": 9,
"end": 11,
"name": "to",
"digest": null
"name": "to"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 13,
"end": 19,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 14,
"end": 15,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
}
],
"digest": null
},
"digest": null
]
}
},
{
"type": "ObjectProperty",
@ -78,52 +67,35 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 24,
"name": "from",
"digest": null
"name": "from"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 26,
"end": 32,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 27,
"end": 28,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
{
"type": "Literal",
"type": "Literal",
"start": 30,
"end": 31,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
}
],
"digest": null
},
"digest": null
]
}
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 14,
"name": "mySketch",
"digest": null
"name": "mySketch"
},
"init": {
"type": "CallExpression",
"type": "CallExpression",
"start": 17,
"end": 37,
@ -32,52 +30,36 @@ expression: actual
"type": "Identifier",
"start": 17,
"end": 30,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 31,
"end": 36,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 32,
"end": 33,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 34,
"end": 35,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
]
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 28,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 28,
@ -20,47 +19,32 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 3,
"name": "log",
"digest": null
"name": "log"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 4,
"end": 5,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
},
{
"type": "Literal",
"type": "Literal",
"start": 7,
"end": 14,
"value": "hello",
"raw": "\"hello\"",
"digest": null
"raw": "\"hello\""
},
{
"type": "Identifier",
"type": "Identifier",
"start": 16,
"end": 27,
"name": "aIdentifier",
"digest": null
"name": "aIdentifier"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 7,
"expression": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 0,
"end": 7,
@ -23,8 +22,7 @@ expression: actual
"start": 0,
"end": 1,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
},
"right": {
"type": "Literal",
@ -32,18 +30,9 @@ expression: actual
"start": 4,
"end": 7,
"value": "a",
"raw": "\"a\"",
"digest": null
},
"digest": null
},
"digest": null
"raw": "\"a\""
}
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -12,7 +12,6 @@ expression: actual
"start": 0,
"end": 15,
"expression": {
"type": "CallExpression",
"type": "CallExpression",
"start": 0,
"end": 15,
@ -20,54 +19,37 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 4,
"name": "line",
"digest": null
"name": "line"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 5,
"end": 11,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 6,
"end": 7,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Identifier",
"type": "Identifier",
"start": 9,
"end": 10,
"name": "l",
"digest": null
"name": "l"
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 13,
"end": 14,
"digest": null
"end": 14
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 14,
"name": "cylinder",
"digest": null
"name": "cylinder"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 17,
"end": 107,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 17,
"end": 36,
@ -38,25 +35,20 @@ expression: actual
"type": "Identifier",
"start": 17,
"end": 30,
"name": "startSketchOn",
"digest": null
"name": "startSketchOn"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 31,
"end": 35,
"value": "XY",
"raw": "'XY'",
"digest": null
"raw": "'XY'"
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 44,
"end": 85,
@ -64,12 +56,10 @@ expression: actual
"type": "Identifier",
"start": 44,
"end": 50,
"name": "circle",
"digest": null
"name": "circle"
},
"arguments": [
{
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 51,
"end": 81,
@ -82,37 +72,29 @@ expression: actual
"type": "Identifier",
"start": 53,
"end": 59,
"name": "center",
"digest": null
"name": "center"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 61,
"end": 67,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 62,
"end": 63,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "Literal",
"type": "Literal",
"start": 65,
"end": 66,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
},
"digest": null
]
}
},
{
"type": "ObjectProperty",
@ -122,36 +104,27 @@ expression: actual
"type": "Identifier",
"start": 69,
"end": 75,
"name": "radius",
"digest": null
"name": "radius"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 77,
"end": 79,
"value": 22,
"raw": "22",
"digest": null
},
"digest": null
"raw": "22"
}
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 83,
"end": 84,
"digest": null
"end": 84
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 93,
"end": 107,
@ -159,49 +132,29 @@ expression: actual
"type": "Identifier",
"start": 93,
"end": 100,
"name": "extrude",
"digest": null
"name": "extrude"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 101,
"end": 103,
"value": 14,
"raw": "14",
"digest": null
"raw": "14"
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 105,
"end": 106,
"digest": null
"end": 106
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 3,
"end": 4,
"name": "f",
"digest": null
"name": "f"
},
"init": {
"type": "FunctionExpression",
"type": "FunctionExpression",
"start": 7,
"end": 49,
@ -35,11 +33,9 @@ expression: actual
"type": "Identifier",
"start": 8,
"end": 13,
"name": "angle",
"digest": null
"name": "angle"
},
"optional": true,
"digest": null
"optional": true
}
],
"body": {
@ -52,7 +48,6 @@ expression: actual
"start": 21,
"end": 47,
"argument": {
"type": "CallExpression",
"type": "CallExpression",
"start": 28,
"end": 47,
@ -60,54 +55,32 @@ expression: actual
"type": "Identifier",
"start": 28,
"end": 35,
"name": "default",
"digest": null
"name": "default"
},
"arguments": [
{
"type": "Identifier",
"type": "Identifier",
"start": 36,
"end": 41,
"name": "angle",
"digest": null
"name": "angle"
},
{
"type": "Literal",
"type": "Literal",
"start": 43,
"end": 46,
"value": 360,
"raw": "360",
"digest": null
"raw": "360"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
},
"digest": null
]
}
}
}
],
"kind": "fn",
"digest": null
"kind": "fn"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,32 +20,26 @@ expression: actual
"type": "Identifier",
"start": 4,
"end": 11,
"name": "numbers",
"digest": null
"name": "numbers"
},
"init": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 14,
"end": 91,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 28,
"end": 29,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
{
"type": "Literal",
"type": "Literal",
"start": 79,
"end": 80,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
}
],
"nonCodeMeta": {
@ -59,8 +53,7 @@ expression: actual
"type": "blockComment",
"value": "A,",
"style": "line"
},
"digest": null
}
}
],
"2": [
@ -72,27 +65,16 @@ expression: actual
"type": "blockComment",
"value": "B,",
"style": "line"
},
"digest": null
}
}
]
},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
"start": []
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,32 +20,26 @@ expression: actual
"type": "Identifier",
"start": 4,
"end": 11,
"name": "numbers",
"digest": null
"name": "numbers"
},
"init": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 14,
"end": 91,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 28,
"end": 29,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
{
"type": "Literal",
"type": "Literal",
"start": 43,
"end": 44,
"value": 2,
"raw": "2",
"digest": null
"raw": "2"
}
],
"nonCodeMeta": {
@ -59,8 +53,7 @@ expression: actual
"type": "blockComment",
"value": "A,",
"style": "line"
},
"digest": null
}
}
],
"3": [
@ -72,27 +65,16 @@ expression: actual
"type": "blockComment",
"value": "B,",
"style": "line"
},
"digest": null
}
}
]
},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
"start": []
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 4,
"end": 9,
"name": "props",
"digest": null
"name": "props"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 80,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 26,
"end": 27,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 29,
"end": 30,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,19 +53,15 @@ expression: actual
"type": "Identifier",
"start": 65,
"end": 66,
"name": "c",
"digest": null
"name": "c"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 68,
"end": 69,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
"raw": "3"
}
}
],
"nonCodeMeta": {
@ -85,27 +75,16 @@ expression: actual
"type": "blockComment",
"value": "b: 2,",
"style": "line"
},
"digest": null
}
}
]
},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
"start": []
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 4,
"end": 9,
"name": "props",
"digest": null
"name": "props"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 79,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 26,
"end": 27,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 29,
"end": 30,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,19 +53,15 @@ expression: actual
"type": "Identifier",
"start": 65,
"end": 66,
"name": "c",
"digest": null
"name": "c"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 68,
"end": 69,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
"raw": "3"
}
}
],
"nonCodeMeta": {
@ -85,27 +75,16 @@ expression: actual
"type": "blockComment",
"value": "b: 2,",
"style": "line"
},
"digest": null
}
}
]
},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
"start": []
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 11,
"name": "myVar",
"digest": null
"name": "myVar"
},
"init": {
"type": "CallExpression",
"type": "CallExpression",
"start": 14,
"end": 36,
@ -32,21 +30,17 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 17,
"name": "min",
"digest": null
"name": "min"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 18,
"end": 19,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
},
{
"type": "UnaryExpression",
"type": "UnaryExpression",
"start": 22,
"end": 35,
@ -60,49 +54,33 @@ expression: actual
"type": "Identifier",
"start": 23,
"end": 29,
"name": "legLen",
"digest": null
"name": "legLen"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 30,
"end": 31,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
},
{
"type": "Literal",
"type": "Literal",
"start": 33,
"end": 34,
"value": 4,
"raw": "4",
"digest": null
"raw": "4"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 7,
"end": 16,
"name": "sketch001",
"digest": null
"name": "sketch001"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 19,
"end": 132,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 19,
"end": 38,
@ -38,25 +35,20 @@ expression: actual
"type": "Identifier",
"start": 19,
"end": 32,
"name": "startSketchOn",
"digest": null
"name": "startSketchOn"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 33,
"end": 37,
"value": "XY",
"raw": "'XY'",
"digest": null
"raw": "'XY'"
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 115,
"end": 132,
@ -64,20 +56,16 @@ expression: actual
"type": "Identifier",
"start": 115,
"end": 129,
"name": "startProfileAt",
"digest": null
"name": "startProfileAt"
},
"arguments": [
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 130,
"end": 131,
"digest": null
"end": 131
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
@ -91,8 +79,7 @@ expression: actual
"type": "blockComment",
"value": "|> arc({",
"style": "line"
},
"digest": null
}
},
{
"type": "NonCodeNode",
@ -102,8 +89,7 @@ expression: actual
"type": "blockComment",
"value": "angleEnd: 270,",
"style": "line"
},
"digest": null
}
},
{
"type": "NonCodeNode",
@ -113,8 +99,7 @@ expression: actual
"type": "blockComment",
"value": "angleStart: 450,",
"style": "line"
},
"digest": null
}
},
{
"type": "NonCodeNode",
@ -124,27 +109,16 @@ expression: actual
"type": "blockComment",
"value": "}, %)",
"style": "line"
},
"digest": null
}
}
]
},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
"start": []
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 7,
"end": 11,
"name": "my14",
"digest": null
"name": "my14"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 14,
"end": 31,
@ -41,8 +39,7 @@ expression: actual
"start": 14,
"end": 15,
"value": 4,
"raw": "4",
"digest": null
"raw": "4"
},
"right": {
"type": "Literal",
@ -50,10 +47,8 @@ expression: actual
"start": 18,
"end": 19,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
},
"right": {
"type": "BinaryExpression",
@ -73,8 +68,7 @@ expression: actual
"start": 22,
"end": 23,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
"right": {
"type": "Literal",
@ -82,10 +76,8 @@ expression: actual
"start": 26,
"end": 27,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
},
"right": {
"type": "Literal",
@ -93,24 +85,13 @@ expression: actual
"start": 30,
"end": 31,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
},
"digest": null
},
"digest": null
"raw": "2"
}
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,22 +20,18 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 7,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "IfExpression",
"type": "IfExpression",
"start": 10,
"end": 74,
"cond": {
"type": "Literal",
"type": "Literal",
"start": 13,
"end": 17,
"value": true,
"raw": "true",
"digest": null
"raw": "true"
},
"then_val": {
"start": 32,
@ -47,23 +43,14 @@ expression: actual
"start": 32,
"end": 33,
"expression": {
"type": "Literal",
"type": "Literal",
"start": 32,
"end": 33,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
"raw": "3"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
},
"else_ifs": [],
"final_else": {
@ -76,37 +63,20 @@ expression: actual
"start": 63,
"end": 64,
"expression": {
"type": "Literal",
"type": "Literal",
"start": 63,
"end": 64,
"value": 4,
"raw": "4",
"digest": null
},
"digest": null
"raw": "4"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
},
"digest": null
},
"digest": null
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,22 +20,18 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 7,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "IfExpression",
"type": "IfExpression",
"start": 10,
"end": 121,
"cond": {
"type": "Literal",
"type": "Literal",
"start": 13,
"end": 17,
"value": true,
"raw": "true",
"digest": null
"raw": "true"
},
"then_val": {
"start": 32,
@ -47,23 +43,14 @@ expression: actual
"start": 32,
"end": 33,
"expression": {
"type": "Literal",
"type": "Literal",
"start": 32,
"end": 33,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
"raw": "3"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
},
"else_ifs": [
{
@ -71,7 +58,6 @@ expression: actual
"start": 44,
"end": 90,
"cond": {
"type": "CallExpression",
"type": "CallExpression",
"start": 52,
"end": 64,
@ -79,21 +65,17 @@ expression: actual
"type": "Identifier",
"start": 52,
"end": 56,
"name": "func",
"digest": null
"name": "func"
},
"arguments": [
{
"type": "Identifier",
"type": "Identifier",
"start": 57,
"end": 63,
"name": "radius",
"digest": null
"name": "radius"
}
],
"optional": false,
"digest": null
"optional": false
},
"then_val": {
"start": 65,
@ -105,23 +87,14 @@ expression: actual
"start": 79,
"end": 80,
"expression": {
"type": "Literal",
"type": "Literal",
"start": 79,
"end": 80,
"value": 4,
"raw": "4",
"digest": null
},
"digest": null
"raw": "4"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
},
"digest": null
}
@ -136,37 +109,20 @@ expression: actual
"start": 110,
"end": 111,
"expression": {
"type": "Literal",
"type": "Literal",
"start": 110,
"end": 111,
"value": 5,
"raw": "5",
"digest": null
},
"digest": null
"raw": "5"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
},
"digest": null
},
"digest": null
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 4,
"end": 5,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 8,
"end": 14,
@ -35,8 +33,7 @@ expression: actual
"start": 8,
"end": 9,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
"right": {
"type": "Literal",
@ -44,22 +41,12 @@ expression: actual
"start": 13,
"end": 14,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
},
"digest": null
"raw": "3"
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 4,
"end": 5,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 8,
"end": 14,
@ -35,8 +33,7 @@ expression: actual
"start": 8,
"end": 9,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
"right": {
"type": "Literal",
@ -44,22 +41,12 @@ expression: actual
"start": 13,
"end": 14,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
},
"digest": null
"raw": "3"
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,29 +20,18 @@ expression: actual
"type": "Identifier",
"start": 0,
"end": 1,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "Literal",
"type": "Literal",
"start": 4,
"end": 5,
"value": 4,
"raw": "4",
"digest": null
},
"digest": null
"raw": "4"
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -1,6 +1,5 @@
---
source: kcl/src/parser/parser_impl.rs
assertion_line: 3718
expression: actual
---
{
@ -21,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 42,
@ -38,37 +35,29 @@ expression: actual
"type": "Identifier",
"start": 13,
"end": 19,
"name": "center",
"digest": null
"name": "center"
},
"value": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 22,
"end": 30,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 25,
"value": 10,
"raw": "10",
"digest": null
"raw": "10"
},
{
"type": "Literal",
"type": "Literal",
"start": 27,
"end": 29,
"value": 10,
"raw": "10",
"digest": null
"raw": "10"
}
],
"digest": null
},
"digest": null
]
}
},
{
"type": "ObjectProperty",
@ -78,34 +67,21 @@ expression: actual
"type": "Identifier",
"start": 32,
"end": 38,
"name": "radius",
"digest": null
"name": "radius"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 40,
"end": 41,
"value": 5,
"raw": "5",
"digest": null
},
"digest": null
"raw": "5"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 11,
"name": "myVar",
"digest": null
"name": "myVar"
},
"init": {
"type": "CallExpression",
"type": "CallExpression",
"start": 14,
"end": 35,
@ -32,12 +30,10 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 17,
"name": "min",
"digest": null
"name": "min"
},
"arguments": [
{
"type": "UnaryExpression",
"type": "UnaryExpression",
"start": 18,
"end": 31,
@ -51,58 +47,40 @@ expression: actual
"type": "Identifier",
"start": 19,
"end": 25,
"name": "legLen",
"digest": null
"name": "legLen"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 26,
"end": 27,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
},
{
"type": "Literal",
"type": "Literal",
"start": 29,
"end": 30,
"value": 4,
"raw": "4",
"digest": null
"raw": "4"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
},
{
"type": "Literal",
"type": "Literal",
"start": 33,
"end": 34,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 11,
"name": "myVar",
"digest": null
"name": "myVar"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 14,
"end": 36,
"body": [
{
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 14,
"end": 19,
@ -41,8 +38,7 @@ expression: actual
"start": 14,
"end": 15,
"value": 5,
"raw": "5",
"digest": null
"raw": "5"
},
"right": {
"type": "Literal",
@ -50,13 +46,10 @@ expression: actual
"start": 18,
"end": 19,
"value": 6,
"raw": "6",
"digest": null
},
"digest": null
"raw": "6"
}
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 23,
"end": 36,
@ -64,49 +57,29 @@ expression: actual
"type": "Identifier",
"start": 23,
"end": 29,
"name": "myFunc",
"digest": null
"name": "myFunc"
},
"arguments": [
{
"type": "Literal",
"type": "Literal",
"start": 30,
"end": 32,
"value": 45,
"raw": "45",
"digest": null
"raw": "45"
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 34,
"end": 35,
"digest": null
"end": 35
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 7,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 10,
"end": 27,
@ -40,32 +38,20 @@ expression: actual
"type": "Identifier",
"start": 11,
"end": 15,
"name": "leg2",
"digest": null
},
"digest": null
"name": "leg2"
}
},
"right": {
"type": "Identifier",
"type": "Identifier",
"start": 18,
"end": 27,
"name": "thickness",
"digest": null
},
"digest": null
},
"digest": null
"name": "thickness"
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 4,
"end": 5,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 8,
"end": 18,
@ -35,8 +33,7 @@ expression: actual
"start": 8,
"end": 9,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "BinaryExpression",
@ -50,8 +47,7 @@ expression: actual
"start": 13,
"end": 14,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
"right": {
"type": "Literal",
@ -59,24 +55,13 @@ expression: actual
"start": 17,
"end": 18,
"value": 4,
"raw": "4",
"digest": null
},
"digest": null
},
"digest": null
},
"digest": null
"raw": "4"
}
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,23 +20,18 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 7,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "Literal",
"type": "Literal",
"start": 10,
"end": 11,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
@ -50,13 +45,10 @@ expression: actual
"type": "inlineComment",
"value": "this is an inline comment",
"style": "line"
},
"digest": null
}
}
]
},
"start": [],
"digest": null
},
"digest": null
"start": []
}
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 3,
"end": 4,
"name": "x",
"digest": null
"name": "x"
},
"init": {
"type": "FunctionExpression",
"type": "FunctionExpression",
"start": 7,
"end": 58,
@ -39,14 +37,11 @@ expression: actual
"start": 23,
"end": 32,
"argument": {
"type": "Identifier",
"type": "Identifier",
"start": 30,
"end": 32,
"name": "sg",
"digest": null
},
"digest": null
"name": "sg"
}
},
{
"type": "ReturnStatement",
@ -54,36 +49,18 @@ expression: actual
"start": 41,
"end": 50,
"argument": {
"type": "Identifier",
"type": "Identifier",
"start": 48,
"end": 50,
"name": "sg",
"digest": null
},
"digest": null
"name": "sg"
}
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
},
"digest": null
]
}
}
}
],
"kind": "fn",
"digest": null
"kind": "fn"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 26,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,28 +53,21 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 21,
"name": "b",
"digest": null
"name": "b"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 24,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
},
{
"type": "VariableDeclaration",
@ -96,11 +83,9 @@ expression: actual
"type": "Identifier",
"start": 37,
"end": 43,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 46,
"end": 55,
@ -111,8 +96,7 @@ expression: actual
"start": 46,
"end": 47,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "MemberExpression",
@ -124,33 +108,21 @@ expression: actual
"type": "Identifier",
"start": 50,
"end": 53,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 54,
"end": 55,
"name": "a",
"digest": null
"name": "a"
},
"computed": false,
"digest": null
},
"digest": null
},
"digest": null
"computed": false
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 26,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,28 +53,21 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 21,
"name": "b",
"digest": null
"name": "b"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 24,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
},
{
"type": "VariableDeclaration",
@ -96,11 +83,9 @@ expression: actual
"type": "Identifier",
"start": 38,
"end": 44,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 47,
"end": 59,
@ -111,8 +96,7 @@ expression: actual
"start": 47,
"end": 48,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "MemberExpression",
@ -124,8 +108,7 @@ expression: actual
"type": "Identifier",
"start": 51,
"end": 54,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Literal",
@ -133,25 +116,14 @@ expression: actual
"start": 55,
"end": 58,
"value": "a",
"raw": "\"a\"",
"digest": null
"raw": "\"a\""
},
"computed": false,
"digest": null
},
"digest": null
},
"digest": null
"computed": false
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 26,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,28 +53,21 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 21,
"name": "b",
"digest": null
"name": "b"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 24,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
},
{
"type": "VariableDeclaration",
@ -96,11 +83,9 @@ expression: actual
"type": "Identifier",
"start": 37,
"end": 43,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 46,
"end": 58,
@ -115,8 +100,7 @@ expression: actual
"type": "Identifier",
"start": 46,
"end": 49,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Literal",
@ -124,11 +108,9 @@ expression: actual
"start": 50,
"end": 53,
"value": "a",
"raw": "\"a\"",
"digest": null
"raw": "\"a\""
},
"computed": false,
"digest": null
"computed": false
},
"right": {
"type": "Literal",
@ -136,22 +118,12 @@ expression: actual
"start": 57,
"end": 58,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
},
"digest": null
"raw": "1"
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 26,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,28 +53,21 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 21,
"name": "b",
"digest": null
"name": "b"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 24,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
},
{
"type": "VariableDeclaration",
@ -96,17 +83,14 @@ expression: actual
"type": "Identifier",
"start": 37,
"end": 43,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 46,
"end": 63,
"elements": [
{
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 47,
"end": 59,
@ -117,8 +101,7 @@ expression: actual
"start": 47,
"end": 48,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "MemberExpression",
@ -130,8 +113,7 @@ expression: actual
"type": "Identifier",
"start": 51,
"end": 54,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Literal",
@ -139,37 +121,23 @@ expression: actual
"start": 55,
"end": 58,
"value": "a",
"raw": "\"a\"",
"digest": null
"raw": "\"a\""
},
"computed": false,
"digest": null
},
"digest": null
"computed": false
}
},
{
"type": "Literal",
"type": "Literal",
"start": 61,
"end": 62,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 26,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,28 +53,21 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 21,
"name": "b",
"digest": null
"name": "b"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 24,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
},
{
"type": "VariableDeclaration",
@ -96,17 +83,14 @@ expression: actual
"type": "Identifier",
"start": 37,
"end": 43,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 46,
"end": 63,
"elements": [
{
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 47,
"end": 59,
@ -121,8 +105,7 @@ expression: actual
"type": "Identifier",
"start": 47,
"end": 50,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Literal",
@ -130,11 +113,9 @@ expression: actual
"start": 51,
"end": 54,
"value": "a",
"raw": "\"a\"",
"digest": null
"raw": "\"a\""
},
"computed": false,
"digest": null
"computed": false
},
"right": {
"type": "Literal",
@ -142,34 +123,21 @@ expression: actual
"start": 58,
"end": 59,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "Literal",
"type": "Literal",
"start": 61,
"end": 62,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 26,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,28 +53,21 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 21,
"name": "b",
"digest": null
"name": "b"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 24,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
},
{
"type": "VariableDeclaration",
@ -96,17 +83,14 @@ expression: actual
"type": "Identifier",
"start": 37,
"end": 43,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 46,
"end": 62,
"elements": [
{
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 47,
"end": 58,
@ -121,8 +105,7 @@ expression: actual
"type": "Identifier",
"start": 47,
"end": 50,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Literal",
@ -130,11 +113,9 @@ expression: actual
"start": 51,
"end": 54,
"value": "a",
"raw": "\"a\"",
"digest": null
"raw": "\"a\""
},
"computed": false,
"digest": null
"computed": false
},
"right": {
"type": "Literal",
@ -142,34 +123,21 @@ expression: actual
"start": 57,
"end": 58,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "Literal",
"type": "Literal",
"start": 60,
"end": 61,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 12,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 15,
"end": 24,
@ -35,8 +33,7 @@ expression: actual
"start": 15,
"end": 16,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "MemberExpression",
@ -48,33 +45,21 @@ expression: actual
"type": "Identifier",
"start": 19,
"end": 22,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 23,
"end": 24,
"name": "a",
"digest": null
"name": "a"
},
"computed": false,
"digest": null
},
"digest": null
},
"digest": null
"computed": false
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "six",
"digest": null
"name": "six"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 12,
"end": 21,
@ -41,8 +39,7 @@ expression: actual
"start": 12,
"end": 13,
"value": 1,
"raw": "1",
"digest": null
"raw": "1"
},
"right": {
"type": "Literal",
@ -50,10 +47,8 @@ expression: actual
"start": 16,
"end": 17,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
},
"right": {
"type": "Literal",
@ -61,22 +56,12 @@ expression: actual
"start": 20,
"end": 21,
"value": 3,
"raw": "3",
"digest": null
},
"digest": null
},
"digest": null
"raw": "3"
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 10,
"name": "five",
"digest": null
"name": "five"
},
"init": {
"type": "BinaryExpression",
"type": "BinaryExpression",
"start": 13,
"end": 22,
@ -41,8 +39,7 @@ expression: actual
"start": 13,
"end": 14,
"value": 3,
"raw": "3",
"digest": null
"raw": "3"
},
"right": {
"type": "Literal",
@ -50,10 +47,8 @@ expression: actual
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
"right": {
"type": "Literal",
@ -61,22 +56,12 @@ expression: actual
"start": 21,
"end": 22,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
},
"digest": null
"raw": "2"
}
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 12,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 15,
"end": 30,
"elements": [
{
"type": "MemberExpression",
"type": "MemberExpression",
"start": 17,
"end": 25,
@ -39,8 +36,7 @@ expression: actual
"type": "Identifier",
"start": 17,
"end": 20,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Literal",
@ -48,35 +44,22 @@ expression: actual
"start": 21,
"end": 24,
"value": "a",
"raw": "\"a\"",
"digest": null
"raw": "\"a\""
},
"computed": false,
"digest": null
"computed": false
},
{
"type": "Literal",
"type": "Literal",
"start": 27,
"end": 28,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "obj",
"digest": null
"name": "obj"
},
"init": {
"type": "ObjectExpression",
"type": "ObjectExpression",
"start": 12,
"end": 26,
@ -37,19 +35,15 @@ expression: actual
"type": "Identifier",
"start": 14,
"end": 15,
"name": "a",
"digest": null
"name": "a"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 17,
"end": 18,
"value": 1,
"raw": "1",
"digest": null
},
"digest": null
"raw": "1"
}
},
{
"type": "ObjectProperty",
@ -59,28 +53,21 @@ expression: actual
"type": "Identifier",
"start": 20,
"end": 21,
"name": "b",
"digest": null
"name": "b"
},
"value": {
"type": "Literal",
"type": "Literal",
"start": 23,
"end": 24,
"value": 2,
"raw": "2",
"digest": null
},
"digest": null
"raw": "2"
}
}
],
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
},
{
"type": "VariableDeclaration",
@ -96,11 +83,9 @@ expression: actual
"type": "Identifier",
"start": 37,
"end": 43,
"name": "height",
"digest": null
"name": "height"
},
"init": {
"type": "MemberExpression",
"type": "MemberExpression",
"start": 46,
"end": 54,
@ -109,8 +94,7 @@ expression: actual
"type": "Identifier",
"start": 46,
"end": 49,
"name": "obj",
"digest": null
"name": "obj"
},
"property": {
"type": "Literal",
@ -118,23 +102,13 @@ expression: actual
"start": 50,
"end": 53,
"value": "a",
"raw": "\"a\"",
"digest": null
"raw": "\"a\""
},
"computed": false,
"digest": null
},
"digest": null
"computed": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 10,
"name": "prop",
"digest": null
"name": "prop"
},
"init": {
"type": "MemberExpression",
"type": "MemberExpression",
"start": 13,
"end": 27,
@ -38,8 +36,7 @@ expression: actual
"type": "Identifier",
"start": 13,
"end": 15,
"name": "yo",
"digest": null
"name": "yo"
},
"property": {
"type": "Literal",
@ -47,34 +44,22 @@ expression: actual
"start": 16,
"end": 21,
"value": "one",
"raw": "\"one\"",
"digest": null
"raw": "\"one\""
},
"computed": false,
"digest": null
"computed": false
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 23,
"end": 26,
"name": "two",
"digest": null
"name": "two"
},
"computed": true,
"digest": null
},
"digest": null
"computed": true
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "pt1",
"digest": null
"name": "pt1"
},
"init": {
"type": "MemberExpression",
"type": "MemberExpression",
"start": 12,
"end": 17,
@ -33,31 +31,20 @@ expression: actual
"type": "Identifier",
"start": 12,
"end": 14,
"name": "b1",
"digest": null
"name": "b1"
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 15,
"end": 16,
"name": "x",
"digest": null
"name": "x"
},
"computed": true,
"digest": null
},
"digest": null
"computed": true
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 10,
"name": "prop",
"digest": null
"name": "prop"
},
"init": {
"type": "MemberExpression",
"type": "MemberExpression",
"start": 13,
"end": 34,
@ -48,64 +46,47 @@ expression: actual
"type": "Identifier",
"start": 13,
"end": 15,
"name": "yo",
"digest": null
"name": "yo"
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 16,
"end": 19,
"name": "one",
"digest": null
"name": "one"
},
"computed": false,
"digest": null
"computed": false
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 20,
"end": 23,
"name": "two",
"digest": null
"name": "two"
},
"computed": false,
"digest": null
"computed": false
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 24,
"end": 29,
"name": "three",
"digest": null
"name": "three"
},
"computed": false,
"digest": null
"computed": false
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 30,
"end": 34,
"name": "four",
"digest": null
"name": "four"
},
"computed": false,
"digest": null
},
"digest": null
"computed": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "pt1",
"digest": null
"name": "pt1"
},
"init": {
"type": "MemberExpression",
"type": "MemberExpression",
"start": 12,
"end": 17,
@ -33,8 +31,7 @@ expression: actual
"type": "Identifier",
"start": 12,
"end": 14,
"name": "b1",
"digest": null
"name": "b1"
},
"property": {
"type": "Literal",
@ -42,23 +39,13 @@ expression: actual
"start": 15,
"end": 16,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
"computed": false,
"digest": null
},
"digest": null
"computed": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "pt1",
"digest": null
"name": "pt1"
},
"init": {
"type": "MemberExpression",
"type": "MemberExpression",
"start": 12,
"end": 22,
@ -33,8 +31,7 @@ expression: actual
"type": "Identifier",
"start": 12,
"end": 14,
"name": "b1",
"digest": null
"name": "b1"
},
"property": {
"type": "Literal",
@ -42,23 +39,13 @@ expression: actual
"start": 15,
"end": 21,
"value": "zero",
"raw": "'zero'",
"digest": null
"raw": "'zero'"
},
"computed": false,
"digest": null
},
"digest": null
"computed": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 9,
"name": "pt1",
"digest": null
"name": "pt1"
},
"init": {
"type": "MemberExpression",
"type": "MemberExpression",
"start": 12,
"end": 19,
@ -33,31 +31,20 @@ expression: actual
"type": "Identifier",
"start": 12,
"end": 14,
"name": "b1",
"digest": null
"name": "b1"
},
"property": {
"type": "Identifier",
"type": "Identifier",
"start": 15,
"end": 19,
"name": "zero",
"digest": null
"name": "zero"
},
"computed": false,
"digest": null
},
"digest": null
"computed": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,11 +20,9 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 8,
"name": "sg",
"digest": null
"name": "sg"
},
"init": {
"type": "CallExpression",
"type": "CallExpression",
"start": 11,
"end": 29,
@ -32,33 +30,21 @@ expression: actual
"type": "Identifier",
"start": 11,
"end": 24,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "Identifier",
"type": "Identifier",
"start": 25,
"end": 28,
"name": "pos",
"digest": null
"name": "pos"
}
],
"optional": false,
"digest": null
},
"digest": null
"optional": false
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -20,17 +20,14 @@ expression: actual
"type": "Identifier",
"start": 6,
"end": 8,
"name": "sg",
"digest": null
"name": "sg"
},
"init": {
"type": "PipeExpression",
"type": "PipeExpression",
"start": 11,
"end": 53,
"body": [
{
"type": "CallExpression",
"type": "CallExpression",
"start": 11,
"end": 29,
@ -38,24 +35,19 @@ expression: actual
"type": "Identifier",
"start": 11,
"end": 24,
"name": "startSketchAt",
"digest": null
"name": "startSketchAt"
},
"arguments": [
{
"type": "Identifier",
"type": "Identifier",
"start": 25,
"end": 28,
"name": "pos",
"digest": null
"name": "pos"
}
],
"optional": false,
"digest": null
"optional": false
},
{
"type": "CallExpression",
"type": "CallExpression",
"start": 33,
"end": 53,
@ -63,27 +55,22 @@ expression: actual
"type": "Identifier",
"start": 33,
"end": 37,
"name": "line",
"digest": null
"name": "line"
},
"arguments": [
{
"type": "ArrayExpression",
"type": "ArrayExpression",
"start": 38,
"end": 49,
"elements": [
{
"type": "Literal",
"type": "Literal",
"start": 39,
"end": 40,
"value": 0,
"raw": "0",
"digest": null
"raw": "0"
},
{
"type": "UnaryExpression",
"type": "UnaryExpression",
"start": 42,
"end": 48,
@ -93,44 +80,24 @@ expression: actual
"type": "Identifier",
"start": 43,
"end": 48,
"name": "scale",
"digest": null
},
"digest": null
"name": "scale"
}
}
],
"digest": null
]
},
{
"type": "PipeSubstitution",
"type": "PipeSubstitution",
"start": 51,
"end": 52,
"digest": null
"end": 52
}
],
"optional": false,
"digest": null
"optional": false
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
},
"digest": null
]
}
}
],
"kind": "const",
"digest": null
"kind": "const"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"start": [],
"digest": null
},
"digest": null
]
}

View File

@ -108,7 +108,7 @@ gen_test_fail!(
);
gen_test_fail!(
invalid_index_negative,
"semantic: i's value is not a valid property/index, you can only use a string or int (>= 0) here"
"semantic: '-1' is not a valid index, indices must be whole positive numbers"
);
gen_test_fail!(
invalid_index_fractional,