diff --git a/.github/workflows/build-apps.yml b/.github/workflows/build-apps.yml index 930038027..d3c4da1e0 100644 --- a/.github/workflows/build-apps.yml +++ b/.github/workflows/build-apps.yml @@ -362,6 +362,17 @@ jobs: - name: List artifacts run: "ls -R out" + - name: Set more complete nightly release notes + if: ${{ env.IS_NIGHTLY == 'true' }} + run: | + # Note: prefered going this way instead of a full clone in the checkout step, + # see https://github.com/actions/checkout/issues/1471 + git fetch --prune --unshallow --tags + export TAG="nightly-${VERSION}" + export PREVIOUS_TAG=$(git describe --tags --match="nightly-v[0-9]*" --abbrev=0) + export NOTES=$(./scripts/get-nightly-changelog.sh) + yarn files:set-notes + - name: Authenticate to Google Cloud if: ${{ env.IS_NIGHTLY == 'true' }} uses: 'google-github-actions/auth@v2.1.7' @@ -382,3 +393,14 @@ jobs: glob: '*' parent: false destination: 'dl.kittycad.io/releases/modeling-app/nightly' + + - name: Tag nightly commit + if: ${{ env.IS_NIGHTLY == 'true' }} + uses: actions/github-script@v7 + with: + script: | + const { VERSION } = process.env + const { owner, repo } = context.repo + const { sha } = context + const ref = `refs/tags/nightly-${VERSION}` + github.rest.git.createRef({ owner, repo, sha, ref }) diff --git a/docs/kcl/rem.md b/docs/kcl/rem.md index 92cc2c93c..23435a707 100644 --- a/docs/kcl/rem.md +++ b/docs/kcl/rem.md @@ -32,9 +32,9 @@ rem(num: i64, divisor: i64) -> i64 ### Examples ```js -assertEqual(rem(7, 4), 3, 0.01, "remainder is 3") -assertEqual(rem(-7, 4), -3, 0.01, "remainder is 3") -assertEqual(rem(7, -4), 3, 0.01, "remainder is 3") +assertEqual(rem(7, divisor: 4), 3, 0.01, "remainder is 3") +assertEqual(rem(-7, divisor: 4), -3, 0.01, "remainder is 3") +assertEqual(rem(7, divisor: -4), 3, 0.01, "remainder is 3") ``` ![Rendered example of rem 0](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABQAAAALQCAYAAADPfd1WAABMiklEQVR4Ae3AA6AkWZbG8f937o3IzKdyS2Oubdu2bdu2bdu2bWmMnpZKr54yMyLu+Xa3anqmhztr1a8+6EEP4qqrrrrqqquuuuqqq6666qqrrrrqqquu+j+JylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V9F5aqrrrrqqquuuuqqq6666qqrrrrqqquu+r+KylVXXXXVVVddddVVV1111VVXXXXVVVdd9X8Vlauuuuqqq6666qqrrrrqqquuuuqqq6666v8qKlddddVVV1111VVXXXXVVVddddVVV1111f9VVK666qqrrrrqqquuuuqqq6666qqrrrrqqv+rqFx11VVXXXXVVVddddVVV1111VVXXXXVVf9XUbnqqquuuuqqq6666qqrrrrqqquuuuqqq/6vonLVVVddddVVV1111VVXXXXVVVddddVVV/1fReWqq6666qqrrrrqqquuuuqqq6666qqrrvq/ispVV1111VVXXXXVVVddddVVV1111VVXXfV/FZWrrrrqqquuuuqqq6666qqrrrrqqquuuur/KipXXXXVVVddddVVV1111VVXXXXVVVddddX/VVSuuuqqq6666qqrrrrqqquuuuqqq6666qr/q6hcddVVV1111VVXXXXVVVddddVVV1111VX/V1G56qqrrrrqqquuuuqqq6666qqrrrrqqqv+r6Jy1VVXXXXVVVddddVVV1111VVXXXXVVVf9X0Xlqquuuuqqq6666qqrrrrqqquuuuqqq676v4rKVVddddVVV1111VVXXXXVVVddddVVV131fxWVq6666qqrrrrqqquuuuqqq6666qqrrrrq/yoqV1111VVXXXXVVVddddVVV1111VVXXXXV/1VUrrrqqquuuuqqq6666qqrrrrqqquuuuqq/6uoXHXVVVddddVVV1111VVXXXXVVVddddVV/1dRueqqq6666qqrrrrqqquuuuqqq6666qqr/q+ictVVV1111VVXXXXVVVddddVVV1111VVX/V/FPwKn4gueWQqZ4gAAAABJRU5ErkJggg==) diff --git a/docs/kcl/std.json b/docs/kcl/std.json index 046ac3a29..db3ee35b4 100644 --- a/docs/kcl/std.json +++ b/docs/kcl/std.json @@ -6,6 +6,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -16,7 +17,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -28,7 +30,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -43,6 +46,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -53,7 +57,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -65,7 +70,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -78,6 +84,7 @@ "summary": "Returns the angle to match the given length for x.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -956,7 +963,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "to", @@ -1813,7 +1821,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -3183,7 +3192,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -3195,7 +3205,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -3208,6 +3219,7 @@ "summary": "Returns the angle to match the given length for y.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -4086,7 +4098,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "to", @@ -4943,7 +4956,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -6313,7 +6327,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -6325,7 +6340,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -6338,6 +6354,7 @@ "summary": "Draw a line segment relative to the current origin using the polar", "description": "measure of some angle and distance.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -6379,7 +6396,8 @@ } ] }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -7749,7 +7767,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -9072,7 +9091,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -10443,7 +10463,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -10456,6 +10477,7 @@ "summary": "Create a line segment from the current 2-dimensional sketch origin", "description": "along some angle (in degrees) for some relative length in the 'x' dimension.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -10497,7 +10519,8 @@ } ] }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -11867,7 +11890,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -13190,7 +13214,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -14561,7 +14586,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -14574,6 +14600,7 @@ "summary": "Create a line segment from the current 2-dimensional sketch origin", "description": "along some angle (in degrees) for some relative length in the 'y' dimension.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -14615,7 +14642,8 @@ } ] }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -15985,7 +16013,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -17308,7 +17337,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -18679,7 +18709,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -18692,6 +18723,7 @@ "summary": "Draw an angled line from the current origin, constructing a line segment", "description": "such that the newly created line intersects the desired target line segment.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -19599,7 +19631,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -20969,7 +21002,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -22292,7 +22326,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -23663,7 +23698,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -23676,6 +23712,7 @@ "summary": "Create a line segment from the current 2-dimensional sketch origin", "description": "along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -23702,7 +23739,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -25072,7 +25110,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -26395,7 +26434,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -27766,7 +27806,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -27779,6 +27820,7 @@ "summary": "Create a line segment from the current 2-dimensional sketch origin", "description": "along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -27805,7 +27847,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -29175,7 +29218,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -30498,7 +30542,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -31869,7 +31914,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -31882,6 +31928,7 @@ "summary": "Draw a curved line segment along an imaginary circle.", "description": "The arc is constructed such that the current position of the sketch is placed along an imaginary circle of the specified radius, at angleStart degrees. The resulting arc is the segment of the imaginary circle from that origin point to angleEnd, radius away from the center of the imaginary circle.\n\nUnless this makes a lot of sense and feels like what you're looking for to construct your shape, you're likely looking for tangentialArc.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -31959,7 +32006,8 @@ } ] }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -33329,7 +33377,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -34652,7 +34701,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -36023,7 +36073,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -36036,6 +36087,7 @@ "summary": "Draw a 3 point arc.", "description": "The arc is constructed such that the start point is the current position of the sketch and two more points defined as the end and interior point. The interior point is placed between the start point and end point. The radius of the arc will be controlled by how far the interior point is placed from the start and end.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -36072,7 +36124,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -37442,7 +37495,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -38765,7 +38819,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -40136,7 +40191,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40151,6 +40207,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -40161,7 +40218,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40173,7 +40231,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40186,6 +40245,7 @@ "summary": "Check a value at runtime, and raise an error if the argument provided", "description": "is false.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -40195,7 +40255,8 @@ "title": "Boolean", "type": "boolean" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "message", @@ -40205,7 +40266,8 @@ "title": "String", "type": "string" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40216,7 +40278,8 @@ "title": "Null", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40229,6 +40292,7 @@ "summary": "Check that a numerical value equals another at runtime,", "description": "otherwise raise an error.", "tags": [], + "keywordArguments": false, "args": [ { "name": "left", @@ -40239,7 +40303,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "right", @@ -40250,7 +40315,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "epsilon", @@ -40261,7 +40327,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "message", @@ -40271,7 +40338,8 @@ "title": "String", "type": "string" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40282,7 +40350,8 @@ "title": "Null", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40295,6 +40364,7 @@ "summary": "Check that a numerical value is greater than another at runtime,", "description": "otherwise raise an error.", "tags": [], + "keywordArguments": false, "args": [ { "name": "left", @@ -40305,7 +40375,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "right", @@ -40316,7 +40387,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "message", @@ -40326,7 +40398,8 @@ "title": "String", "type": "string" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40337,7 +40410,8 @@ "title": "Null", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40350,6 +40424,7 @@ "summary": "Check that a numerical value is greater than or equal to another at runtime,", "description": "otherwise raise an error.", "tags": [], + "keywordArguments": false, "args": [ { "name": "left", @@ -40360,7 +40435,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "right", @@ -40371,7 +40447,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "message", @@ -40381,7 +40458,8 @@ "title": "String", "type": "string" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40392,7 +40470,8 @@ "title": "Null", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40405,6 +40484,7 @@ "summary": "Check that a numerical value is less than to another at runtime,", "description": "otherwise raise an error.", "tags": [], + "keywordArguments": false, "args": [ { "name": "left", @@ -40415,7 +40495,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "right", @@ -40426,7 +40507,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "message", @@ -40436,7 +40518,8 @@ "title": "String", "type": "string" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40447,7 +40530,8 @@ "title": "Null", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40460,6 +40544,7 @@ "summary": "Check that a numerical value is less than or equal to another at runtime,", "description": "otherwise raise an error.", "tags": [], + "keywordArguments": false, "args": [ { "name": "left", @@ -40470,7 +40555,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "right", @@ -40481,7 +40567,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "message", @@ -40491,7 +40578,8 @@ "title": "String", "type": "string" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40502,7 +40590,8 @@ "title": "Null", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40517,6 +40606,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -40527,7 +40617,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -40539,7 +40630,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -40552,6 +40644,7 @@ "summary": "Draw a smooth, continuous, curved line segment from the current origin to", "description": "the desired (x, y), using a number of control points to shape the curve's shape.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -40599,7 +40692,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -41969,7 +42063,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -43292,7 +43387,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -44663,7 +44759,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -44678,6 +44775,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -44688,7 +44786,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -44700,7 +44799,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -44713,6 +44813,7 @@ "summary": "Cut a straight transitional edge along a tagged path.", "description": "Chamfer is similar in function and use to a fillet, except a fillet will blend the transition along an edge, rather than cut a sharp, straight transitional edge.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -45631,7 +45732,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid", @@ -47028,7 +47130,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -48369,7 +48472,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -49749,7 +49853,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -49763,6 +49868,7 @@ "summary": "Construct a 2-dimensional circle, of the specified radius, centered at", "description": "the provided (x, y) origin point.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -49794,7 +49900,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch_surface_or_group", @@ -51120,7 +51227,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -52443,7 +52551,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -53814,7 +53923,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -53828,6 +53938,7 @@ "summary": "Construct a line segment from the current origin back to the profile's", "description": "origin, ensuring the resulting 2-dimensional sketch is not open-ended.", "tags": [], + "keywordArguments": false, "args": [ { "name": "sketch", @@ -55197,7 +55308,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -56520,7 +56632,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -57891,7 +58004,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -57907,6 +58021,7 @@ "tags": [ "units" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -57917,7 +58032,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -57932,6 +58048,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -57942,7 +58059,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -57954,7 +58072,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -57969,6 +58088,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -57979,7 +58099,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -57992,6 +58113,7 @@ "summary": "Extend a 2-dimensional sketch through a third dimension in order to", "description": "create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.", "tags": [], + "keywordArguments": false, "args": [ { "name": "length", @@ -58002,7 +58124,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch_set", @@ -59404,7 +59527,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -60816,7 +60940,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -60830,6 +60955,7 @@ "summary": "Blend a transitional edge along a tagged path, smoothing the sharp edge.", "description": "Fillet is similar in function and use to a chamfer, except a chamfer will cut a sharp transition along an edge while fillet will smoothly blend the transition.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -61755,7 +61881,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid", @@ -63152,7 +63279,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -64493,7 +64621,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -65873,7 +66002,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -65889,6 +66019,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -65899,7 +66030,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -65911,7 +66043,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -65926,6 +66059,7 @@ "tags": [ "units" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -65936,7 +66070,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -65949,6 +66084,7 @@ "summary": "Get the next adjacent edge to the edge given.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -66827,7 +66963,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -66839,7 +66976,8 @@ "type": "string", "format": "uuid" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -66852,6 +66990,7 @@ "summary": "Get the opposite edge to the edge given.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -67730,7 +67869,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -67742,7 +67882,8 @@ "type": "string", "format": "uuid" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -67755,6 +67896,7 @@ "summary": "Get the previous adjacent edge to the edge given.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -68633,7 +68775,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -68645,7 +68788,8 @@ "type": "string", "format": "uuid" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -68658,6 +68802,7 @@ "summary": "Create a helix on a cylinder.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -68695,7 +68840,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid", @@ -70074,7 +70220,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -71454,7 +71601,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -71467,6 +71615,7 @@ "summary": "Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "hole_sketch", @@ -72868,7 +73017,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -74238,7 +74388,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -75609,7 +75760,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -75623,6 +75775,7 @@ "summary": "Make the inside of a 3D object hollow.", "description": "Remove volume from a 3-dimensional shape such that a wall of the provided thickness remains around the exterior of the shape.", "tags": [], + "keywordArguments": false, "args": [ { "name": "thickness", @@ -75633,7 +75786,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid", @@ -77012,7 +77166,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -78392,7 +78547,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -78407,6 +78563,7 @@ "summary": "Import a CAD file.", "description": "For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory.\n\nNote: The import command currently only works when using the native Modeling App.\n\nFor importing KCL functions using the `import` statement, see the docs on [KCL modules](/docs/kcl/modules).", "tags": [], + "keywordArguments": false, "args": [ { "name": "file_path", @@ -78416,7 +78573,8 @@ "title": "String", "type": "string" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "options", @@ -78734,7 +78892,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -78800,7 +78959,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -78820,6 +78980,7 @@ "tags": [ "units" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -78830,7 +78991,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -78845,6 +79007,7 @@ "tags": [ "convert" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -78855,7 +79018,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -78867,7 +79031,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -78880,6 +79045,7 @@ "summary": "Extract the 'x' axis value of the last line segment in the provided 2-d", "description": "sketch.", "tags": [], + "keywordArguments": false, "args": [ { "name": "sketch", @@ -80249,7 +80415,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -80261,7 +80428,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -80274,6 +80442,7 @@ "summary": "Extract the 'y' axis value of the last line segment in the provided 2-d", "description": "sketch.", "tags": [], + "keywordArguments": false, "args": [ { "name": "sketch", @@ -81643,7 +81812,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -81655,7 +81825,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -81670,6 +81841,7 @@ "tags": [ "utilities" ], + "keywordArguments": false, "args": [ { "name": "hypotenuse", @@ -81680,7 +81852,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "leg", @@ -81691,7 +81864,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -81703,7 +81877,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -81718,6 +81893,7 @@ "tags": [ "utilities" ], + "keywordArguments": false, "args": [ { "name": "hypotenuse", @@ -81728,7 +81904,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "leg", @@ -81739,7 +81916,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -81751,7 +81929,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -81766,6 +81945,7 @@ "tags": [ "utilities" ], + "keywordArguments": false, "args": [ { "name": "hypotenuse", @@ -81776,7 +81956,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "leg", @@ -81787,7 +81968,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -81799,7 +81981,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -81812,6 +81995,7 @@ "summary": "Draw a line relative to the current origin to a specified (x, y) away", "description": "from the current position.", "tags": [], + "keywordArguments": false, "args": [ { "name": "delta", @@ -81827,7 +82011,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -83197,7 +83382,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -84520,7 +84706,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -85891,7 +86078,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -85905,6 +86093,7 @@ "summary": "Draw a line from the current origin to some absolute (x, y) point.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "to", @@ -85920,7 +86109,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -87290,7 +87480,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -88613,7 +88804,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -89984,7 +90176,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -89999,6 +90192,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -90009,7 +90203,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -90021,7 +90216,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -90034,6 +90230,7 @@ "summary": "Create a 3D surface or solid by interpolating between two or more sketches.", "description": "The sketches need to closed and on the same plane.", "tags": [], + "keywordArguments": false, "args": [ { "name": "sketches", @@ -91354,7 +91551,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "data", @@ -92711,7 +92909,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -94091,7 +94290,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -94108,6 +94308,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -94118,7 +94319,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "base", @@ -94129,7 +94331,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -94141,7 +94344,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -94156,6 +94360,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -94166,7 +94371,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -94178,7 +94384,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -94193,6 +94400,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -94203,7 +94411,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -94215,7 +94424,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -94230,6 +94440,7 @@ "tags": [ "units" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -94240,7 +94451,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -94253,6 +94465,7 @@ "summary": "Apply a function to every element of a list.", "description": "Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(c)]`", "tags": [], + "keywordArguments": false, "args": [ { "name": "array", @@ -96240,7 +96453,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "map_fn", @@ -98225,7 +98439,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -100214,7 +100429,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -100230,6 +100446,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "args", @@ -100243,7 +100460,8 @@ "format": "double" } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -100255,7 +100473,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -100270,6 +100489,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "args", @@ -100283,7 +100503,8 @@ "format": "double" } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -100295,7 +100516,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -100308,6 +100530,7 @@ "summary": "Mirror a sketch.", "description": "Only works on unclosed sketches for now.\n\nMirror occurs around a local sketch axis rather than a global axis.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -101313,7 +101536,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch_set", @@ -102825,7 +103049,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -104147,7 +104372,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -104165,6 +104391,7 @@ "tags": [ "units" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -104175,7 +104402,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -104188,6 +104416,7 @@ "summary": "Offset a plane by a distance along its normal.", "description": "For example, if you offset the 'XZ' plane by 10, the new plane will be parallel to the 'XZ' plane and 10 units away from it.", "tags": [], + "keywordArguments": false, "args": [ { "name": "std_plane", @@ -104241,7 +104470,8 @@ } ] }, - "required": true + "required": true, + "labelRequired": true }, { "name": "offset", @@ -104252,7 +104482,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -104392,7 +104623,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -104409,6 +104641,7 @@ "summary": "Repeat a 2-dimensional sketch some number of times along a partial or", "description": "complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -104452,7 +104685,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch_set", @@ -105854,7 +106088,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -107176,7 +107411,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -107189,6 +107425,7 @@ "summary": "Repeat a 3-dimensional solid some number of times along a partial or", "description": "complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -107243,7 +107480,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid_set", @@ -108654,7 +108892,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -109976,7 +110215,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -109989,6 +110229,7 @@ "summary": "Repeat a 2-dimensional sketch along some dimension, with a dynamic amount", "description": "of distance between each repetition, some specified number of times.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -110027,7 +110268,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch_set", @@ -111429,7 +111671,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -112751,7 +112994,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -112764,6 +113008,7 @@ "summary": "Repeat a 3-dimensional solid along a linear path, with a dynamic amount", "description": "of distance between each repetition, some specified number of times.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -112802,7 +113047,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid_set", @@ -114213,7 +114459,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -115535,7 +115782,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -115548,6 +115796,7 @@ "summary": "Repeat a 3-dimensional solid, changing it each time.", "description": "Replicates the 3D solid, applying a transformation function to each replica. Transformation function could alter rotation, scale, visibility, position, etc.\n\nThe `patternTransform` call itself takes a number for how many total instances of the shape should be. For example, if you use a circle with `patternTransform(4, transform)` then there will be 4 circles: the original, and 3 created by replicating the original and calling the transform function on each.\n\nThe transform function takes a single parameter: an integer representing which number replication the transform is for. E.g. the first replica to be transformed will be passed the argument `1`. This simplifies your math: the transform function can rely on id `0` being the original instance passed into the `patternTransform`. See the examples.\n\nThe transform function returns a transform object. All properties of the object are optional, they each default to \"no change\". So the overall transform object defaults to \"no change\" too. Its properties are:\n\n - `translate` (3D point)\n\n Translates the replica, moving its position in space.\n\n - `replicate` (bool)\n\n If false, this ID will not actually copy the object. It'll be skipped.\n\n - `scale` (3D point)\n\n Stretches the object, multiplying its width in the given dimension by the point's component in that direction.\n\n - `rotation` (object, with the following properties)\n\n - `rotation.axis` (a 3D point, defaults to the Z axis)\n\n - `rotation.angle` (number of degrees)\n\n - `rotation.origin` (either \"local\" i.e. rotate around its own center, \"global\" i.e. rotate around the scene's center, or a 3D point, defaults to \"local\")", "tags": [], + "keywordArguments": false, "args": [ { "name": "total_instances", @@ -115559,7 +115808,8 @@ "format": "uint32", "minimum": 0.0 }, - "required": true + "required": true, + "labelRequired": true }, { "name": "transform_function", @@ -115569,7 +115819,8 @@ "title": "FunctionParam", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid_set", @@ -116980,7 +117231,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -118302,7 +118554,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -118320,6 +118573,7 @@ "summary": "Just like patternTransform, but works on 2D sketches not 3D solids.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "total_instances", @@ -118331,7 +118585,8 @@ "format": "uint32", "minimum": 0.0 }, - "required": true + "required": true, + "labelRequired": true }, { "name": "transform_function", @@ -118341,7 +118596,8 @@ "title": "FunctionParam", "type": "null" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid_set", @@ -119743,7 +119999,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -121065,7 +121322,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -121080,6 +121338,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -121090,7 +121349,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -121103,6 +121363,7 @@ "summary": "Convert polar/sphere (azimuth, elevation, distance) coordinates to", "description": "cartesian (x/y/z grid) coordinates.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -121129,7 +121390,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -121146,7 +121408,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -121159,6 +121422,7 @@ "summary": "Create a regular polygon with the specified number of sides that is either inscribed or circumscribed around a circle of the specified radius.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -121202,7 +121466,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch_surface_or_group", @@ -122528,7 +122793,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -123851,7 +124117,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -125222,7 +125489,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -125238,6 +125506,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -125248,7 +125517,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "pow", @@ -125259,7 +125529,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -125271,7 +125542,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -125284,6 +125556,7 @@ "summary": "Extract the provided 2-dimensional sketch's profile's origin", "description": "value.", "tags": [], + "keywordArguments": false, "args": [ { "name": "sketch", @@ -126653,7 +126926,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -126670,7 +126944,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -126683,6 +126958,7 @@ "summary": "Extract the provided 2-dimensional sketch's profile's origin's 'x'", "description": "value.", "tags": [], + "keywordArguments": false, "args": [ { "name": "sketch", @@ -128052,7 +128328,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -128064,7 +128341,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -128077,6 +128355,7 @@ "summary": "Extract the provided 2-dimensional sketch's profile's origin's 'y'", "description": "value.", "tags": [], + "keywordArguments": false, "args": [ { "name": "sketch", @@ -129446,7 +129725,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -129458,7 +129738,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -129471,6 +129752,7 @@ "summary": "Append an element to the end of an array.", "description": "Returns a new array with the element appended.", "tags": [], + "keywordArguments": false, "args": [ { "name": "array", @@ -131458,7 +131740,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "elem", @@ -134055,7 +134338,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -136653,7 +136937,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -136666,6 +136951,7 @@ "summary": "Take a starting value. Then, for each element of an array, calculate the next value,", "description": "using the previous value and the element.", "tags": [], + "keywordArguments": false, "args": [ { "name": "array", @@ -138653,7 +138939,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "start", @@ -141250,7 +141537,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "reduce_fn", @@ -143235,7 +143523,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -145833,7 +146122,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -145850,6 +146140,7 @@ "tags": [ "math" ], + "keywordArguments": true, "args": [ { "name": "num", @@ -145860,7 +146151,8 @@ "type": "integer", "format": "int64" }, - "required": true + "required": true, + "labelRequired": false }, { "name": "divisor", @@ -145871,7 +146163,8 @@ "type": "integer", "format": "int64" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -145883,12 +146176,13 @@ "type": "integer", "format": "int64" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, "examples": [ - "assertEqual(rem(7, 4), 3, 0.01, \"remainder is 3\")\nassertEqual(rem(-7, 4), -3, 0.01, \"remainder is 3\")\nassertEqual(rem(7, -4), 3, 0.01, \"remainder is 3\")" + "assertEqual(rem(7, divisor: 4), 3, 0.01, \"remainder is 3\")\nassertEqual(rem(-7, divisor: 4), -3, 0.01, \"remainder is 3\")\nassertEqual(rem(7, divisor: -4), 3, 0.01, \"remainder is 3\")" ] }, { @@ -145896,6 +146190,7 @@ "summary": "Rotate a sketch around some provided axis, creating a solid from its extent.", "description": "This, like extrude, is able to create a 3-dimensional solid from a 2-dimensional sketch. However, unlike extrude, this creates a solid by using the extent of the sketch as its revolved around an axis rather than using the extent of the sketch linearly translated through a third dimension.\n\nRevolve occurs around a local sketch axis rather than a global axis.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -146917,7 +147212,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -148397,7 +148693,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -149777,7 +150074,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -149799,6 +150097,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -149809,7 +150108,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -149821,7 +150121,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -149834,6 +150135,7 @@ "summary": "Compute the angle (in degrees) of the provided line segment.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -150712,7 +151014,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -150724,7 +151027,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -150737,6 +151041,7 @@ "summary": "Compute the ending point of the provided line segment.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -151615,7 +151920,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -151632,7 +151938,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -151645,6 +151952,7 @@ "summary": "Compute the ending point of the provided line segment along the 'x' axis.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -152523,7 +152831,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -152535,7 +152844,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -152548,6 +152858,7 @@ "summary": "Compute the ending point of the provided line segment along the 'y' axis.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -153426,7 +153737,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -153438,7 +153750,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -153451,6 +153764,7 @@ "summary": "Compute the length of the provided line segment.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -154329,7 +154643,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -154341,7 +154656,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -154354,6 +154670,7 @@ "summary": "Compute the starting point of the provided line segment.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -155232,7 +155549,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -155249,7 +155567,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -155262,6 +155581,7 @@ "summary": "Compute the starting point of the provided line segment along the 'x' axis.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -156140,7 +156460,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -156152,7 +156473,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -156165,6 +156487,7 @@ "summary": "Compute the starting point of the provided line segment along the 'y' axis.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -157043,7 +157366,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -157055,7 +157379,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -157068,6 +157393,7 @@ "summary": "Remove volume from a 3-dimensional shape such that a wall of the", "description": "provided thickness remains, taking volume starting at the provided face, leaving it open in that direction.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -158002,7 +158328,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "solid_set", @@ -159447,7 +159774,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -160859,7 +161187,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -160880,6 +161209,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -160890,7 +161220,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -160902,7 +161233,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -160917,6 +161249,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -160927,7 +161260,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -160939,7 +161273,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -160952,6 +161287,7 @@ "summary": "Start a new profile at a given point.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "to", @@ -160967,7 +161303,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch_surface", @@ -162424,7 +162761,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -163747,7 +164085,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -165118,7 +165457,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -165133,6 +165473,7 @@ "summary": "Start a new 2-dimensional sketch at a given point on the 'XY' plane.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -165148,7 +165489,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -166519,7 +166861,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -166534,6 +166877,7 @@ "summary": "Start a new 2-dimensional sketch on a specific plane or face.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -168023,7 +168367,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -169541,7 +169886,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -170999,7 +171345,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -171017,6 +171364,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -171027,7 +171375,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -171039,7 +171388,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -171052,6 +171402,7 @@ "summary": "Returns the angle coming out of the end of the segment in degrees.", "description": "", "tags": [], + "keywordArguments": false, "args": [ { "name": "tag", @@ -171930,7 +172281,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -171942,7 +172294,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -171959,6 +172312,7 @@ "summary": "Draw a curved line segment along part of an imaginary circle.", "description": "The arc is constructed such that the last line segment is placed tangent to the imaginary circle of the specified radius. The resulting arc is the segment of the imaginary circle from that tangent point for 'offset' degrees along the imaginary circle.", "tags": [], + "keywordArguments": false, "args": [ { "name": "data", @@ -171989,7 +172343,8 @@ } ] }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -173359,7 +173714,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -174682,7 +175038,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -176053,7 +176410,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -176066,6 +176424,7 @@ "summary": "Starting at the current sketch's origin, draw a curved line segment along", "description": "some part of an imaginary circle until it reaches the desired (x, y) coordinates.", "tags": [], + "keywordArguments": false, "args": [ { "name": "to", @@ -176081,7 +176440,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -177451,7 +177811,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -178774,7 +179135,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -180145,7 +180507,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -180158,6 +180521,7 @@ "summary": "Starting at the current sketch's origin, draw a curved line segment along", "description": "some part of an imaginary circle until it reaches a point the given (x, y) distance away.", "tags": [], + "keywordArguments": false, "args": [ { "name": "delta", @@ -180173,7 +180537,8 @@ "maxItems": 2, "minItems": 2 }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -181543,7 +181908,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -182866,7 +183232,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -184237,7 +184604,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -184252,6 +184620,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -184262,7 +184631,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -184277,6 +184647,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -184287,7 +184658,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -184299,7 +184671,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -184314,6 +184687,7 @@ "tags": [ "math" ], + "keywordArguments": false, "args": [ { "name": "num", @@ -184324,7 +184698,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true } ], "returnValue": { @@ -184336,7 +184711,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -184349,6 +184725,7 @@ "summary": "Draw a line relative to the current origin to a specified distance away", "description": "from the current position along the 'x' axis.", "tags": [], + "keywordArguments": false, "args": [ { "name": "length", @@ -184359,7 +184736,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -185729,7 +186107,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -187052,7 +187431,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -188423,7 +188803,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -188436,6 +188817,7 @@ "summary": "Draw a line parallel to the X axis, that ends at the given X.", "description": "E.g. if the previous line ended at (1, 1), then xLineTo(4) draws a line from (1, 1) to (4, 1)", "tags": [], + "keywordArguments": false, "args": [ { "name": "to", @@ -188446,7 +188828,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -189816,7 +190199,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -191139,7 +191523,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -192510,7 +192895,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -192523,6 +192909,7 @@ "summary": "Draw a line relative to the current origin to a specified distance away", "description": "from the current position along the 'y' axis.", "tags": [], + "keywordArguments": false, "args": [ { "name": "length", @@ -192533,7 +192920,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -193903,7 +194291,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -195226,7 +195615,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -196597,7 +196987,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -196610,6 +197001,7 @@ "summary": "Draw a line parallel to the Y axis, that ends at the given Y.", "description": "E.g. if the previous line ended at (1, 1), then yLineTo(4) draws a line from (1, 1) to (1, 4)", "tags": [], + "keywordArguments": false, "args": [ { "name": "to", @@ -196620,7 +197012,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, { "name": "sketch", @@ -197990,7 +198383,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, { "name": "tag", @@ -199313,7 +199707,8 @@ } } }, - "required": false + "required": false, + "labelRequired": true } ], "returnValue": { @@ -200684,7 +201079,8 @@ } } }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, @@ -200699,6 +201095,7 @@ "tags": [ "units" ], + "keywordArguments": false, "args": [], "returnValue": { "name": "", @@ -200709,7 +201106,8 @@ "type": "number", "format": "double" }, - "required": true + "required": true, + "labelRequired": true }, "unpublished": false, "deprecated": false, diff --git a/e2e/playwright/fixtures/toolbarFixture.ts b/e2e/playwright/fixtures/toolbarFixture.ts index 991c0bae5..600144f06 100644 --- a/e2e/playwright/fixtures/toolbarFixture.ts +++ b/e2e/playwright/fixtures/toolbarFixture.ts @@ -6,6 +6,7 @@ export class ToolbarFixture { public page: Page extrudeButton!: Locator + loftButton!: Locator offsetPlaneButton!: Locator startSketchBtn!: Locator lineBtn!: Locator @@ -26,6 +27,7 @@ export class ToolbarFixture { reConstruct = (page: Page) => { this.page = page this.extrudeButton = page.getByTestId('extrude') + this.loftButton = page.getByTestId('loft') this.offsetPlaneButton = page.getByTestId('plane-offset') this.startSketchBtn = page.getByTestId('sketch') this.lineBtn = page.getByTestId('line') diff --git a/e2e/playwright/point-click.spec.ts b/e2e/playwright/point-click.spec.ts index 3155ed0fc..a4555fdeb 100644 --- a/e2e/playwright/point-click.spec.ts +++ b/e2e/playwright/point-click.spec.ts @@ -753,3 +753,94 @@ test(`Offset plane point-and-click`, async ({ await scene.expectPixelColor([74, 74, 74], testPoint, 15) }) }) + +const loftPointAndClickCases = [ + { shouldPreselect: true }, + { shouldPreselect: false }, +] +loftPointAndClickCases.forEach(({ shouldPreselect }) => { + test(`Loft point-and-click (preselected sketches: ${shouldPreselect})`, async ({ + app, + page, + scene, + editor, + toolbar, + cmdBar, + }) => { + const initialCode = `sketch001 = startSketchOn('XZ') + |> circle({ center = [0, 0], radius = 30 }, %) + plane001 = offsetPlane('XZ', 50) + sketch002 = startSketchOn(plane001) + |> circle({ center = [0, 0], radius = 20 }, %) +` + await app.initialise(initialCode) + + // One dumb hardcoded screen pixel value + const testPoint = { x: 575, y: 200 } + const [clickOnSketch1] = scene.makeMouseHelpers(testPoint.x, testPoint.y) + const [clickOnSketch2] = scene.makeMouseHelpers( + testPoint.x, + testPoint.y + 80 + ) + const loftDeclaration = 'loft001 = loft([sketch001, sketch002])' + + await test.step(`Look for the white of the sketch001 shape`, async () => { + await scene.expectPixelColor([254, 254, 254], testPoint, 15) + }) + + async function selectSketches() { + await clickOnSketch1() + await page.keyboard.down('Shift') + await clickOnSketch2() + await app.page.waitForTimeout(500) + await page.keyboard.up('Shift') + } + + if (!shouldPreselect) { + await test.step(`Go through the command bar flow without preselected sketches`, async () => { + await toolbar.loftButton.click() + await cmdBar.expectState({ + stage: 'arguments', + currentArgKey: 'selection', + currentArgValue: '', + headerArguments: { Selection: '' }, + highlightedHeaderArg: 'selection', + commandName: 'Loft', + }) + await selectSketches() + await cmdBar.progressCmdBar() + await cmdBar.expectState({ + stage: 'review', + headerArguments: { Selection: '2 faces' }, + commandName: 'Loft', + }) + await cmdBar.progressCmdBar() + }) + } else { + await test.step(`Preselect the two sketches`, async () => { + await selectSketches() + }) + + await test.step(`Go through the command bar flow with preselected sketches`, async () => { + await toolbar.loftButton.click() + await cmdBar.progressCmdBar() + await cmdBar.expectState({ + stage: 'review', + headerArguments: { Selection: '2 faces' }, + commandName: 'Loft', + }) + await cmdBar.progressCmdBar() + }) + } + + await test.step(`Confirm code is added to the editor, scene has changed`, async () => { + await editor.expectEditor.toContain(loftDeclaration) + await editor.expectState({ + diagnostics: [], + activeLines: [loftDeclaration], + highlightedCode: '', + }) + await scene.expectPixelColor([89, 89, 89], testPoint, 15) + }) + }) +}) diff --git a/e2e/playwright/regression-tests.spec.ts b/e2e/playwright/regression-tests.spec.ts index 7166d21e0..3a3679d1f 100644 --- a/e2e/playwright/regression-tests.spec.ts +++ b/e2e/playwright/regression-tests.spec.ts @@ -563,7 +563,7 @@ extrude001 = extrude(50, sketch001) const u = await getUtils(page) // Constants and locators - const planeColor: [number, number, number] = [170, 220, 170] + const planeColor: [number, number, number] = [161, 220, 155] const bgColor: [number, number, number] = [27, 27, 27] const middlePixelIsColor = async (color: [number, number, number]) => { return u.getGreatestPixDiff({ x: 600, y: 250 }, color) diff --git a/e2e/playwright/secrets.ts b/e2e/playwright/secrets.ts index ed5fd63aa..6626f5e3e 100644 --- a/e2e/playwright/secrets.ts +++ b/e2e/playwright/secrets.ts @@ -7,6 +7,8 @@ try { .split('\n') .filter((line) => line && line.length > 1) .forEach((line) => { + // Allow line comments. + if (line.trimStart().startsWith('#')) return const [key, value] = line.split('=') // prefer env vars over secrets file secrets[key] = process.env[key] || (value as any).replaceAll('"', '') diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png index 378c43abb..d283a77f4 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-win32.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-win32.png index be55c744a..1d1640822 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-win32.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-win32.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png index 0fc060736..67fae90ab 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-win32.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-win32.png index 83a3c1d39..96afeb186 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-win32.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-win32.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png index 45799475c..86fb84906 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-win32.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-win32.png index 4442073d2..245e822c6 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-win32.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-win32.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png index 5ac634db5..2acac7c3a 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-win32.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-win32.png index 6adcd1517..aa989becd 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-win32.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-win32.png differ diff --git a/e2e/playwright/testing-perspective-toggle.spec.ts b/e2e/playwright/testing-perspective-toggle.spec.ts index 430d0157e..55977e08a 100644 --- a/e2e/playwright/testing-perspective-toggle.spec.ts +++ b/e2e/playwright/testing-perspective-toggle.spec.ts @@ -13,7 +13,7 @@ test.describe('Test toggling perspective', () => { y: screenHeight * 0.2, } const backgroundColor: [number, number, number] = [29, 29, 29] - const xzPlaneColor: [number, number, number] = [50, 50, 99] + const xzPlaneColor: [number, number, number] = [82, 55, 96] const locationToHaveColor = async (color: [number, number, number]) => { return u.getGreatestPixDiff(checkedScreenLocation, color) } diff --git a/scripts/get-nightly-changelog.sh b/scripts/get-nightly-changelog.sh new file mode 100755 index 000000000..c599f4df8 --- /dev/null +++ b/scripts/get-nightly-changelog.sh @@ -0,0 +1,5 @@ +#!/bin/bash +echo "## What's Changed" +git log ${PREVIOUS_TAG}..HEAD --oneline --pretty=format:%s | grep -v Bump | awk '{print "* "toupper(substr($0,0,1))substr($0,2)}' +echo "" +echo "**Full Changelog**: https://github.com/KittyCAD/modeling-app/compare/${PREVIOUS_TAG}...${TAG}" diff --git a/src/clientSideScene/CameraControls.ts b/src/clientSideScene/CameraControls.ts index fdc83ab70..a0d9553d2 100644 --- a/src/clientSideScene/CameraControls.ts +++ b/src/clientSideScene/CameraControls.ts @@ -273,14 +273,26 @@ export class CameraControls { camSettings.center.y, camSettings.center.z ) - const quat = new Quaternion( + const orientation = new Quaternion( camSettings.orientation.x, camSettings.orientation.y, camSettings.orientation.z, camSettings.orientation.w ).invert() - this.camera.up.copy(new Vector3(0, 1, 0).applyQuaternion(quat)) + const newUp = new Vector3( + camSettings.up.x, + camSettings.up.y, + camSettings.up.z + ) + this.camera.quaternion.set( + orientation.x, + orientation.y, + orientation.z, + orientation.w + ) + this.camera.up.copy(newUp) + this.camera.updateProjectionMatrix() if (this.camera instanceof PerspectiveCamera && camSettings.ortho) { this.useOrthographicCamera() } @@ -1164,7 +1176,7 @@ export class CameraControls { this.camera.updateProjectionMatrix() } - if (this.syncDirection === 'clientToEngine' || forceUpdate) + if (this.syncDirection === 'clientToEngine' || forceUpdate) { this.throttledUpdateEngineCamera({ quaternion: this.camera.quaternion, position: this.camera.position, @@ -1172,6 +1184,7 @@ export class CameraControls { isPerspective: this.isPerspective, target: this.target, }) + } this.deferReactUpdate(this.reactCameraProperties) Object.values(this._camChangeCallbacks).forEach((cb) => cb()) } diff --git a/src/components/ModelingMachineProvider.tsx b/src/components/ModelingMachineProvider.tsx index 8ca03ff84..f642cceae 100644 --- a/src/components/ModelingMachineProvider.tsx +++ b/src/components/ModelingMachineProvider.tsx @@ -50,6 +50,7 @@ import { isSketchPipe, Selections, updateSelections, + canLoftSelection, } from 'lib/selections' import { applyConstraintIntersect } from './Toolbar/Intersect' import { applyConstraintAbsDistance } from './Toolbar/SetAbsDistance' @@ -569,6 +570,21 @@ export const ModelingMachineProvider = ({ if (err(canSweep)) return false return canSweep }, + 'has valid loft selection': ({ context: { selectionRanges } }) => { + const hasNoSelection = + selectionRanges.graphSelections.length === 0 || + isRangeBetweenCharacters(selectionRanges) || + isSelectionLastLine(selectionRanges, codeManager.code) + + if (hasNoSelection) { + const count = 2 + return doesSceneHaveSweepableSketch(kclManager.ast, count) + } + + const canLoft = canLoftSelection(selectionRanges) + if (err(canLoft)) return false + return canLoft + }, 'has valid selection for deletion': ({ context: { selectionRanges }, }) => { diff --git a/src/lang/modifyAst.ts b/src/lang/modifyAst.ts index 0903c60ac..c5e48ca22 100644 --- a/src/lang/modifyAst.ts +++ b/src/lang/modifyAst.ts @@ -346,6 +346,37 @@ export function extrudeSketch( } } +export function loftSketches( + node: Node, + declarators: VariableDeclarator[] +): { + modifiedAst: Node + pathToNode: PathToNode +} { + const modifiedAst = structuredClone(node) + const name = findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.LOFT) + const elements = declarators.map((d) => createIdentifier(d.id.name)) + const loft = createCallExpressionStdLib('loft', [ + createArrayExpression(elements), + ]) + const declaration = createVariableDeclaration(name, loft) + modifiedAst.body.push(declaration) + const pathToNode: PathToNode = [ + ['body', ''], + [modifiedAst.body.length - 1, 'index'], + ['declarations', 'VariableDeclaration'], + ['0', 'index'], + ['init', 'VariableDeclarator'], + ['arguments', 'CallExpression'], + [0, 'index'], + ] + + return { + modifiedAst, + pathToNode, + } +} + export function revolveSketch( node: Node, pathToNode: PathToNode, diff --git a/src/lang/queryAst.test.ts b/src/lang/queryAst.test.ts index 679cc6b0e..2268e3572 100644 --- a/src/lang/queryAst.test.ts +++ b/src/lang/queryAst.test.ts @@ -628,6 +628,18 @@ sketch002 = startSketchOn(extrude001, $seg01) const extrudable = doesSceneHaveSweepableSketch(ast) expect(extrudable).toBeTruthy() }) + it('finds sketch001 and sketch002 pipes to be lofted', async () => { + const exampleCode = `sketch001 = startSketchOn('XZ') + |> circle({ center = [0, 0], radius = 1 }, %) +plane001 = offsetPlane('XZ', 2) +sketch002 = startSketchOn(plane001) + |> circle({ center = [0, 0], radius = 3 }, %) +` + const ast = parse(exampleCode) + if (err(ast)) throw ast + const extrudable = doesSceneHaveSweepableSketch(ast, 2) + expect(extrudable).toBeTruthy() + }) it('find sketch002 NOT pipe to be extruded', async () => { const exampleCode = `sketch001 = startSketchOn('XZ') |> startProfileAt([3.29, 7.86], %) diff --git a/src/lang/queryAst.ts b/src/lang/queryAst.ts index 85360c4f1..e217be0e5 100644 --- a/src/lang/queryAst.ts +++ b/src/lang/queryAst.ts @@ -173,6 +173,30 @@ function moreNodePathFromSourceRange( } return path } + + if (_node.type === 'CallExpressionKw' && isInRange) { + const { callee, arguments: args } = _node + if ( + callee.type === 'Identifier' && + callee.start <= start && + callee.end >= end + ) { + path.push(['callee', 'CallExpressionKw']) + return path + } + if (args.length > 0) { + for (let argIndex = 0; argIndex < args.length; argIndex++) { + const arg = args[argIndex].arg + if (arg.start <= start && arg.end >= end) { + path.push(['arguments', 'CallExpressionKw']) + path.push([argIndex, 'index']) + return moreNodePathFromSourceRange(arg, sourceRange, path) + } + } + } + return path + } + if (_node.type === 'BinaryExpression' && isInRange) { const { left, right } = _node if (left.start <= start && left.end >= end) { @@ -975,7 +999,9 @@ export function hasSketchPipeBeenExtruded(selection: Selection, ast: Program) { if ( node.type === 'CallExpression' && node.callee.type === 'Identifier' && - (node.callee.name === 'extrude' || node.callee.name === 'revolve') && + (node.callee.name === 'extrude' || + node.callee.name === 'revolve' || + node.callee.name === 'loft') && node.arguments?.[1]?.type === 'Identifier' && node.arguments[1].name === varDec.id.name ) { @@ -988,7 +1014,7 @@ export function hasSketchPipeBeenExtruded(selection: Selection, ast: Program) { } /** File must contain at least one sketch that has not been extruded already */ -export function doesSceneHaveSweepableSketch(ast: Node) { +export function doesSceneHaveSweepableSketch(ast: Node, count = 1) { const theMap: any = {} traverse(ast as any, { enter(node) { @@ -1037,7 +1063,7 @@ export function doesSceneHaveSweepableSketch(ast: Node) { } }, }) - return Object.keys(theMap).length > 0 + return Object.keys(theMap).length >= count } export function getObjExprProperty( diff --git a/src/lang/std/__snapshots__/artifactGraph.test.ts.snap b/src/lang/std/__snapshots__/artifactGraph.test.ts.snap index 4a5beb7f2..6b375bd39 100644 --- a/src/lang/std/__snapshots__/artifactGraph.test.ts.snap +++ b/src/lang/std/__snapshots__/artifactGraph.test.ts.snap @@ -11,8 +11,8 @@ Map { ], ], "range": [ - 37, - 64, + 12, + 31, 0, ], }, diff --git a/src/lib/commandBarConfigs/modelingCommandConfig.ts b/src/lib/commandBarConfigs/modelingCommandConfig.ts index b3145a729..14acaaaa3 100644 --- a/src/lib/commandBarConfigs/modelingCommandConfig.ts +++ b/src/lib/commandBarConfigs/modelingCommandConfig.ts @@ -31,6 +31,9 @@ export type ModelingCommandSchema = { // result: (typeof EXTRUSION_RESULTS)[number] distance: KclCommandValue } + Loft: { + selection: Selections + } Revolve: { selection: Selections angle: KclCommandValue @@ -260,6 +263,20 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig< }, }, }, + Loft: { + description: 'Create a 3D body by blending between two or more sketches', + icon: 'loft', + needsReview: true, + args: { + selection: { + inputType: 'selection', + selectionTypes: ['solid2D'], + multiple: true, + required: true, + skip: false, + }, + }, + }, // TODO: Update this configuration, copied from extrude for MVP of revolve, specifically the args.selection Revolve: { description: 'Create a 3D body by rotating a sketch region about an axis.', diff --git a/src/lib/constants.ts b/src/lib/constants.ts index d80983c93..cf072e985 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -52,6 +52,7 @@ export const ONBOARDING_PROJECT_NAME = 'Tutorial Project $nn' export const KCL_DEFAULT_CONSTANT_PREFIXES = { SKETCH: 'sketch', EXTRUDE: 'extrude', + LOFT: 'loft', SEGMENT: 'seg', REVOLVE: 'revolve', PLANE: 'plane', diff --git a/src/lib/selections.ts b/src/lib/selections.ts index 05c757c33..88004bdd8 100644 --- a/src/lib/selections.ts +++ b/src/lib/selections.ts @@ -529,6 +529,10 @@ function nodeHasExtrude(node: CommonASTNode) { doesPipeHaveCallExp({ calleeName: 'revolve', ...node, + }) || + doesPipeHaveCallExp({ + calleeName: 'loft', + ...node, }) ) } @@ -559,6 +563,22 @@ export function canSweepSelection(selection: Selections) { ) } +export function canLoftSelection(selection: Selections) { + const commonNodes = selection.graphSelections.map((_, i) => + buildCommonNodeFromSelection(selection, i) + ) + return ( + !!isCursorInSketchCommandRange( + engineCommandManager.artifactGraph, + selection + ) && + commonNodes.length > 1 && + commonNodes.every((n) => !hasSketchPipeBeenExtruded(n.selection, n.ast)) && + commonNodes.every((n) => nodeHasClose(n) || nodeHasCircle(n)) && + commonNodes.every((n) => !nodeHasExtrude(n)) + ) +} + // This accounts for non-geometry selections under "other" export type ResolvedSelectionType = Artifact['type'] | 'other' export type SelectionCountsByType = Map diff --git a/src/lib/toolbar.ts b/src/lib/toolbar.ts index ed7aa2a25..0535a3dcc 100644 --- a/src/lib/toolbar.ts +++ b/src/lib/toolbar.ts @@ -139,9 +139,14 @@ export const toolbarConfig: Record = { }, { id: 'loft', - onClick: () => console.error('Loft not yet implemented'), + onClick: ({ commandBarSend }) => + commandBarSend({ + type: 'Find and select command', + data: { name: 'Loft', groupId: 'modeling' }, + }), + disabled: (state) => !state.can({ type: 'Loft' }), icon: 'loft', - status: 'kcl-only', + status: 'available', title: 'Loft', hotkey: 'L', description: diff --git a/src/machines/modelingMachine.ts b/src/machines/modelingMachine.ts index 04c005f56..59d65082c 100644 --- a/src/machines/modelingMachine.ts +++ b/src/machines/modelingMachine.ts @@ -44,6 +44,7 @@ import { addOffsetPlane, deleteFromSelection, extrudeSketch, + loftSketches, revolveSketch, } from 'lang/modifyAst' import { @@ -256,6 +257,7 @@ export type ModelingMachineEvent = | { type: 'Export'; data: ModelingCommandSchema['Export'] } | { type: 'Make'; data: ModelingCommandSchema['Make'] } | { type: 'Extrude'; data?: ModelingCommandSchema['Extrude'] } + | { type: 'Loft'; data?: ModelingCommandSchema['Loft'] } | { type: 'Revolve'; data?: ModelingCommandSchema['Revolve'] } | { type: 'Fillet'; data?: ModelingCommandSchema['Fillet'] } | { type: 'Offset plane'; data: ModelingCommandSchema['Offset plane'] } @@ -387,6 +389,7 @@ export const modelingMachine = setup({ guards: { 'Selection is on face': () => false, 'has valid sweep selection': () => false, + 'has valid loft selection': () => false, 'has valid edge treatment selection': () => false, 'Has exportable geometry': () => false, 'has valid selection for deletion': () => false, @@ -1529,6 +1532,50 @@ export const modelingMachine = setup({ updateAstResult.newAst ) + if (updateAstResult?.selections) { + editorManager.selectRange(updateAstResult?.selections) + } + } + ), + loftAstMod: fromPromise( + async ({ + input, + }: { + input: ModelingCommandSchema['Loft'] | undefined + }) => { + if (!input) return new Error('No input provided') + // Extract inputs + const ast = kclManager.ast + const { selection } = input + const declarators = selection.graphSelections.flatMap((s) => { + const path = getNodePathFromSourceRange(ast, s?.codeRef.range) + const nodeFromPath = getNodeFromPath( + ast, + path, + 'VariableDeclarator' + ) + return err(nodeFromPath) ? [] : nodeFromPath.node + }) + + // TODO: add better validation on selection + if (!(declarators && declarators.length > 1)) { + trap('Not enough sketches selected') + } + + // Perform the loft + const loftSketchesRes = loftSketches(ast, declarators) + const updateAstResult = await kclManager.updateAst( + loftSketchesRes.modifiedAst, + true, + { + focusPath: [loftSketchesRes.pathToNode], + } + ) + + await codeManager.updateEditorWithAstAndWriteToFile( + updateAstResult.newAst + ) + if (updateAstResult?.selections) { editorManager.selectRange(updateAstResult?.selections) } @@ -1570,6 +1617,11 @@ export const modelingMachine = setup({ reenter: false, }, + Loft: { + target: 'Applying loft', + reenter: true, + }, + Fillet: { target: 'idle', guard: 'has valid edge treatment selection', @@ -2318,6 +2370,19 @@ export const modelingMachine = setup({ onError: ['idle'], }, }, + + 'Applying loft': { + invoke: { + src: 'loftAstMod', + id: 'loftAstMod', + input: ({ event }) => { + if (event.type !== 'Loft') return undefined + return event.data + }, + onDone: ['idle'], + onError: ['idle'], + }, + }, }, initial: 'idle', diff --git a/src/wasm-lib/Cargo.lock b/src/wasm-lib/Cargo.lock index 7d4d6fcf9..362d75fbb 100644 --- a/src/wasm-lib/Cargo.lock +++ b/src/wasm-lib/Cargo.lock @@ -316,7 +316,7 @@ dependencies = [ "bitvec", "chrono", "hex", - "indexmap 2.6.0", + "indexmap 2.7.0", "js-sys", "once_cell", "rand 0.8.5", @@ -746,7 +746,7 @@ dependencies = [ [[package]] name = "derive-docs" -version = "0.1.31" +version = "0.1.32" dependencies = [ "Inflector", "anyhow", @@ -1136,7 +1136,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -1182,9 +1182,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -1584,12 +1584,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] @@ -1706,7 +1706,7 @@ dependencies = [ [[package]] name = "kcl-lib" -version = "0.2.27" +version = "0.2.28" dependencies = [ "anyhow", "approx 0.5.1", @@ -1732,7 +1732,7 @@ dependencies = [ "http 1.1.0", "iai", "image", - "indexmap 2.6.0", + "indexmap 2.7.0", "insta", "itertools 0.13.0", "js-sys", @@ -1773,7 +1773,7 @@ dependencies = [ [[package]] name = "kcl-test-server" -version = "0.1.17" +version = "0.1.18" dependencies = [ "anyhow", "hyper 0.14.30", @@ -1790,7 +1790,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "indexmap 2.6.0", + "indexmap 2.7.0", "kcl-lib", "kittycad", "kittycad-modeling-cmds", @@ -1800,9 +1800,9 @@ dependencies = [ [[package]] name = "kittycad" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6359cc0a1bbccbcf78775eea17a033cf2aa89d3fe6a9784f8ce94e5f882c185" +checksum = "933cb5f77624386c87d296e3fd493daf50156d1cbfa03b9f333a6d4da2896369" dependencies = [ "anyhow", "async-trait", @@ -1831,7 +1831,7 @@ dependencies = [ "serde_bytes", "serde_json", "serde_urlencoded", - "thiserror 1.0.68", + "thiserror 2.0.0", "tokio", "tracing", "url", @@ -2921,9 +2921,9 @@ dependencies = [ [[package]] name = "reqwest-conditional-middleware" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1663d9d4fbb6e3900f91455d6d7833301c91ae3c7fc6e116fd7acd40e478a93" +checksum = "f67ad7fdf5c0a015763fcd164bee294b13fb7b6f89f1b55961d40f00c3e32d6b" dependencies = [ "async-trait", "http 1.1.0", @@ -2933,9 +2933,9 @@ dependencies = [ [[package]] name = "reqwest-middleware" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04" +checksum = "d1ccd3b55e711f91a9885a2fa6fbbb2e39db1776420b062efc058c6410f7e5e3" dependencies = [ "anyhow", "async-trait", @@ -2948,9 +2948,9 @@ dependencies = [ [[package]] name = "reqwest-retry" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a83df1aaec00176d0fabb65dea13f832d2a446ca99107afc17c5d2d4981221d0" +checksum = "29c73e4195a6bfbcb174b790d9b3407ab90646976c55de58a6515da25d851178" dependencies = [ "anyhow", "async-trait", @@ -2962,6 +2962,7 @@ dependencies = [ "reqwest", "reqwest-middleware", "retry-policies", + "thiserror 1.0.68", "tokio", "tracing", "wasm-timer", @@ -2969,9 +2970,9 @@ dependencies = [ [[package]] name = "reqwest-tracing" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdd9bfa64c72233d8dd99ab7883efcdefe9e16d46488ecb9228b71a2e2ceb45" +checksum = "ff82cf5730a1311fb9413b0bc2b8e743e0157cd73f010ab4ec374a923873b6a2" dependencies = [ "anyhow", "async-trait", @@ -3157,7 +3158,7 @@ dependencies = [ "chrono", "dyn-clone", "indexmap 1.9.3", - "indexmap 2.6.0", + "indexmap 2.7.0", "schemars_derive", "serde", "serde_json", @@ -3258,7 +3259,7 @@ version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "memchr", "ryu", @@ -3846,7 +3847,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -4012,7 +4013,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a2f31991cee3dce1ca4f929a8a04fdd11fd8801aac0f2030b0fa8a0a3fef6b9" dependencies = [ "chrono", - "indexmap 2.6.0", + "indexmap 2.7.0", "lazy_static", "serde_json", "thiserror 1.0.68", @@ -4769,7 +4770,7 @@ dependencies = [ "crc32fast", "crossbeam-utils", "displaydoc", - "indexmap 2.6.0", + "indexmap 2.7.0", "memchr", "thiserror 1.0.68", ] diff --git a/src/wasm-lib/Cargo.toml b/src/wasm-lib/Cargo.toml index 2dfd823ff..f537690fc 100644 --- a/src/wasm-lib/Cargo.toml +++ b/src/wasm-lib/Cargo.toml @@ -74,8 +74,11 @@ members = [ [workspace.dependencies] http = "1" -kittycad = { version = "0.3.25", default-features = false, features = ["js", "requests"] } -kittycad-modeling-cmds = { version = "0.2.76", features = ["websocket"] } +kittycad = { version = "0.3.28", default-features = false, features = ["js", "requests"] } +kittycad-modeling-cmds = { version = "0.2.77", features = ["websocket"] } + +[workspace.lints.clippy] +iter_over_hash_type = "warn" [[test]] name = "executor" diff --git a/src/wasm-lib/derive-docs/Cargo.toml b/src/wasm-lib/derive-docs/Cargo.toml index 3e8dbed84..2cf024420 100644 --- a/src/wasm-lib/derive-docs/Cargo.toml +++ b/src/wasm-lib/derive-docs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "derive-docs" description = "A tool for generating documentation from Rust derive macros" -version = "0.1.31" +version = "0.1.32" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" @@ -27,3 +27,6 @@ anyhow = "1.0.93" expectorate = "1.1.0" pretty_assertions = "1.4.1" rustfmt-wrapper = "0.2.1" + +[lints] +workspace = true diff --git a/src/wasm-lib/derive-docs/src/lib.rs b/src/wasm-lib/derive-docs/src/lib.rs index c051bc31f..1cb49dd7f 100644 --- a/src/wasm-lib/derive-docs/src/lib.rs +++ b/src/wasm-lib/derive-docs/src/lib.rs @@ -23,17 +23,30 @@ use unbox::unbox; struct StdlibMetadata { /// The name of the function in the API. name: String, + /// Tags for the function. #[serde(default)] tags: Vec, + /// Whether the function is unpublished. /// Then docs will not be generated. #[serde(default)] unpublished: bool, + /// Whether the function is deprecated. /// Then specific docs detailing that this is deprecated will be generated. #[serde(default)] deprecated: bool, + + /// If true, expects keyword arguments. + /// If false, expects positional arguments. + #[serde(default)] + keywords: bool, + + /// If true, the first argument is unlabeled. + /// If false, all arguments require labels. + #[serde(default)] + unlabeled_first: bool, } #[proc_macro_attribute] @@ -171,7 +184,7 @@ fn do_stdlib_inner( code_blocks.iter().map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }).collect::>() @@ -225,6 +238,12 @@ fn do_stdlib_inner( quote! { false } }; + let uses_keyword_arguments = if metadata.keywords { + quote! { true } + } else { + quote! { false } + }; + let docs_crate = get_crate(None); // When the user attaches this proc macro to a function with the wrong type @@ -233,7 +252,7 @@ fn do_stdlib_inner( // of the various parameters. We do this by calling dummy functions that // require a type that satisfies SharedExtractor or ExclusiveExtractor. let mut arg_types = Vec::new(); - for arg in ast.sig.inputs.iter() { + for (i, arg) in ast.sig.inputs.iter().enumerate() { // Get the name of the argument. let arg_name = match arg { syn::FnArg::Receiver(pat) => { @@ -263,7 +282,7 @@ fn do_stdlib_inner( let ty_string = rust_type_to_openapi_type(&ty_string); let required = !ty_ident.to_string().starts_with("Option <"); - + let label_required = !(i == 0 && metadata.unlabeled_first); if ty_string != "ExecState" && ty_string != "Args" { let schema = quote! { generator.root_schema_for::<#ty_ident>() @@ -274,6 +293,7 @@ fn do_stdlib_inner( type_: #ty_string.to_string(), schema: #schema, required: #required, + label_required: #label_required, } }); } @@ -334,6 +354,7 @@ fn do_stdlib_inner( type_: #ret_ty_string.to_string(), schema, required: true, + label_required: true, }) } } else { @@ -400,6 +421,10 @@ fn do_stdlib_inner( vec![#(#tags),*] } + fn keyword_arguments(&self) -> bool { + #uses_keyword_arguments + } + fn args(&self, inline_subschemas: bool) -> Vec<#docs_crate::StdLibFnArg> { let mut settings = schemars::gen::SchemaSettings::openapi3(); // We set this to false so we can recurse them later. diff --git a/src/wasm-lib/derive-docs/tests/args_with_lifetime.gen b/src/wasm-lib/derive-docs/tests/args_with_lifetime.gen index db1a2ba31..1e1c13171 100644 --- a/src/wasm-lib/derive-docs/tests/args_with_lifetime.gen +++ b/src/wasm-lib/derive-docs/tests/args_with_lifetime.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for SomeFn { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for SomeFn { type_: "Foo".to_string(), schema: generator.root_schema_for::(), required: true, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for SomeFn { type_: "i32".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for SomeFn { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/args_with_refs.gen b/src/wasm-lib/derive-docs/tests/args_with_refs.gen index fd7b59cff..22b9a6f8c 100644 --- a/src/wasm-lib/derive-docs/tests/args_with_refs.gen +++ b/src/wasm-lib/derive-docs/tests/args_with_refs.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for SomeFn { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for SomeFn { type_: "string".to_string(), schema: generator.root_schema_for::(), required: true, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for SomeFn { type_: "i32".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for SomeFn { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/array.gen b/src/wasm-lib/derive-docs/tests/array.gen index e71f76646..f10b98c8a 100644 --- a/src/wasm-lib/derive-docs/tests/array.gen +++ b/src/wasm-lib/derive-docs/tests/array.gen @@ -108,6 +108,10 @@ impl crate::docs::StdLibFn for Show { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -117,6 +121,7 @@ impl crate::docs::StdLibFn for Show { type_: "[number]".to_string(), schema: generator.root_schema_for::<[f64; 2usize]>(), required: true, + label_required: true, }] } @@ -130,6 +135,7 @@ impl crate::docs::StdLibFn for Show { type_: "number".to_string(), schema, required: true, + label_required: true, }) } @@ -150,7 +156,7 @@ impl crate::docs::StdLibFn for Show { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/box.gen b/src/wasm-lib/derive-docs/tests/box.gen index e9c1abc08..e4ca3c235 100644 --- a/src/wasm-lib/derive-docs/tests/box.gen +++ b/src/wasm-lib/derive-docs/tests/box.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for Show { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for Show { type_: "number".to_string(), schema: generator.root_schema_for::(), required: true, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for Show { type_: "number".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for Show { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/doc_comment_with_code.gen b/src/wasm-lib/derive-docs/tests/doc_comment_with_code.gen index b734cd912..614864821 100644 --- a/src/wasm-lib/derive-docs/tests/doc_comment_with_code.gen +++ b/src/wasm-lib/derive-docs/tests/doc_comment_with_code.gen @@ -108,6 +108,10 @@ impl crate::docs::StdLibFn for MyFunc { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -117,6 +121,7 @@ impl crate::docs::StdLibFn for MyFunc { type_: "kittycad::types::InputFormat".to_string(), schema: generator.root_schema_for::>(), required: false, + label_required: true, }] } @@ -130,6 +135,7 @@ impl crate::docs::StdLibFn for MyFunc { type_: "[Sketch]".to_string(), schema, required: true, + label_required: true, }) } @@ -150,7 +156,7 @@ impl crate::docs::StdLibFn for MyFunc { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/lineTo.gen b/src/wasm-lib/derive-docs/tests/lineTo.gen index e3b811848..712c4cbe8 100644 --- a/src/wasm-lib/derive-docs/tests/lineTo.gen +++ b/src/wasm-lib/derive-docs/tests/lineTo.gen @@ -108,6 +108,10 @@ impl crate::docs::StdLibFn for LineTo { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -118,12 +122,14 @@ impl crate::docs::StdLibFn for LineTo { type_: "LineToData".to_string(), schema: generator.root_schema_for::(), required: true, + label_required: true, }, crate::docs::StdLibFnArg { name: "sketch".to_string(), type_: "Sketch".to_string(), schema: generator.root_schema_for::(), required: true, + label_required: true, }, ] } @@ -138,6 +144,7 @@ impl crate::docs::StdLibFn for LineTo { type_: "Sketch".to_string(), schema, required: true, + label_required: true, }) } @@ -158,7 +165,7 @@ impl crate::docs::StdLibFn for LineTo { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/min.gen b/src/wasm-lib/derive-docs/tests/min.gen index 09b67fd92..a5c9caf39 100644 --- a/src/wasm-lib/derive-docs/tests/min.gen +++ b/src/wasm-lib/derive-docs/tests/min.gen @@ -108,6 +108,10 @@ impl crate::docs::StdLibFn for Min { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -117,6 +121,7 @@ impl crate::docs::StdLibFn for Min { type_: "[number]".to_string(), schema: generator.root_schema_for::>(), required: true, + label_required: true, }] } @@ -130,6 +135,7 @@ impl crate::docs::StdLibFn for Min { type_: "number".to_string(), schema, required: true, + label_required: true, }) } @@ -150,7 +156,7 @@ impl crate::docs::StdLibFn for Min { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/option.gen b/src/wasm-lib/derive-docs/tests/option.gen index 4722dd055..6bcca3a1c 100644 --- a/src/wasm-lib/derive-docs/tests/option.gen +++ b/src/wasm-lib/derive-docs/tests/option.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for Show { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for Show { type_: "number".to_string(), schema: generator.root_schema_for::>(), required: false, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for Show { type_: "number".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for Show { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/option_input_format.gen b/src/wasm-lib/derive-docs/tests/option_input_format.gen index 5ef7c07e2..431709623 100644 --- a/src/wasm-lib/derive-docs/tests/option_input_format.gen +++ b/src/wasm-lib/derive-docs/tests/option_input_format.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for Import { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for Import { type_: "kittycad::types::InputFormat".to_string(), schema: generator.root_schema_for::>(), required: false, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for Import { type_: "number".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for Import { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/return_vec_box_sketch.gen b/src/wasm-lib/derive-docs/tests/return_vec_box_sketch.gen index 508d714b8..987a8ee29 100644 --- a/src/wasm-lib/derive-docs/tests/return_vec_box_sketch.gen +++ b/src/wasm-lib/derive-docs/tests/return_vec_box_sketch.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for Import { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for Import { type_: "kittycad::types::InputFormat".to_string(), schema: generator.root_schema_for::>(), required: false, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for Import { type_: "[Sketch]".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for Import { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/return_vec_sketch.gen b/src/wasm-lib/derive-docs/tests/return_vec_sketch.gen index d7bb1dfa5..72d034a78 100644 --- a/src/wasm-lib/derive-docs/tests/return_vec_sketch.gen +++ b/src/wasm-lib/derive-docs/tests/return_vec_sketch.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for Import { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for Import { type_: "kittycad::types::InputFormat".to_string(), schema: generator.root_schema_for::>(), required: false, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for Import { type_: "[Sketch]".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for Import { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/show.gen b/src/wasm-lib/derive-docs/tests/show.gen index e966c4a82..d0414b063 100644 --- a/src/wasm-lib/derive-docs/tests/show.gen +++ b/src/wasm-lib/derive-docs/tests/show.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for Show { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -83,6 +87,7 @@ impl crate::docs::StdLibFn for Show { type_: "[number]".to_string(), schema: generator.root_schema_for::>(), required: true, + label_required: true, }] } @@ -96,6 +101,7 @@ impl crate::docs::StdLibFn for Show { type_: "()".to_string(), schema, required: true, + label_required: true, }) } @@ -113,7 +119,7 @@ impl crate::docs::StdLibFn for Show { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/derive-docs/tests/test_args_with_exec_state.gen b/src/wasm-lib/derive-docs/tests/test_args_with_exec_state.gen index 0c400e5c6..e7e9410ce 100644 --- a/src/wasm-lib/derive-docs/tests/test_args_with_exec_state.gen +++ b/src/wasm-lib/derive-docs/tests/test_args_with_exec_state.gen @@ -74,6 +74,10 @@ impl crate::docs::StdLibFn for SomeFunction { vec![] } + fn keyword_arguments(&self) -> bool { + false + } + fn args(&self, inline_subschemas: bool) -> Vec { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = inline_subschemas; @@ -91,6 +95,7 @@ impl crate::docs::StdLibFn for SomeFunction { type_: "i32".to_string(), schema, required: true, + label_required: true, }) } @@ -108,7 +113,7 @@ impl crate::docs::StdLibFn for SomeFunction { .iter() .map(|cb| { let program = crate::Program::parse(cb).unwrap(); - let mut options: crate::ast::types::FormatOptions = Default::default(); + let mut options: crate::parsing::ast::types::FormatOptions = Default::default(); options.insert_final_newline = false; program.ast.recast(&options, 0) }) diff --git a/src/wasm-lib/kcl-test-server/Cargo.toml b/src/wasm-lib/kcl-test-server/Cargo.toml index c2312eb8f..043b115ef 100644 --- a/src/wasm-lib/kcl-test-server/Cargo.toml +++ b/src/wasm-lib/kcl-test-server/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-test-server" description = "A test server for KCL" -version = "0.1.17" +version = "0.1.18" edition = "2021" license = "MIT" @@ -13,3 +13,6 @@ pico-args = "0.5.0" serde = { version = "1.0.214", features = ["derive"] } serde_json = "1.0.128" tokio = { version = "1.41.1", features = ["macros", "rt-multi-thread"] } + +[lints] +workspace = true diff --git a/src/wasm-lib/kcl-to-core/Cargo.toml b/src/wasm-lib/kcl-to-core/Cargo.toml index 455fcddf5..c9a0276da 100644 --- a/src/wasm-lib/kcl-to-core/Cargo.toml +++ b/src/wasm-lib/kcl-to-core/Cargo.toml @@ -15,9 +15,12 @@ path = "src/tool.rs" [dependencies] anyhow = "1" async-trait = "0.1.81" -indexmap = "2.6.0" +indexmap = "2.7.0" kcl-lib = { path = "../kcl" } kittycad = { workspace = true, features = ["clap"] } kittycad-modeling-cmds = { workspace = true } tokio = { version = "1.41", features = ["full", "time", "rt", "tracing"] } uuid = { version = "1.11.0", features = ["v4", "js", "serde"] } + +[lints] +workspace = true diff --git a/src/wasm-lib/kcl/Cargo.toml b/src/wasm-lib/kcl/Cargo.toml index 95d28749a..4856da009 100644 --- a/src/wasm-lib/kcl/Cargo.toml +++ b/src/wasm-lib/kcl/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-lib" description = "KittyCAD Language implementation and tools" -version = "0.2.27" +version = "0.2.28" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" @@ -23,7 +23,7 @@ clap = { version = "4.5.21", default-features = false, optional = true, features convert_case = "0.6.0" dashmap = "6.1.0" databake = { version = "0.1.8", features = ["derive"] } -derive-docs = { version = "0.1.29", path = "../derive-docs" } +derive-docs = { version = "0.1.32", path = "../derive-docs" } dhat = { version = "0.3", optional = true } fnv = "1.0.7" form_urlencoded = "1.2.1" @@ -32,7 +32,7 @@ git_rev = "0.1.0" gltf-json = "1.4.1" http = { workspace = true } image = { version = "0.25.5", default-features = false, features = ["png"] } -indexmap = { version = "2.6.0", features = ["serde"] } +indexmap = { version = "2.7.0", features = ["serde"] } kittycad = { workspace = true } kittycad-modeling-cmds = { workspace = true } lazy_static = "1.5.0" @@ -121,6 +121,9 @@ pretty_assertions = "1.4.1" tokio = { version = "1.41.1", features = ["rt-multi-thread", "macros", "time"] } twenty-twenty = "0.8.0" +[lints] +workspace = true + [[bench]] name = "compiler_benchmark_criterion" harness = false diff --git a/src/wasm-lib/kcl/fuzz/Cargo.toml b/src/wasm-lib/kcl/fuzz/Cargo.toml index f75b8420d..f88f4b363 100644 --- a/src/wasm-lib/kcl/fuzz/Cargo.toml +++ b/src/wasm-lib/kcl/fuzz/Cargo.toml @@ -22,6 +22,9 @@ members = ["."] [profile.release] debug = 1 +[lints] +workspace = true + [[bin]] name = "parser" path = "fuzz_targets/parser.rs" diff --git a/src/wasm-lib/kcl/src/ast/mod.rs b/src/wasm-lib/kcl/src/ast/mod.rs deleted file mode 100644 index ff0075903..000000000 --- a/src/wasm-lib/kcl/src/ast/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod modify; -pub mod types; diff --git a/src/wasm-lib/kcl/src/docs/gen_std_tests.rs b/src/wasm-lib/kcl/src/docs/gen_std_tests.rs index 00d85d711..0bd3439c8 100644 --- a/src/wasm-lib/kcl/src/docs/gen_std_tests.rs +++ b/src/wasm-lib/kcl/src/docs/gen_std_tests.rs @@ -1,9 +1,10 @@ -use std::collections::{BTreeMap, HashMap}; +use std::collections::BTreeMap; use anyhow::Result; use base64::Engine; use convert_case::Casing; use handlebars::Renderable; +use indexmap::IndexMap; use itertools::Itertools; use serde_json::json; @@ -271,7 +272,7 @@ fn init_handlebars() -> Result> { Ok(hbs) } -fn generate_index(combined: &HashMap>) -> Result<()> { +fn generate_index(combined: &IndexMap>) -> Result<()> { let hbs = init_handlebars()?; let mut functions = Vec::new(); diff --git a/src/wasm-lib/kcl/src/docs/mod.rs b/src/wasm-lib/kcl/src/docs/mod.rs index a7dc91db9..22c39f337 100644 --- a/src/wasm-lib/kcl/src/docs/mod.rs +++ b/src/wasm-lib/kcl/src/docs/mod.rs @@ -27,6 +27,8 @@ pub struct StdLibFnData { pub description: String, /// The tags of the function. pub tags: Vec, + /// If this function uses keyword arguments, or positional arguments. + pub keyword_arguments: bool, /// The args of the function. pub args: Vec, /// The return value of the function. @@ -55,6 +57,18 @@ pub struct StdLibFnArg { pub schema: schemars::schema::RootSchema, /// If the argument is required. pub required: bool, + /// Even in functions that use keyword arguments, not every parameter requires a label (most do though). + /// Some functions allow one unlabeled parameter, which has to be first in the + /// argument list. + /// + /// This field is ignored for functions that still use positional arguments. + /// Defaults to true. + #[serde(default = "its_true")] + pub label_required: bool, +} + +fn its_true() -> bool { + true } impl StdLibFnArg { @@ -120,6 +134,9 @@ pub trait StdLibFn: std::fmt::Debug + Send + Sync { /// The description of the function. fn description(&self) -> String; + /// Does this use keyword arguments, or positional? + fn keyword_arguments(&self) -> bool; + /// The tags of the function. fn tags(&self) -> Vec; @@ -151,6 +168,7 @@ pub trait StdLibFn: std::fmt::Debug + Send + Sync { summary: self.summary(), description: self.description(), tags: self.tags(), + keyword_arguments: self.keyword_arguments(), args: self.args(false), return_value: self.return_value(false), unpublished: self.unpublished(), @@ -797,7 +815,7 @@ mod tests { #[test] fn test_serialize_function() { - let some_function = crate::ast::types::Function::StdLib { + let some_function = crate::parsing::ast::types::Function::StdLib { func: Box::new(crate::std::sketch::Line), }; let serialized = serde_json::to_string(&some_function).unwrap(); @@ -806,12 +824,12 @@ mod tests { #[test] fn test_deserialize_function() { - let some_function_string = r#"{"type":"StdLib","func":{"name":"line","summary":"","description":"","tags":[],"returnValue":{"type":"","required":false,"name":"","schema":{},"schemaDefinitions":{}},"args":[],"unpublished":false,"deprecated":false, "examples": []}}"#; - let some_function: crate::ast::types::Function = serde_json::from_str(some_function_string).unwrap(); + let some_function_string = r#"{"type":"StdLib","func":{"name":"line","keywordArguments":false,"summary":"","description":"","tags":[],"returnValue":{"type":"","required":false,"name":"","schema":{},"schemaDefinitions":{}},"args":[],"unpublished":false,"deprecated":false, "examples": []}}"#; + let some_function: crate::parsing::ast::types::Function = serde_json::from_str(some_function_string).unwrap(); assert_eq!( some_function, - crate::ast::types::Function::StdLib { + crate::parsing::ast::types::Function::StdLib { func: Box::new(crate::std::sketch::Line) } ); diff --git a/src/wasm-lib/kcl/src/engine/conn.rs b/src/wasm-lib/kcl/src/engine/conn.rs index 953a26a70..b85f3512a 100644 --- a/src/wasm-lib/kcl/src/engine/conn.rs +++ b/src/wasm-lib/kcl/src/engine/conn.rs @@ -213,7 +213,12 @@ impl EngineConnection { WebSocketResponse::Success(SuccessWebSocketResponse { resp: OkWebSocketResponseData::ModelingBatch { responses }, .. - }) => { + }) => + { + #[expect( + clippy::iter_over_hash_type, + reason = "modeling command uses a HashMap and keys are random, so we don't really have a choice" + )] for (resp_id, batch_response) in responses { let id: uuid::Uuid = (*resp_id).into(); match batch_response { diff --git a/src/wasm-lib/kcl/src/engine/mod.rs b/src/wasm-lib/kcl/src/engine/mod.rs index f985324a2..09d35a2e1 100644 --- a/src/wasm-lib/kcl/src/engine/mod.rs +++ b/src/wasm-lib/kcl/src/engine/mod.rs @@ -342,92 +342,80 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static { id_generator: &mut IdGenerator, source_range: SourceRange, ) -> Result { - let plane_settings: HashMap)> = HashMap::from([ + let plane_settings: Vec<(PlaneName, Uuid, Point3d, Point3d, Option)> = vec![ ( PlaneName::Xy, - ( - id_generator.next_uuid(), - Point3d { x: 1.0, y: 0.0, z: 0.0 }, - Point3d { x: 0.0, y: 1.0, z: 0.0 }, - Some(Color { - r: 0.7, - g: 0.28, - b: 0.28, - a: 0.4, - }), - ), + id_generator.next_uuid(), + Point3d { x: 1.0, y: 0.0, z: 0.0 }, + Point3d { x: 0.0, y: 1.0, z: 0.0 }, + Some(Color { + r: 0.7, + g: 0.28, + b: 0.28, + a: 0.4, + }), ), ( PlaneName::Yz, - ( - id_generator.next_uuid(), - Point3d { x: 0.0, y: 1.0, z: 0.0 }, - Point3d { x: 0.0, y: 0.0, z: 1.0 }, - Some(Color { - r: 0.28, - g: 0.7, - b: 0.28, - a: 0.4, - }), - ), + id_generator.next_uuid(), + Point3d { x: 0.0, y: 1.0, z: 0.0 }, + Point3d { x: 0.0, y: 0.0, z: 1.0 }, + Some(Color { + r: 0.28, + g: 0.7, + b: 0.28, + a: 0.4, + }), ), ( PlaneName::Xz, - ( - id_generator.next_uuid(), - Point3d { x: 1.0, y: 0.0, z: 0.0 }, - Point3d { x: 0.0, y: 0.0, z: 1.0 }, - Some(Color { - r: 0.28, - g: 0.28, - b: 0.7, - a: 0.4, - }), - ), + id_generator.next_uuid(), + Point3d { x: 1.0, y: 0.0, z: 0.0 }, + Point3d { x: 0.0, y: 0.0, z: 1.0 }, + Some(Color { + r: 0.28, + g: 0.28, + b: 0.7, + a: 0.4, + }), ), ( PlaneName::NegXy, - ( - id_generator.next_uuid(), - Point3d { - x: -1.0, - y: 0.0, - z: 0.0, - }, - Point3d { x: 0.0, y: 1.0, z: 0.0 }, - None, - ), + id_generator.next_uuid(), + Point3d { + x: -1.0, + y: 0.0, + z: 0.0, + }, + Point3d { x: 0.0, y: 1.0, z: 0.0 }, + None, ), ( PlaneName::NegYz, - ( - id_generator.next_uuid(), - Point3d { - x: 0.0, - y: -1.0, - z: 0.0, - }, - Point3d { x: 0.0, y: 0.0, z: 1.0 }, - None, - ), + id_generator.next_uuid(), + Point3d { + x: 0.0, + y: -1.0, + z: 0.0, + }, + Point3d { x: 0.0, y: 0.0, z: 1.0 }, + None, ), ( PlaneName::NegXz, - ( - id_generator.next_uuid(), - Point3d { - x: -1.0, - y: 0.0, - z: 0.0, - }, - Point3d { x: 0.0, y: 0.0, z: 1.0 }, - None, - ), + id_generator.next_uuid(), + Point3d { + x: -1.0, + y: 0.0, + z: 0.0, + }, + Point3d { x: 0.0, y: 0.0, z: 1.0 }, + None, ), - ]); + ]; let mut planes = HashMap::new(); - for (name, (plane_id, x_axis, y_axis, color)) in plane_settings { + for (name, plane_id, x_axis, y_axis, color) in plane_settings { planes.insert( name, self.make_default_plane(plane_id, x_axis, y_axis, color, source_range) @@ -475,6 +463,10 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static { responses: HashMap, ) -> Result { // Iterate over the responses and check for errors. + #[expect( + clippy::iter_over_hash_type, + reason = "modeling command uses a HashMap and keys are random, so we don't really have a choice" + )] for (cmd_id, resp) in responses.iter() { match resp { BatchResponse::Success { response } => { diff --git a/src/wasm-lib/kcl/src/executor.rs b/src/wasm-lib/kcl/src/executor.rs index 17d7493cf..67bb0de34 100644 --- a/src/wasm-lib/kcl/src/executor.rs +++ b/src/wasm-lib/kcl/src/executor.rs @@ -1,9 +1,6 @@ //! The executor for the AST. -use std::{ - collections::{HashMap, HashSet}, - sync::Arc, -}; +use std::{collections::HashSet, sync::Arc}; use anyhow::Result; use async_recursion::async_recursion; @@ -25,10 +22,12 @@ type Point3D = kcmc::shared::Point3d; pub use crate::kcl_value::KclValue; use crate::{ - ast::types::{BodyItem, Expr, FunctionExpression, ItemVisibility, KclNone, Node, NodeRef, TagDeclarator, TagNode}, engine::{EngineManager, ExecutionKind}, errors::{KclError, KclErrorDetails}, fs::{FileManager, FileSystem}, + parsing::ast::types::{ + BodyItem, Expr, FunctionExpression, ItemVisibility, KclNone, Node, NodeRef, TagDeclarator, TagNode, + }, settings::types::UnitLength, source_range::{ModuleId, SourceRange}, std::{args::Arg, StdLib}, @@ -191,7 +190,7 @@ impl EnvironmentRef { #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] pub struct Environment { - bindings: HashMap, + bindings: IndexMap, parent: Option, } @@ -201,7 +200,7 @@ impl Environment { pub fn root() -> Self { Self { // Prelude - bindings: HashMap::from([ + bindings: IndexMap::from([ ("ZERO".to_string(), KclValue::from_number(0.0, NO_META)), ("QUARTER_TURN".to_string(), KclValue::from_number(90.0, NO_META)), ("HALF_TURN".to_string(), KclValue::from_number(180.0, NO_META)), @@ -213,7 +212,7 @@ impl Environment { pub fn new(parent: EnvironmentRef) -> Self { Self { - bindings: HashMap::new(), + bindings: IndexMap::new(), parent: Some(parent), } } @@ -733,7 +732,7 @@ pub type MemoryFunction = fn( s: Vec, memory: ProgramMemory, - expression: crate::ast::types::BoxNode, + expression: crate::parsing::ast::types::BoxNode, metadata: Vec, exec_state: &ExecState, ctx: ExecutorContext, @@ -768,8 +767,8 @@ pub struct Sketch { /// The starting path. pub start: BasePath, /// Tag identifiers that have been declared in this sketch. - #[serde(default, skip_serializing_if = "HashMap::is_empty")] - pub tags: HashMap, + #[serde(default, skip_serializing_if = "IndexMap::is_empty")] + pub tags: IndexMap, /// The original id of the sketch. This stays the same even if the sketch is /// is sketched on face etc. #[serde(skip)] @@ -1842,7 +1841,7 @@ impl ExecutorContext { #[async_recursion] pub(crate) async fn inner_execute<'a>( &'a self, - program: NodeRef<'a, crate::ast::types::Program>, + program: NodeRef<'a, crate::parsing::ast::types::Program>, exec_state: &mut ExecState, body_type: BodyType, ) -> Result, KclError> { @@ -1883,7 +1882,7 @@ impl ExecutorContext { let module_id = exec_state.add_module(resolved_path.clone()); let source = self.fs.read_to_string(&resolved_path, source_range).await?; // TODO handle parsing errors properly - let program = crate::parser::parse_str(&source, module_id).parse_errs_as_err()?; + let program = crate::parsing::parse_str(&source, module_id).parse_errs_as_err()?; let (module_memory, module_exports) = { exec_state.import_stack.push(resolved_path.clone()); let original_execution = self.engine.replace_execution_kind(ExecutionKind::Isolated); @@ -2239,7 +2238,7 @@ mod tests { use pretty_assertions::assert_eq; use super::*; - use crate::ast::types::{Identifier, Node, Parameter}; + use crate::parsing::ast::types::{Identifier, Node, Parameter}; pub async fn parse_execute(code: &str) -> Result { let program = Program::parse(code)?; @@ -3088,7 +3087,7 @@ let w = f() + f() let func_expr = &Node::no_src(FunctionExpression { params, body: Node { - inner: crate::ast::types::Program { + inner: crate::parsing::ast::types::Program { body: Vec::new(), non_code_meta: Default::default(), shebang: None, diff --git a/src/wasm-lib/kcl/src/function_param.rs b/src/wasm-lib/kcl/src/function_param.rs index 07c69c1db..452950699 100644 --- a/src/wasm-lib/kcl/src/function_param.rs +++ b/src/wasm-lib/kcl/src/function_param.rs @@ -1,11 +1,11 @@ use schemars::JsonSchema; use crate::{ - ast::types::FunctionExpression, errors::KclError, executor::{ call_user_defined_function, ExecState, ExecutorContext, KclValue, MemoryFunction, Metadata, ProgramMemory, }, + parsing::ast::types::FunctionExpression, std::args::Arg, }; @@ -14,7 +14,7 @@ use crate::{ pub struct FunctionParam<'a> { pub inner: Option<&'a MemoryFunction>, pub memory: ProgramMemory, - pub fn_expr: crate::ast::types::BoxNode, + pub fn_expr: crate::parsing::ast::types::BoxNode, pub meta: Vec, pub ctx: ExecutorContext, } diff --git a/src/wasm-lib/kcl/src/kcl_value.rs b/src/wasm-lib/kcl/src/kcl_value.rs index ebebd2fc3..371a37467 100644 --- a/src/wasm-lib/kcl/src/kcl_value.rs +++ b/src/wasm-lib/kcl/src/kcl_value.rs @@ -5,10 +5,10 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ - ast::types::{FunctionExpression, KclNone, TagDeclarator, TagNode}, errors::KclErrorDetails, exec::{ProgramMemory, Sketch}, executor::{Face, ImportedGeometry, MemoryFunction, Metadata, Plane, SketchSet, Solid, SolidSet, TagIdentifier}, + parsing::ast::types::{FunctionExpression, KclNone, TagDeclarator, TagNode}, std::{args::Arg, FnAsArg}, ExecState, ExecutorContext, KclError, SourceRange, }; @@ -56,7 +56,7 @@ pub enum KclValue { meta: Vec, }, TagIdentifier(Box), - TagDeclarator(crate::ast::types::BoxNode), + TagDeclarator(crate::parsing::ast::types::BoxNode), Plane(Box), Face(Box), Sketch { @@ -75,7 +75,7 @@ pub enum KclValue { #[serde(skip)] func: Option, #[schemars(skip)] - expression: crate::ast::types::BoxNode, + expression: crate::parsing::ast::types::BoxNode, memory: Box, #[serde(rename = "__meta")] meta: Vec, diff --git a/src/wasm-lib/kcl/src/lib.rs b/src/wasm-lib/kcl/src/lib.rs index de4007c3c..121e74214 100644 --- a/src/wasm-lib/kcl/src/lib.rs +++ b/src/wasm-lib/kcl/src/lib.rs @@ -56,7 +56,6 @@ macro_rules! eprint { #[global_allocator] static ALLOC: dhat::Alloc = dhat::Alloc; -mod ast; mod coredump; mod docs; mod engine; @@ -68,7 +67,7 @@ mod kcl_value; pub mod lint; mod log; mod lsp; -mod parser; +mod parsing; mod settings; #[cfg(test)] mod simulation_tests; @@ -77,13 +76,11 @@ mod std; #[cfg(not(target_arch = "wasm32"))] pub mod test_server; mod thread; -mod token; mod unparser; mod walk; #[cfg(target_arch = "wasm32")] mod wasm; -pub use ast::{modify::modify_ast_for_sketch, types::FormatOptions}; pub use coredump::CoreDump; pub use engine::{EngineManager, ExecutionKind}; pub use errors::{ConnectionError, ExecError, KclError}; @@ -92,6 +89,7 @@ pub use lsp::{ copilot::Backend as CopilotLspBackend, kcl::{Backend as KclLspBackend, Server as KclLspServerSubCommand}, }; +pub use parsing::ast::{modify::modify_ast_for_sketch, types::FormatOptions}; pub use settings::types::{project::ProjectConfiguration, Configuration, UnitLength}; pub use source_range::{ModuleId, SourceRange}; @@ -127,7 +125,7 @@ use crate::log::{log, logln}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Program { #[serde(flatten)] - ast: ast::types::Node, + ast: parsing::ast::types::Node, } #[cfg(any(test, feature = "lsp-test-util"))] @@ -138,14 +136,14 @@ pub use lsp::test_util::kcl_lsp_server; impl Program { pub fn parse(input: &str) -> Result { let module_id = ModuleId::default(); - let tokens = token::lexer(input, module_id)?; + let tokens = parsing::token::lexer(input, module_id)?; // TODO handle parsing errors properly - let ast = parser::parse_tokens(tokens).parse_errs_as_err()?; + let ast = parsing::parse_tokens(tokens).parse_errs_as_err()?; Ok(Program { ast }) } - pub fn compute_digest(&mut self) -> ast::types::digest::Digest { + pub fn compute_digest(&mut self) -> parsing::ast::digest::Digest { self.ast.compute_digest() } @@ -167,8 +165,8 @@ impl Program { } } -impl From> for Program { - fn from(ast: ast::types::Node) -> Program { +impl From> for Program { + fn from(ast: parsing::ast::types::Node) -> Program { Self { ast } } } diff --git a/src/wasm-lib/kcl/src/lint/checks/camel_case.rs b/src/wasm-lib/kcl/src/lint/checks/camel_case.rs index c369febcc..649a6faa2 100644 --- a/src/wasm-lib/kcl/src/lint/checks/camel_case.rs +++ b/src/wasm-lib/kcl/src/lint/checks/camel_case.rs @@ -2,8 +2,8 @@ use anyhow::Result; use convert_case::Casing; use crate::{ - ast::types::{ObjectProperty, VariableDeclarator}, lint::rule::{def_finding, Discovered, Finding}, + parsing::ast::types::{ObjectProperty, VariableDeclarator}, walk::Node, SourceRange, }; diff --git a/src/wasm-lib/kcl/src/lint/checks/offset_plane.rs b/src/wasm-lib/kcl/src/lint/checks/offset_plane.rs index 7bfb94eea..62231769d 100644 --- a/src/wasm-lib/kcl/src/lint/checks/offset_plane.rs +++ b/src/wasm-lib/kcl/src/lint/checks/offset_plane.rs @@ -3,8 +3,8 @@ use std::collections::HashMap; use anyhow::Result; use crate::{ - ast::types::{BinaryPart, Expr, LiteralValue, ObjectExpression, UnaryOperator}, lint::rule::{def_finding, Discovered, Finding}, + parsing::ast::types::{BinaryPart, Expr, LiteralValue, ObjectExpression, UnaryOperator}, walk::Node, SourceRange, }; diff --git a/src/wasm-lib/kcl/src/lint/checks/std_lib_args.rs b/src/wasm-lib/kcl/src/lint/checks/std_lib_args.rs index d8688ceb7..48d15a744 100644 --- a/src/wasm-lib/kcl/src/lint/checks/std_lib_args.rs +++ b/src/wasm-lib/kcl/src/lint/checks/std_lib_args.rs @@ -3,9 +3,9 @@ use std::sync::Arc; use anyhow::Result; use crate::{ - ast::types::{CallExpression, NodeRef}, docs::StdLibFn, lint::rule::{def_finding, Discovered, Finding}, + parsing::ast::types::{CallExpression, NodeRef}, std::{FunctionKind, StdLib}, walk::Node, SourceRange, diff --git a/src/wasm-lib/kcl/src/lint/rule.rs b/src/wasm-lib/kcl/src/lint/rule.rs index d8e45b953..bdd5c67da 100644 --- a/src/wasm-lib/kcl/src/lint/rule.rs +++ b/src/wasm-lib/kcl/src/lint/rule.rs @@ -30,16 +30,16 @@ where #[serde(rename_all = "camelCase")] pub struct Discovered { /// Zoo Lint Finding information. - pub(super) finding: Finding, + pub finding: Finding, /// Further information about the specific finding. - pub(super) description: String, + pub description: String, /// Source code location. - pub(super) pos: SourceRange, + pub pos: SourceRange, /// Is this discovered issue overridden by the programmer? - pub(super) overridden: bool, + pub overridden: bool, } #[cfg(feature = "pyo3")] @@ -182,7 +182,7 @@ mod test { macro_rules! assert_no_finding { ( $check:expr, $finding:expr, $kcl:expr ) => { - let prog = $crate::parser::top_level_parse($kcl).unwrap(); + let prog = $crate::parsing::top_level_parse($kcl).unwrap(); for discovered_finding in prog.lint($check).unwrap() { if discovered_finding.finding == $finding { assert!(false, "Finding {:?} was emitted", $finding.code); @@ -193,7 +193,7 @@ mod test { macro_rules! assert_finding { ( $check:expr, $finding:expr, $kcl:expr ) => { - let prog = $crate::parser::top_level_parse($kcl).unwrap(); + let prog = $crate::parsing::top_level_parse($kcl).unwrap(); for discovered_finding in prog.lint($check).unwrap() { if discovered_finding.finding == $finding { diff --git a/src/wasm-lib/kcl/src/lsp/kcl/custom_notifications.rs b/src/wasm-lib/kcl/src/lsp/kcl/custom_notifications.rs index a6d35527e..286f2a2ab 100644 --- a/src/wasm-lib/kcl/src/lsp/kcl/custom_notifications.rs +++ b/src/wasm-lib/kcl/src/lsp/kcl/custom_notifications.rs @@ -3,14 +3,14 @@ use serde::{Deserialize, Serialize}; use tower_lsp::lsp_types::notification::Notification; -use crate::{ast::types::Node, settings::types::UnitLength}; +use crate::{parsing::ast::types::Node, settings::types::UnitLength}; /// A notification that the AST has changed. #[derive(Debug)] pub enum AstUpdated {} impl Notification for AstUpdated { - type Params = Node; + type Params = Node; const METHOD: &'static str = "kcl/astUpdated"; } diff --git a/src/wasm-lib/kcl/src/lsp/kcl/mod.rs b/src/wasm-lib/kcl/src/lsp/kcl/mod.rs index f1c0841f1..da3c820f3 100644 --- a/src/wasm-lib/kcl/src/lsp/kcl/mod.rs +++ b/src/wasm-lib/kcl/src/lsp/kcl/mod.rs @@ -41,10 +41,12 @@ use tower_lsp::{ }; use crate::{ - ast::types::{Expr, Node, VariableKind}, lsp::{backend::Backend as _, util::IntoDiagnostic}, - parser::PIPE_OPERATOR, - token::TokenType, + parsing::{ + ast::types::{Expr, Node, VariableKind}, + token::TokenType, + PIPE_OPERATOR, + }, ExecState, ModuleId, Program, SourceRange, }; @@ -98,9 +100,9 @@ pub struct Backend { /// The stdlib signatures for the language. pub stdlib_signatures: HashMap, /// Token maps. - pub token_map: DashMap>, + pub token_map: DashMap>, /// AST maps. - pub ast_map: DashMap>, + pub ast_map: DashMap>, /// Memory maps. pub memory_map: DashMap, /// Current code. @@ -257,7 +259,7 @@ impl crate::lsp::backend::Backend for Backend { // Lets update the tokens. let module_id = ModuleId::default(); - let tokens = match crate::token::lexer(¶ms.text, module_id) { + let tokens = match crate::parsing::token::lexer(¶ms.text, module_id) { Ok(tokens) => tokens, Err(err) => { self.add_to_diagnostics(¶ms, &[err], true).await; @@ -298,7 +300,7 @@ impl crate::lsp::backend::Backend for Backend { } // Lets update the ast. - let result = crate::parser::parse_tokens(tokens.clone()); + let result = crate::parsing::parse_tokens(tokens.clone()); // TODO handle parse errors properly let mut ast = match result.parse_errs_as_err() { Ok(ast) => ast, @@ -376,7 +378,7 @@ impl Backend { self.executor_ctx.read().await } - async fn update_semantic_tokens(&self, tokens: &[crate::token::Token], params: &TextDocumentItem) { + async fn update_semantic_tokens(&self, tokens: &[crate::parsing::token::Token], params: &TextDocumentItem) { // Update the semantic tokens map. let mut semantic_tokens = vec![]; let mut last_position = Position::new(0, 0); @@ -1036,7 +1038,7 @@ impl LanguageServer for Backend { }; match hover { - crate::ast::types::Hover::Function { name, range } => { + crate::parsing::ast::types::Hover::Function { name, range } => { // Get the docs for this function. let Some(completion) = self.stdlib_completions.get(&name) else { return Ok(None); @@ -1071,8 +1073,8 @@ impl LanguageServer for Backend { range: Some(range), })) } - crate::ast::types::Hover::Signature { .. } => Ok(None), - crate::ast::types::Hover::Comment { value, range } => Ok(Some(Hover { + crate::parsing::ast::types::Hover::Signature { .. } => Ok(None), + crate::parsing::ast::types::Hover::Comment { value, range } => Ok(Some(Hover { contents: HoverContents::Markup(MarkupContent { kind: MarkupKind::Markdown, value, @@ -1230,7 +1232,7 @@ impl LanguageServer for Backend { }; match hover { - crate::ast::types::Hover::Function { name, range: _ } => { + crate::parsing::ast::types::Hover::Function { name, range: _ } => { // Get the docs for this function. let Some(signature) = self.stdlib_signatures.get(&name) else { return Ok(None); @@ -1238,7 +1240,7 @@ impl LanguageServer for Backend { Ok(Some(signature.clone())) } - crate::ast::types::Hover::Signature { + crate::parsing::ast::types::Hover::Signature { name, parameter_index, range: _, @@ -1253,7 +1255,7 @@ impl LanguageServer for Backend { Ok(Some(signature)) } - crate::ast::types::Hover::Comment { value: _, range: _ } => { + crate::parsing::ast::types::Hover::Comment { value: _, range: _ } => { return Ok(None); } } @@ -1302,12 +1304,12 @@ impl LanguageServer for Backend { // I don't know if we need to do this again since it should be updated in the context. // But I figure better safe than sorry since this will write back out to the file. let module_id = ModuleId::default(); - let Ok(ast) = crate::parser::parse_str(current_code, module_id).parse_errs_as_err() else { + let Ok(ast) = crate::parsing::parse_str(current_code, module_id).parse_errs_as_err() else { return Ok(None); }; // Now recast it. let recast = ast.recast( - &crate::ast::types::FormatOptions { + &crate::parsing::ast::types::FormatOptions { tab_size: params.options.tab_size as usize, insert_final_newline: params.options.insert_final_newline.unwrap_or(false), use_tabs: !params.options.insert_spaces, @@ -1336,7 +1338,7 @@ impl LanguageServer for Backend { // I don't know if we need to do this again since it should be updated in the context. // But I figure better safe than sorry since this will write back out to the file. let module_id = ModuleId::default(); - let Ok(mut ast) = crate::parser::parse_str(current_code, module_id).parse_errs_as_err() else { + let Ok(mut ast) = crate::parsing::parse_str(current_code, module_id).parse_errs_as_err() else { return Ok(None); }; diff --git a/src/wasm-lib/kcl/src/lsp/tests.rs b/src/wasm-lib/kcl/src/lsp/tests.rs index 1e294bf00..9d1e2ed95 100644 --- a/src/wasm-lib/kcl/src/lsp/tests.rs +++ b/src/wasm-lib/kcl/src/lsp/tests.rs @@ -7,9 +7,9 @@ use tower_lsp::{ }; use crate::{ - ast::types::{Node, Program}, executor::ProgramMemory, lsp::test_util::{copilot_lsp_server, kcl_lsp_server}, + parsing::ast::types::{Node, Program}, }; #[tokio::test(flavor = "multi_thread", worker_threads = 12)] diff --git a/src/wasm-lib/kcl/src/parser/bad_inputs.rs b/src/wasm-lib/kcl/src/parser/bad_inputs.rs deleted file mode 100644 index d101112ce..000000000 --- a/src/wasm-lib/kcl/src/parser/bad_inputs.rs +++ /dev/null @@ -1,14 +0,0 @@ -#[cfg(test)] -mod tests { - macro_rules! parse_and_lex { - ($func_name:ident, $test_kcl_program:expr) => { - #[test] - fn $func_name() { - let _ = crate::parser::top_level_parse($test_kcl_program); - } - }; - } - - parse_and_lex!(crash_eof_1, "{\"ގގ\0\0\0\"\"."); - parse_and_lex!(crash_eof_2, "(/=e\"\u{616}ݝ\"\""); -} diff --git a/src/wasm-lib/kcl/src/ast/types/digest.rs b/src/wasm-lib/kcl/src/parsing/ast/digest.rs similarity index 87% rename from src/wasm-lib/kcl/src/ast/types/digest.rs rename to src/wasm-lib/kcl/src/parsing/ast/digest.rs index acaf43996..1405908e6 100644 --- a/src/wasm-lib/kcl/src/ast/types/digest.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/digest.rs @@ -1,9 +1,10 @@ use sha2::{Digest as DigestTrait, Sha256}; -use super::{ +use super::types::{ItemVisibility, VariableKind}; +use crate::parsing::ast::types::{ ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryPart, BodyItem, CallExpression, CallExpressionKw, - ElseIf, Expr, ExpressionStatement, FnArgType, FunctionExpression, Identifier, IfExpression, ImportItem, - ImportStatement, Literal, LiteralIdentifier, MemberExpression, MemberObject, NonCodeMeta, NonCodeNode, + CommentStyle, ElseIf, Expr, ExpressionStatement, FnArgType, FunctionExpression, Identifier, IfExpression, + ImportItem, ImportStatement, Literal, LiteralIdentifier, MemberExpression, MemberObject, NonCodeMeta, NonCodeNode, NonCodeValue, ObjectExpression, ObjectProperty, Parameter, PipeExpression, PipeSubstitution, Program, ReturnStatement, TagDeclarator, UnaryExpression, VariableDeclaration, VariableDeclarator, }; @@ -209,6 +210,15 @@ impl ReturnStatement { }); } +impl CommentStyle { + fn digestable_id(&self) -> [u8; 2] { + match &self { + CommentStyle::Line => *b"//", + CommentStyle::Block => *b"/*", + } + } +} + impl NonCodeNode { compute_digest!(|slf, hasher| { match &slf.value { @@ -264,6 +274,24 @@ impl VariableDeclaration { }); } +impl VariableKind { + fn digestable_id(&self) -> [u8; 1] { + match self { + VariableKind::Const => [2], + VariableKind::Fn => [3], + } + } +} + +impl ItemVisibility { + fn digestable_id(&self) -> [u8; 1] { + match self { + ItemVisibility::Default => [0], + ItemVisibility::Export => [1], + } + } +} + impl VariableDeclarator { compute_digest!(|slf, hasher| { hasher.update(slf.id.compute_digest()); @@ -406,3 +434,31 @@ impl ElseIf { hasher.update(slf.then_val.compute_digest()); }); } + +#[cfg(test)] +mod test { + #[tokio::test(flavor = "multi_thread")] + async fn test_parse_digest() { + let prog1_string = r#"startSketchOn('XY') + |> startProfileAt([0, 0], %) + |> line([5, 5], %) +"#; + let prog1_digest = crate::parsing::top_level_parse(prog1_string).unwrap().compute_digest(); + + let prog2_string = r#"startSketchOn('XY') + |> startProfileAt([0, 2], %) + |> line([5, 5], %) +"#; + let prog2_digest = crate::parsing::top_level_parse(prog2_string).unwrap().compute_digest(); + + assert!(prog1_digest != prog2_digest); + + let prog3_string = r#"startSketchOn('XY') + |> startProfileAt([0, 0], %) + |> line([5, 5], %) +"#; + let prog3_digest = crate::parsing::top_level_parse(prog3_string).unwrap().compute_digest(); + + assert_eq!(prog1_digest, prog3_digest); + } +} diff --git a/src/wasm-lib/kcl/src/ast/types/execute.rs b/src/wasm-lib/kcl/src/parsing/ast/execute.rs similarity index 85% rename from src/wasm-lib/kcl/src/ast/types/execute.rs rename to src/wasm-lib/kcl/src/parsing/ast/execute.rs index 1b014bb4f..146fa406b 100644 --- a/src/wasm-lib/kcl/src/ast/types/execute.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/execute.rs @@ -2,14 +2,14 @@ use std::collections::HashMap; use async_recursion::async_recursion; -use super::{ - ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, CallExpression, - CallExpressionKw, Expr, IfExpression, KclNone, LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, - Node, ObjectExpression, TagDeclarator, UnaryExpression, UnaryOperator, -}; use crate::{ errors::{KclError, KclErrorDetails}, executor::{BodyType, ExecState, ExecutorContext, KclValue, Metadata, StatementKind, TagEngineInfo, TagIdentifier}, + parsing::ast::types::{ + ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, CallExpression, + CallExpressionKw, Expr, IfExpression, KclNone, LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, + Node, ObjectExpression, TagDeclarator, UnaryExpression, UnaryOperator, + }, source_range::SourceRange, std::{args::Arg, FunctionKind}, }; @@ -358,8 +358,47 @@ async fn inner_execute_pipe_body( } impl Node { - pub async fn execute(&self, _exec_state: &mut ExecState, _ctx: &ExecutorContext) -> Result { - todo!() + #[async_recursion] + pub async fn execute(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result { + let fn_name = &self.callee.name; + + // Build a hashmap from argument labels to the final evaluated values. + let mut fn_args = HashMap::with_capacity(self.arguments.len()); + for arg_expr in &self.arguments { + let source_range = SourceRange::from(arg_expr.arg.clone()); + let metadata = Metadata { source_range }; + let value = ctx + .execute_expr(&arg_expr.arg, exec_state, &metadata, StatementKind::Expression) + .await?; + fn_args.insert(arg_expr.label.name.clone(), Arg::new(value, source_range)); + } + let fn_args = fn_args; // remove mutability + + // Evaluate the unlabeled first param, if any exists. + let unlabeled = if let Some(ref arg_expr) = self.unlabeled { + let source_range = SourceRange::from(arg_expr.clone()); + let metadata = Metadata { source_range }; + let value = ctx + .execute_expr(arg_expr, exec_state, &metadata, StatementKind::Expression) + .await?; + Some(Arg::new(value, source_range)) + } else { + None + }; + + let args = crate::std::Args::new_kw(fn_args, unlabeled, self.into(), ctx.clone()); + match ctx.stdlib.get_either(fn_name) { + FunctionKind::Core(func) => { + // Attempt to call the function. + let mut result = func.std_lib_fn()(exec_state, args).await?; + update_memory_for_tags_of_geometry(&mut result, exec_state)?; + Ok(result) + } + FunctionKind::UserDefined => { + todo!("Part of modeling-app#4600: Support keyword arguments for user-defined functions") + } + FunctionKind::Std(_) => todo!("There is no KCL std anymore, it's all core."), + } } } @@ -381,76 +420,12 @@ impl Node { fn_args.push(arg); } - match ctx.stdlib.get_either(&self.callee.name) { + match ctx.stdlib.get_either(fn_name) { FunctionKind::Core(func) => { // Attempt to call the function. let args = crate::std::Args::new(fn_args, self.into(), ctx.clone()); let mut result = func.std_lib_fn()(exec_state, args).await?; - - // If the return result is a sketch or solid, we want to update the - // memory for the tags of the group. - // TODO: This could probably be done in a better way, but as of now this was my only idea - // and it works. - match result { - KclValue::Sketch { value: ref mut sketch } => { - for (_, tag) in sketch.tags.iter() { - exec_state.memory.update_tag(&tag.value, tag.clone())?; - } - } - KclValue::Solid(ref mut solid) => { - for value in &solid.value { - if let Some(tag) = value.get_tag() { - // Get the past tag and update it. - let mut t = if let Some(t) = solid.sketch.tags.get(&tag.name) { - t.clone() - } else { - // It's probably a fillet or a chamfer. - // Initialize it. - TagIdentifier { - value: tag.name.clone(), - info: Some(TagEngineInfo { - id: value.get_id(), - surface: Some(value.clone()), - path: None, - sketch: solid.id, - }), - meta: vec![Metadata { - source_range: tag.clone().into(), - }], - } - }; - - let Some(ref info) = t.info else { - return Err(KclError::Semantic(KclErrorDetails { - message: format!("Tag {} does not have path info", tag.name), - source_ranges: vec![tag.into()], - })); - }; - - let mut info = info.clone(); - info.surface = Some(value.clone()); - info.sketch = solid.id; - t.info = Some(info); - - exec_state.memory.update_tag(&tag.name, t.clone())?; - - // update the sketch tags. - solid.sketch.tags.insert(tag.name.clone(), t); - } - } - - // Find the stale sketch in memory and update it. - if let Some(current_env) = exec_state - .memory - .environments - .get_mut(exec_state.memory.current_env.index()) - { - current_env.update_sketch_tags(&solid.sketch); - } - } - _ => {} - } - + update_memory_for_tags_of_geometry(&mut result, exec_state)?; Ok(result) } FunctionKind::Std(func) => { @@ -570,6 +545,73 @@ impl Node { } } +fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut ExecState) -> Result<(), KclError> { + // If the return result is a sketch or solid, we want to update the + // memory for the tags of the group. + // TODO: This could probably be done in a better way, but as of now this was my only idea + // and it works. + match result { + KclValue::Sketch { value: ref mut sketch } => { + for (_, tag) in sketch.tags.iter() { + exec_state.memory.update_tag(&tag.value, tag.clone())?; + } + } + KclValue::Solid(ref mut solid) => { + for value in &solid.value { + if let Some(tag) = value.get_tag() { + // Get the past tag and update it. + let mut t = if let Some(t) = solid.sketch.tags.get(&tag.name) { + t.clone() + } else { + // It's probably a fillet or a chamfer. + // Initialize it. + TagIdentifier { + value: tag.name.clone(), + info: Some(TagEngineInfo { + id: value.get_id(), + surface: Some(value.clone()), + path: None, + sketch: solid.id, + }), + meta: vec![Metadata { + source_range: tag.clone().into(), + }], + } + }; + + let Some(ref info) = t.info else { + return Err(KclError::Semantic(KclErrorDetails { + message: format!("Tag {} does not have path info", tag.name), + source_ranges: vec![tag.into()], + })); + }; + + let mut info = info.clone(); + info.surface = Some(value.clone()); + info.sketch = solid.id; + t.info = Some(info); + + exec_state.memory.update_tag(&tag.name, t.clone())?; + + // update the sketch tags. + solid.sketch.tags.insert(tag.name.clone(), t); + } + } + + // Find the stale sketch in memory and update it. + if let Some(current_env) = exec_state + .memory + .environments + .get_mut(exec_state.memory.current_env.index()) + { + current_env.update_sketch_tags(&solid.sketch); + } + } + _ => {} + } + Ok(()) +} + impl Node { pub async fn execute(&self, exec_state: &mut ExecState) -> Result { let memory_item = KclValue::TagIdentifier(Box::new(TagIdentifier { diff --git a/src/wasm-lib/kcl/src/parsing/ast/mod.rs b/src/wasm-lib/kcl/src/parsing/ast/mod.rs new file mode 100644 index 000000000..fa2e039ae --- /dev/null +++ b/src/wasm-lib/kcl/src/parsing/ast/mod.rs @@ -0,0 +1,5 @@ +pub(crate) mod digest; +pub(crate) mod execute; +pub mod modify; +pub(crate) mod source_range; +pub mod types; diff --git a/src/wasm-lib/kcl/src/ast/modify.rs b/src/wasm-lib/kcl/src/parsing/ast/modify.rs similarity index 99% rename from src/wasm-lib/kcl/src/ast/modify.rs rename to src/wasm-lib/kcl/src/parsing/ast/modify.rs index 7c3adb1e1..ff1014a38 100644 --- a/src/wasm-lib/kcl/src/ast/modify.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/modify.rs @@ -7,13 +7,13 @@ use kcmc::{ use kittycad_modeling_cmds as kcmc; use crate::{ - ast::types::{ - ArrayExpression, CallExpression, ConstraintLevel, FormatOptions, Literal, Node, PipeExpression, - PipeSubstitution, VariableDeclarator, - }, engine::EngineManager, errors::{KclError, KclErrorDetails}, executor::Point2d, + parsing::ast::types::{ + ArrayExpression, CallExpression, ConstraintLevel, FormatOptions, Literal, Node, PipeExpression, + PipeSubstitution, VariableDeclarator, + }, source_range::{ModuleId, SourceRange}, Program, }; @@ -184,7 +184,7 @@ pub async fn modify_ast_for_sketch( let recasted = program.ast.recast(&FormatOptions::default(), 0); // Re-parse the ast so we get the correct source ranges. - *program = crate::parser::parse_str(&recasted, module_id) + *program = crate::parsing::parse_str(&recasted, module_id) .parse_errs_as_err()? .into(); diff --git a/src/wasm-lib/kcl/src/ast/types/source_range.rs b/src/wasm-lib/kcl/src/parsing/ast/source_range.rs similarity index 96% rename from src/wasm-lib/kcl/src/ast/types/source_range.rs rename to src/wasm-lib/kcl/src/parsing/ast/source_range.rs index f961579e4..f76976c75 100644 --- a/src/wasm-lib/kcl/src/ast/types/source_range.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/source_range.rs @@ -1,4 +1,4 @@ -use super::{BinaryPart, BodyItem, Expr, LiteralIdentifier, MemberObject}; +use crate::parsing::ast::types::{BinaryPart, BodyItem, Expr, LiteralIdentifier, MemberObject}; use crate::source_range::ModuleId; impl BodyItem { diff --git a/src/wasm-lib/kcl/src/ast/types/condition.rs b/src/wasm-lib/kcl/src/parsing/ast/types/condition.rs similarity index 98% rename from src/wasm-lib/kcl/src/ast/types/condition.rs rename to src/wasm-lib/kcl/src/parsing/ast/types/condition.rs index a211d6b43..e1ee8ea0a 100644 --- a/src/wasm-lib/kcl/src/ast/types/condition.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/types/condition.rs @@ -8,7 +8,7 @@ use crate::SourceRange; // TODO: This should be its own type, similar to Program, // but guaranteed to have an Expression as its final item. // https://github.com/KittyCAD/modeling-app/issues/4015 -type IfBlock = crate::ast::types::Program; +type IfBlock = crate::parsing::ast::types::Program; #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)] #[databake(path = kcl_lib::ast::types)] diff --git a/src/wasm-lib/kcl/src/ast/types/literal_value.rs b/src/wasm-lib/kcl/src/parsing/ast/types/literal_value.rs similarity index 97% rename from src/wasm-lib/kcl/src/ast/types/literal_value.rs rename to src/wasm-lib/kcl/src/parsing/ast/types/literal_value.rs index 80a73c430..52a64588e 100644 --- a/src/wasm-lib/kcl/src/ast/types/literal_value.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/types/literal_value.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value as JValue; use super::Node; -use crate::ast::types::{Expr, Literal}; +use crate::parsing::ast::types::{Expr, Literal}; #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)] #[databake(path = kcl_lib::ast::types)] diff --git a/src/wasm-lib/kcl/src/ast/types.rs b/src/wasm-lib/kcl/src/parsing/ast/types/mod.rs similarity index 98% rename from src/wasm-lib/kcl/src/ast/types.rs rename to src/wasm-lib/kcl/src/parsing/ast/types/mod.rs index abd0bf67b..f0771a07a 100644 --- a/src/wasm-lib/kcl/src/ast/types.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/types/mod.rs @@ -18,8 +18,8 @@ use tower_lsp::lsp_types::{ CompletionItem, CompletionItemKind, DocumentSymbol, FoldingRange, FoldingRangeKind, Range as LspRange, SymbolKind, }; -use self::execute::execute_pipe_body; -pub use crate::ast::types::{ +use super::{digest::Digest, execute::execute_pipe_body}; +pub use crate::parsing::ast::types::{ condition::{ElseIf, IfExpression}, literal_value::LiteralValue, none::KclNone, @@ -28,19 +28,14 @@ use crate::{ docs::StdLibFn, errors::KclError, executor::{ExecState, ExecutorContext, KclValue, Metadata, TagIdentifier}, - parser::PIPE_OPERATOR, + parsing::PIPE_OPERATOR, source_range::{ModuleId, SourceRange}, std::kcl_stdlib::KclStdLibFn, }; mod condition; -pub(crate) mod digest; -pub(crate) mod execute; mod literal_value; mod none; -pub(crate) mod source_range; - -use digest::Digest; pub enum Definition<'a> { Variable(&'a VariableDeclarator), @@ -1029,15 +1024,6 @@ pub enum CommentStyle { Block, } -impl CommentStyle { - fn digestable_id(&self) -> [u8; 2] { - match &self { - CommentStyle::Line => *b"//", - CommentStyle::Block => *b"/*", - } - } -} - #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)] #[databake(path = kcl_lib::ast::types)] #[ts(export)] @@ -1502,13 +1488,6 @@ pub enum ItemVisibility { } impl ItemVisibility { - fn digestable_id(&self) -> [u8; 1] { - match self { - ItemVisibility::Default => [0], - ItemVisibility::Export => [1], - } - } - fn is_default(&self) -> bool { matches!(self, Self::Default) } @@ -1732,13 +1711,6 @@ pub enum VariableKind { } impl VariableKind { - fn digestable_id(&self) -> [u8; 1] { - match self { - VariableKind::Const => [2], - VariableKind::Fn => [3], - } - } - pub fn to_completion_items() -> Result> { let mut settings = schemars::gen::SchemaSettings::openapi3(); settings.inline_subschemas = true; @@ -3158,7 +3130,7 @@ fn ghi = (x) => { ghi("things") "#; - let program = crate::parser::top_level_parse(code).unwrap(); + let program = crate::parsing::top_level_parse(code).unwrap(); let folding_ranges = program.get_lsp_folding_ranges(); assert_eq!(folding_ranges.len(), 3); assert_eq!(folding_ranges[0].start_line, 29); @@ -3194,7 +3166,7 @@ fn ghi = (x) => { return x } "#; - let program = crate::parser::top_level_parse(code).unwrap(); + let program = crate::parsing::top_level_parse(code).unwrap(); let symbols = program.get_lsp_symbols(code).unwrap(); assert_eq!(symbols.len(), 7); } @@ -3214,7 +3186,7 @@ const cylinder = startSketchOn('-XZ') }, %) |> extrude(h, %) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let value = program.get_non_code_meta_for_position(50); @@ -3237,7 +3209,7 @@ const cylinder = startSketchOn('-XZ') }, %) |> extrude(h, %) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let value = program.get_non_code_meta_for_position(124); @@ -3250,7 +3222,7 @@ const cylinder = startSketchOn('-XZ') |> startProfileAt([0,0], %) |> xLine(5, %) // lin "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let value = program.get_non_code_meta_for_position(86); @@ -3262,7 +3234,7 @@ const cylinder = startSketchOn('-XZ') let some_program_string = r#"fn thing = (arg0: number, arg1: string, tag?: string) => { return arg0 }"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); // Check the program output for the types of the parameters. let function = program.body.first().unwrap(); @@ -3284,7 +3256,7 @@ const cylinder = startSketchOn('-XZ') let some_program_string = r#"fn thing = (arg0: number[], arg1: string[], tag?: string) => { return arg0 }"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); // Check the program output for the types of the parameters. let function = program.body.first().unwrap(); @@ -3307,7 +3279,7 @@ const cylinder = startSketchOn('-XZ') return arg0 }"#; let module_id = ModuleId::default(); - let program = crate::parser::parse_str(some_program_string, module_id).unwrap(); + let program = crate::parsing::parse_str(some_program_string, module_id).unwrap(); // Check the program output for the types of the parameters. let function = program.body.first().unwrap(); @@ -3378,7 +3350,7 @@ const cylinder = startSketchOn('-XZ') return 1 }"#; let module_id = ModuleId::default(); - let program = crate::parser::parse_str(some_program_string, module_id).unwrap(); + let program = crate::parsing::parse_str(some_program_string, module_id).unwrap(); // Check the program output for the types of the parameters. let function = program.body.first().unwrap(); @@ -3566,7 +3538,7 @@ const cylinder = startSketchOn('-XZ') #[tokio::test(flavor = "multi_thread")] async fn test_parse_object_bool() { let some_program_string = r#"some_func({thing: true, other_thing: false})"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); // We want to get the bool and verify it is a bool. @@ -3607,29 +3579,4 @@ const cylinder = startSketchOn('-XZ') assert_eq!(l.raw, "false"); } - - #[tokio::test(flavor = "multi_thread")] - async fn test_parse_digest() { - let prog1_string = r#"startSketchOn('XY') - |> startProfileAt([0, 0], %) - |> line([5, 5], %) -"#; - let prog1_digest = crate::parser::top_level_parse(prog1_string).unwrap().compute_digest(); - - let prog2_string = r#"startSketchOn('XY') - |> startProfileAt([0, 2], %) - |> line([5, 5], %) -"#; - let prog2_digest = crate::parser::top_level_parse(prog2_string).unwrap().compute_digest(); - - assert!(prog1_digest != prog2_digest); - - let prog3_string = r#"startSketchOn('XY') - |> startProfileAt([0, 0], %) - |> line([5, 5], %) -"#; - let prog3_digest = crate::parser::top_level_parse(prog3_string).unwrap().compute_digest(); - - assert_eq!(prog1_digest, prog3_digest); - } } diff --git a/src/wasm-lib/kcl/src/ast/types/none.rs b/src/wasm-lib/kcl/src/parsing/ast/types/none.rs similarity index 97% rename from src/wasm-lib/kcl/src/ast/types/none.rs rename to src/wasm-lib/kcl/src/parsing/ast/types/none.rs index fef7b0ea6..51a2ec387 100644 --- a/src/wasm-lib/kcl/src/ast/types/none.rs +++ b/src/wasm-lib/kcl/src/parsing/ast/types/none.rs @@ -5,7 +5,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use super::Node; -use crate::{ast::types::ConstraintLevel, executor::KclValue}; +use crate::{executor::KclValue, parsing::ast::types::ConstraintLevel}; const KCL_NONE_ID: &str = "KCL_NONE_ID"; diff --git a/src/wasm-lib/kcl/src/parser/parser_impl/error.rs b/src/wasm-lib/kcl/src/parsing/error.rs similarity index 99% rename from src/wasm-lib/kcl/src/parser/parser_impl/error.rs rename to src/wasm-lib/kcl/src/parsing/error.rs index 028b2265e..088e442d2 100644 --- a/src/wasm-lib/kcl/src/parser/parser_impl/error.rs +++ b/src/wasm-lib/kcl/src/parsing/error.rs @@ -2,7 +2,7 @@ use winnow::{error::StrContext, stream::Stream}; use crate::{ errors::{KclError, KclErrorDetails}, - token::Token, + parsing::token::Token, SourceRange, }; diff --git a/src/wasm-lib/kcl/src/parser/math.rs b/src/wasm-lib/kcl/src/parsing/math.rs similarity index 97% rename from src/wasm-lib/kcl/src/parser/math.rs rename to src/wasm-lib/kcl/src/parsing/math.rs index 53eaa9bda..d37e2477f 100644 --- a/src/wasm-lib/kcl/src/parser/math.rs +++ b/src/wasm-lib/kcl/src/parsing/math.rs @@ -1,6 +1,6 @@ use crate::{ - ast::types::{BinaryExpression, BinaryOperator, BinaryPart, Node}, errors::{KclError, KclErrorDetails}, + parsing::ast::types::{BinaryExpression, BinaryOperator, BinaryPart, Node}, SourceRange, }; @@ -126,7 +126,8 @@ impl From for BinaryExpressionToken { #[cfg(test)] mod tests { use super::*; - use crate::{ast::types::Literal, source_range::ModuleId}; + use crate::parsing::ast::types::Literal; + use crate::source_range::ModuleId; #[test] fn parse_and_evaluate() { diff --git a/src/wasm-lib/kcl/src/parser.rs b/src/wasm-lib/kcl/src/parsing/mod.rs similarity index 85% rename from src/wasm-lib/kcl/src/parser.rs rename to src/wasm-lib/kcl/src/parsing/mod.rs index 18ec54a87..c3e4e4f44 100644 --- a/src/wasm-lib/kcl/src/parser.rs +++ b/src/wasm-lib/kcl/src/parsing/mod.rs @@ -1,15 +1,19 @@ -use parser_impl::ParseContext; +use parser::ParseContext; use crate::{ - ast::types::{Node, Program}, errors::{KclError, KclErrorDetails}, + parsing::{ + ast::types::{Node, Program}, + token::{Token, TokenType}, + }, source_range::{ModuleId, SourceRange}, - token::{Token, TokenType}, }; -mod bad_inputs; +pub(crate) mod ast; +mod error; mod math; -pub(crate) mod parser_impl; +pub(crate) mod parser; +pub(crate) mod token; pub const PIPE_SUBSTITUTION_OPERATOR: &str = "%"; pub const PIPE_OPERATOR: &str = "|>"; @@ -33,7 +37,7 @@ pub fn top_level_parse(code: &str) -> ParseResult { /// Parse the given KCL code into an AST. pub fn parse_str(code: &str, module_id: ModuleId) -> ParseResult { - let tokens = pr_try!(crate::token::lexer(code, module_id)); + let tokens = pr_try!(crate::parsing::token::lexer(code, module_id)); parse_tokens(tokens) } @@ -68,7 +72,7 @@ pub fn parse_tokens(tokens: Vec) -> ParseResult { return Node::::default().into(); } - parser_impl::run_parser(&mut tokens.as_slice()) + parser::run_parser(&mut tokens.as_slice()) } /// Result of parsing. @@ -104,7 +108,7 @@ impl ParseResult { #[cfg(test)] #[track_caller] - pub fn unwrap_errs(&self) -> &[parser_impl::error::ParseError] { + pub fn unwrap_errs(&self) -> &[error::ParseError] { &self.0.as_ref().unwrap().1.errors } @@ -145,3 +149,18 @@ impl From for ParseResult { ParseResult(Err(e)) } } + +#[cfg(test)] +mod tests { + macro_rules! parse_and_lex { + ($func_name:ident, $test_kcl_program:expr) => { + #[test] + fn $func_name() { + let _ = crate::parsing::top_level_parse($test_kcl_program); + } + }; + } + + parse_and_lex!(crash_eof_1, "{\"ގގ\0\0\0\"\"."); + parse_and_lex!(crash_eof_2, "(/=e\"\u{616}ݝ\"\""); +} diff --git a/src/wasm-lib/kcl/src/parser/parser_impl.rs b/src/wasm-lib/kcl/src/parsing/parser.rs similarity index 95% rename from src/wasm-lib/kcl/src/parser/parser_impl.rs rename to src/wasm-lib/kcl/src/parsing/parser.rs index 1b48c8b3e..936051ec5 100644 --- a/src/wasm-lib/kcl/src/parser/parser_impl.rs +++ b/src/wasm-lib/kcl/src/parsing/parser.rs @@ -8,27 +8,29 @@ use winnow::{ token::{any, one_of, take_till}, }; -use self::error::ParseError; use crate::{ - ast::types::{ - ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem, BoxNode, - CallExpression, CallExpressionKw, CommentStyle, ElseIf, Expr, ExpressionStatement, FnArgPrimitive, FnArgType, - FunctionExpression, Identifier, IfExpression, ImportItem, ImportStatement, ItemVisibility, LabeledArg, Literal, - LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Node, NonCodeMeta, NonCodeNode, NonCodeValue, - ObjectExpression, ObjectProperty, Parameter, PipeExpression, PipeSubstitution, Program, ReturnStatement, - Shebang, TagDeclarator, UnaryExpression, UnaryOperator, VariableDeclaration, VariableDeclarator, VariableKind, - }, docs::StdLibFn, errors::{KclError, KclErrorDetails}, - parser::{ - math::BinaryExpressionToken, parser_impl::error::ContextError, PIPE_OPERATOR, PIPE_SUBSTITUTION_OPERATOR, + parsing::{ + ast::types::{ + ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem, BoxNode, + CallExpression, CallExpressionKw, CommentStyle, ElseIf, Expr, ExpressionStatement, FnArgPrimitive, + FnArgType, FunctionExpression, Identifier, IfExpression, ImportItem, ImportStatement, ItemVisibility, + Literal, LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Node, NonCodeMeta, NonCodeNode, + NonCodeValue, ObjectExpression, ObjectProperty, Parameter, PipeExpression, PipeSubstitution, Program, + ReturnStatement, Shebang, TagDeclarator, UnaryExpression, UnaryOperator, VariableDeclaration, + VariableDeclarator, VariableKind, + }, + error::{self, ContextError, ParseError}, + math::BinaryExpressionToken, + token::{Token, TokenType}, + PIPE_OPERATOR, PIPE_SUBSTITUTION_OPERATOR, }, - token::{Token, TokenType}, unparser::ExprContext, SourceRange, }; -pub(crate) mod error; +use super::ast::types::LabeledArg; thread_local! { /// The current `ParseContext`. `None` if parsing is not currently happening on this thread. @@ -2288,14 +2290,14 @@ mod tests { use super::*; use crate::{ - ast::types::{BodyItem, Expr, VariableKind}, + parsing::ast::types::{BodyItem, Expr, VariableKind}, ModuleId, }; fn assert_reserved(word: &str) { // Try to use it as a variable name. let code = format!(r#"{} = 0"#, word); - let result = crate::parser::top_level_parse(code.as_str()); + let result = crate::parsing::top_level_parse(code.as_str()); let err = &result.unwrap_errs()[0]; // Which token causes the error may change. In "return = 0", for // example, "return" is the problem. @@ -2313,7 +2315,7 @@ mod tests { fn reserved_words() { // Since these are stored in a set, we sort to make the tests // deterministic. - for word in crate::token::RESERVED_WORDS.keys().sorted() { + for word in crate::parsing::token::RESERVED_WORDS.keys().sorted() { assert_reserved(word); } assert_reserved("import"); @@ -2322,7 +2324,7 @@ mod tests { #[test] fn parse_args() { for (i, (test, expected_len)) in [("someVar", 1), ("5, 3", 2), (r#""a""#, 1)].into_iter().enumerate() { - let tokens = crate::token::lexer(test, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test, ModuleId::default()).unwrap(); let actual = match arguments.parse(&tokens) { Ok(x) => x, Err(e) => panic!("Failed test {i}, could not parse function arguments from \"{test}\": {e:?}"), @@ -2333,7 +2335,7 @@ mod tests { #[test] fn weird_program_unclosed_paren() { - let tokens = crate::token::lexer("fn firstPrime(", ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer("fn firstPrime(", ModuleId::default()).unwrap(); let last = tokens.last().unwrap(); let err: super::error::ErrorKind = program.parse(&tokens).unwrap_err().into(); let err = err.unwrap_parse_error(); @@ -2345,7 +2347,7 @@ mod tests { #[test] fn weird_program_just_a_pipe() { - let tokens = crate::token::lexer("|", ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer("|", ModuleId::default()).unwrap(); let err: super::error::ErrorKind = program.parse(&tokens).unwrap_err().into(); let err = err.unwrap_parse_error(); assert_eq!( @@ -2358,7 +2360,7 @@ mod tests { #[test] fn parse_binary_expressions() { for (i, test_program) in ["1 + 2 + 3"].into_iter().enumerate() { - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let mut slice = tokens.as_slice(); let _actual = match binary_expression.parse_next(&mut slice) { Ok(x) => x, @@ -2369,7 +2371,7 @@ mod tests { #[test] fn test_vardec_no_keyword() { - let tokens = crate::token::lexer("x = 4", ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer("x = 4", ModuleId::default()).unwrap(); let vardec = declaration(&mut tokens.as_slice()).unwrap(); assert_eq!(vardec.inner.kind, VariableKind::Const); let vardec = vardec.declarations.first().unwrap(); @@ -2382,7 +2384,7 @@ mod tests { #[test] fn test_negative_operands() { - let tokens = crate::token::lexer("-leg2", ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer("-leg2", ModuleId::default()).unwrap(); let _s = operand.parse_next(&mut tokens.as_slice()).unwrap(); } @@ -2396,7 +2398,7 @@ mod tests { // comment 2 return 1 }"#; - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let mut slice = tokens.as_slice(); let expr = function_decl.map(|t| t.0).parse_next(&mut slice).unwrap(); assert_eq!(expr.params, vec![]); @@ -2414,7 +2416,7 @@ mod tests { const yo = { a = { b = { c = '123' } } } /* block comment */ }"#; - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let mut slice = tokens.as_slice(); let expr = function_decl.map(|t| t.0).parse_next(&mut slice).unwrap(); let comment0 = &expr.body.non_code_meta.non_code_nodes.get(&0).unwrap()[0]; @@ -2427,7 +2429,7 @@ comment */ /* comment at start */ const mySk1 = startSketchAt([0, 0])"#; - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let program = program.parse(&tokens).unwrap(); let mut starting_comments = program.inner.non_code_meta.start_nodes; assert_eq!(starting_comments.len(), 2); @@ -2445,7 +2447,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_comment_in_pipe() { - let tokens = crate::token::lexer(r#"const x = y() |> /*hi*/ z(%)"#, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(r#"const x = y() |> /*hi*/ z(%)"#, ModuleId::default()).unwrap(); let mut body = program.parse(&tokens).unwrap().inner.body; let BodyItem::VariableDeclaration(mut item) = body.remove(0) else { panic!("expected vardec"); @@ -2472,7 +2474,7 @@ const mySk1 = startSketchAt([0, 0])"#; return sg return sg }"#; - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let mut slice = tokens.as_slice(); let _expr = function_decl.parse_next(&mut slice).unwrap(); } @@ -2484,7 +2486,7 @@ const mySk1 = startSketchAt([0, 0])"#; return 2 }"; let module_id = ModuleId::from_usize(1); - let tokens = crate::token::lexer(test_program, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, module_id).unwrap(); let mut slice = tokens.as_slice(); let expr = function_decl.map(|t| t.0).parse_next(&mut slice).unwrap(); assert_eq!( @@ -2549,7 +2551,7 @@ const mySk1 = startSketchAt([0, 0])"#; |> c(%) // inline-comment |> d(%)"#; - let tokens = crate::token::lexer(test_input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_input, ModuleId::default()).unwrap(); let mut slice = tokens.as_slice(); let Node { inner: PipeExpression { @@ -2580,7 +2582,7 @@ const mySk1 = startSketchAt([0, 0])"#; "#; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(test_program, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, module_id).unwrap(); let Program { non_code_meta, .. } = function_body.parse(&tokens).unwrap().inner; assert_eq!( vec![Node::new( @@ -2648,7 +2650,7 @@ const mySk1 = startSketchAt([0, 0])"#; comment */ return 1"#; - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let actual = program.parse(&tokens).unwrap(); assert_eq!(actual.non_code_meta.non_code_nodes.len(), 1); assert_eq!( @@ -2663,7 +2665,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_bracketed_binary_expression() { let input = "(2 - 3)"; - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); let actual = match binary_expr_in_parens.parse(&tokens) { Ok(x) => x, Err(e) => panic!("{e:?}"), @@ -2678,7 +2680,7 @@ const mySk1 = startSketchAt([0, 0])"#; "6 / ( sigmaAllow * width )", "sqrt(distance * p * FOS * 6 / ( sigmaAllow * width ))", ] { - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); let _actual = match expression.parse(&tokens) { Ok(x) => x, Err(e) => panic!("{e:?}"), @@ -2689,7 +2691,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_arithmetic() { let input = "1 * (2 - 3)"; - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); // The RHS should be a binary expression. let actual = binary_expression.parse(&tokens).unwrap(); assert_eq!(actual.operator, BinaryOperator::Mul); @@ -2717,7 +2719,7 @@ const mySk1 = startSketchAt([0, 0])"#; .into_iter() .enumerate() { - let tokens = crate::token::lexer(test_input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_input, ModuleId::default()).unwrap(); let mut actual = match declaration.parse(&tokens) { Err(e) => panic!("Could not parse test {i}: {e:#?}"), Ok(a) => a, @@ -2735,7 +2737,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_function_call() { for (i, test_input) in ["const x = f(1)", "const x = f( 1 )"].into_iter().enumerate() { - let tokens = crate::token::lexer(test_input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_input, ModuleId::default()).unwrap(); let _actual = match declaration.parse(&tokens) { Err(e) => panic!("Could not parse test {i}: {e:#?}"), Ok(a) => a, @@ -2746,7 +2748,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_nested_arithmetic() { let input = "1 * ((2 - 3) / 4)"; - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); // The RHS should be a binary expression. let outer = binary_expression.parse(&tokens).unwrap(); assert_eq!(outer.operator, BinaryOperator::Mul); @@ -2765,7 +2767,7 @@ const mySk1 = startSketchAt([0, 0])"#; fn binary_expression_ignores_whitespace() { let tests = ["1 - 2", "1- 2", "1 -2", "1-2"]; for test in tests { - let tokens = crate::token::lexer(test, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test, ModuleId::default()).unwrap(); let actual = binary_expression.parse(&tokens).unwrap(); assert_eq!(actual.operator, BinaryOperator::Sub); let BinaryPart::Literal(left) = actual.inner.left else { @@ -2786,7 +2788,7 @@ const mySk1 = startSketchAt([0, 0])"#; a comment spanning a few lines */ |> z(%)"#; - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let actual = pipe_expression.parse(&tokens).unwrap(); let n = actual.non_code_meta.non_code_nodes.len(); assert_eq!(n, 1, "expected one comment in pipe expression but found {n}"); @@ -2814,7 +2816,7 @@ const mySk1 = startSketchAt([0, 0])"#; .into_iter() .enumerate() { - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let actual = pipe_expression.parse(&tokens); assert!(actual.is_ok(), "could not parse test {i}, '{test_program}'"); let actual = actual.unwrap(); @@ -2959,7 +2961,7 @@ const mySk1 = startSketchAt([0, 0])"#; .into_iter() .enumerate() { - let tokens = crate::token::lexer(test_program, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, module_id).unwrap(); let actual = non_code_node.parse(&tokens); assert!(actual.is_ok(), "could not parse test {i}: {actual:#?}"); let actual = actual.unwrap(); @@ -2971,7 +2973,7 @@ const mySk1 = startSketchAt([0, 0])"#; fn recognize_invalid_params() { let test_fn = "(let) => { return 1 }"; let module_id = ModuleId::from_usize(2); - let tokens = crate::token::lexer(test_fn, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(test_fn, module_id).unwrap(); let err = function_decl.parse(&tokens).unwrap_err().into_inner(); let cause = err.cause.unwrap(); // This is the token `let` @@ -2987,7 +2989,7 @@ const mySk1 = startSketchAt([0, 0])"#; let string_literal = r#"" // a comment ""#; - let tokens = crate::token::lexer(string_literal, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(string_literal, ModuleId::default()).unwrap(); let parsed_literal = literal.parse(&tokens).unwrap(); assert_eq!( parsed_literal.value, @@ -3004,7 +3006,7 @@ const mySk1 = startSketchAt([0, 0])"#; |> lineTo([0, -0], %) // MoveRelative "#; - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let mut slice = &tokens[..]; let _actual = pipe_expression.parse_next(&mut slice).unwrap(); assert_eq!(slice[0].token_type, TokenType::Whitespace); @@ -3013,14 +3015,14 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_pipes_on_pipes() { let test_program = include_str!("../../../tests/executor/inputs/pipes_on_pipes.kcl"); - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); let _ = run_parser(&mut &*tokens).unwrap(); } #[test] fn test_cube() { let test_program = include_str!("../../../tests/executor/inputs/cube.kcl"); - let tokens = crate::token::lexer(test_program, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(test_program, ModuleId::default()).unwrap(); match program.parse(&tokens) { Ok(_) => {} Err(e) => { @@ -3038,7 +3040,7 @@ const mySk1 = startSketchAt([0, 0])"#; ("a,b", vec!["a", "b"]), ]; for (i, (input, expected)) in tests.into_iter().enumerate() { - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); let actual = parameters.parse(&tokens); assert!(actual.is_ok(), "could not parse test {i}"); let actual_ids: Vec<_> = actual.unwrap().into_iter().map(|p| p.identifier.inner.name).collect(); @@ -3052,7 +3054,7 @@ const mySk1 = startSketchAt([0, 0])"#; return 2 }"; - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); let actual = function_decl.parse(&tokens); assert!(actual.is_ok(), "could not parse test function"); } @@ -3062,8 +3064,8 @@ const mySk1 = startSketchAt([0, 0])"#; let tests = ["const myVar = 5", "const myVar=5", "const myVar =5", "const myVar= 5"]; for test in tests { // Run the original parser - let tokens = crate::token::lexer(test, ModuleId::default()).unwrap(); - let mut expected_body = crate::parser::parse_tokens(tokens.clone()).unwrap().inner.body; + let tokens = crate::parsing::token::lexer(test, ModuleId::default()).unwrap(); + let mut expected_body = crate::parsing::parse_tokens(tokens.clone()).unwrap().inner.body; assert_eq!(expected_body.len(), 1); let BodyItem::VariableDeclaration(expected) = expected_body.pop().unwrap() else { panic!("Expected variable declaration"); @@ -3090,7 +3092,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_math_parse() { let module_id = ModuleId::default(); - let actual = crate::parser::parse_str(r#"5 + "a""#, module_id).unwrap().inner.body; + let actual = crate::parsing::parse_str(r#"5 + "a""#, module_id).unwrap().inner.body; let expr = Node::boxed( BinaryExpression { operator: BinaryOperator::Add, @@ -3226,7 +3228,7 @@ const mySk1 = startSketchAt([0, 0])"#; fn test_abstract_syntax_tree() { let code = "5 +6"; let module_id = ModuleId::default(); - let result = crate::parser::parse_str(code, module_id).unwrap(); + let result = crate::parsing::parse_str(code, module_id).unwrap(); let expected_result = Node::new( Program { body: vec![BodyItem::ExpressionStatement(Node::new( @@ -3281,13 +3283,13 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_empty_file() { let some_program_string = r#""#; - let result = crate::parser::top_level_parse(some_program_string); + let result = crate::parsing::top_level_parse(some_program_string); assert!(result.is_ok()); } #[track_caller] fn assert_no_err(p: &str) -> (Node, ParseContext) { - let result = crate::parser::top_level_parse(p); + let result = crate::parsing::top_level_parse(p); let result = result.0.unwrap(); assert!(result.1.errors.is_empty(), "found: {:#?}", result.1.errors); (result.0.unwrap(), result.1) @@ -3295,7 +3297,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[track_caller] fn assert_err(p: &str, msg: &str, src: [usize; 2]) { - let result = crate::parser::top_level_parse(p); + let result = crate::parsing::top_level_parse(p); let err = &result.unwrap_errs()[0]; assert_eq!(err.message, msg); assert_eq!(err.source_range.start(), src[0]); @@ -3304,7 +3306,7 @@ const mySk1 = startSketchAt([0, 0])"#; #[track_caller] fn assert_err_contains(p: &str, expected: &str) { - let result = crate::parser::top_level_parse(p); + let result = crate::parsing::top_level_parse(p); let err = &result.unwrap_errs()[0].message; assert!(err.contains(expected), "actual='{err}'"); } @@ -3322,14 +3324,14 @@ const mySk1 = startSketchAt([0, 0])"#; #[test] fn test_parse_member_expression_double_nested_braces() { let code = r#"const prop = yo["one"][two]"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_parse_member_expression_binary_expression_period_number_first() { let code = r#"const obj = { a: 1, b: 2 } const height = 1 - obj.a"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] @@ -3337,47 +3339,47 @@ const height = 1 - obj.a"#; let code = r#"const obj = { thing: 1 } startSketchOn(obj.sketch)"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_parse_member_expression_binary_expression_brace_number_first() { let code = r#"const obj = { a: 1, b: 2 } const height = 1 - obj["a"]"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_parse_member_expression_binary_expression_brace_number_second() { let code = r#"const obj = { a: 1, b: 2 } const height = obj["a"] - 1"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_parse_member_expression_binary_expression_in_array_number_first() { let code = r#"const obj = { a: 1, b: 2 } const height = [1 - obj["a"], 0]"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_parse_member_expression_binary_expression_in_array_number_second() { let code = r#"const obj = { a: 1, b: 2 } const height = [obj["a"] - 1, 0]"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_parse_member_expression_binary_expression_in_array_number_second_missing_space() { let code = r#"const obj = { a: 1, b: 2 } const height = [obj["a"] -1, 0]"#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_anon_fn() { - crate::parser::top_level_parse("foo(42, fn(x) { return x + 1 })").unwrap(); + crate::parsing::top_level_parse("foo(42, fn(x) { return x + 1 })").unwrap(); } #[test] @@ -3415,7 +3417,7 @@ const secondExtrude = startSketchOn('XY') #[test] fn test_parse_parens_unicode() { - let result = crate::parser::top_level_parse("(ޜ"); + let result = crate::parsing::top_level_parse("(ޜ"); let KclError::Lexical(details) = result.0.unwrap_err() else { panic!(); }; @@ -3433,12 +3435,12 @@ const thickness = 0.56 const bracket = [-leg2 + thickness, 0] "#; - crate::parser::top_level_parse(code).unwrap(); + crate::parsing::top_level_parse(code).unwrap(); } #[test] fn test_parse_nested_open_brackets() { - crate::parser::top_level_parse( + crate::parsing::top_level_parse( r#" z(-[["#, ) @@ -3625,14 +3627,14 @@ e } firstPrimeNumber() "#; - let _ast = crate::parser::top_level_parse(code).unwrap(); + let _ast = crate::parsing::top_level_parse(code).unwrap(); } #[test] fn array() { let program = r#"[1, 2, 3]"#; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(program, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(program, module_id).unwrap(); let mut sl: &[Token] = &tokens; let _arr = array_elem_by_elem(&mut sl).unwrap(); } @@ -3645,7 +3647,7 @@ e 3, ]"#; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(program, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(program, module_id).unwrap(); let mut sl: &[Token] = &tokens; let _arr = array_elem_by_elem(&mut sl).unwrap(); } @@ -3659,7 +3661,7 @@ e 3 ]"#; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(program, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(program, module_id).unwrap(); let mut sl: &[Token] = &tokens; let _arr = array_elem_by_elem(&mut sl).unwrap(); } @@ -3672,7 +3674,7 @@ e 4 }"; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(some_program_string, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(some_program_string, module_id).unwrap(); let mut sl: &[Token] = &tokens; let _res = if_expr(&mut sl).unwrap(); } @@ -3683,7 +3685,7 @@ e 4 }"; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(some_program_string, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(some_program_string, module_id).unwrap(); let mut sl: &[Token] = &tokens; let _res = else_if(&mut sl).unwrap(); } @@ -3698,7 +3700,7 @@ e 5 }"; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(some_program_string, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(some_program_string, module_id).unwrap(); let mut sl: &[Token] = &tokens; let _res = if_expr(&mut sl).unwrap(); } @@ -3711,7 +3713,7 @@ e thing(false) "#; - crate::parser::top_level_parse(some_program_string).unwrap(); + crate::parsing::top_level_parse(some_program_string).unwrap(); } #[test] @@ -3752,7 +3754,7 @@ thing(false) |> line([-5.09, 12.33], %) asdasd "#; - crate::parser::top_level_parse(test_program).unwrap_errs(); + crate::parsing::top_level_parse(test_program).unwrap_errs(); } #[test] @@ -3773,14 +3775,14 @@ const b2 = cube([3,3], 4) const pt1 = b1[0] const pt2 = b2[0] "#; - crate::parser::top_level_parse(some_program_string).unwrap(); + crate::parsing::top_level_parse(some_program_string).unwrap(); } #[test] fn test_math_with_stdlib() { let some_program_string = r#"const d2r = pi() / 2 let other_thing = 2 * cos(3)"#; - crate::parser::top_level_parse(some_program_string).unwrap(); + crate::parsing::top_level_parse(some_program_string).unwrap(); } #[test] @@ -3798,7 +3800,7 @@ let other_thing = 2 * cos(3)"#; } let myBox = box([0,0], -3, -16, -10) "#; - crate::parser::top_level_parse(some_program_string).unwrap(); + crate::parsing::top_level_parse(some_program_string).unwrap(); } #[test] @@ -3818,7 +3820,7 @@ let myBox = box([0,0], -3, -16, -10) fn arg_labels() { let input = r#"length: 3"#; let module_id = ModuleId::default(); - let tokens = crate::token::lexer(input, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(input, module_id).unwrap(); let mut sl: &[Token] = &tokens; super::labeled_arguments(&mut sl).unwrap(); } @@ -3827,7 +3829,7 @@ let myBox = box([0,0], -3, -16, -10) fn kw_fn() { for input in ["val = foo(x, y: z)", "val = foo(y: z)"] { let module_id = ModuleId::default(); - let tokens = crate::token::lexer(input, module_id).unwrap(); + let tokens = crate::parsing::token::lexer(input, module_id).unwrap(); let sl = &tokens; super::program.parse(sl).unwrap(); } @@ -3900,7 +3902,6 @@ int(42.3)"#; #[cfg(test)] mod snapshot_math_tests { use super::*; - use crate::ModuleId; // This macro generates a test function with the given function name. // The macro takes a KCL program, ensures it tokenizes and parses, then compares @@ -3909,8 +3910,8 @@ mod snapshot_math_tests { ($func_name:ident, $test_kcl_program:expr) => { #[test] fn $func_name() { - let module_id = ModuleId::default(); - let tokens = crate::token::lexer($test_kcl_program, module_id).unwrap(); + let module_id = crate::ModuleId::default(); + let tokens = crate::parsing::token::lexer($test_kcl_program, module_id).unwrap(); ParseContext::init(); let actual = match binary_expression.parse(&tokens) { @@ -3939,7 +3940,6 @@ mod snapshot_math_tests { #[cfg(test)] mod snapshot_tests { use super::*; - use crate::ModuleId; // This macro generates a test function with the given function name. // The macro takes a KCL program, ensures it tokenizes and parses, then compares @@ -3948,8 +3948,8 @@ mod snapshot_tests { ($func_name:ident, $test_kcl_program:expr) => { #[test] fn $func_name() { - let module_id = ModuleId::default(); - let tokens = crate::token::lexer($test_kcl_program, module_id).unwrap(); + let module_id = crate::ModuleId::default(); + let tokens = crate::parsing::token::lexer($test_kcl_program, module_id).unwrap(); print_tokens(&tokens); ParseContext::init(); let actual = match program.parse(&tokens) { diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__a.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__a.snap similarity index 86% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__a.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__a.snap index 7a02a0aa0..fcefa57e6 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__a.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__a.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3609 +source: kcl/src/parsing/parser.rs +assertion_line: 3851 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__b.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__b.snap similarity index 86% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__b.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__b.snap index 586aec2f4..637b00246 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__b.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__b.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3610 +source: kcl/src/parsing/parser.rs +assertion_line: 3852 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__c.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__c.snap similarity index 86% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__c.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__c.snap index 8d82cffe8..b12df680f 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__c.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__c.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3611 +source: kcl/src/parsing/parser.rs +assertion_line: 3853 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__d.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__d.snap similarity index 91% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__d.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__d.snap index a0b270251..ba6a1dc99 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__d.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__d.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3612 +source: kcl/src/parsing/parser.rs +assertion_line: 3854 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__e.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__e.snap similarity index 91% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__e.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__e.snap index 736fd42b9..bf684fde0 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__e.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__e.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3613 +source: kcl/src/parsing/parser.rs +assertion_line: 3855 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__f.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__f.snap similarity index 94% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__f.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__f.snap index a99788ae5..2859e0587 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__f.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__f.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3614 +source: kcl/src/parsing/parser.rs +assertion_line: 3856 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__g.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__g.snap similarity index 94% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__g.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__g.snap index 484aad384..1c5307df0 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__g.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__g.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3615 +source: kcl/src/parsing/parser.rs +assertion_line: 3857 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__h.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__h.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__h.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__h.snap index 9a5b8f906..f106b5f18 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__h.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__h.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3616 +source: kcl/src/parsing/parser.rs +assertion_line: 3858 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__i.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__i.snap similarity index 91% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__i.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__i.snap index 28dbc97ea..456ed5c8c 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__i.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__i.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3617 +source: kcl/src/parsing/parser.rs +assertion_line: 3859 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__j.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__j.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__j.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__j.snap index 29ed437a6..db5460978 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__j.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__j.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3618 +source: kcl/src/parsing/parser.rs +assertion_line: 3860 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__k.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__k.snap similarity index 86% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__k.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__k.snap index 5a59786e8..06909d27e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_math_tests__k.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_math_tests__k.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3619 +source: kcl/src/parsing/parser.rs +assertion_line: 3861 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__a.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__a.snap similarity index 99% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__a.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__a.snap index 29c66fcf1..a03048000 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__a.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__a.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3893 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aa.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aa.snap similarity index 94% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aa.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aa.snap index 275e95265..3d77961ea 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aa.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aa.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3963 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ab.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ab.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ab.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ab.snap index 025f452d1..064dbf918 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ab.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ab.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3964 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ac.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ac.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ac.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ac.snap index d737f683b..2fa9b9260 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ac.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ac.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3721 +source: kcl/src/parsing/parser.rs +assertion_line: 3965 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ad.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ad.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ad.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ad.snap index cd87200c3..c9606f241 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ad.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ad.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3966 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ae.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ae.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ae.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ae.snap index c425d15b2..9f01e14bd 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ae.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ae.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3974 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__af.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__af.snap similarity index 99% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__af.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__af.snap index f0534f52e..b8977e1e4 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__af.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__af.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3981 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ag.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ag.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ag.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ag.snap index f5ea449e5..5c3f1a757 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ag.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ag.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3989 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ah.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ah.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ah.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ah.snap index 99ac0ba52..7b4edfa1e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ah.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ah.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3993 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ai.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ai.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ai.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ai.snap index 35eb411a9..cc05f2fc5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ai.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ai.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3994 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aj.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aj.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aj.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aj.snap index 1e29e80d1..9d2831ea2 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aj.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aj.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3995 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ak.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ak.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ak.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ak.snap index aef381994..7c3301bd5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ak.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ak.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3996 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__al.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__al.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__al.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__al.snap index 9250278ff..da3bc68dd 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__al.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__al.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3997 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__am.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__am.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__am.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__am.snap index 93c1ec300..39739efb5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__am.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__am.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3998 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__an.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__an.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__an.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__an.snap index 4210cad25..fae9112de 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__an.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__an.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3999 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ao.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ao.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ao.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ao.snap index 5cbb444dc..4f96570f3 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ao.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ao.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4000 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ap.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ap.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ap.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ap.snap index 9af34156e..d63007035 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ap.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ap.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4001 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aq.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aq.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aq.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aq.snap index e13184ac4..58651956e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aq.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aq.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4002 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ar.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ar.snap similarity index 92% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ar.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ar.snap index e466910ce..6fa2c06d0 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ar.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ar.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3759 +source: kcl/src/parsing/parser.rs +assertion_line: 4003 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__at.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__at.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__at.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__at.snap index e762909eb..f627be223 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__at.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__at.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4004 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__au.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__au.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__au.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__au.snap index 298ff655d..12698fd92 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__au.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__au.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4005 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__av.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__av.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__av.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__av.snap index de93b541f..ae5ae5aa8 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__av.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__av.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4006 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aw.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aw.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aw.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aw.snap index a546c74fa..4652eea40 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__aw.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__aw.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3763 +source: kcl/src/parsing/parser.rs +assertion_line: 4007 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ax.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ax.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ax.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ax.snap index 12e398797..7dca1bc6e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ax.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ax.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3772 +source: kcl/src/parsing/parser.rs +assertion_line: 4016 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ay.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ay.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ay.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ay.snap index c06b7b05b..f397f9065 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ay.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ay.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3781 +source: kcl/src/parsing/parser.rs +assertion_line: 4025 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__az.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__az.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__az.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__az.snap index c143f4c18..25b17e4ca 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__az.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__az.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3789 +source: kcl/src/parsing/parser.rs +assertion_line: 4033 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__b.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__b.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__b.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__b.snap index 38e6e1505..43e4a3537 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__b.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__b.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3902 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ba.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ba.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ba.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ba.snap index 1e61e74c9..8812f9382 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__ba.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__ba.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4041 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bb.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bb.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bb.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bb.snap index 9e1071827..2af9096e1 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bb.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bb.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3808 +source: kcl/src/parsing/parser.rs +assertion_line: 4052 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bc.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bc.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bc.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bc.snap index f6fcc2f41..85be1e6c7 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bc.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bc.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3814 +source: kcl/src/parsing/parser.rs +assertion_line: 4058 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bd.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bd.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bd.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bd.snap index 6b96233a8..4fd63ff31 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bd.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bd.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 4066 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__be.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__be.snap similarity index 94% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__be.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__be.snap index a05565ac8..9337cfaf8 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__be.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__be.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3832 +source: kcl/src/parsing/parser.rs +assertion_line: 4076 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bf.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bf.snap similarity index 94% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bf.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bf.snap index ffc172dc8..a85cf3321 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bf.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bf.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3833 +source: kcl/src/parsing/parser.rs +assertion_line: 4077 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bg.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bg.snap similarity index 92% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bg.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bg.snap index e4d412993..6427a9dc5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bg.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bg.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3834 +source: kcl/src/parsing/parser.rs +assertion_line: 4078 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bh.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bh.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bh.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bh.snap index ff2ebfdbb..85d998743 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bh.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bh.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3835 +source: kcl/src/parsing/parser.rs +assertion_line: 4079 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bi.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bi.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bi.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bi.snap index d101d813b..f34264f8e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__bi.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__bi.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3836 +source: kcl/src/parsing/parser.rs +assertion_line: 4080 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__c.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__c.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__c.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__c.snap index 5ae28bf38..52edc76f9 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__c.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__c.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3904 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__d.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__d.snap index 56e8aeed0..f9e87e083 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__d.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3905 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d2.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__d2.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d2.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__d2.snap index 72e8c8f0d..b231474b4 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__d2.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__d2.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3915 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__e.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__e.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__e.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__e.snap index 733d62883..a7dc23fad 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__e.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__e.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3662 +source: kcl/src/parsing/parser.rs +assertion_line: 3906 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__f.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__f.snap similarity index 94% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__f.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__f.snap index 82fe3b898..600f3b56e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__f.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__f.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3663 +source: kcl/src/parsing/parser.rs +assertion_line: 3907 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__g.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__g.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__g.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__g.snap index 2a7269487..5347d32bd 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__g.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__g.snap @@ -1,6 +1,8 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3908 expression: actual +snapshot_kind: text --- { "body": [ diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__h.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__h.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__h.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__h.snap index aee00de5c..78d8ec1c2 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__h.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__h.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3672 +source: kcl/src/parsing/parser.rs +assertion_line: 3916 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__i.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__i.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__i.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__i.snap index 18a5a03d2..8be5525e6 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__i.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__i.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3677 +source: kcl/src/parsing/parser.rs +assertion_line: 3921 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__j.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__j.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__j.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__j.snap index afe1770ac..8c4868916 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__j.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__j.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3682 +source: kcl/src/parsing/parser.rs +assertion_line: 3926 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__k.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__k.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__k.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__k.snap index 7cd79b447..10b79332c 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__k.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__k.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3687 +source: kcl/src/parsing/parser.rs +assertion_line: 3931 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__kw_function_all_named.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__kw_function_all_named.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__kw_function_all_named.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__kw_function_all_named.snap index e865af411..215dbb5ed 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__kw_function_all_named.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__kw_function_all_named.snap @@ -1,7 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs expression: actual -snapshot_kind: text --- { "body": [ diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__kw_function_unnamed_first.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__kw_function_unnamed_first.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__kw_function_unnamed_first.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__kw_function_unnamed_first.snap index 90db6f4f9..d7b0c67e5 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__kw_function_unnamed_first.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__kw_function_unnamed_first.snap @@ -1,7 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs expression: actual -snapshot_kind: text --- { "body": [ diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__l.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__l.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__l.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__l.snap index 7c6003436..59c9266be 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__l.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__l.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3692 +source: kcl/src/parsing/parser.rs +assertion_line: 3936 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__m.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__m.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__m.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__m.snap index 3b76fe1a2..60263cbf0 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__m.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__m.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3697 +source: kcl/src/parsing/parser.rs +assertion_line: 3941 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__n.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__n.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__n.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__n.snap index 95f2cee7c..672a396fd 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__n.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__n.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3702 +source: kcl/src/parsing/parser.rs +assertion_line: 3946 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__o.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__o.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__o.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__o.snap index df1eafa3d..22b78e87e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__o.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__o.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3703 +source: kcl/src/parsing/parser.rs +assertion_line: 3947 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__p.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__p.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__p.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__p.snap index 37fff21bd..250886a1e 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__p.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__p.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3704 +source: kcl/src/parsing/parser.rs +assertion_line: 3948 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__q.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__q.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__q.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__q.snap index 370783b6d..6e66c823c 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__q.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__q.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3705 +source: kcl/src/parsing/parser.rs +assertion_line: 3949 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__r.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__r.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__r.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__r.snap index 72cf2ef08..05ad844ea 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__r.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__r.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3706 +source: kcl/src/parsing/parser.rs +assertion_line: 3950 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__s.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__s.snap similarity index 96% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__s.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__s.snap index 57cbc351f..a42358948 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__s.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__s.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3955 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__t.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__t.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__t.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__t.snap index 261d1d28b..41d53eec1 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__t.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__t.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3956 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__u.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__u.snap similarity index 97% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__u.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__u.snap index 36b7438b3..a9b6215c3 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__u.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__u.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3957 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__v.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__v.snap similarity index 94% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__v.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__v.snap index 68edd600c..3ce627a2d 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__v.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__v.snap @@ -1,6 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs -assertion_line: 3714 +source: kcl/src/parsing/parser.rs +assertion_line: 3958 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__w.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__w.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__w.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__w.snap index f7458327c..7aea18604 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__w.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__w.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3959 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__x.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__x.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__x.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__x.snap index 754dd975f..b5fb972b2 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__x.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__x.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3960 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__y.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__y.snap similarity index 95% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__y.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__y.snap index b6e738160..3b8c8e7bb 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__y.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__y.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3961 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__z.snap b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__z.snap similarity index 98% rename from src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__z.snap rename to src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__z.snap index b039586e0..411791887 100644 --- a/src/wasm-lib/kcl/src/parser/snapshots/kcl_lib__parser__parser_impl__snapshot_tests__z.snap +++ b/src/wasm-lib/kcl/src/parsing/snapshots/kcl_lib__parsing__parser__snapshot_tests__z.snap @@ -1,5 +1,6 @@ --- -source: kcl/src/parser/parser_impl.rs +source: kcl/src/parsing/parser.rs +assertion_line: 3962 expression: actual snapshot_kind: text --- diff --git a/src/wasm-lib/kcl/src/token.rs b/src/wasm-lib/kcl/src/parsing/token/mod.rs similarity index 99% rename from src/wasm-lib/kcl/src/token.rs rename to src/wasm-lib/kcl/src/parsing/token/mod.rs index 21e50be8a..0f71000c9 100644 --- a/src/wasm-lib/kcl/src/token.rs +++ b/src/wasm-lib/kcl/src/parsing/token/mod.rs @@ -8,8 +8,8 @@ use tower_lsp::lsp_types::SemanticTokenType; use winnow::{error::ParseError, stream::ContainsToken}; use crate::{ - ast::types::{ItemVisibility, VariableKind}, errors::KclError, + parsing::ast::types::{ItemVisibility, VariableKind}, source_range::{ModuleId, SourceRange}, }; diff --git a/src/wasm-lib/kcl/src/token/tokeniser.rs b/src/wasm-lib/kcl/src/parsing/token/tokeniser.rs similarity index 99% rename from src/wasm-lib/kcl/src/token/tokeniser.rs rename to src/wasm-lib/kcl/src/parsing/token/tokeniser.rs index b46c2d588..e6fbb4ad5 100644 --- a/src/wasm-lib/kcl/src/token/tokeniser.rs +++ b/src/wasm-lib/kcl/src/parsing/token/tokeniser.rs @@ -11,8 +11,8 @@ use winnow::{ }; use crate::{ + parsing::token::{Token, TokenType}, source_range::ModuleId, - token::{Token, TokenType}, }; lazy_static! { @@ -1854,13 +1854,13 @@ const things = "things" #[test] fn test_kitt() { - let program = include_str!("../../../tests/executor/inputs/kittycad_svg.kcl"); + let program = include_str!("../../../../tests/executor/inputs/kittycad_svg.kcl"); let actual = lex(program, ModuleId::default()).unwrap(); assert_eq!(actual.len(), 5103); } #[test] fn test_pipes_on_pipes() { - let program = include_str!("../../../tests/executor/inputs/pipes_on_pipes.kcl"); + let program = include_str!("../../../../tests/executor/inputs/pipes_on_pipes.kcl"); let actual = lex(program, ModuleId::default()).unwrap(); assert_eq!(actual.len(), 17841); } diff --git a/src/wasm-lib/kcl/src/simulation_tests.rs b/src/wasm-lib/kcl/src/simulation_tests.rs index 7e67c4ca5..e79ce7951 100644 --- a/src/wasm-lib/kcl/src/simulation_tests.rs +++ b/src/wasm-lib/kcl/src/simulation_tests.rs @@ -1,8 +1,8 @@ use insta::rounded_redaction; use crate::{ - ast::types::{Node, Program}, errors::KclError, + parsing::ast::types::{Node, Program}, source_range::ModuleId, }; @@ -45,10 +45,10 @@ fn read(filename: &'static str, test_name: &str) -> String { fn parse(test_name: &str) { let input = read("input.kcl", test_name); - let tokens = crate::token::lexer(&input, ModuleId::default()).unwrap(); + let tokens = crate::parsing::token::lexer(&input, ModuleId::default()).unwrap(); // Parse the tokens into an AST. - let parse_res = Result::<_, KclError>::Ok(crate::parser::parse_tokens(tokens).unwrap()); + let parse_res = Result::<_, KclError>::Ok(crate::parsing::parse_tokens(tokens).unwrap()); assert_snapshot(test_name, "Result of parsing", || { insta::assert_json_snapshot!("ast", parse_res); }); diff --git a/src/wasm-lib/kcl/src/std/args.rs b/src/wasm-lib/kcl/src/std/args.rs index cd48248a2..f75718c83 100644 --- a/src/wasm-lib/kcl/src/std/args.rs +++ b/src/wasm-lib/kcl/src/std/args.rs @@ -1,4 +1,4 @@ -use std::{any::type_name, num::NonZeroU32}; +use std::{any::type_name, collections::HashMap, num::NonZeroU32}; use anyhow::Result; use kcmc::{websocket::OkWebSocketResponseData, ModelingCmd}; @@ -6,13 +6,13 @@ use kittycad_modeling_cmds as kcmc; use super::shapes::PolygonType; use crate::{ - ast::types::TagNode, errors::{KclError, KclErrorDetails}, executor::{ ExecState, ExecutorContext, ExtrudeSurface, KclValue, Metadata, Sketch, SketchSet, SketchSurface, Solid, SolidSet, TagIdentifier, }, kcl_value::KclObjectFields, + parsing::ast::types::TagNode, source_range::SourceRange, std::{shapes::SketchOrSurface, sketch::FaceTag, FnAsArg}, ModuleId, @@ -45,7 +45,12 @@ impl Arg { #[derive(Debug, Clone)] pub struct Args { + /// Positional args. pub args: Vec, + /// Keyword args. + pub kw_args: HashMap, + /// Unlabeled keyword args. Currently only the first arg can be unlabeled. + pub unlabeled_kw_arg: Option, pub source_range: SourceRange, pub ctx: ExecutorContext, } @@ -54,6 +59,24 @@ impl Args { pub fn new(args: Vec, source_range: SourceRange, ctx: ExecutorContext) -> Self { Self { args, + kw_args: Default::default(), + unlabeled_kw_arg: Default::default(), + source_range, + ctx, + } + } + + /// Collect the given keyword arguments. + pub fn new_kw( + kw_args: HashMap, + unlabeled_kw_arg: Option, + source_range: SourceRange, + ctx: ExecutorContext, + ) -> Self { + Self { + args: Default::default(), + kw_args, + unlabeled_kw_arg, source_range, ctx, } @@ -65,6 +88,8 @@ impl Args { Ok(Self { args: Vec::new(), + kw_args: Default::default(), + unlabeled_kw_arg: Default::default(), source_range: SourceRange::default(), ctx: ExecutorContext { engine: Arc::new(Box::new(crate::engine::conn_mock::EngineConnection::new().await?)), @@ -76,6 +101,50 @@ impl Args { }) } + /// Get a keyword argument. If not set, returns None. + pub(crate) fn get_kw_arg_opt<'a, T>(&'a self, label: &str) -> Option + where + T: FromKclValue<'a>, + { + self.kw_args.get(label).and_then(|arg| T::from_kcl_val(&arg.value)) + } + + /// Get a keyword argument. If not set, returns Err. + pub(crate) fn get_kw_arg<'a, T>(&'a self, label: &str) -> Result + where + T: FromKclValue<'a>, + { + self.get_kw_arg_opt(label).ok_or_else(|| { + KclError::Semantic(KclErrorDetails { + source_ranges: vec![self.source_range], + message: format!("This function requires a keyword argument '{label}'"), + }) + }) + } + + /// Get the unlabeled keyword argument. If not set, returns Err. + pub(crate) fn get_unlabeled_kw_arg<'a, T>(&'a self, label: &str) -> Result + where + T: FromKclValue<'a>, + { + let Some(ref arg) = self.unlabeled_kw_arg else { + return Err(KclError::Semantic(KclErrorDetails { + source_ranges: vec![self.source_range], + message: format!("This function requires a value for the special unlabeled first parameter, '{label}'"), + })); + }; + T::from_kcl_val(&arg.value).ok_or_else(|| { + KclError::Semantic(KclErrorDetails { + source_ranges: arg.source_ranges(), + message: format!( + "Expected a {} but found {}", + type_name::(), + arg.value.human_friendly_type() + ), + }) + }) + } + // Add a modeling command to the batch but don't fire it right away. pub(crate) async fn batch_modeling_cmd( &self, @@ -578,7 +647,7 @@ where { fn from_args(args: &'a Args, i: usize) -> Result { let Some(arg) = args.args.get(i) else { return Ok(None) }; - if crate::ast::types::KclNone::from_kcl_val(&arg.value).is_some() { + if crate::parsing::ast::types::KclNone::from_kcl_val(&arg.value).is_some() { return Ok(None); } let Some(val) = T::from_kcl_val(&arg.value) else { @@ -1509,7 +1578,7 @@ impl<'a> FromKclValue<'a> for String { Some(value.to_owned()) } } -impl<'a> FromKclValue<'a> for crate::ast::types::KclNone { +impl<'a> FromKclValue<'a> for crate::parsing::ast::types::KclNone { fn from_kcl_val(arg: &'a KclValue) -> Option { let KclValue::KclNone { value, meta: _ } = arg else { return None; diff --git a/src/wasm-lib/kcl/src/std/chamfer.rs b/src/wasm-lib/kcl/src/std/chamfer.rs index ef6f2ecfd..4451cdee6 100644 --- a/src/wasm-lib/kcl/src/std/chamfer.rs +++ b/src/wasm-lib/kcl/src/std/chamfer.rs @@ -8,9 +8,9 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ - ast::types::TagNode, errors::{KclError, KclErrorDetails}, executor::{ChamferSurface, EdgeCut, ExecState, ExtrudeSurface, GeoMeta, KclValue, Solid}, + parsing::ast::types::TagNode, std::{fillet::EdgeReference, Args}, }; diff --git a/src/wasm-lib/kcl/src/std/fillet.rs b/src/wasm-lib/kcl/src/std/fillet.rs index 9f8641190..0da8c6be7 100644 --- a/src/wasm-lib/kcl/src/std/fillet.rs +++ b/src/wasm-lib/kcl/src/std/fillet.rs @@ -12,9 +12,9 @@ use serde::{Deserialize, Serialize}; use uuid::Uuid; use crate::{ - ast::types::TagNode, errors::{KclError, KclErrorDetails}, executor::{EdgeCut, ExecState, ExtrudeSurface, FilletSurface, GeoMeta, KclValue, Solid, TagIdentifier}, + parsing::ast::types::TagNode, settings::types::UnitLength, std::Args, }; diff --git a/src/wasm-lib/kcl/src/std/kcl_stdlib.rs b/src/wasm-lib/kcl/src/std/kcl_stdlib.rs index 6ed9fc85d..7cc91a5fe 100644 --- a/src/wasm-lib/kcl/src/std/kcl_stdlib.rs +++ b/src/wasm-lib/kcl/src/std/kcl_stdlib.rs @@ -4,8 +4,8 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ - ast::types::{FunctionExpression, Program}, docs::{StdLibFn, StdLibFnData}, + parsing::ast::types::{FunctionExpression, Program}, }; pub trait KclStdLibFn: StdLibFn { diff --git a/src/wasm-lib/kcl/src/std/math.rs b/src/wasm-lib/kcl/src/std/math.rs index 4567594fa..7dc313598 100644 --- a/src/wasm-lib/kcl/src/std/math.rs +++ b/src/wasm-lib/kcl/src/std/math.rs @@ -3,7 +3,6 @@ use anyhow::Result; use derive_docs::stdlib; -use super::args::FromArgs; use crate::{ errors::{KclError, KclErrorDetails}, executor::{ExecState, KclValue}, @@ -13,7 +12,8 @@ use crate::{ /// Compute the remainder after dividing `num` by `div`. /// If `num` is negative, the result will be too. pub async fn rem(_exec_state: &mut ExecState, args: Args) -> Result { - let (n, d) = FromArgs::from_args(&args, 0)?; + let n = args.get_unlabeled_kw_arg("number to divide")?; + let d = args.get_kw_arg("divisor")?; let result = inner_rem(n, d)?; Ok(args.make_user_val_from_i64(result)) @@ -23,13 +23,15 @@ pub async fn rem(_exec_state: &mut ExecState, args: Args) -> Result Result { Ok(num % divisor) diff --git a/src/wasm-lib/kcl/src/std/mod.rs b/src/wasm-lib/kcl/src/std/mod.rs index eb4988368..99e32b192 100644 --- a/src/wasm-lib/kcl/src/std/mod.rs +++ b/src/wasm-lib/kcl/src/std/mod.rs @@ -25,21 +25,20 @@ pub mod types; pub mod units; pub mod utils; -use std::collections::HashMap; - use anyhow::Result; pub use args::Args; use derive_docs::stdlib; +use indexmap::IndexMap; use lazy_static::lazy_static; use parse_display::{Display, FromStr}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ - ast::types::FunctionExpression, docs::StdLibFn, errors::KclError, executor::{ExecState, KclValue, ProgramMemory}, + parsing::ast::types::FunctionExpression, std::kcl_stdlib::KclStdLibFn, }; @@ -167,8 +166,8 @@ pub fn get_stdlib_fn(name: &str) -> Option> { } pub struct StdLib { - pub fns: HashMap>, - pub kcl_fns: HashMap>, + pub fns: IndexMap>, + pub kcl_fns: IndexMap>, } impl std::fmt::Debug for StdLib { @@ -198,7 +197,7 @@ impl StdLib { } // Get the combined hashmaps. - pub fn combined(&self) -> HashMap> { + pub fn combined(&self) -> IndexMap> { let mut combined = self.fns.clone(); for (k, v) in self.kcl_fns.clone() { combined.insert(k, v.std_lib()); @@ -320,6 +319,6 @@ pub enum Primitive { /// A closure used as an argument to a stdlib function. pub struct FnAsArg<'a> { pub func: Option<&'a crate::executor::MemoryFunction>, - pub expr: crate::ast::types::BoxNode, + pub expr: crate::parsing::ast::types::BoxNode, pub memory: Box, } diff --git a/src/wasm-lib/kcl/src/std/shapes.rs b/src/wasm-lib/kcl/src/std/shapes.rs index 7b9e0e51e..353cc6e11 100644 --- a/src/wasm-lib/kcl/src/std/shapes.rs +++ b/src/wasm-lib/kcl/src/std/shapes.rs @@ -14,9 +14,9 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ - ast::types::TagNode, errors::{KclError, KclErrorDetails}, executor::{BasePath, ExecState, GeoMeta, KclValue, Path, Sketch, SketchSurface}, + parsing::ast::types::TagNode, std::Args, }; diff --git a/src/wasm-lib/kcl/src/std/sketch.rs b/src/wasm-lib/kcl/src/std/sketch.rs index c456e3ba4..7754284e3 100644 --- a/src/wasm-lib/kcl/src/std/sketch.rs +++ b/src/wasm-lib/kcl/src/std/sketch.rs @@ -1,9 +1,8 @@ //! Functions related to sketching. -use std::collections::HashMap; - use anyhow::Result; use derive_docs::stdlib; +use indexmap::IndexMap; use kcmc::shared::Point2d as KPoint2d; // Point2d is already defined in this pkg, to impl ts_rs traits. use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Angle, ModelingCmd}; use kittycad_modeling_cmds as kcmc; @@ -13,12 +12,12 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::{ - ast::types::TagNode, errors::{KclError, KclErrorDetails}, executor::{ BasePath, ExecState, Face, GeoMeta, KclValue, Path, Plane, Point2d, Point3d, Sketch, SketchSet, SketchSurface, Solid, TagEngineInfo, TagIdentifier, }, + parsing::ast::types::TagNode, std::{ utils::{ arc_angles, arc_center_and_end, get_tangential_arc_to_info, get_x_component, get_y_component, @@ -1113,46 +1112,53 @@ async fn make_sketch_plane_from_orientation( exec_state: &mut ExecState, args: &Args, ) -> Result, KclError> { - let mut plane = Plane::from_plane_data(data.clone(), exec_state); + let plane = Plane::from_plane_data(data.clone(), exec_state); - // Get the default planes. - let default_planes = args - .ctx - .engine - .default_planes(&mut exec_state.id_generator, args.source_range) - .await?; - - plane.id = match data { - PlaneData::XY => default_planes.xy, - PlaneData::NegXY => default_planes.neg_xy, - PlaneData::XZ => default_planes.xz, - PlaneData::NegXZ => default_planes.neg_xz, - PlaneData::YZ => default_planes.yz, - PlaneData::NegYZ => default_planes.neg_yz, + // Create the plane on the fly. + let clobber = false; + let size = LengthUnit(60.0); + let hide = Some(true); + match data { + PlaneData::XY | PlaneData::NegXY | PlaneData::XZ | PlaneData::NegXZ | PlaneData::YZ | PlaneData::NegYZ => { + let x_axis = match data { + PlaneData::NegXY => Point3d::new(-1.0, 0.0, 0.0), + PlaneData::NegXZ => Point3d::new(-1.0, 0.0, 0.0), + PlaneData::NegYZ => Point3d::new(0.0, -1.0, 0.0), + _ => plane.x_axis, + }; + args.batch_modeling_cmd( + plane.id, + ModelingCmd::from(mcmd::MakePlane { + clobber, + origin: plane.origin.into(), + size, + x_axis: x_axis.into(), + y_axis: plane.y_axis.into(), + hide, + }), + ) + .await?; + } PlaneData::Plane { origin, x_axis, y_axis, z_axis: _, } => { - // Create the custom plane on the fly. - let id = exec_state.id_generator.next_uuid(); args.batch_modeling_cmd( - id, + plane.id, ModelingCmd::from(mcmd::MakePlane { - clobber: false, + clobber, origin: (*origin).into(), - size: LengthUnit(60.0), + size, x_axis: (*x_axis).into(), y_axis: (*y_axis).into(), - hide: Some(true), + hide, }), ) .await?; - - id } - }; + } Ok(Box::new(plane)) } @@ -1294,7 +1300,7 @@ pub(crate) async fn inner_start_profile_at( }), surface: None, }); - HashMap::from([(tag.name.to_string(), tag_identifier)]) + IndexMap::from([(tag.name.to_string(), tag_identifier)]) } else { Default::default() }, diff --git a/src/wasm-lib/kcl/src/unparser.rs b/src/wasm-lib/kcl/src/unparser.rs index e1946b105..155163baa 100644 --- a/src/wasm-lib/kcl/src/unparser.rs +++ b/src/wasm-lib/kcl/src/unparser.rs @@ -1,6 +1,6 @@ use std::fmt::Write; -use crate::{ +use crate::parsing::{ ast::types::{ ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem, CallExpression, CallExpressionKw, Expr, FnArgType, FormatOptions, FunctionExpression, IfExpression, ImportStatement, @@ -8,7 +8,7 @@ use crate::{ NonCodeValue, ObjectExpression, Parameter, PipeExpression, Program, TagDeclarator, UnaryExpression, VariableDeclaration, VariableKind, }, - parser::PIPE_OPERATOR, + PIPE_OPERATOR, }; impl Program { @@ -173,7 +173,7 @@ impl Expr { Expr::PipeExpression(pipe_exp) => pipe_exp.recast(options, indentation_level), Expr::UnaryExpression(unary_exp) => unary_exp.recast(options), Expr::IfExpression(e) => e.recast(options, indentation_level, ctxt), - Expr::PipeSubstitution(_) => crate::parser::PIPE_SUBSTITUTION_OPERATOR.to_string(), + Expr::PipeSubstitution(_) => crate::parsing::PIPE_SUBSTITUTION_OPERATOR.to_string(), Expr::None(_) => { unimplemented!("there is no literal None, see https://github.com/KittyCAD/modeling-app/issues/1115") } @@ -683,7 +683,7 @@ mod tests { use pretty_assertions::assert_eq; use super::*; - use crate::{ast::types::FormatOptions, source_range::ModuleId}; + use crate::{parsing::ast::types::FormatOptions, source_range::ModuleId}; #[test] fn test_recast_if_else_if_same() { @@ -695,7 +695,7 @@ mod tests { 5 } "#; - let program = crate::parser::top_level_parse(input).unwrap(); + let program = crate::parsing::top_level_parse(input).unwrap(); let output = program.recast(&Default::default(), 0); assert_eq!(output, input); } @@ -708,7 +708,7 @@ mod tests { 5 } "#; - let program = crate::parser::top_level_parse(input).unwrap(); + let program = crate::parsing::top_level_parse(input).unwrap(); let output = program.recast(&Default::default(), 0); assert_eq!(output, input); } @@ -722,7 +722,7 @@ import a as aaa, b from "a.kcl" import a, b as bbb from "a.kcl" import a as aaa, b as bbb from "a.kcl" "#; - let program = crate::parser::top_level_parse(input).unwrap(); + let program = crate::parsing::top_level_parse(input).unwrap(); let output = program.recast(&Default::default(), 0); assert_eq!(output, input); } @@ -731,7 +731,7 @@ import a as aaa, b as bbb from "a.kcl" fn test_recast_import_as_same_name() { let input = r#"import a as a from "a.kcl" "#; - let program = crate::parser::top_level_parse(input).unwrap(); + let program = crate::parsing::top_level_parse(input).unwrap(); let output = program.recast(&Default::default(), 0); let expected = r#"import a from "a.kcl" "#; @@ -744,7 +744,7 @@ import a as aaa, b as bbb from "a.kcl" return 0 } "#; - let program = crate::parser::top_level_parse(input).unwrap(); + let program = crate::parsing::top_level_parse(input).unwrap(); let output = program.recast(&Default::default(), 0); assert_eq!(output, input); } @@ -867,7 +867,7 @@ fn zoo(x0, y0) { zoo(zoo_x, zoo_y) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted, some_program_string); @@ -936,7 +936,7 @@ outsideRevolve = startSketchOn('XZ') |> line([overHangLength - thickness, 0], %) |> close(%) |> revolve({ axis: 'y' }, %)"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1012,7 +1012,7 @@ outsideRevolve = startSketchOn('XZ') let some_program_string = r#"bing = { yo = 55 } myNestedVar = [{ prop = callExp(bing.yo) }] "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted, some_program_string); @@ -1023,7 +1023,7 @@ myNestedVar = [{ prop = callExp(bing.yo) }] let some_program_string = r#"bing = { yo = 55 } myNestedVar = [callExp(bing.yo)] "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted, some_program_string); @@ -1035,7 +1035,7 @@ myNestedVar = [callExp(bing.yo)] ten = 10 bar = [0 + 1 .. ten] "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted, some_program_string); @@ -1049,7 +1049,7 @@ bar = [0 + 1 .. ten] thing ( 1 ) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1069,7 +1069,7 @@ thing(1) return x + 1 } "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted, some_program_string); @@ -1084,7 +1084,7 @@ myNestedVar = [ } ] "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1102,7 +1102,7 @@ myNestedVar = [ #[test] fn test_recast_empty_file() { let some_program_string = r#""#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); // Its VERY important this comes back with zero new lines. @@ -1113,7 +1113,7 @@ myNestedVar = [ fn test_recast_empty_file_new_line() { let some_program_string = r#" "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); // Its VERY important this comes back with zero new lines. @@ -1131,7 +1131,7 @@ part001 = startSketchOn('XY') |> close(%) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1162,7 +1162,7 @@ part001 = startSketchOn('XY') |> close(%) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1192,7 +1192,7 @@ part001 = startSketchOn('XY') |> close(%) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1330,7 +1330,7 @@ tabs_l = startSketchOn({ distance = length - 10 }, %) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); // Its VERY important this comes back with zero new lines. @@ -1468,7 +1468,7 @@ tabs_l = startSketchOn({ |> close(%) |> extrude(scale, %) }"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1492,7 +1492,7 @@ tabs_l = startSketchOn({ |> startProfileAt([0.0, 5.0], %) |> line([0.4900857016, -0.0240763666], %) |> line([0.6804562304, 0.9087880491], %)"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1511,7 +1511,7 @@ tabs_l = startSketchOn({ |> startProfileAt([0.0, 5.0], %) |> line([0.4900857016, -0.0240763666], %) // hello world |> line([0.6804562304, 0.9087880491], %)"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1530,7 +1530,7 @@ tabs_l = startSketchOn({ |> line([0.4900857016, -0.0240763666], %) // hello world |> line([0.6804562304, 0.9087880491], %)"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1555,7 +1555,7 @@ tabs_l = startSketchOn({ // this is also a comment return things }"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1579,7 +1579,7 @@ tabs_l = startSketchOn({ // this is also a comment thing = 'foo' "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1600,7 +1600,7 @@ key = 'c' // hello thing = 'foo' "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1628,7 +1628,7 @@ thing = 'c' foo = 'bar' // "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1654,7 +1654,7 @@ foo = 'bar' // // hello thing = 'foo' "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1673,7 +1673,7 @@ thing = 'foo' /* comment at start */ mySk1 = startSketchAt([0, 0])"#; - let program = crate::parser::top_level_parse(test_program).unwrap(); + let program = crate::parsing::top_level_parse(test_program).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1703,7 +1703,7 @@ mySk1 = startSketchOn('XY') |> ry(45, %) |> rx(45, %) // one more for good measure"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1739,7 +1739,7 @@ mySk1 = startSketchOn('XY') intersectTag = seg01 }, %) |> line([-0.42, -1.72], %)"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted.trim(), some_program_string); @@ -1763,7 +1763,7 @@ yo = [ " hey oooooo really long long long" ] "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted, some_program_string); @@ -1779,7 +1779,7 @@ key = 'c' things = "things" // this is also a comment"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); let expected = some_program_string.trim(); @@ -1798,7 +1798,7 @@ things = "things" // a comment " }"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted.trim(), some_program_string.trim()); @@ -1822,7 +1822,7 @@ part001 = startSketchOn('XY') -angleToMatchLengthY(seg01, myVar, %), myVar ], %) // ln-lineTo-yAbsolute should use angleToMatchLengthY helper"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted.trim(), some_program_string); @@ -1847,7 +1847,7 @@ part001 = startSketchOn('XY') myVar ], %) // ln-lineTo-yAbsolute should use angleToMatchLengthY helper "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast( &FormatOptions { @@ -1876,7 +1876,7 @@ fn ghi = (part001) => { return part001 } "#; - let mut program = crate::parser::top_level_parse(some_program_string).unwrap(); + let mut program = crate::parsing::top_level_parse(some_program_string).unwrap(); program.rename_symbol("mySuperCoolPart", 6); let recasted = program.recast(&Default::default(), 0); @@ -1904,7 +1904,7 @@ fn ghi(part001) { let some_program_string = r#"fn ghi = (x, y, z) => { return x }"#; - let mut program = crate::parser::top_level_parse(some_program_string).unwrap(); + let mut program = crate::parsing::top_level_parse(some_program_string).unwrap(); program.rename_symbol("newName", 10); let recasted = program.recast(&Default::default(), 0); @@ -1926,7 +1926,7 @@ fn ghi(part001) { angle_start = 0, angle_end = 180, }, %)"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1956,7 +1956,7 @@ firstExtrude = startSketchOn('XY') |> close(%) |> extrude(h, %) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -1993,7 +1993,7 @@ firstExtrude = startSketchOn('XY') |> close(%) |> extrude(h, %) "#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!( @@ -2019,7 +2019,7 @@ firstExtrude = startSketchOn('XY') #[tokio::test(flavor = "multi_thread")] async fn test_recast_math_start_negative() { let some_program_string = r#"myVar = -5 + 6"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted.trim(), some_program_string); @@ -2036,7 +2036,7 @@ startSketchOn('XY') |> line([0, -(5 - thickness)], %) |> line([0, -(5 - 1)], %) |> line([0, -(-5 - 1)], %)"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted.trim(), some_program_string); @@ -2050,7 +2050,7 @@ FOS = 2 sigmaAllow = 8 width = 20 thickness = sqrt(distance * p * FOS * 6 / (sigmaAllow * width))"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted.trim(), some_program_string); @@ -2059,7 +2059,7 @@ thickness = sqrt(distance * p * FOS * 6 / (sigmaAllow * width))"#; #[tokio::test(flavor = "multi_thread")] async fn no_vardec_keyword() { let some_program_string = r#"distance = 5"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); assert_eq!(recasted.trim(), some_program_string); @@ -2072,7 +2072,7 @@ thickness = sqrt(distance * p * FOS * 6 / (sigmaAllow * width))"#; return 1 } }"#; - let program = crate::parser::top_level_parse(some_program_string).unwrap(); + let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let recasted = program.recast(&Default::default(), 0); let expected = "\ fn f() { @@ -2107,10 +2107,8 @@ fn f() { .into_iter() .enumerate() { - let tokens = crate::token::lexer(raw, ModuleId::default()).unwrap(); - let literal = crate::parser::parser_impl::unsigned_number_literal - .parse(&tokens) - .unwrap(); + let tokens = crate::parsing::token::lexer(raw, ModuleId::default()).unwrap(); + let literal = crate::parsing::parser::unsigned_number_literal.parse(&tokens).unwrap(); assert_eq!( literal.recast(), expected, @@ -2140,7 +2138,7 @@ sketch002 = startSketchOn({ } }) "#; - let ast = crate::parser::top_level_parse(input).unwrap(); + let ast = crate::parsing::top_level_parse(input).unwrap(); let actual = ast.recast(&FormatOptions::new(), 0); assert_eq!(actual, expected); } @@ -2166,9 +2164,9 @@ sketch002 = startSketchOn({ .into_iter() .enumerate() { - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); - crate::parser::parser_impl::print_tokens(&tokens); - let expr = crate::parser::parser_impl::object.parse(&tokens).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); + crate::parsing::parser::print_tokens(&tokens); + let expr = crate::parsing::parser::object.parse(&tokens).unwrap(); assert_eq!( expr.recast(&FormatOptions::new(), 0, ExprContext::Other), expected, @@ -2264,8 +2262,8 @@ sketch002 = startSketchOn({ .into_iter() .enumerate() { - let tokens = crate::token::lexer(input, ModuleId::default()).unwrap(); - let expr = crate::parser::parser_impl::array_elem_by_elem.parse(&tokens).unwrap(); + let tokens = crate::parsing::token::lexer(input, ModuleId::default()).unwrap(); + let expr = crate::parsing::parser::array_elem_by_elem.parse(&tokens).unwrap(); assert_eq!( expr.recast(&FormatOptions::new(), 0, ExprContext::Other), expected, diff --git a/src/wasm-lib/kcl/src/walk/ast_node.rs b/src/wasm-lib/kcl/src/walk/ast_node.rs index 7f75ea2f4..9c8e8f87e 100644 --- a/src/wasm-lib/kcl/src/walk/ast_node.rs +++ b/src/wasm-lib/kcl/src/walk/ast_node.rs @@ -1,5 +1,5 @@ use crate::{ - ast::types::{self, NodeRef}, + parsing::ast::types::{self, NodeRef}, source_range::SourceRange, }; diff --git a/src/wasm-lib/kcl/src/walk/ast_walk.rs b/src/wasm-lib/kcl/src/walk/ast_walk.rs index a44267aeb..39f063019 100644 --- a/src/wasm-lib/kcl/src/walk/ast_walk.rs +++ b/src/wasm-lib/kcl/src/walk/ast_walk.rs @@ -1,7 +1,7 @@ use anyhow::Result; use crate::{ - ast::types::{ + parsing::ast::types::{ BinaryPart, BodyItem, Expr, IfExpression, LiteralIdentifier, MemberExpression, MemberObject, NodeRef, ObjectExpression, ObjectProperty, Parameter, Program, UnaryExpression, VariableDeclarator, }, @@ -336,7 +336,7 @@ mod tests { macro_rules! kcl { ( $kcl:expr ) => {{ - $crate::parser::top_level_parse($kcl).unwrap() + $crate::parsing::top_level_parse($kcl).unwrap() }}; }