🚨🦀 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
This commit is contained in:
Kurt Hutten
2023-02-21 09:42:41 +11:00
committed by GitHub
parent 594d55576a
commit cb8e97eceb
22 changed files with 1181 additions and 381 deletions

View File

@ -79,7 +79,7 @@ function MovingSphere({
const handleMouseUp = () => {
if (isMouseDown && ast) {
const thePath = getNodePathFromSourceRange(ast, sourceRange)
const yo = point2DRef.current.clone()
const current2d = point2DRef.current.clone()
const inverseQuaternion = new Quaternion()
if (
guiMode.mode === 'canEditSketch' ||
@ -88,8 +88,8 @@ function MovingSphere({
inverseQuaternion.set(...guiMode.rotation)
inverseQuaternion.invert()
}
yo.sub(new Vector3(...position).applyQuaternion(inverseQuaternion))
let [x, y] = [roundOff(yo.x, 2), roundOff(yo.y, 2)]
current2d.sub(new Vector3(...position).applyQuaternion(inverseQuaternion))
let [x, y] = [roundOff(current2d.x, 2), roundOff(current2d.y, 2)]
let theNewPoints: [number, number] = [x, y]
const { modifiedAst } = changeSketchArguments(
ast,