Commit Graph

3894 Commits

Author SHA1 Message Date
cb8e97eceb 🚨🦀 Setup Rust -> WASM 🦀🚨 (#28)
* initial tokeniser to wasm port

* fix tests

* add wasm to build script

* add rust tools to test action

* tweaks

* maybe tests will be happy

* tweak simple server

* trying to get tests to pass

* it pget vercel to build

* tidy up

* clean up rust files

* change lexer to use recursion so that it's consistent with the rest of the interpreter

* clean up nokeniser further

* rename variables

* readme typos

* run rust tests in CI

* follow clippy's advice

* more clippy clean up

* setup up proper serialzation to js-land

* tidy init promise in tests
2023-02-21 09:42:41 +11:00
594d55576a functional sketch working (#26)
* functional sketch working

With old sketch block still there

* get all version of lines working with add line and update line

* remove old ui state types

* some clean up

* rename some things

* add todo for multi cursor

* shorten useStore repitition

* small type improvement

* big overhaul to group sketch function and they ast modifying helpers together

* unneeded tweak

* ruthlessly rip out sketch logic

* clean up path keyword

* getting sketch on face working again with all the new sketch line types

* add a bunch of tests and re-arrage file structure
2023-02-12 10:56:45 +11:00
3404529743 tweak logs (#23) 2023-02-03 11:31:37 +11:00
9bb4f68794 change logs aswell (#21)
* kurt-19-change-logs-aswell

* fix tests
2023-02-03 11:09:09 +11:00
487d61b862 add memory dump panel (#20) 2023-02-03 10:04:16 +11:00
96720023db clean up panels a little (#18) 2023-02-02 20:41:28 +11:00
29e06ec852 Add non-code metadata to the ast (#15)
* Revert "wire up comments to ui (#11)"

This reverts commit bdf778530f.

* Revert "Add the ability to recast comments and some whitespace (#10)"

This reverts commit dd5022b38e.

* ast metadata

* clean up
2023-02-01 07:30:55 +11:00
bdf778530f wire up comments to ui (#11) 2023-01-24 21:09:00 +11:00
dd5022b38e Add the ability to recast comments and some whitespace (#10)
* Add the ability to recast comments and some whitespace

Currently because whitespace or anything that's not needed for execution is not stored in the AST, it's hard to respect things like user formatting when recasting.

I think having a by-default-opinioned formatter is a good thing, but where this becomes problematic is when users wants to simply leave a blank space between some lines for a bit of breathing room, a code paragraph if you will, but maybe more importantly comments have not been implemented for the same reason, there wasn't a way with the current setup to insert them back in.

In some ways the most straightforward way to do this is to put whitespace and comments into the AST. Even though they are not crucial for execution, code-gen/recasting needs to be a first-class citizen in this lang so that's probably the long-term solution. However I'm trying to draw inspiration from other languages, and since it's not the norm to put comments et-al into the AST I haven't done so.

Because whitespace is tokenised already if not transformed into the AST, there is somewhat of a map of these things without going back to source code, so atm I'm experimenting with using this to insert extra linebreaks and comments back in between statements. I think this is a good compromise for the time being for what is a nice to have feature atm.

Because it's only going to respect non-code parts in between statements this will mean that you can't format objects or function params how you like (but I think this is good to have an opinioned fmt out of the box) and comments like myFunctionCall('a', /* inline comment */ b) will not work either.

* clean up
2023-01-23 14:50:58 +11:00
18629ea50c Update README.md (#8) 2023-01-22 07:46:53 +11:00
9540c2fca5 clean up (#7) 2023-01-22 07:43:28 +11:00
e37f68424b Improved math expressions (#6)
* Improved math expressions

Things are in a better state, + - / * work now for basic const var = 5 <operator> 1

Though the current method I'm using to make the ast isn't really going to work for dealing with precedence rules so some refactoring is needed going forward

* get complex math expressions working with precedence including parans

Node that identifiers are working, call expressions are not, that's a TODO
/ * % + - are working both other things like exponent and logical operators are also not working.
Recasting is the most important thing to implement next

* get recasting working for nested binary expressions

* clean up
2023-01-21 21:23:01 +11:00
d61c003f82 refactor internal fns (#4) 2023-01-17 16:14:09 +11:00
2aadcd5c21 Merge pull request #3 from KittyCAD/kurt-setup-tests
setup tests
2023-01-13 18:16:53 +11:00
9d2f322bb1 Merge pull request #2 from KittyCAD/kurt-extrude-focus
focus on extrude literal when extruding sketch
2023-01-13 18:16:30 +11:00
9ec332d681 focus on extrude literal when extruding sketch 2023-01-13 18:13:23 +11:00
5a8e500a94 setup tests 2023-01-13 18:10:48 +11:00
bd9dab8a29 Update README.md 2023-01-12 11:55:58 +11:00
5b6dd5bfd1 Update README.md 2023-01-12 11:49:01 +11:00
9dbc1ee875 quick fix 2023-01-12 10:49:11 +11:00
cb16d3efd7 rename file 2023-01-10 15:42:22 +11:00
3fefc1cca2 number of stability fixes 2023-01-10 15:40:34 +11:00
ed686e5e69 initial implementation of sketching on extrude face 2023-01-09 13:19:14 +11:00
2e007ae288 Add sketch on extrude face functionality 2023-01-09 08:52:48 +11:00
9ad6b946c0 massive overhall to how program memory works and how artifacts their metada are rendered 2023-01-08 16:37:31 +11:00
0515acf459 add button for extruding sketches 2023-01-06 12:45:34 +11:00
82f4616032 refactor ast modifing function into seperate module 2023-01-06 09:29:26 +11:00
43454ce2e3 use more generic variable names for parts 2023-01-06 09:18:40 +11:00
248317f354 set cursor on geo click 2023-01-06 09:07:22 +11:00
f9e2f163a4 remove hardcoded extrude length 2023-01-05 15:03:27 +11:00
6ab93e85fe fix line edit on transformed sketches 2023-01-05 15:01:27 +11:00
0779befc65 fix sketch plan orientation 2023-01-04 01:28:26 +11:00
a1f844b0b1 add member expression 2023-01-03 19:41:27 +11:00
d2a4bb7851 refactor makeValue and makeDeclatator to reduce code duplication 2023-01-02 12:20:32 +11:00
dbf8a993e5 add object declarations 2023-01-01 21:48:30 +11:00
84d76b5763 allow array as callexpression argument 2023-01-01 13:45:23 +11:00
d80d487d08 remove log 2023-01-01 07:51:19 +11:00
6b19966e49 update near far cam settings 2023-01-01 07:50:09 +11:00
ca33896dc1 add translate and fix up quaternion and transform logic 2023-01-01 07:49:45 +11:00
3d6f5982c2 add array declarations 2022-12-30 21:53:50 +11:00
f6c4250947 add start of extrude 2022-12-30 14:09:07 +11:00
8818d9cec1 use quaternions for artifact transforms 2022-12-27 05:57:30 +11:00
b09aae84fc fix edit sketch from cursor 2022-12-25 21:14:43 +11:00
1c1ceae4d3 fmt 2022-12-23 07:47:46 +11:00
544f20852c make 'axis' redundant 2022-12-23 07:45:47 +11:00
07a40cdd11 port over to quanternions 2022-12-23 07:37:42 +11:00
6abc0d2798 make offline safe 2022-12-18 08:13:46 +11:00
cecc4b1f01 drag sphere - edit sketch working for xy plane 2022-12-07 10:02:21 +11:00
034c903672 add the ability to edit sketch later 2022-12-06 05:40:05 +11:00
847b0b5b28 add helper 'getNodePathFromSourceRange' and it's test 2022-12-04 18:35:32 +11:00