diff --git a/.cargo/config.toml b/.cargo/config.toml
index 22fe7e245bd6..4ec2f3b86203 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,9 +1,2 @@
[target.wasm32-unknown-unknown]
runner = 'wasm-bindgen-test-runner'
-
-[target.'cfg(target_os = "macos")']
-# Required for prql-elixir on Mac
-rustflags = [
- "-C", "link-arg=-undefined",
- "-C", "link-arg=dynamic_lookup",
-]
diff --git a/.devcontainer/base-image/Dockerfile b/.devcontainer/base-image/Dockerfile
new file mode 100644
index 000000000000..6d71dcde78cb
--- /dev/null
+++ b/.devcontainer/base-image/Dockerfile
@@ -0,0 +1,15 @@
+FROM mcr.microsoft.com/devcontainers/rust:0.203.8-1-bullseye
+
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends \
+ cmake \
+ && rm -rf /var/lib/apt/lists/* \
+ && sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
+
+# ========= Install cargo-tools for non-root user (vscode) =========
+COPY Taskfile.cargo-tools.yml /tmp/Taskfile.cargo-tools.yml
+WORKDIR /tmp
+USER vscode
+RUN task -t Taskfile.cargo-tools.yml install
+
+USER root
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000000..8af2eec50d0e
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,33 @@
+// Dev Container for Rust, website, prql-js and prql-python
+{
+ "image": "ghcr.io/prql/prql-devcontainer-base:latest",
+ "features": {
+ "ghcr.io/devcontainers/features/hugo:1": {},
+ "ghcr.io/devcontainers/features/python:1": {},
+ "ghcr.io/devcontainers/features/node:1": {},
+ "ghcr.io/eitsupi/devcontainer-features/go-task:1": {}
+ },
+ "customizations": {
+ "vscode": {
+ "extensions": [
+ // Keep in sync with Taskfile.yml
+ "prql-lang.prql-vscode",
+ "rust-lang.rust-analyzer",
+ "mitsuhiko.insta",
+ "esbenp.prettier-vscode",
+ "budparr.language-hugo-vscode"
+ ]
+ }
+ },
+ "mounts": [
+ {
+ "source": "devcontainer-cargo-cache",
+ "target": "/usr/local/cargo",
+ "type": "volume"
+ }
+ ],
+ "postCreateCommand": {
+ "install-maturin": "task install-maturin",
+ "install-npm-dependencies": "task install-npm-dependencies"
+ }
+}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml
new file mode 100644
index 000000000000..08196cce0f0d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yaml
@@ -0,0 +1,62 @@
+name: ๐ Bug report
+description: File a bug report to help us improve
+labels: [bug]
+body:
+ - type: textarea
+ id: what-happened
+ attributes:
+ label: What happened?
+ description: |
+ Thanks for reporting a bug! Feel free to add any initial context here.
+
+ - type: textarea
+ id: prql-input
+ attributes:
+ label: PRQL input
+ description: |
+ A minimal, self-contained example that demonstrates the issue.
+
+ This will be automatically formatted into code, so no need for markdown backticks.
+ render: elm
+ validations:
+ required: true
+
+ - type: textarea
+ id: output
+ attributes:
+ label: SQL output
+ description: |
+ The SQL that PRQL currently compiles to. Feel free to use the [playground](https://prql-lang.org/playground/) to generate the SQL.
+
+ This will be automatically formatted into code, so no need for markdown backticks.
+ render: SQL
+ validations:
+ required: true
+
+ - type: textarea
+ id: expected-output
+ attributes:
+ label: Expected SQL output
+
+ description:
+ Optional; no need to write out if it's obvious from the context
+ render: SQL
+
+ - type: checkboxes
+ id: mvce-checkboxes
+ attributes:
+ label: MVCE confirmation
+ description: |
+ Please confirm that the bug report is minimal and doesn't exist already:
+
+ - **Minimal example** โ the example is as focused as reasonably possible to demonstrate the underlying issue in PRQL. For example, it's not possible to exclude any line and still observe the bug.
+
+ - **New issue** โ a search of GitHub Issues suggests this is not a duplicate.
+ options:
+ - label: Minimal example
+ - label: New issue
+
+ - type: textarea
+ id: extra
+ attributes:
+ label: Anything else?
diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml
new file mode 100644
index 000000000000..0086358db1eb
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yaml
@@ -0,0 +1 @@
+blank_issues_enabled: true
diff --git a/.github/ISSUE_TEMPLATE/something_else.yaml b/.github/ISSUE_TEMPLATE/something_else.yaml
new file mode 100644
index 000000000000..56f5cad63e46
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/something_else.yaml
@@ -0,0 +1,7 @@
+name: Something else
+description: Anything that's not a bug report
+body:
+ - type: textarea
+ id: what-happened
+ attributes:
+ label: What's up?
diff --git a/.github/actions/build-prql-js/action.yaml b/.github/actions/build-prql-js/action.yaml
index 8843384d437c..556bc9170997 100644
--- a/.github/actions/build-prql-js/action.yaml
+++ b/.github/actions/build-prql-js/action.yaml
@@ -6,10 +6,9 @@ description: ""
runs:
using: composite
steps:
- - name: Install wasm-pack
- uses: jetli/wasm-pack-action@v0.4.0
+ - uses: baptiste0928/cargo-install@next
with:
- version: "latest"
+ crate: wasm-pack
- name: Setup Node
uses: actions/setup-node@v3
@@ -20,4 +19,4 @@ runs:
- name: Run wasm-pack for node, bundler, & web
run: npm run build
shell: bash
- working-directory: prql-js/
+ working-directory: bindings/prql-js/
diff --git a/.github/actions/build-prql-python/action.yaml b/.github/actions/build-prql-python/action.yaml
index 95c2429151e9..995e59f642e0 100644
--- a/.github/actions/build-prql-python/action.yaml
+++ b/.github/actions/build-prql-python/action.yaml
@@ -9,22 +9,23 @@ runs:
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
+ key: python
- uses: messense/maturin-action@v1
if: runner.os == 'Linux'
with:
manylinux: auto
command: build
- args: --release -o dist -m prql-python/Cargo.toml
+ args: --release -o dist -m bindings/prql-python/Cargo.toml
- uses: messense/maturin-action@v1
if: runner.os == 'Windows'
with:
command: build
- args: --release -o dist -m prql-python/Cargo.toml
+ args: --release -o dist -m bindings/prql-python/Cargo.toml
- uses: messense/maturin-action@v1
if: runner.os == 'macOS'
with:
command: build
- args: --release -o dist --universal2 -m prql-python/Cargo.toml
+ args: --release -o dist --universal2 -m bindings/prql-python/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 9037733798b9..28bf10f7d512 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -19,7 +19,7 @@ updates:
prefix: "chore: "
- package-ecosystem: "npm"
- directory: "/playground"
+ directory: "/bindings/prql-js"
schedule:
interval: daily
ignore:
@@ -29,6 +29,24 @@ updates:
commit-message:
prefix: "chore: "
+ - package-ecosystem: "npm"
+ directory: "/web/playground"
+ schedule:
+ interval: daily
+ ignore:
+ - dependency-name: "*"
+ update-types:
+ - version-update:semver-patch
+ commit-message:
+ prefix: "chore: "
+
+ - package-ecosystem: docker
+ directory: .devcontainer/base-image
+ schedule:
+ interval: daily
+ commit-message:
+ prefix: "chore: "
+
# For actions (rather than workflows), we need to list each directory, ref
# https://github.com/dependabot/dependabot-core/issues/5137, from https://github.com/dependabot/dependabot-core/issues/4178#issuecomment-1118492006
- directory: ".github/actions/build-prql-js"
diff --git a/.github/workflows/devcontainer.yaml b/.github/workflows/devcontainer.yaml
new file mode 100644
index 000000000000..28c9cf330822
--- /dev/null
+++ b/.github/workflows/devcontainer.yaml
@@ -0,0 +1,67 @@
+name: devcontainer
+
+on:
+ # TODO: adopt our standard hierarchy for these, as per
+ # https://github.com/PRQL/prql/pull/1893#discussion_r1125736478, possibly only
+ # publishing on releases or on the `web` branch (which possibly should be
+ # renamed back to `stable` if we use it more for this)
+ push:
+ paths:
+ - .devcontainer/base-image/Dockerfile
+ - Taskfile.cargo-tools.yml
+ pull_request:
+ paths:
+ - .devcontainer/base-image/Dockerfile
+ - Taskfile.cargo-tools.yml
+ workflow_dispatch:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: docker/metadata-action@v4
+ id: meta
+ with:
+ images: ghcr.io/${{ github.repository_owner }}/prql-devcontainer-base
+ tags: |
+ type=raw,latest
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v2
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v2
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v2
+
+ - id: set-options
+ run: |
+ if [ "${{ github.ref }}" = "refs/heads/main" ]; then
+ echo "push=true" >>$GITHUB_OUTPUT
+ else
+ echo "push=false" >>$GITHUB_OUTPUT
+ fi
+
+ - name: Build
+ uses: docker/build-push-action@v4
+ with:
+ file: "./.devcontainer/base-image/Dockerfile"
+ tags: ${{ steps.meta.outputs.tags }}
+ # TODO: add linux/arm64
+ platforms: linux/amd64
+ push: ${{ steps.set-options.outputs.push }}
+ cache-from: |
+ ${{ env.IMAGE_NAME }}
+ type=gha
+ cache-to: |
+ type=inline
+ type=gha,mode=max
diff --git a/.github/workflows/mega-linter.yaml b/.github/workflows/mega-linter.yaml
new file mode 100644
index 000000000000..542bcb365b59
--- /dev/null
+++ b/.github/workflows/mega-linter.yaml
@@ -0,0 +1,105 @@
+# This MegaLinter workflow is very experimental stage. Open to changes and updates.
+# https://github.com/PRQL/prql/pull/1974
+
+# MegaLinter GitHub Action configuration file
+# More info at https://megalinter.io
+name: MegaLinter
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+env: # Comment env block if you do not want to apply fixes
+ # Apply linter fixes configuration
+ # APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
+ APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
+ APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)
+
+concurrency:
+ group: ${{ github.ref }}-${{ github.workflow }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ name: MegaLinter
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances
+
+ # MegaLinter
+ - name: MegaLinter
+ id: ml
+ # You can override MegaLinter flavor used to have faster performances
+ # More info at https://megalinter.io/flavors/
+ uses: oxsecurity/megalinter@v6
+ env:
+ # All available variables are described in documentation
+ # https://megalinter.io/configuration/
+ VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref
+ == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
+ # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks
+
+ # Upload MegaLinter artifacts
+ - name: Archive production artifacts
+ if: ${{ success() }} || ${{ failure() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: MegaLinter reports
+ path: |
+ megalinter-reports
+ mega-linter.log
+
+ # Create pull request if applicable (for now works only on PR from same repository, not from forks)
+ - name: Create Pull Request with applied fixes
+ id: cpr
+ if:
+ steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT ==
+ 'all' || env.APPLY_FIXES_EVENT == github.event_name) &&
+ env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push'
+ || github.event.pull_request.head.repo.full_name == github.repository)
+ uses: peter-evans/create-pull-request@v4
+ with:
+ token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
+ commit-message: "[MegaLinter] Apply linters automatic fixes"
+ title: "[MegaLinter] Apply linters automatic fixes"
+ labels: bot
+ - name: Create PR output
+ if:
+ steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT ==
+ 'all' || env.APPLY_FIXES_EVENT == github.event_name) &&
+ env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push'
+ || github.event.pull_request.head.repo.full_name == github.repository)
+ run: |
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
+
+ # Push new commit if applicable (for now works only on PR from same repository, not from forks)
+ - name: Prepare commit
+ if:
+ steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT ==
+ 'all' || env.APPLY_FIXES_EVENT == github.event_name) &&
+ env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' &&
+ (github.event_name == 'push' ||
+ github.event.pull_request.head.repo.full_name == github.repository)
+ run: sudo chown -Rc $UID .git/
+ - name: Commit and push applied linter fixes
+ if:
+ steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT ==
+ 'all' || env.APPLY_FIXES_EVENT == github.event_name) &&
+ env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' &&
+ (github.event_name == 'push' ||
+ github.event.pull_request.head.repo.full_name == github.repository)
+ uses: stefanzweifel/git-auto-commit-action@v4
+ with:
+ branch:
+ ${{ github.event.pull_request.head.ref || github.head_ref ||
+ github.ref }}
+ commit_message: "[MegaLinter] Apply linters fixes"
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml
index a08c5f23f99c..47b83bb8f061 100644
--- a/.github/workflows/nightly.yaml
+++ b/.github/workflows/nightly.yaml
@@ -12,6 +12,10 @@ on:
jobs:
cargo-audit:
runs-on: ubuntu-latest
+ # We can't read PRQL repo security events on forks, which causes this to
+ # incorrectly fail. So we disable. If we wanted to run checks on PRs, we
+ # could move this to `pull-request-target`.
+ if: "!github.event.pull_request.head.repo.fork"
permissions:
actions: read
contents: read
@@ -48,14 +52,15 @@ jobs:
update-rust-toolchain:
runs-on: ubuntu-latest
+ # Don't run on forks; will attempt to create a PR into the fork...
+ if: "!github.event.pull_request.head.repo.fork"
steps:
- name: ๐ Checkout code
uses: actions/checkout@v3
- uses: a-kenji/update-rust-toolchain@main
with:
# Discussion in #1561
- # Move this up until 3, so the next upgrade is at 1.66 once 1.69 is released.
- minor-version-delta: 2
+ minor-version-delta: 3
toolchain-path: "./rust-toolchain.toml"
pr-title: "build: Update rust toolchain version"
diff --git a/.github/workflows/publish-web.yaml b/.github/workflows/publish-web.yaml
index ba17deef1ae5..1260325e0760 100644
--- a/.github/workflows/publish-web.yaml
+++ b/.github/workflows/publish-web.yaml
@@ -6,23 +6,24 @@ on:
# Called by pull-request when specifically requested
workflow_call:
+# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
+permissions:
+ pages: write
+ id-token: write
+
jobs:
- publish-web:
+ build-web:
runs-on: ubuntu-latest
- # Skip running workflow on forks
+ # Skip running workflow on forks. This still runs on PRs, but then below we
+ # disable it from attempting to publish.
if: github.repository_owner == 'prql'
- # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
- permissions:
- pages: write
- id-token: write
-
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
-
steps:
+ - name: Setup Pages
+ id: pages
+ uses: actions/configure-pages@v3
+
- name: ๐ Checkout code
uses: actions/checkout@v3
@@ -31,10 +32,6 @@ jobs:
uses: peaceiris/actions-hugo@v2.6.0
# Book setup, duplicated from `pull-request.yaml`
- - name: ๐ฐ Cache
- uses: Swatinem/rust-cache@v2
- with:
- save-if: ${{ github.ref == 'refs/heads/web' }}
- uses: baptiste0928/cargo-install@next
with:
crate: mdbook
@@ -44,23 +41,35 @@ jobs:
- uses: baptiste0928/cargo-install@next
with:
crate: mdbook-admonish
+ - name: ๐ฐ Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ save-if: ${{ github.ref == 'refs/heads/web' }}
- uses: ./.github/actions/build-prql-js
- uses: arduino/setup-task@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
+
- name: ๐ท๏ธ Build website
run: task build-web
- - name: Prepare tar for upload
- uses: actions/upload-pages-artifact@v1.0.7
+ - uses: actions/upload-pages-artifact@v1.0.7
with:
path: website/public/
+ deploy-web:
+ needs: build-web
+ runs-on: ubuntu-latest
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+
+ # Don't attempt to publish if on a fork, including a PR.
+ if: "!github.event.pull_request.head.repo.fork"
+
+ steps:
- name: Deploy to GitHub Pages
- # Even if called by another workflow, don't try and actually publish if
- # on a fork (it'll fail the workflow even if it otherwise builds successfully)
- if: "!github.event.pull_request.head.repo.fork"
id: deployment
- uses: actions/deploy-pages@v1.2.4
+ uses: actions/deploy-pages@v1.2.5
diff --git a/.github/workflows/pull-request-target.yaml b/.github/workflows/pull-request-target.yaml
index ff60c7b89406..81b8762bf0d7 100644
--- a/.github/workflows/pull-request-target.yaml
+++ b/.github/workflows/pull-request-target.yaml
@@ -5,7 +5,8 @@ on:
types: [opened, edited, synchronize, labeled, closed]
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
+ # Generally we use `github.ref`, but in pull_request_target, that's always `main`.
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
@@ -18,10 +19,31 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: false
+ # The standard ones plus
+ # - "internal" for code quality / ergonomics improvements
+ # - "devops" for developer ergonomics
+ # - "web" for playground / website (but not docs)
+ types: |
+ feat
+ fix
+ docs
+ style
+ refactor
+ perf
+ test
+ build
+ ci
+ chore
+ revert
+ internal
+ devops
+ web
backport:
+ # Backport to `web` branch on `pr-backport-web`
+ name: Backport to `web` branch
runs-on: ubuntu-latest
- # Confirm that it's merged and has a label to ensure nothing is merged without oversight
+ # Confirm that it's merged and has a label to ensure nothing is backported without oversight
if: |
github.event.pull_request.merged
&& (
diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml
index c00a026f61f2..0b34fb0e0ef8 100644
--- a/.github/workflows/pull-request.yaml
+++ b/.github/workflows/pull-request.yaml
@@ -42,10 +42,6 @@ jobs:
- name: ๐ Checkout code
uses: actions/checkout@v3
# Duplicated in `publish-web.yaml`
- - name: ๐ฐ Cache
- uses: Swatinem/rust-cache@v2
- with:
- save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: baptiste0928/cargo-install@next
with:
crate: mdbook
@@ -55,9 +51,13 @@ jobs:
- uses: baptiste0928/cargo-install@next
with:
crate: mdbook-admonish
+ - name: ๐ฐ Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ save-if: ${{ github.ref == 'refs/heads/main' }}
- name: ๐จ Build
run: mdbook build
- working-directory: book/
+ working-directory: web/book/
# Run Mac & Windows & bindings' other tests on a `pr-test-all` label or a `!`
# (meanting a breaking change) in the PR title. (We also run on other
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index c0e6e6cc0fba..d125cc2bf22a 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -24,6 +24,81 @@ jobs:
}
})
+ build-deb-package:
+ # TODO: currently this doesn't publish it as an artifact; would be a welcome contribution
+ # to add that (and eventually as a release asset)
+ runs-on: ubuntu-latest
+ steps:
+ - name: ๐ Checkout code
+ uses: actions/checkout@v3
+ - name: ๐ท Build prql-compiler
+ run: cargo build --release
+ - name: Copy files into .deb package
+ run: |
+ mkdir -p .debpkg/usr/bin
+ cp target/release/prqlc .debpkg/usr/bin/prqlc
+ chmod +x .debpkg/usr/bin/prqlc
+ - name: ๐ฆ Build .deb package
+ uses: jiro4989/build-deb-action@v2
+ with:
+ package: prqlc
+ package_root: .debpkg
+ maintainer: The PRQL Project
+ version: ${{ github.ref }}
+ desc: |
+ prqlc is the CLI for the PRQL compiler. It compiles PRQL to SQL, and offers various diagnostics.
+
+ PRQL is a modern language for transforming data โ a simple, powerful, pipelined SQL replacement.
+
+ build-rpm-package:
+ # TODO: This doesn't publish the rpm yet, that would be a welcome follow-up (even as a CI artifact)
+ runs-on: ubuntu-latest
+ steps:
+ - name: ๐ Checkout code
+ uses: actions/checkout@v3
+ - name: ๐ท Build prqlc
+ run: cargo build --bin prqlc --release
+ - name: Copy files into .rpm package
+ run: |
+ mkdir -p .rpmpkg/usr/bin
+ cp target/release/prqlc .rpmpkg/usr/bin/prqlc
+ chmod +x .rpmpkg/usr/bin/prqlc
+ - name: ๐ฆ Build .rpm package
+ uses: jiro4989/build-rpm-action@v2
+ with:
+ summary: CLI for PRQL, a modern language for transforming data
+ package: prqlc
+ package_root: .rpmpkg
+ maintainer: The PRQL Project
+ version: ${{ github.ref }}
+ desc: |
+ prqlc is the CLI for the PRQL compiler. It compiles PRQL to SQL, and offers various diagnostics.
+
+ PRQL is a modern language for transforming data โ a simple, powerful, pipelined SQL replacement.
+ license: Apache-2.0
+
+ build-and-publish-snap:
+ runs-on: ubuntu-latest
+
+ # Skip running workflow on forks
+ if: github.repository_owner == 'prql'
+
+ steps:
+ - name: ๐ Checkout code
+ uses: actions/checkout@v3
+ - name: ๐ฆ Build Snap
+ uses: snapcore/action-build@v1
+ with:
+ path: packages/
+ - name: ๐ Publish Snap
+ uses: snapcore/action-publish@v1
+ env:
+ SNAPCRAFT_STORE_CREDENTIALS:
+ ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
+ with:
+ snap: ${{ steps.build.outputs.snap }}
+ release: edge
+
build-python-wheels:
runs-on: ${{ matrix.os }}
strategy:
@@ -57,7 +132,7 @@ jobs:
- uses: ./.github/actions/build-prql-js
- name: Publish package on npm
run: npm publish
- working-directory: prql-js/
+ working-directory: bindings/prql-js/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -72,7 +147,7 @@ jobs:
- uses: richb-hanover/cargo@v1.1.0
with:
command: release
- args: publish -x
+ args: publish --no-confirm -x
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
diff --git a/.github/workflows/test-all.yaml b/.github/workflows/test-all.yaml
index 43de52522bb9..c51da0711cf2 100644
--- a/.github/workflows/test-all.yaml
+++ b/.github/workflows/test-all.yaml
@@ -18,7 +18,7 @@ on:
concurrency:
# See notes in `pull-request.yaml`
- group: ${{ github.workflow }}-${{ github.ref }}-test-all
+ group: ${{ github.workflow }}-${{ github.ref }}-all
cancel-in-progress: true
jobs:
@@ -27,11 +27,15 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
target_option: ["", --target=wasm32-unknown-unknown]
+
uses: ./.github/workflows/test-rust.yaml
with:
os: ${{ matrix.os }}
target_option: ${{ matrix.target_option }}
+ test-php:
+ uses: ./.github/workflows/test-php.yaml
+
test-python:
uses: ./.github/workflows/test-python.yaml
@@ -44,6 +48,12 @@ jobs:
test-elixir:
uses: ./.github/workflows/test-elixir.yaml
+ test-dotnet:
+ uses: ./.github/workflows/test-dotnet.yaml
+
+ test-lib:
+ uses: ./.github/workflows/test-lib.yaml
+
measure-code-cov:
# Currently disabled due to https://github.com/actions-rs/tarpaulin/issues/21
if: false
@@ -56,6 +66,8 @@ jobs:
uses: actions/checkout@v3
- name: ๐ฐ Cache
uses: Swatinem/rust-cache@v2
+ with:
+ save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
@@ -105,7 +117,7 @@ jobs:
- uses: baptiste0928/cargo-install@next
with:
crate: cargo-msrv
- # Note this currently uses a manually mantained key in
+ # Note this currently uses a manually maintained key in
# `prql-compiler/Cargo.toml`, because of
# https://github.com/foresterre/cargo-msrv/issues/590
- name: Verify minimum rust version
diff --git a/.github/workflows/test-dotnet.yaml b/.github/workflows/test-dotnet.yaml
new file mode 100644
index 000000000000..2e9ffcfaa6a3
--- /dev/null
+++ b/.github/workflows/test-dotnet.yaml
@@ -0,0 +1,35 @@
+name: test-dotnet
+
+on:
+ pull_request:
+ paths:
+ - "bindings/prql-dotnet/**"
+ - "bindings/prql-lib/**"
+ - ".github/workflows/test-dotnet.yaml"
+ workflow_call:
+
+concurrency:
+ # See notes in `pull-request.yaml`
+ group: ${{ github.workflow }}-${{ github.ref }}-dotnet
+ cancel-in-progress: true
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - name: ๐ Checkout code
+ uses: actions/checkout@v3
+ - name: ๐ Build prql-lib
+ run: cargo build
+ working-directory: bindings/prql-lib
+ - name: ๐ง Setup dotnet
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 7
+ - name: ๐งช Build and test
+ working-directory: bindings
+ run: |
+ dotnet build prql-dotnet
+ cp ../target/debug/libprql_lib.* prql-dotnet/PrqlCompiler/bin/Debug/net*/
+ cp ../target/debug/libprql_lib.* prql-dotnet/PrqlCompiler.Tests/bin/Debug/net*/
+ dotnet test prql-dotnet
diff --git a/.github/workflows/test-elixir.yaml b/.github/workflows/test-elixir.yaml
index e8fb34941c5f..99de8f1cf12d 100644
--- a/.github/workflows/test-elixir.yaml
+++ b/.github/workflows/test-elixir.yaml
@@ -1,22 +1,19 @@
name: test-elixir
on:
- push:
- branches:
- - main
- pull_request:
- paths:
- - "prql-elixir/**"
- - ".github/workflows/test-elixir.yaml"
+ # pull_request:
+ # paths:
+ # - "bindings/prql-elixir/**"
+ # - ".github/workflows/test-elixir.yaml"
workflow_call:
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
+ group: ${{ github.workflow }}-${{ github.ref }}-elixir
cancel-in-progress: true
defaults:
run:
- working-directory: prql-elixir
+ working-directory: bindings/prql-elixir
env:
MIX_ENV: test
@@ -25,7 +22,8 @@ jobs:
test:
strategy:
matrix:
- os: [ubuntu-latest, windows-latest, macos-latest]
+ # Currently disabling mac tests, see prql-elixir/readme.md for more details.
+ os: [ubuntu-latest, windows-latest]
otp: ["25.1.2"]
elixir: ["1.14.2"]
runs-on: ${{matrix.os}}
diff --git a/.github/workflows/test-java.yaml b/.github/workflows/test-java.yaml
index b3940b283861..a16bae9e8b22 100644
--- a/.github/workflows/test-java.yaml
+++ b/.github/workflows/test-java.yaml
@@ -1,17 +1,15 @@
name: test-java
on:
- push:
- branches:
- - main
pull_request:
paths:
- - "prql-java/**"
+ - "bindings/prql-java/**"
+ - "bindings/prql-lib/**"
- ".github/workflows/test-java.yaml"
workflow_call:
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}-test-java
+ group: ${{ github.workflow }}-${{ github.ref }}-java
cancel-in-progress: true
jobs:
@@ -24,5 +22,5 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Maven test
- working-directory: prql-java/java/
+ working-directory: bindings/prql-java/java/
run: ./mvnw test
diff --git a/.github/workflows/test-js.yaml b/.github/workflows/test-js.yaml
index 4dd0344226c4..8ec0b0158c55 100644
--- a/.github/workflows/test-js.yaml
+++ b/.github/workflows/test-js.yaml
@@ -1,29 +1,26 @@
name: test-js
on:
- push:
- branches:
- - main
pull_request:
paths:
- - "prql-js/**"
+ - "bindings/prql-js/**"
- ".github/workflows/test-js.yaml"
workflow_call:
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
+ group: ${{ github.workflow }}-${{ github.ref }}-js
cancel-in-progress: true
jobs:
test:
- # This is copy & pasted into test-all.yaml
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ubuntu-latest]
+ os: [ubuntu-latest, macos-latest, windows-latest]
+
steps:
- name: ๐ Checkout code
uses: actions/checkout@v3
- uses: ./.github/actions/build-prql-js
- run: npm cit
- working-directory: prql-js
+ working-directory: bindings/prql-js
diff --git a/.github/workflows/test-lib.yaml b/.github/workflows/test-lib.yaml
new file mode 100644
index 000000000000..0e1a7a838cbb
--- /dev/null
+++ b/.github/workflows/test-lib.yaml
@@ -0,0 +1,35 @@
+name: test-lib
+
+on:
+ pull_request:
+ paths:
+ # We also run the tests for the libraries that depend on this, from their workflow files.
+ - "bindings/prql-lib/**"
+ - ".github/workflows/test-lib.yaml"
+ workflow_call:
+
+concurrency:
+ # See notes in `pull-request.yaml`
+ group: ${{ github.workflow }}-${{ github.ref }}-lib
+ cancel-in-progress: true
+
+jobs:
+ test-lib:
+ runs-on: ubuntu-latest
+ steps:
+ - name: ๐ Checkout code
+ uses: actions/checkout@v3
+ - name: ๐ฐ Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ key: 0.6.0-${{ inputs.target_option }}
+ save-if: ${{ github.ref == 'refs/heads/main' }}
+ - name: Build
+ uses: richb-hanover/cargo@v1.1.0
+ with:
+ command: build
+ # Currently requires a release build; would be useful to allow a debug build.
+ args: --release -p prql-lib
+ - name: Run basic C example
+ working-directory: bindings/prql-lib/examples/minimal-c
+ run: make run
diff --git a/.github/workflows/test-php.yaml b/.github/workflows/test-php.yaml
new file mode 100644
index 000000000000..197bfc3477a8
--- /dev/null
+++ b/.github/workflows/test-php.yaml
@@ -0,0 +1,37 @@
+name: test-php
+
+on:
+ pull_request:
+ paths:
+ - "bindings/prql-php/**"
+ - "bindings/prql-lib/**"
+ - ".github/workflows/test-php.yaml"
+ workflow_call:
+
+concurrency:
+ # See notes in `pull-request.yaml`
+ group: ${{ github.workflow }}-${{ github.ref }}-php
+ cancel-in-progress: true
+
+jobs:
+ test:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ steps:
+ - name: ๐ Checkout code
+ uses: actions/checkout@v3
+ - uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ - run: sh build.sh
+ working-directory: bindings/prql-php
+ - name: ๐ฆ Install dependencies using Composer
+ uses: php-actions/composer@v6
+ with:
+ args: --working-dir=bindings/prql-php
+ php_extensions: FFI
+ - name: ๐งช Run tests using PHPUnit
+ run: vendor/bin/phpunit tests
+ working-directory: bindings/prql-php
diff --git a/.github/workflows/test-python.yaml b/.github/workflows/test-python.yaml
index fd00d6c82242..43489999b4c3 100644
--- a/.github/workflows/test-python.yaml
+++ b/.github/workflows/test-python.yaml
@@ -1,12 +1,9 @@
name: test-python
on:
- push:
- branches:
- - main
pull_request:
paths:
- - "prql-python/**"
+ - "bindings/prql-python/**"
- ".github/workflows/test-python.yaml"
workflow_call:
@@ -45,4 +42,4 @@ jobs:
hashFiles('prql-python/requirements.txt') }}
- name: Run tests
shell: bash
- run: nox -s tests -f prql-python/noxfile.py
+ run: nox -s tests -f bindings/prql-python/noxfile.py
diff --git a/.github/workflows/test-rust.yaml b/.github/workflows/test-rust.yaml
index db2271459078..1ca2a4743354 100644
--- a/.github/workflows/test-rust.yaml
+++ b/.github/workflows/test-rust.yaml
@@ -9,19 +9,31 @@ on:
target_option:
type: string
+env:
+ CARGO_TERM_COLOR: always
+
jobs:
- test:
+ test-rust:
runs-on: ${{ inputs.os }}
steps:
- name: ๐ Checkout code
uses: actions/checkout@v3
+ - uses: baptiste0928/cargo-install@next
+ with:
+ crate: wasm-bindgen-cli
+ if: inputs.target_option == '--target=wasm32-unknown-unknown'
+ - uses: baptiste0928/cargo-install@next
+ with:
+ crate: cargo-insta
- name: ๐ฐ Cache
uses: Swatinem/rust-cache@v2
with:
- key: ${{ inputs.os }}-${{ inputs.target_option }}
+ # Based on https://github.com/PRQL/prql/issues/1985, attempting to
+ # reset the cache. If necessary, we could do this on each release and
+ # have this update automatically (there's no variable that contains
+ # the current version unfortunately, though).
+ key: 0.6.0-${{ inputs.target_option }}
save-if: ${{ github.ref == 'refs/heads/main' }}
- - uses: jetli/wasm-bindgen-action@v0.2.0
- if: inputs.target_option == '--target=wasm32-unknown-unknown'
- name: ๐ Clippy
uses: richb-hanover/cargo@v1.1.0
with:
@@ -41,13 +53,12 @@ jobs:
with:
command: test
args: ${{ inputs.target_option }} --no-run --locked
- - uses: baptiste0928/cargo-install@next
- with:
- crate: cargo-insta
- # Only check unreferenced snapshots on the default target tests on ubuntu (maybe
- # there's a nicer approach where we can parameterize one step rather than
- # have two different ones; we welcome a change to simplify this)
- - name: ๐ Test
+ # Only check unreferenced snapshots on the default target tests on ubuntu
+ #
+ # (Maybe there's a nicer approach where we can parameterize one step
+ # rather than have two different ones? We welcome a change to simplify
+ # this.)
+ - name: ๐ Test default
uses: richb-hanover/cargo@v1.1.0
if:
${{ (inputs.target_option != '--target=wasm32-unknown-unknown' &&
@@ -55,7 +66,7 @@ jobs:
with:
command: insta
args: test --unreferenced=auto ${{ inputs.target_option }}
- - name: ๐ Test
+ - name: ๐ Test wasm
uses: richb-hanover/cargo@v1.1.0
if:
${{ ! (inputs.target_option != '--target=wasm32-unknown-unknown' &&
diff --git a/.github/workflows/test-taskfile.yaml b/.github/workflows/test-taskfile.yaml
index 15dcec83ccb3..5a9fe8c3449c 100644
--- a/.github/workflows/test-taskfile.yaml
+++ b/.github/workflows/test-taskfile.yaml
@@ -1,18 +1,14 @@
# Workflow to check that the workflows in Taskfile pass.
-name: taskfile
+name: test-taskfile
on:
- push:
- branches:
- - main
pull_request:
- types: [opened, reopened, synchronize, labeled]
paths:
- Taskfile.yml
- .github/workflows/test-taskfile.yaml
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
+ group: ${{ github.workflow }}-${{ github.ref }}-taskfile
cancel-in-progress: true
jobs:
diff --git a/.gitignore b/.gitignore
index 362d0c3c3c71..702287897cf2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,15 @@
.DS_Store
dist
-target*
+target*/
+*.out
lcov.info
-**/.vscode/settings.json
-**/.vscode/launch.json
-**/.vscode/tasks.json
-**/.idea
+.vscode/settings.json
+.vscode/launch.json
+.vscode/tasks.json
+.idea
/*.prql
_*.prql
@@ -19,3 +20,10 @@ _*.prql
**/node_modules/
.task
+
+# These shouldn't be committed, and cause watchers to re-run when they're
+# created, which we don't want. That said, if ignoring them causes confusion
+# (e.g. folks look at their git status to assess whether there are pending
+# snapshots), we can adjust.
+*.pending-snap
+*.snap.new
diff --git a/.mega-linter.yaml b/.mega-linter.yaml
new file mode 100644
index 000000000000..4235b513c9cd
--- /dev/null
+++ b/.mega-linter.yaml
@@ -0,0 +1,35 @@
+# This MegaLinter config is very experimental stage. Open to changes and updates.
+# https://github.com/PRQL/prql/pull/1974
+
+GITHUB_COMMENT_REPORTER: false
+DISABLE:
+ - RUST
+ - JAVASCRIPT
+ - PYTHON
+DISABLE_LINTERS:
+ - SPELL_CSPELL
+ - CSS_STYLELINT
+ - PHP_PSALM
+ - PHP_PHPSTAN # Disabled for now as we couldn't figure out how to prevent false positives. #2069
+DISABLE_ERRORS_LINTERS:
+ - COPYPASTE_JSCPD
+ - REPOSITORY_TRIVY
+ - REPOSITORY_CHECKOV
+ - REPOSITORY_DEVSKIM
+ - ACTION_ACTIONLINT
+ - BASH_SHELLCHECK
+ - C_CPPLINT
+ - CPP_CPPLINT
+ - DOCKERFILE_HADOLINT
+ - HTML_DJLINT
+ - HTML_HTMLHINT
+ - JAVA_CHECKSTYLE
+ - JAVA_PMD
+ - JSON_JSONLINT
+ - MAKEFILE_CHECKMAKE
+ - MARKDOWN_MARKDOWN_LINK_CHECK
+ - SPELL_MISSPELL
+ - SQL_TSQLLINT
+ - YAML_V8R
+PHP_PHPCS_ARGUMENTS:
+ - --standard=PSR12
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a2623a4cf4ae..f7ae30ed711c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -8,20 +8,20 @@ repos:
- id: check-yaml
- id: mixed-line-ending
- repo: https://github.com/crate-ci/typos
- rev: typos-dict-v0.9.16
+ rev: v1.13.18
hooks:
- id: typos
# https://github.com/crate-ci/typos/issues/347
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-prettier
- rev: v3.0.0-alpha.4
+ rev: v3.0.0-alpha.6
hooks:
- id: prettier
additional_dependencies:
- prettier
- prettier-plugin-go-template
- repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.0.246
+ rev: v0.0.254
hooks:
- id: ruff
- repo: https://github.com/psf/black
@@ -34,7 +34,7 @@ repos:
- id: fmt
- id: clippy
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v1.0.0
+ rev: v1.0.1
hooks:
- id: mypy
additional_dependencies: ["types-PyYAML==6.0.12.4"]
diff --git a/.prettierignore b/.prettierignore
index ca7368fe76a4..e8fe196147ea 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,10 +1,9 @@
*.min.*
-/book/theme/highlight.js
+/web/book/theme/highlight.js
# TODO: move these into content out of layouts
-/website/themes/prql-theme/layouts/partials/codes/
-
-/website/themes/prql-theme/layouts/_default/_markup/render-link.html
+/web/website/themes/prql-theme/layouts/partials/codes/
+/web/website/themes/prql-theme/layouts/_default/_markup/render-link.html
# Ideally prettier would allow blanket gitignores, https://github.com/prettier/prettier/issues/8048
@@ -14,5 +13,5 @@ target/
.mypy_cache
**/build
**/dist
-/book/book
-/website/public
+/web/book/book
+/web/website/public
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 294c08c83ebf..c131f1d28577 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,129 @@
# PRQL Changelog
+## 0.6.1 โ 2022-03-12
+
+0.6.1 is a small release containing an internal refactoring and improved
+bindings for C, PHP & .NET.
+
+This release has 54 commits from 6 contributors. Selected changes:
+
+**Fixes**:
+
+- No longer incorrectly compile to `DISTINCT` when a `take 1` refers to a
+ different set of columns than are in the `group`. (@max-sixty, with thanks to
+ @cottrell, #2109)
+- The version specification of the dependency Chumsky was bumped from `0.9.0` to
+ `0.9.2`. `0.9.0` has a bug that causes an infinite loop. (@eitsupi, #2110)
+
+**Documentation**:
+
+- Add a policy for which bindings are supported / unsupported / nascent
+ (@max-sixty, #2062)
+
+**Integrations**:
+
+- [prql-lib] Added C++ header file. (@vanillajonathan, #2126)
+
+**Internal changes**:
+
+- Many of the items that were in the root of the repo have been aggregated into
+ `web` & `bindings`, simplifying the repo's structure. There's also `grammars`
+ & `packages` (@max-sixty, #2135, #2117, #2121).
+
+## 0.6.0 โ 2022-03-08
+
+0.6.0 introduces a rewritten parser, giving us the ability to dramatically
+improve error messages, renames `switch` to `case` and includes lots of minor
+improvements and fixes. It also introduces `loop`, which compiles to
+`WITH RECURSIVE`, as a highly experimental feature.
+
+There are a few cases of breaking changes, including switching `switch` to
+`case`, in case that's confusing. There are also some minor parsing changes
+outlined below.
+
+This release has 108 commits from 11 contributors. Selected changes:
+
+**Features**:
+
+- Add a (highly experimental) `loop` language feature, which translates to
+ `WITH RECURSIVE`. We expect changes and refinements in upcoming releases.
+ (#1642, @aljazerzen)
+- Rename the experimental `switch` function to `case` given it more closely
+ matches the traditional semantics of `case`. (@max-sixty, #2036)
+- Change the `case` syntax to use `=>` instead of `->` to distinguish it from
+ function syntax.
+- Convert parser from pest to Chumsky (@aljazerzen, #1818)
+ - Improved error messages, and the potential to make even better in the
+ future. Many of these improvements come from error recovery.
+ - String escapes (`\n \t`).
+ - Raw strings that don't escape backslashes.
+ - String interpolations can only contain identifiers and not any expression.
+ - Operator associativity has been changed from right-to-left to left-to-right
+ to be more similar to other conventional languages.
+ - `and` now has a higher precedence than `or` (of same reason as the previous
+ point).
+ - Dates, times and timestamps have stricter parsing rules.
+ - `let`, `func`, `prql`, `case` are now treated as keywords.
+ - Float literals without fraction part are not allowed anymore (`1.`).
+- Add a `--format` option to `prqlc parse` which can return the AST in YAML
+ (@max-sixty, #1962)
+- A new compile target `"sql.any"`. When `"sql.any"` is used as the target of
+ the compile function's option, the target contained in the query header will
+ be used. (@aljazerzen, #1995)
+- Support for SQL parameters with similar syntax (#1957, @aljazerzen)
+- Allow `:` to be elided in timezones, such as `0800` in
+ `@2020-01-01T13:19:55-0800` (@max-sixty, #1991).
+- Add `std.upper` and `std.lower` functions for changing string casing
+ (@Jelenkee, #2019).
+
+**Fixes**:
+
+- `prqlc compile` returns a non-zero exit code for invalid queries. (@max-sixty,
+ #1924)
+- Identifiers can contain any alphabetic unicode characters (@max-sixty, #2003)
+
+**Documentation**:
+
+- Operator precedence (@aljazerzen, #1818)
+- Error messages for invalid queries are displayed in the book (@max-sixty,
+ #2015)
+
+**Integrations**:
+
+- [prql-php] Added PHP bindings. (@vanillajonathan, #1860)
+- [prql-dotnet] Added .NET bindings. (@vanillajonathan, #1917)
+- [prql-lib] Added C header file. (@vanillajonathan, #1879)
+- Added a workflow building a `.deb` on each release. (Note that it's not yet
+ published on each release). (@vanillajonathan, #1883)
+- Added a workflow building a `.rpm` on each release. (Note that it's not yet
+ published on each release). (@vanillajonathan, #1918)
+- Added a workflow building a Snap package on each release. (@vanillajonathan,
+ #1881)
+
+**Internal changes**:
+
+- Test that the output of our nascent autoformatter can be successfully compiled
+ into SQL. Failing examples are now clearly labeled. (@max-sixty, #2016)
+- Definition files have been added to configure
+ [Dev Containers](https://containers.dev/) for Rust development environment.
+ (@eitsupi, #1893, #2025, #2028)
+
+**New Contributors**:
+
+- @linux-china, with #1971
+- @Jelenkee, with #2019
+
+## 0.5.2 โ 2022-02-18
+
+0.5.2 is a tiny release to fix an build issue in yesterday's `prql-js` 0.5.1
+release.
+
+This release has 7 commits from 2 contributors.
+
+**New Contributors**:
+
+- @matthias-Q, with #1873
+
## 0.5.1 โ 2022-02-17
0.5.1 contains a few fixes, and another change to how bindings handle default
@@ -143,7 +267,7 @@ This release has 74 commits from 12 contributors. Selected changes:
## 0.4.0 โ 2022-01-15
-0.4.0 brings lots of new features including `switch`, `select ![]` and numbers
+0.4.0 brings lots of new features including `case`, `select ![]` and numbers
with underscores. We have initial (unpublished) bindings to Elixir. And there's
the usual improvements to fixes & documentation (only a minority are listed
below in this release).
@@ -158,12 +282,12 @@ below in this release).
[tables docs](https://prql-lang.org/book/queries/variables.html) for details.
- _Experimental:_ The
- [`switch`](https://prql-lang.org/book/language-features/switch.html) function
- sets a variable to a value based on one of several expressions (@aljazerzen,
+ [`case`](https://prql-lang.org/book/language-features/case.html) function sets
+ a variable to a value based on one of several expressions (@aljazerzen,
#1278).
```prql
- derive var = switch [
+ derive var = case [
score <= 10 -> "low",
score <= 30 -> "medium",
score <= 70 -> "high",
@@ -187,8 +311,8 @@ below in this release).
```
Check out the
- [`switch` docs](https://prql-lang.org/book/language-features/switch.html) for
- more details.
+ [`case` docs](https://prql-lang.org/book/language-features/case.html) for more
+ details.
- _Experimental:_ Columns can be excluded by name with `select` (@aljazerzen,
#1329)
@@ -627,8 +751,8 @@ improvements:
- More examples on homepage; e.g. `join` & `window`, lots of small docs
improvements
- Automated releases to homebrew (@roG0d )
-- [prql-js](https://github.com/PRQL/prql/tree/main/prql-js) is now a single
- package for node, browsers & webpack (@charlie-sanders )
+- [prql-js](https://github.com/PRQL/prql/tree/main/bindings/prql-js) is now a
+ single package for Node, browsers & webpack (@charlie-sanders )
- Parsing has some fixes, including `>=` and leading underscores in idents
(@mklopets )
- Ranges receive correct syntax highlighting (@max-sixty )
diff --git a/Cargo.lock b/Cargo.lock
index bc1e658fc3ff..9ab3d5af3278 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -17,15 +17,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-[[package]]
-name = "ahash"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217"
-dependencies = [
- "const-random",
-]
-
[[package]]
name = "ahash"
version = "0.7.6"
@@ -39,9 +30,9 @@ dependencies = [
[[package]]
name = "ahash"
-version = "0.8.2"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf6ccdb167abbf410dcb915cabd428929d7f6a04980b54a11f26a39f1c7f7107"
+checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
dependencies = [
"cfg-if",
"const-random",
@@ -76,9 +67,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
[[package]]
name = "anyhow"
-version = "1.0.68"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
+checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"
dependencies = [
"backtrace",
]
@@ -104,7 +95,7 @@ version = "32.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87d948f553cf556656eb89265700258e1032d26fec9b7920cd20319336e06afd"
dependencies = [
- "ahash 0.8.2",
+ "ahash 0.8.3",
"arrow-arith",
"arrow-array",
"arrow-buffer",
@@ -130,7 +121,7 @@ dependencies = [
"arrow-data",
"arrow-schema",
"chrono",
- "half 2.1.0",
+ "half 2.2.1",
"num",
]
@@ -140,13 +131,13 @@ version = "32.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fe66ec388d882a61fff3eb613b5266af133aa08a3318e5e493daf0f5c1696cb"
dependencies = [
- "ahash 0.8.2",
+ "ahash 0.8.3",
"arrow-buffer",
"arrow-data",
"arrow-schema",
"chrono",
- "half 2.1.0",
- "hashbrown 0.13.1",
+ "half 2.2.1",
+ "hashbrown 0.13.2",
"num",
]
@@ -156,7 +147,7 @@ version = "32.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ef967dadbccd4586ec8d7aab27d7033ecb5dfae8a605c839613039eac227bda"
dependencies = [
- "half 2.1.0",
+ "half 2.2.1",
"num",
]
@@ -184,7 +175,7 @@ checksum = "ee0c0e3c5d3b80be8f267f4b2af714c08cad630569be01a8379cfe27b4866495"
dependencies = [
"arrow-buffer",
"arrow-schema",
- "half 2.1.0",
+ "half 2.2.1",
"num",
]
@@ -208,13 +199,13 @@ version = "32.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e064ac4e64960ebfbe35f218f5e7d9dc9803b59c2e56f611da28ce6d008f839e"
dependencies = [
- "ahash 0.8.2",
+ "ahash 0.8.3",
"arrow-array",
"arrow-buffer",
"arrow-data",
"arrow-schema",
- "half 2.1.0",
- "hashbrown 0.13.1",
+ "half 2.2.1",
+ "hashbrown 0.13.2",
]
[[package]]
@@ -253,9 +244,9 @@ dependencies = [
[[package]]
name = "async-trait"
-version = "0.1.60"
+version = "0.1.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3"
+checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2"
dependencies = [
"proc-macro2",
"quote",
@@ -317,19 +308,19 @@ dependencies = [
[[package]]
name = "borsh"
-version = "0.9.3"
+version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa"
+checksum = "40f9ca3698b2e4cb7c15571db0abc5551dca417a21ae8140460b50309bb2cc62"
dependencies = [
"borsh-derive",
- "hashbrown 0.11.2",
+ "hashbrown 0.13.2",
]
[[package]]
name = "borsh-derive"
-version = "0.9.3"
+version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775"
+checksum = "598b3eacc6db9c3ee57b22707ad8f6a8d2f6d442bfe24ffeb8cbb70ca59e6a35"
dependencies = [
"borsh-derive-internal",
"borsh-schema-derive-internal",
@@ -340,9 +331,9 @@ dependencies = [
[[package]]
name = "borsh-derive-internal"
-version = "0.9.3"
+version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065"
+checksum = "186b734fa1c9f6743e90c95d7233c9faab6360d1a96d4ffa19d9cfd1e9350f8a"
dependencies = [
"proc-macro2",
"quote",
@@ -351,9 +342,9 @@ dependencies = [
[[package]]
name = "borsh-schema-derive-internal"
-version = "0.9.3"
+version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0"
+checksum = "99b7ff1008316626f485991b960ade129253d4034014616b94f309a15366cc49"
dependencies = [
"proc-macro2",
"quote",
@@ -362,20 +353,21 @@ dependencies = [
[[package]]
name = "bstr"
-version = "0.2.17"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
+checksum = "5ffdb39cb703212f3c11973452c2861b972f757b021158f3516ba10f2fa8b2c1"
dependencies = [
- "lazy_static",
"memchr",
+ "once_cell",
"regex-automata",
+ "serde",
]
[[package]]
name = "bumpalo"
-version = "3.11.1"
+version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
+checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
[[package]]
name = "bytecheck"
@@ -406,9 +398,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "bytes"
-version = "1.3.0"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c"
+checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
[[package]]
name = "cast"
@@ -418,9 +410,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
-version = "1.0.78"
+version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
+checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
dependencies = [
"jobserver",
]
@@ -454,11 +446,12 @@ dependencies = [
[[package]]
name = "chumsky"
-version = "0.8.0"
+version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4"
+checksum = "23170228b96236b5a7299057ac284a321457700bc8c41a4476052f0f4ba5349d"
dependencies = [
- "ahash 0.3.8",
+ "hashbrown 0.12.3",
+ "stacker",
]
[[package]]
@@ -502,13 +495,13 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.1.1"
+version = "4.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2"
+checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3"
dependencies = [
"bitflags",
"clap_derive",
- "clap_lex 0.3.0",
+ "clap_lex 0.3.2",
"is-terminal",
"once_cell",
"strsim",
@@ -518,11 +511,11 @@ dependencies = [
[[package]]
name = "clap_complete"
-version = "4.0.6"
+version = "4.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7b3c9eae0de7bf8e3f904a5e40612b21fb2e2e566456d177809a48b892d24da"
+checksum = "0012995dc3a54314f4710f5631d74767e73c534b8757221708303e48eef7a19b"
dependencies = [
- "clap 4.1.1",
+ "clap 4.1.6",
]
[[package]]
@@ -549,9 +542,9 @@ dependencies = [
[[package]]
name = "clap_lex"
-version = "0.3.0"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
+checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09"
dependencies = [
"os_str_bytes",
]
@@ -562,9 +555,9 @@ version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94b38784f05c5e908bb8751e9b9f29fbcd470f636c0d0a76a0f90c0c823f3b68"
dependencies = [
- "clap 4.1.1",
+ "clap 4.1.6",
"libc",
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -616,9 +609,9 @@ dependencies = [
[[package]]
name = "comfy-table"
-version = "6.1.3"
+version = "6.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e621e7e86c46fd8a14c32c6ae3cb95656621b4743a27d0cffedb831d46e7ad21"
+checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d"
dependencies = [
"strum",
"strum_macros",
@@ -627,21 +620,21 @@ dependencies = [
[[package]]
name = "compile-files"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"prql-compiler",
]
[[package]]
name = "console"
-version = "0.15.4"
+version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9b6515d269224923b26b5febea2ed42b2d5f2ce37284a4dd670fedd6cb8347a"
+checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60"
dependencies = [
"encode_unicode",
"lazy_static",
"libc",
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -819,9 +812,9 @@ dependencies = [
[[package]]
name = "cxx"
-version = "1.0.85"
+version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd"
+checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62"
dependencies = [
"cc",
"cxxbridge-flags",
@@ -831,9 +824,9 @@ dependencies = [
[[package]]
name = "cxx-build"
-version = "1.0.85"
+version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0"
+checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690"
dependencies = [
"cc",
"codespan-reporting",
@@ -846,15 +839,15 @@ dependencies = [
[[package]]
name = "cxxbridge-flags"
-version = "1.0.85"
+version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59"
+checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf"
[[package]]
name = "cxxbridge-macro"
-version = "1.0.85"
+version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6"
+checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892"
dependencies = [
"proc-macro2",
"quote",
@@ -899,9 +892,9 @@ dependencies = [
[[package]]
name = "either"
-version = "1.8.0"
+version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
+checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]]
name = "encode_unicode"
@@ -921,19 +914,6 @@ dependencies = [
"syn",
]
-[[package]]
-name = "env_logger"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
-dependencies = [
- "atty",
- "humantime",
- "log",
- "regex",
- "termcolor",
-]
-
[[package]]
name = "env_logger"
version = "0.10.0"
@@ -992,23 +972,23 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
[[package]]
name = "fastrand"
-version = "1.8.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
+checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
[[package]]
name = "filetime"
-version = "0.2.19"
+version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9"
+checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -1037,9 +1017,9 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.25"
+version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed"
+checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5"
dependencies = [
"futures-core",
"futures-sink",
@@ -1047,15 +1027,15 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.25"
+version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac"
+checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608"
[[package]]
name = "futures-macro"
-version = "0.3.25"
+version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d"
+checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70"
dependencies = [
"proc-macro2",
"quote",
@@ -1064,21 +1044,21 @@ dependencies = [
[[package]]
name = "futures-sink"
-version = "0.3.25"
+version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9"
+checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364"
[[package]]
name = "futures-task"
-version = "0.3.25"
+version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea"
+checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366"
[[package]]
name = "futures-util"
-version = "0.3.25"
+version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6"
+checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1"
dependencies = [
"futures-core",
"futures-macro",
@@ -1121,15 +1101,15 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.27.0"
+version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793"
+checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
[[package]]
name = "globset"
-version = "0.4.9"
+version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a"
+checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc"
dependencies = [
"aho-corasick",
"bstr",
@@ -1146,9 +1126,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
[[package]]
name = "half"
-version = "2.1.0"
+version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad6a9459c9c30b177b925162351f97e7d967c7ea8bab3b8352805327daf45554"
+checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0"
dependencies = [
"crunchy",
"num-traits",
@@ -1168,15 +1148,6 @@ dependencies = [
"thiserror",
]
-[[package]]
-name = "hashbrown"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
-dependencies = [
- "ahash 0.7.6",
-]
-
[[package]]
name = "hashbrown"
version = "0.12.3"
@@ -1188,9 +1159,12 @@ dependencies = [
[[package]]
name = "hashbrown"
-version = "0.13.1"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038"
+checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
+dependencies = [
+ "ahash 0.8.3",
+]
[[package]]
name = "hashlink"
@@ -1203,9 +1177,9 @@ dependencies = [
[[package]]
name = "heck"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
@@ -1225,6 +1199,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "hermit-abi"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
+
[[package]]
name = "hmac"
version = "0.12.1"
@@ -1292,9 +1272,9 @@ dependencies = [
[[package]]
name = "indoc"
-version = "1.0.8"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da2d6f23ffea9d7e76c53eee25dfb67bcd8fde7f1198b0855350698c9f07c780"
+checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306"
[[package]]
name = "inotify"
@@ -1343,24 +1323,24 @@ dependencies = [
[[package]]
name = "io-lifetimes"
-version = "1.0.3"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
+checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
dependencies = [
"libc",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
name = "is-terminal"
-version = "0.4.2"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
+checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857"
dependencies = [
- "hermit-abi 0.2.6",
+ "hermit-abi 0.3.1",
"io-lifetimes",
"rustix",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -1508,9 +1488,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.138"
+version = "0.2.139"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8"
+checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
[[package]]
name = "libduckdb-sys"
@@ -1600,15 +1580,15 @@ dependencies = [
[[package]]
name = "mdbook"
-version = "0.4.25"
+version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d1ed28d5903dde77bd5182645078a37ee57014cac6ccb2d54e1d6496386648e4"
+checksum = "0f387adfd85d2eeebe3d47d67b1e3f8c9d83ef327582558c5ca88f78d171e73a"
dependencies = [
"anyhow",
"chrono",
- "clap 4.1.1",
+ "clap 4.1.6",
"clap_complete",
- "env_logger 0.10.0",
+ "env_logger",
"handlebars",
"log",
"memchr",
@@ -1626,10 +1606,10 @@ dependencies = [
[[package]]
name = "mdbook-prql"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"anyhow",
- "clap 4.1.1",
+ "clap 4.1.6",
"globset",
"insta",
"itertools",
@@ -1669,6 +1649,15 @@ dependencies = [
"autocfg",
]
+[[package]]
+name = "minijinja"
+version = "0.30.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f95c8f0999f88dd509934824ce03582ffbbcabf8af6484107572618732660c54"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "minimal-lexical"
version = "0.2.1"
@@ -1686,21 +1675,21 @@ dependencies = [
[[package]]
name = "mio"
-version = "0.8.5"
+version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de"
+checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
dependencies = [
"libc",
"log",
"wasi 0.11.0+wasi-snapshot-preview1",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
name = "nom"
-version = "7.1.1"
+version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
@@ -1721,7 +1710,7 @@ dependencies = [
"libc",
"mio",
"walkdir",
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -1751,9 +1740,9 @@ dependencies = [
[[package]]
name = "num-complex"
-version = "0.4.2"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19"
+checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d"
dependencies = [
"num-traits",
]
@@ -1822,18 +1811,18 @@ dependencies = [
[[package]]
name = "object"
-version = "0.30.0"
+version = "0.30.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb"
+checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439"
dependencies = [
"memchr",
]
[[package]]
name = "once_cell"
-version = "1.17.0"
+version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
+checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "oorandom"
@@ -1843,9 +1832,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
[[package]]
name = "opener"
-version = "0.5.0"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ea3ebcd72a54701f56345f16785a6d3ac2df7e986d273eb4395c0b01db17952"
+checksum = "293c15678e37254c15bd2f092314abb4e51d7fdde05c2021279c12631b54f005"
dependencies = [
"bstr",
"winapi",
@@ -1884,15 +1873,15 @@ dependencies = [
[[package]]
name = "parking_lot_core"
-version = "0.9.5"
+version = "0.9.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba"
+checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -1903,9 +1892,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "pest"
-version = "2.5.1"
+version = "2.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0"
+checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660"
dependencies = [
"thiserror",
"ucd-trie",
@@ -1913,9 +1902,9 @@ dependencies = [
[[package]]
name = "pest_derive"
-version = "2.5.1"
+version = "2.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdc078600d06ff90d4ed238f0119d84ab5d43dbaad278b0e33a8820293b32344"
+checksum = "2ac3922aac69a40733080f53c1ce7f91dcf57e1a5f6c52f421fadec7fbdc4b69"
dependencies = [
"pest",
"pest_generator",
@@ -1923,9 +1912,9 @@ dependencies = [
[[package]]
name = "pest_generator"
-version = "2.5.1"
+version = "2.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28a1af60b1c4148bb269006a750cff8e2ea36aff34d2d96cf7be0b14d1bed23c"
+checksum = "d06646e185566b5961b4058dd107e0a7f56e77c3f484549fb119867773c0f202"
dependencies = [
"pest",
"pest_meta",
@@ -1936,13 +1925,13 @@ dependencies = [
[[package]]
name = "pest_meta"
-version = "2.5.1"
+version = "2.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20"
+checksum = "e6f60b2ba541577e2a0c307c8f39d1439108120eb7903adeb6497fa880c59616"
dependencies = [
"once_cell",
"pest",
- "sha1",
+ "sha2",
]
[[package]]
@@ -2111,16 +2100,16 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
[[package]]
name = "proc-macro2"
-version = "1.0.49"
+version = "1.0.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
+checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
dependencies = [
"unicode-ident",
]
[[package]]
name = "prql"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"prql-compiler",
"rustler",
@@ -2128,7 +2117,7 @@ dependencies = [
[[package]]
name = "prql-compiler"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"anyhow",
"ariadne",
@@ -2144,8 +2133,6 @@ dependencies = [
"lazy_static",
"log",
"once_cell",
- "pest",
- "pest_derive",
"postgres",
"pretty_assertions",
"regex",
@@ -2161,7 +2148,7 @@ dependencies = [
[[package]]
name = "prql-compiler-macros"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"prql-compiler",
"syn",
@@ -2169,7 +2156,7 @@ dependencies = [
[[package]]
name = "prql-java"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"jni",
"prql-compiler",
@@ -2177,7 +2164,7 @@ dependencies = [
[[package]]
name = "prql-js"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"console_error_panic_hook",
"prql-compiler",
@@ -2187,7 +2174,7 @@ dependencies = [
[[package]]
name = "prql-lib"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"libc",
"prql-compiler",
@@ -2196,7 +2183,7 @@ dependencies = [
[[package]]
name = "prql-python"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"insta",
"prql-compiler",
@@ -2206,24 +2193,36 @@ dependencies = [
[[package]]
name = "prqlc"
-version = "0.5.1"
+version = "0.6.1"
dependencies = [
"anyhow",
"ariadne",
"atty",
- "clap 4.1.1",
+ "clap 4.1.6",
"clio",
"color-eyre",
- "env_logger 0.9.3",
+ "env_logger",
"insta",
"itertools",
+ "minijinja",
"notify",
"prql-compiler",
+ "regex",
+ "serde",
"serde_json",
"serde_yaml",
"walkdir",
]
+[[package]]
+name = "psm"
+version = "0.1.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874"
+dependencies = [
+ "cc",
+]
+
[[package]]
name = "ptr_meta"
version = "0.1.4"
@@ -2267,9 +2266,9 @@ dependencies = [
[[package]]
name = "pyo3"
-version = "0.18.0"
+version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccd4149c8c3975099622b4e1962dac27565cf5663b76452c3e2b66e0b6824277"
+checksum = "06a3d8e8a46ab2738109347433cb7b96dffda2e4a218b03ef27090238886b147"
dependencies = [
"cfg-if",
"indoc",
@@ -2284,9 +2283,9 @@ dependencies = [
[[package]]
name = "pyo3-build-config"
-version = "0.18.0"
+version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cd09fe469834db21ee60e0051030339e5d361293d8cb5ec02facf7fdcf52dbf"
+checksum = "75439f995d07ddfad42b192dfcf3bc66a7ecfd8b4a1f5f6f046aa5c2c5d7677d"
dependencies = [
"once_cell",
"target-lexicon",
@@ -2294,9 +2293,9 @@ dependencies = [
[[package]]
name = "pyo3-ffi"
-version = "0.18.0"
+version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c427c9a96b9c5b12156dbc11f76b14f49e9aae8905ca783ea87c249044ef137"
+checksum = "839526a5c07a17ff44823679b68add4a58004de00512a95b6c1c98a6dcac0ee5"
dependencies = [
"libc",
"pyo3-build-config",
@@ -2304,9 +2303,9 @@ dependencies = [
[[package]]
name = "pyo3-macros"
-version = "0.18.0"
+version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16b822bbba9d60630a44d2109bc410489bb2f439b33e3a14ddeb8a40b378a7c4"
+checksum = "bd44cf207476c6a9760c4653559be4f206efafb924d3e4cbf2721475fc0d6cc5"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
@@ -2316,9 +2315,9 @@ dependencies = [
[[package]]
name = "pyo3-macros-backend"
-version = "0.18.0"
+version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84ae898104f7c99db06231160770f3e40dad6eb9021daddc0fedfa3e41dff10a"
+checksum = "dc1f43d8e30460f36350d18631ccf85ded64c059829208fe680904c65bcd0a4c"
dependencies = [
"proc-macro2",
"quote",
@@ -2376,9 +2375,9 @@ dependencies = [
[[package]]
name = "rayon-core"
-version = "1.10.1"
+version = "1.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3"
+checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
@@ -2397,9 +2396,9 @@ dependencies = [
[[package]]
name = "regex"
-version = "1.7.0"
+version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
+checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
dependencies = [
"aho-corasick",
"memchr",
@@ -2429,18 +2428,18 @@ dependencies = [
[[package]]
name = "rend"
-version = "0.3.6"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95"
+checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab"
dependencies = [
"bytecheck",
]
[[package]]
name = "rkyv"
-version = "0.7.39"
+version = "0.7.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15"
+checksum = "c30f1d45d9aa61cbc8cd1eb87705470892289bb2d01943e7803b873a57404dc3"
dependencies = [
"bytecheck",
"hashbrown 0.12.3",
@@ -2452,9 +2451,9 @@ dependencies = [
[[package]]
name = "rkyv_derive"
-version = "0.7.39"
+version = "0.7.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6eaedadc88b53e36dd32d940ed21ae4d850d5916f2581526921f553a72ac34c4"
+checksum = "ff26ed6c7c4dfc2aa9480b86a60e3c7233543a270a680e10758a507c5a4ce476"
dependencies = [
"proc-macro2",
"quote",
@@ -2478,9 +2477,9 @@ dependencies = [
[[package]]
name = "rust_decimal"
-version = "1.27.0"
+version = "1.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33c321ee4e17d2b7abe12b5d20c1231db708dd36185c8a21e9de5fed6da4dbe9"
+checksum = "e13cf35f7140155d02ba4ec3294373d513a3c7baa8364c162b030e33c61520a8"
dependencies = [
"arrayvec",
"borsh",
@@ -2502,16 +2501,16 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
[[package]]
name = "rustix"
-version = "0.36.5"
+version = "0.36.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588"
+checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -2603,18 +2602,18 @@ dependencies = [
[[package]]
name = "serde"
-version = "1.0.151"
+version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0"
+checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.151"
+version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8"
+checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
dependencies = [
"proc-macro2",
"quote",
@@ -2623,9 +2622,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.91"
+version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
+checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
dependencies = [
"itoa",
"ryu",
@@ -2634,9 +2633,9 @@ dependencies = [
[[package]]
name = "serde_yaml"
-version = "0.9.16"
+version = "0.9.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92b5b431e8907b50339b51223b97d102db8d987ced36f6e4d03621db9316c834"
+checksum = "8fb06d4b6cdaef0e0c51fa881acb721bed3c924cfaa71d9c94a3b771dfdf6567"
dependencies = [
"indexmap",
"itoa",
@@ -2645,17 +2644,6 @@ dependencies = [
"unsafe-libyaml",
]
-[[package]]
-name = "sha1"
-version = "0.10.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
[[package]]
name = "sha2"
version = "0.10.6"
@@ -2696,9 +2684,9 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
[[package]]
name = "slab"
-version = "0.4.7"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
+checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
dependencies = [
"autocfg",
]
@@ -2732,14 +2720,27 @@ dependencies = [
[[package]]
name = "sqlparser"
-version = "0.30.0"
+version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db67dc6ef36edb658196c3fef0464a80b53dbbc194a904e81f9bd4190f9ecc5b"
+checksum = "0366f270dbabb5cc2e4c88427dc4c08bba144f81e32fbd459a013f26a4d16aa0"
dependencies = [
"log",
"serde",
]
+[[package]]
+name = "stacker"
+version = "0.1.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce"
+dependencies = [
+ "cc",
+ "cfg-if",
+ "libc",
+ "psm",
+ "winapi",
+]
+
[[package]]
name = "static_assertions"
version = "1.1.0"
@@ -2803,9 +2804,9 @@ dependencies = [
[[package]]
name = "target-lexicon"
-version = "0.12.5"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d"
+checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
[[package]]
name = "tempfile"
@@ -2823,21 +2824,21 @@ dependencies = [
[[package]]
name = "termcolor"
-version = "1.1.3"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
]
[[package]]
name = "terminal_size"
-version = "0.2.3"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb20089a8ba2b69debd491f8d2d023761cbf196e999218c591fa1e7e15a21907"
+checksum = "4c9afddd2cec1c0909f06b00ef33f94ab2cc0578c4a610aa208ddfec8aa2b43a"
dependencies = [
"rustix",
- "windows-sys",
+ "windows-sys 0.45.0",
]
[[package]]
@@ -2868,10 +2869,11 @@ dependencies = [
[[package]]
name = "thread_local"
-version = "1.1.4"
+version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
+checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152"
dependencies = [
+ "cfg-if",
"once_cell",
]
@@ -2916,9 +2918,9 @@ dependencies = [
[[package]]
name = "tinyvec_macros"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
@@ -2933,7 +2935,7 @@ dependencies = [
"mio",
"pin-project-lite",
"socket2",
- "windows-sys",
+ "windows-sys 0.42.0",
]
[[package]]
@@ -2962,9 +2964,9 @@ dependencies = [
[[package]]
name = "tokio-util"
-version = "0.7.4"
+version = "0.7.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740"
+checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2"
dependencies = [
"bytes",
"futures-core",
@@ -2976,9 +2978,9 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.5.10"
+version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f"
+checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
dependencies = [
"serde",
]
@@ -3033,9 +3035,9 @@ dependencies = [
[[package]]
name = "trash"
-version = "3.0.0"
+version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f74274f95c7e7340d7c5bcd4863af87a9ed6a117cf73cf483c71cb4d744a948"
+checksum = "a27b2a127810fceb959593bbc6c7b8e0282c2d318d76f0749252197c52a1dd0c"
dependencies = [
"chrono",
"libc",
@@ -3070,9 +3072,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
-version = "0.3.8"
+version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
+checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58"
[[package]]
name = "unicode-ident"
@@ -3313,9 +3315,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
-version = "0.43.0"
+version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244"
+checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.42.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
@@ -3328,9 +3339,18 @@ dependencies = [
[[package]]
name = "windows-sys"
-version = "0.42.0"
+version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
+checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.42.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
@@ -3343,45 +3363,45 @@ dependencies = [
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
+checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
+checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
[[package]]
name = "windows_i686_gnu"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
+checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
[[package]]
name = "windows_i686_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
+checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
+checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
+checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.42.0"
+version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
+checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
[[package]]
name = "yaml-rust"
diff --git a/Cargo.toml b/Cargo.toml
index b51460ce07fc..30d13c22c079 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,32 +1,38 @@
[workspace]
members = [
- "prql-compiler",
- "prql-compiler/examples/compile-files",
- "prql-compiler/prql-compiler-macros",
- "prql-compiler/prqlc",
- "prql-java",
- "prql-lib",
- "prql-js",
- "prql-python",
- "book",
- "prql-elixir/native/prql",
+ # The main crate
+ "prql-compiler", #
+ # The CLI
+ "prql-compiler/prqlc", #
+ # Macros
+ "prql-compiler/prql-compiler-macros", #
+ # An example
+ "prql-compiler/examples/compile-files", #
+ # Bindings
+ "bindings/prql-elixir/native/prql",
+ "bindings/prql-java",
+ "bindings/prql-js",
+ "bindings/prql-lib",
+ "bindings/prql-python", #
+ # The book / docs
+ "web/book",
]
# Note we don't have a `default-members = ["prql-compiler"]`, since that causes
# commands like `cargo test` to only run tests from the default package. And
# `cargo insta test` doesn't have a `--workspace` flag.
+resolver = "2"
[workspace.package]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/PRQL/prql"
rust-version = "1.65.0"
-version = "0.5.1"
+version = "0.6.1"
[profile.release.package.prql-js]
-# Tell `rustc` to optimize for small code size.
+# Tell `rust-js` to optimize for small code size.
opt-level = "s"
[workspace.metadata.release]
allow-branch = ["*"]
consolidate-commits = true
-pre-release-commit-message = "chore: Release {{version}}"
diff --git a/Dockerfile b/Dockerfile
index 98050395e45e..f97fd15bfcb5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -45,10 +45,10 @@ RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/loc
# ========= Set up workdir & copy the taskfile =========
WORKDIR /src
-COPY Taskfile.yml .
+COPY Taskfile.cargo-tools.yml .
# ========= Install cargo-tools =========
-RUN task install-cargo-tools
+RUN task -t Taskfile.cargo-tools.yml install
# TODO: currently this doesn't support doing things like running the playground,
# since we don't install hugo & node. Default `apt` doesn't install up-to-date
diff --git a/README.md b/README.md
index f7b835a6efa8..cd843393f16a 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[![Website](https://img.shields.io/badge/INTRO-WEB-blue?style=for-the-badge)](https://prql-lang.org)
-[![Playground](https://img.shields.io/badge/INTRO-PLAYGROUND-blue?style=for-the-badge)](https://prql-lang.org/book)
+[![Playground](https://img.shields.io/badge/INTRO-PLAYGROUND-blue?style=for-the-badge)](https://prql-lang.org/playground)
[![Language Docs](https://img.shields.io/badge/DOCS-BOOK-blue?style=for-the-badge)](https://prql-lang.org/book)
[![Discord](https://img.shields.io/discord/936728116712316989?label=discord%20chat&style=for-the-badge)](https://discord.gg/eQcfaCmsNc)
diff --git a/Taskfile.cargo-tools.yml b/Taskfile.cargo-tools.yml
new file mode 100644
index 000000000000..814e4108fece
--- /dev/null
+++ b/Taskfile.cargo-tools.yml
@@ -0,0 +1,19 @@
+# yaml-language-server: $schema=https://json.schemastore.org/taskfile.json
+
+version: 3
+
+tasks:
+ install:
+ # factored this out because it takes a long time to build
+ desc: Install cargo tools for PRQL development.
+ cmds:
+ # `--locked` installs from the underlying lock files (which is not the
+ # default?!)
+ - cargo install --locked bacon cargo-audit cargo-insta cargo-release
+ default-target mdbook mdbook-admonish mdbook-toc wasm-bindgen-cli
+ wasm-pack
+ # Can't install atm with `--locked`
+ - cargo install mdbook-footnote
+ - cmd: |
+ [ "$(which cargo-insta)" ] || echo "๐ด Can't find a binary that cargo just installed. Is the cargo bin path (generally at ~/.cargo/bin) on the \$PATH?"
+ silent: true
diff --git a/Taskfile.yml b/Taskfile.yml
index bcdf31a59a4b..ccce977c79f6 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -11,6 +11,9 @@
version: "3"
+includes:
+ cargo-tools: ./Taskfile.cargo-tools.yml
+
vars:
# Keep in sync with .vscode/extensions.json
vscode_extensions: |
@@ -38,7 +41,7 @@ tasks:
desc: Install tools for PRQL development.
cmds:
- - task: install-cargo-tools
+ - task: cargo-tools:install
- task: install-brew-dependencies
- task: install-maturin
- task: install-pre-commit
@@ -54,18 +57,9 @@ tasks:
install-cargo-tools:
# factored this out because it takes a long time to build
- desc: Install cargo tools for PRQL development.
- cmds:
- # `--locked` installs from the underlying lock files (which is not the
- # default?!)
- - cargo install --locked cargo-audit cargo-insta cargo-release
- default-target mdbook mdbook-admonish mdbook-toc wasm-bindgen-cli
- wasm-pack
- # Can't install atm with `--locked`
- - cargo install mdbook-footnote
- - cmd: |
- [ "$(which default-target)" ] || echo "๐ด Can't find a binary that cargo just installed. Is the cargo bin path (generally at ~/.cargo/bin) on the \$PATH?"
- silent: true
+ desc: Alias of `cargo-tools:install`
+ deps:
+ - cargo-tools:install
install-maturin:
desc: Install maturin.
@@ -151,17 +145,9 @@ tasks:
Build everything.
Running this isn't required when developing; it's for caching or as a reference.
- vars:
- default_target:
- sh: default-target
- targets: |
- {{ .default_target }}
- wasm32-unknown-unknown
cmds:
- - |
- {{ range ( .targets | trim | splitLines ) -}}
- cargo build --all-targets --target={{.}}
- {{ end -}}
+ - cargo build --all-targets --target=wasm32-unknown-unknown
+ - cargo build --all-targets
- task: build-web
test-all:
@@ -177,14 +163,10 @@ tasks:
- task: test-rust
- task: build-all
- task: test-js
- - task: test-elixir
- pre-commit run -a
test-rust:
desc: Test all rust code, accepting snapshots.
- vars:
- default_target:
- sh: default-target
# Commenting out the ability to watch, since Task seems to trip over itself,
# starting a new process before the old one has finished when a process
# changes output files.
@@ -203,25 +185,16 @@ tasks:
# - "**/*.md"
# - "**/*.toml"
# - "**/*.lock"
- # - "**/*.pest"
# - "**/*.snap"
cmds:
- # We run this `snapshot` first for the reasons given in
- # `parser::test_parse_pipeline_parse_tree`. Ideally we would a) retain
- # examples in the documentation (inc. tested), b) not rely on falliable
- # tests to extract them, which include compiling prql-compiler, c) not
- # fail other compilation steps if they can't be extracted.
- - cargo insta test --accept -p mdbook-prql --test snapshot
- --target={{.default_target}}
# Only delete unreferenced snapshots on the default target โ lots are
# excluded under wasm. Note that this will also over-delete on Windows.
# Note that we need to pass the target explicitly to manage
# https://github.com/rust-lang/cargo/issues/8899
- - cargo insta test --accept --target={{.default_target}}
- --unreferenced=auto
+ - cargo insta test --accept --unreferenced=auto
- cargo insta test --accept --target=wasm32-unknown-unknown
# We build the book too, because that acts as a test
- - cd book && mdbook build
+ - cd web/book && mdbook build
test-rust-fast:
desc: Test prql-compiler's unit tests.
@@ -244,14 +217,13 @@ tasks:
# by `--accept` and task not interrupting existing runs, so all files go
# to `.snap`s which match the generated output?).
- "prql-compiler/**/*.rs"
- - "prql-compiler/**/*.pest"
- "prql-compiler/**/*.snap"
cmds:
- - cargo insta test --accept -p prql-compiler --lib
- --target=$(default-target)
+ - cargo insta test --accept -p prql-compiler --lib -- --quiet
build-web:
desc: Build the website, including the book & playground.
+ dir: web
cmds:
- cd website && hugo --minify
- cd book && mdbook build
@@ -276,30 +248,31 @@ tasks:
- npm run build
- npm cit
- test-elixir:
- dir: prql-elixir
- cmds:
- # We could move this line into an `install` task
- - mix local.hex --force
- - mix deps.get --force
- - mix compile
- - mix test
+ # Currently disabled; see prql-elixir/README.md for details
+ # test-elixir:
+ # dir: prql-elixir
+ # cmds:
+ # # We could move this line into an `install` task
+ # - mix local.hex --force
+ # - mix deps.get --force
+ # - mix compile
+ # - mix test
run-website:
desc: Build & serve the static website.
- dir: website
+ dir: web/website
cmds:
- hugo server
run-book:
desc: Build & serve the book.
- dir: book
+ dir: web/book
cmds:
- mdbook serve --port=3000
run-playground:
desc: Build & serve the playground.
- dir: playground
+ dir: web/playground
cmds:
# Must set `install-links=false` in the playground's `npm install` to
# install prql-js as the regular dependency, instead of creating a
diff --git a/_typos.toml b/_typos.toml
index 1480bde0ec83..85153656cd55 100644
--- a/_typos.toml
+++ b/_typos.toml
@@ -1,7 +1,11 @@
[files]
extend-exclude = [
- "book/theme/highlight.js",
+ "web/book/theme/highlight.js",
"prql-compiler/tests/integration/data/",
- "website/themes/prql-theme/static/plugins/bootstrap",
- "website/themes/prql-theme/static/plugins/highlight/highlight.min.js",
+ "web/website/themes/prql-theme/static/plugins/bootstrap",
+ "web/website/themes/prql-theme/static/plugins/highlight/highlight.min.js",
]
+
+[default.extend-words]
+# Java test framework
+testng = "testng"
diff --git a/bacon.toml b/bacon.toml
new file mode 100644
index 000000000000..8b65fac4e6d6
--- /dev/null
+++ b/bacon.toml
@@ -0,0 +1,63 @@
+# Initial bacon config file; edits and contributions welcome.
+
+default_job = "check"
+
+# PRQL additions
+[jobs.test-fast]
+command = ['cargo', 'insta', 'test', '--accept', "--color=always", "-p=prql-compiler", "--lib"]
+watch = ["tests", "benches", "examples"]
+
+[jobs.test]
+command = ['cargo', 'insta', 'test', '--accept', "--color=always", "--unreferenced=auto"]
+watch = ["tests", "benches", "examples"]
+
+# Standard tasks
+
+[jobs.check]
+command = ["cargo", "check", "--color", "always"]
+need_stdout = false
+watch = ["tests", "benches", "examples"]
+
+[jobs.check-all]
+command = ["cargo", "check", "--all-targets", "--color", "always"]
+need_stdout = false
+watch = ["tests", "benches", "examples"]
+
+[jobs.clippy]
+command = ["cargo", "clippy", "--all-targets", "--color", "always"]
+need_stdout = false
+watch = ["tests", "benches", "examples"]
+
+[jobs.doc]
+command = ["cargo", "doc", "--color", "always", "--no-deps"]
+need_stdout = false
+
+# If the doc compiles, then it opens in your browser and bacon switches
+# to the previous job
+[jobs.doc-open]
+command = ["cargo", "doc", "--color", "always", "--no-deps", "--open"]
+need_stdout = false
+on_success = "back" # so that we don't open the browser at each change
+
+# You can run your application and have the result displayed in bacon,
+# *if* it makes sense for this crate. You can run an example the same
+# way. Don't forget the `--color always` part or the errors won't be
+# properly parsed.
+# If you want to pass options to your program, a `--` separator
+# will be needed.
+[jobs.run]
+allow_warnings = true
+command = ["cargo", "run", "--color", "always"]
+need_stdout = true
+
+# You may define here keybindings that would be specific to
+# a project, for example a shortcut to launch a specific job.
+# Shortcuts to internal functions (scrolling, toggling, etc.)
+# should go in your personal prefs.toml file instead.
+[keybindings]
+a = "job:check-all"
+c = "job:clippy"
+d = "job:doc-open"
+f = "job:test-fast"
+r = "job:run"
+t = "job:test"
diff --git a/bindings/prql-dotnet/.gitignore b/bindings/prql-dotnet/.gitignore
new file mode 100644
index 000000000000..1746e3269ed0
--- /dev/null
+++ b/bindings/prql-dotnet/.gitignore
@@ -0,0 +1,2 @@
+bin
+obj
diff --git a/bindings/prql-dotnet/PrqlCompiler.Tests/CompilerTest.cs b/bindings/prql-dotnet/PrqlCompiler.Tests/CompilerTest.cs
new file mode 100644
index 000000000000..c9bb7f06ddfa
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler.Tests/CompilerTest.cs
@@ -0,0 +1,52 @@
+using Prql.Compiler;
+
+namespace Prql.Compiler.Tests;
+
+sealed public class CompilerTest
+{
+ [Fact]
+ public void ToCompile_Works()
+ {
+ // Arrange
+ var expected = "SELECT * FROM employees";
+ var options = new PrqlCompilerOptions
+ {
+ Format = false,
+ SignatureComment = false,
+ Target = "sql.mssql"
+ };
+
+ // Act
+ var result = PrqlCompiler.Compile("from employees", options);
+
+ // Assert
+ Assert.Equal(expected, result.Output);
+ }
+
+ [Fact(Skip = "Fails")]
+ public void TestOtherFunctions()
+ {
+ // Arrange
+ var query = """
+ let a = (from employees | take 10)
+
+ from a | select [first_name]
+ """;
+ var options = new PrqlCompilerOptions();
+
+ // Act and assert
+ var pl = PrqlCompiler.PrqlToPl(query);
+ Assert.Empty(pl.Messages);
+
+ var rq = PrqlCompiler.PlToRq(pl.Output);
+ Assert.Empty(rq.Messages);
+
+ var via_json = PrqlCompiler.RqToSql(rq.Output, options);
+ Assert.Empty(via_json.Messages);
+
+ var direct = PrqlCompiler.Compile(query);
+ Assert.Empty(direct.Messages);
+
+ Assert.Equal(via_json, direct);
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler.Tests/PrqlCompiler.Tests.csproj b/bindings/prql-dotnet/PrqlCompiler.Tests/PrqlCompiler.Tests.csproj
new file mode 100644
index 000000000000..eeddc9523e9a
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler.Tests/PrqlCompiler.Tests.csproj
@@ -0,0 +1,28 @@
+
+
+
+ net7.0
+ enable
+ enable
+
+ false
+
+
+
+
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
+
+
+
+
+
diff --git a/bindings/prql-dotnet/PrqlCompiler.Tests/Usings.cs b/bindings/prql-dotnet/PrqlCompiler.Tests/Usings.cs
new file mode 100644
index 000000000000..c802f4480b19
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler.Tests/Usings.cs
@@ -0,0 +1 @@
+global using Xunit;
diff --git a/bindings/prql-dotnet/PrqlCompiler/Message.cs b/bindings/prql-dotnet/PrqlCompiler/Message.cs
new file mode 100644
index 000000000000..d580dd823000
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/Message.cs
@@ -0,0 +1,46 @@
+using System.Runtime.InteropServices;
+
+namespace Prql.Compiler
+{
+ ///
+ /// Compile result message.
+ ///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ public struct Message
+ {
+ ///
+ /// Message kind. Currently only Error is implemented.
+ ///
+ public MessageKind Kind { get; set; }
+
+ ///
+ /// Machine-readable identifier of the error.
+ ///
+ public string Code { get; set; }
+
+ ///
+ /// Plain text of the error.
+ ///
+ public string Reason { get; set; }
+
+ ///
+ /// A list of suggestions of how to fix the error.
+ ///
+ public string Hint { get; set; }
+
+ ///
+ /// Character offset of error origin within a source file.
+ ///
+ public Span Span { get; set; }
+
+ ///
+ /// Annotated code, containing cause and hints.
+ ///
+ public string Display { get; set; }
+
+ ///
+ /// Line and column number of error origin within a source file.
+ ///
+ public SourceLocation Location { get; set; }
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/MessageKind.cs b/bindings/prql-dotnet/PrqlCompiler/MessageKind.cs
new file mode 100644
index 000000000000..efb0a4cb015f
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/MessageKind.cs
@@ -0,0 +1,24 @@
+using System;
+
+namespace Prql.Compiler
+{
+ ///
+ /// Compile message kind. Currently only Error is implemented.
+ ///
+ [Serializable]
+ public enum MessageKind
+ {
+ ///
+ /// Error message.
+ ///
+ Error,
+ ///
+ /// Warning message.
+ ///
+ Warning,
+ ///
+ /// Lint message.
+ ///
+ Lint
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/NativePrqlCompilerOptions.cs b/bindings/prql-dotnet/PrqlCompiler/NativePrqlCompilerOptions.cs
new file mode 100644
index 000000000000..c267e4eeed1e
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/NativePrqlCompilerOptions.cs
@@ -0,0 +1,16 @@
+namespace Prql.Compiler
+{
+ internal struct NativePrqlCompilerOptions
+ {
+ public bool Format;
+ public string Target;
+ public bool SignatureComment;
+
+ public NativePrqlCompilerOptions(PrqlCompilerOptions options)
+ {
+ Format = options.Format;
+ Target = options.Target;
+ SignatureComment = options.SignatureComment;
+ }
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/NativeResult.cs b/bindings/prql-dotnet/PrqlCompiler/NativeResult.cs
new file mode 100644
index 000000000000..304559dee481
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/NativeResult.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace Prql.Compiler
+{
+ internal struct NativeResult
+ {
+ public string Output;
+ public IntPtr Messages;
+ public int MessagesLen;
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/PrqlCompiler.cs b/bindings/prql-dotnet/PrqlCompiler/PrqlCompiler.cs
new file mode 100644
index 000000000000..a275bfcf168d
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/PrqlCompiler.cs
@@ -0,0 +1,141 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Prql.Compiler
+{
+ ///
+ /// The PRQL compiler transpiles RPQL queries.
+ ///
+ public static class PrqlCompiler
+ {
+ ///
+ /// Compile a PRQL string into a SQL string.
+ ///
+ /// A PRQL query.
+ /// SQL query.
+ /// is null or empty.
+ /// cannot be compiled.
+ public static Result Compile(string prqlQuery)
+ {
+ if (string.IsNullOrEmpty(prqlQuery))
+ {
+ throw new ArgumentException(nameof(prqlQuery));
+ }
+
+ var options = new PrqlCompilerOptions();
+
+ return Compile(prqlQuery, options);
+ }
+
+ ///
+ /// Compile a PRQL string into a SQL string.
+ ///
+ /// A PRQL query.
+ /// PRQL compiler options.
+ /// SQL query.
+ /// is null or empty.
+ /// is null.
+ /// cannot be compiled.
+ public static Result Compile(string prqlQuery, PrqlCompilerOptions options)
+ {
+ if (string.IsNullOrEmpty(prqlQuery))
+ {
+ throw new ArgumentException(nameof(prqlQuery));
+ }
+
+ if (options is null)
+ {
+ throw new ArgumentException(nameof(options));
+ }
+
+ var nativeOptions = new NativePrqlCompilerOptions(options);
+ var nativeResult = CompileExtern(prqlQuery, ref nativeOptions);
+ var result = new Result(nativeResult);
+
+ return result;
+ }
+
+ ///
+ /// Build PL AST from a PRQL string.
+ ///
+ /// A PRQL query.
+ /// JSON.
+ /// is null or empty.
+ /// cannot be compiled.
+ /// https://docs.rs/prql-compiler/latest/prql_compiler/ast/pl
+ public static Result PrqlToPl(string prqlQuery)
+ {
+ if (string.IsNullOrEmpty(prqlQuery))
+ {
+ throw new ArgumentException(nameof(prqlQuery));
+ }
+
+ var nativeResult = PrqlToPlExtern(prqlQuery);
+ var result = new Result(nativeResult);
+
+ return result;
+ }
+
+ ///
+ /// Finds variable references, validates functions calls, determines frames and converts PL to RQ.
+ ///
+ /// A PRQL query.
+ /// JSON.
+ /// is null or empty.
+ /// cannot be compiled.
+ /// https://docs.rs/prql-compiler/latest/prql_compiler/ast
+ public static Result PlToRq(string plJson)
+ {
+ if (string.IsNullOrEmpty(plJson))
+ {
+ throw new ArgumentException(nameof(plJson));
+ }
+
+ var nativeResult = PlToRqExtern(plJson);
+ var result = new Result(nativeResult);
+
+ return result;
+ }
+
+ ///
+ /// Convert RQ AST into an SQL string.
+ ///
+ /// RQ string in JSON format.
+ /// PRQL compiler options.
+ /// JSON.
+ /// is null or empty.
+ /// is null.
+ /// cannot be compiled.
+ /// https://docs.rs/prql-compiler/latest/prql_compiler/ast/rq
+ public static Result RqToSql(string rqJson, PrqlCompilerOptions options)
+ {
+ if (string.IsNullOrEmpty(rqJson))
+ {
+ throw new ArgumentException(nameof(rqJson));
+ }
+
+ if (options is null)
+ {
+ throw new ArgumentException(nameof(options));
+ }
+
+ var nativeOptions = new NativePrqlCompilerOptions(options);
+ var nativeResult = RqToSqlExtern(rqJson, ref nativeOptions);
+ var result = new Result(nativeResult);
+
+ return result;
+ }
+
+ [DllImport("libprql_lib", EntryPoint = "compile")]
+ private static extern NativeResult CompileExtern(string prqlQuery, ref NativePrqlCompilerOptions options);
+
+ [DllImport("libprql_lib", EntryPoint = "prql_to_pl")]
+ private static extern NativeResult PrqlToPlExtern(string prqlQuery);
+
+ [DllImport("libprql_lib", EntryPoint = "pl_to_rq")]
+ private static extern NativeResult PlToRqExtern(string plJson);
+
+ [DllImport("libprql_lib", EntryPoint = "rq_to_sql")]
+ private static extern NativeResult RqToSqlExtern(string rqJson, ref NativePrqlCompilerOptions options);
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/PrqlCompiler.csproj b/bindings/prql-dotnet/PrqlCompiler/PrqlCompiler.csproj
new file mode 100644
index 000000000000..2d530e70a232
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/PrqlCompiler.csproj
@@ -0,0 +1,28 @@
+
+
+
+ netstandard2.0
+
+
+
+ Prql.Compiler
+ 0.1.0
+ PRQL Compiler
+ PRQL
+ Copyright ยฉ The PRQL Project 2023
+ .NET bindings for the PRQL compiler. PRQL is a modern language for transforming data
+ Apache-2.0
+ https://prql-lang.org/
+ README.md
+ prql;sql
+ https://github.com/PRQL/prql
+
+
+
+
+ True
+ \
+
+
+
+
diff --git a/bindings/prql-dotnet/PrqlCompiler/PrqlCompilerOptions.cs b/bindings/prql-dotnet/PrqlCompiler/PrqlCompilerOptions.cs
new file mode 100644
index 000000000000..4b827e91073f
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/PrqlCompilerOptions.cs
@@ -0,0 +1,29 @@
+using System.Runtime.InteropServices;
+
+namespace Prql.Compiler
+{
+ ///
+ /// Compilation options for SQL backend of the compiler.
+ ///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ public class PrqlCompilerOptions
+ {
+ ///
+ /// Pass generated SQL string trough a formatter that splits it into
+ /// multiple lines and prettifies indentation and spacing.
+ ///
+ /// Defaults to true.
+ public bool Format { get; set; } = true;
+
+ ///
+ /// Target and dialect to compile to.
+ ///
+ public string Target { get; set; }
+
+ ///
+ /// Emits the compiler signature as a comment after generated SQL.
+ ///
+ /// Defaults to true.
+ public bool SignatureComment { get; set; } = true;
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/Result.cs b/bindings/prql-dotnet/PrqlCompiler/Result.cs
new file mode 100644
index 000000000000..60568751d282
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/Result.cs
@@ -0,0 +1,38 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+
+namespace Prql.Compiler
+{
+ ///
+ /// Result of compilation.
+ ///
+ public class Result
+ {
+ private readonly IReadOnlyCollection _messages;
+
+ internal Result(NativeResult result)
+ {
+ Output = result.Output;
+
+ var messages = new List();
+
+ for (var i = 0; i < result.MessagesLen; i++)
+ {
+ messages.Add(Marshal.PtrToStructure(result.Messages));
+ }
+
+ _messages = messages.ToList().AsReadOnly();
+ }
+
+ ///
+ /// The compiler output.
+ ///
+ public string Output { get; }
+
+ ///
+ /// Error, warning and lint messages.
+ ///
+ public IReadOnlyCollection Messages => _messages;
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/SourceLocation.cs b/bindings/prql-dotnet/PrqlCompiler/SourceLocation.cs
new file mode 100644
index 000000000000..426c65835def
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/SourceLocation.cs
@@ -0,0 +1,31 @@
+using System.Runtime.InteropServices;
+
+namespace Prql.Compiler
+{
+ ///
+ /// Location within a source file.
+ ///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ public struct SourceLocation
+ {
+ ///
+ /// Start line.
+ ///
+ public int StartLine { get; set; }
+
+ ///
+ /// Start column.
+ ///
+ public int StartCol { get; set; }
+
+ ///
+ /// End line.
+ ///
+ public int EndLine { get; set; }
+
+ ///
+ /// End column.
+ ///
+ public int EndCol { get; set; }
+ }
+}
diff --git a/bindings/prql-dotnet/PrqlCompiler/Span.cs b/bindings/prql-dotnet/PrqlCompiler/Span.cs
new file mode 100644
index 000000000000..441347a96390
--- /dev/null
+++ b/bindings/prql-dotnet/PrqlCompiler/Span.cs
@@ -0,0 +1,22 @@
+using System.Runtime.InteropServices;
+
+namespace Prql.Compiler
+{
+ ///
+ /// Identifier of a location in source.
+ /// Contains offsets in terms of chars.
+ ///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ public struct Span
+ {
+ ///
+ /// Start offset.
+ ///
+ public int Start { get; set; }
+
+ ///
+ /// End offset.
+ ///
+ public int End { get; set; }
+ }
+}
diff --git a/bindings/prql-dotnet/README.md b/bindings/prql-dotnet/README.md
new file mode 100644
index 000000000000..6021e017b360
--- /dev/null
+++ b/bindings/prql-dotnet/README.md
@@ -0,0 +1,38 @@
+# prql-dotnet
+
+`prql-net` offers PRQL bindings for .NET bindings as a `netstandard2.0` library.
+
+It provides the `PrqlCompiler` class which contains the `ToJson` and `ToSql`
+static methods.
+
+It's still at an early stage, and isn't published to NuGet. Contributions are
+welcome.
+
+## Installation
+
+Make sure that `libprql_lib.so` (Linux), `libprql_lib.dylib` (macOS) or
+`libprql_lib.dll` (Windows) is in your project's `bin` directory together with
+`PrqlCompiler.dll` and the rest of your project's compiled files. I.e.
+`{your_project}/bin/Debug/net7.0/`.
+
+The `libprql_lib` library gets dynamically imported at runtime.
+
+## Usage
+
+```csharp
+using Prql.Compiler;
+
+var options = new PrqlCompilerOptions
+{
+ Format = false,
+ SignatureComment = false,
+};
+var sql = PrqlCompiler.Compile("from employees", options);
+Console.WriteLine(sql);
+```
+
+# TODO
+
+This is currently at 0.1.0 because we're waiting to update prql-lib for the
+latest API. When we've done that, we can match the version here with the broader
+PRQL version.
diff --git a/bindings/prql-dotnet/prql-net.sln b/bindings/prql-dotnet/prql-net.sln
new file mode 100644
index 000000000000..76842e4e1189
--- /dev/null
+++ b/bindings/prql-dotnet/prql-net.sln
@@ -0,0 +1,28 @@
+๏ปฟ
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrqlCompiler", "PrqlCompiler\PrqlCompiler.csproj", "{339EA2A6-23D2-4938-884F-052431AC0674}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrqlCompiler.Tests", "PrqlCompiler.Tests\PrqlCompiler.Tests.csproj", "{78C1AD08-6FF5-444E-9298-385887ABAA80}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {339EA2A6-23D2-4938-884F-052431AC0674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {339EA2A6-23D2-4938-884F-052431AC0674}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {339EA2A6-23D2-4938-884F-052431AC0674}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {339EA2A6-23D2-4938-884F-052431AC0674}.Release|Any CPU.Build.0 = Release|Any CPU
+ {78C1AD08-6FF5-444E-9298-385887ABAA80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {78C1AD08-6FF5-444E-9298-385887ABAA80}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {78C1AD08-6FF5-444E-9298-385887ABAA80}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {78C1AD08-6FF5-444E-9298-385887ABAA80}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/prql-elixir/.formatter.exs b/bindings/prql-elixir/.formatter.exs
similarity index 100%
rename from prql-elixir/.formatter.exs
rename to bindings/prql-elixir/.formatter.exs
diff --git a/prql-elixir/.gitignore b/bindings/prql-elixir/.gitignore
similarity index 100%
rename from prql-elixir/.gitignore
rename to bindings/prql-elixir/.gitignore
diff --git a/bindings/prql-elixir/README.md b/bindings/prql-elixir/README.md
new file mode 100644
index 000000000000..e3b7c7e0b956
--- /dev/null
+++ b/bindings/prql-elixir/README.md
@@ -0,0 +1,102 @@
+# PRQL
+
+[PRQL](https://prql-lang.org/) bindings for Elixir.
+
+## Installation
+
+```elixir
+def deps do
+ [
+ {:prql, "~> 0.1.0"}
+ ]
+end
+```
+
+## Basic Usage
+
+```elixir
+ iex> PRQL.compile("from customers")
+ {:ok, "SELECT\n *\nFROM\n customers\n\n-- Generated by PRQL compiler version 0.3.1 (https://prql-lang.org)\n"}
+
+
+ iex> PRQL.compile("from customers\ntake 10", dialect: :mssql)
+ {:ok, "SELECT\n TOP (10) *\nFROM\n customers\n\n-- Generated by PRQL compiler version 0.3.1 (https://prql-lang.org)\n"}
+```
+
+## Development
+
+We are in the early stages of developing Elixir bindings.
+
+We're using `Rustler` to provide Rust bindings for `prql-compiler`.
+
+Currently using the bindings in an Elixir project requires compiling the Rust
+crate from this repo:
+
+- Install dependencies with `mix deps.get`
+- Compile project `mix compile`
+- Run tests `mix test`
+
+Future work includes publishing pre-compiled artifacts, so Elixir projects can
+run PRQL without needing a Rust toolchain.
+
+## Mac
+
+We currently don't enable compilation for Mac. This is possible to enable, but
+causes some issues with cargo's compilation cache. Briefly: it requires
+`RUST_FLAGS` to be set, and because of
+ &
+, any compilation of a different
+target will bust the cache.
+
+The possible future workarounds include:
+
+- Passing `--target=aarch64-apple-darwin` to every cargo call, which is
+ inconvenient and can be difficult in some situations; e.g. Rust Analyzer. This
+ disables passing `RUST_FLAGS` (I'm actually unclear why `prql-elixir` builds
+ successfully in that case...)
+- Directing other cargo calls to different paths, such as `/target-ra` for Rust
+ Analyzer and `/target-book` for the book building. But one `cargo build` from
+ the terminal without either the `target` or `target_dir` specified will bust
+ the cache!
+- Never compiling for other targets. But our standard tests run for
+ `--target=wasm32-unknown-unknown`, so this requires refraining from using
+ them.
+- Removing `prql-elixir` from our workspace, so that `cargo` commands in the
+ PRQL workspace don't require rust flags. This would work well, but means we
+ need separate test coverage for this crate, which adds some weight to the
+ tests.
+
+If `prql-elixir` becomes more used (for example, we start publishing to Hex, or
+Mac developers want to work on it), then we can re-enable and deal with the
+caching issues. We can also re-enable them if the `cargo` issue is resolved.
+
+To test on Mac temporarily โย for example if there's an error in GHA and we're on
+a Mac locally โ apply a diff like this, and then run `cargo build` from the
+`prql-elixir` path, which will enable the local
+[`.cargo/config.toml`](native/prql/.cargo/config.toml)). (We could also make a
+feature like `elixir-mac` which enabled building on Mac).
+
+```diff
+diff --git a/prql-elixir/native/prql/Cargo.toml b/prql-elixir/native/prql/Cargo.toml
+index a39a9ee..218abad 100644
+--- a/prql-elixir/native/prql/Cargo.toml
++++ b/prql-elixir/native/prql/Cargo.toml
+@@ -17,7 +17,4 @@ path = "src/lib.rs"
+
+ [dependencies]
+ prql-compiler = {path = "../../../prql-compiler", default-features = false, version = "0.5.2"}
+-
+-# See Readme for details on Mac
+-[target.'cfg(not(any(target_family="wasm", target_os = "macos")))'.dependencies]
+ rustler = "0.27.0"
+diff --git a/prql-elixir/native/prql/src/lib.rs b/prql-elixir/native/prql/src/lib.rs
+index 97eaa11..7525479 100644
+--- a/prql-elixir/native/prql/src/lib.rs
++++ b/prql-elixir/native/prql/src/lib.rs
+@@ -1,5 +1,3 @@
+-// See Readme for more information on Mac compiling
+-#![cfg(not(target_os = "macos"))]
+ // These bindings aren't relevant on wasm
+ #![cfg(not(target_family = "wasm"))]
+ // TODO: unclear why we need this `allow`; it's required in `CompileOptions`,
+```
diff --git a/prql-elixir/lib/prql.ex b/bindings/prql-elixir/lib/prql.ex
similarity index 100%
rename from prql-elixir/lib/prql.ex
rename to bindings/prql-elixir/lib/prql.ex
diff --git a/prql-elixir/lib/prql/errors.ex b/bindings/prql-elixir/lib/prql/errors.ex
similarity index 100%
rename from prql-elixir/lib/prql/errors.ex
rename to bindings/prql-elixir/lib/prql/errors.ex
diff --git a/prql-elixir/lib/prql/native.ex b/bindings/prql-elixir/lib/prql/native.ex
similarity index 100%
rename from prql-elixir/lib/prql/native.ex
rename to bindings/prql-elixir/lib/prql/native.ex
diff --git a/prql-elixir/mix.exs b/bindings/prql-elixir/mix.exs
similarity index 100%
rename from prql-elixir/mix.exs
rename to bindings/prql-elixir/mix.exs
diff --git a/prql-elixir/mix.lock b/bindings/prql-elixir/mix.lock
similarity index 100%
rename from prql-elixir/mix.lock
rename to bindings/prql-elixir/mix.lock
diff --git a/bindings/prql-elixir/native/prql/.cargo/config.toml b/bindings/prql-elixir/native/prql/.cargo/config.toml
new file mode 100644
index 000000000000..a0a666544142
--- /dev/null
+++ b/bindings/prql-elixir/native/prql/.cargo/config.toml
@@ -0,0 +1,8 @@
+# Note that this doesn't apply when compiling from the workspace root. Because
+# we're not currently compiling for Mac, it's also impotent for now.
+
+[target.'cfg(target_os = "macos")']
+rustflags = [
+ "-C", "link-arg=-undefined",
+ "-C", "link-arg=dynamic_lookup",
+]
diff --git a/prql-elixir/native/prql/Cargo.toml b/bindings/prql-elixir/native/prql/Cargo.toml
similarity index 64%
rename from prql-elixir/native/prql/Cargo.toml
rename to bindings/prql-elixir/native/prql/Cargo.toml
index cffb57f7634f..76e536e96fe0 100644
--- a/prql-elixir/native/prql/Cargo.toml
+++ b/bindings/prql-elixir/native/prql/Cargo.toml
@@ -16,6 +16,8 @@ name = "prql"
path = "src/lib.rs"
[dependencies]
-prql-compiler = {path = "../../../prql-compiler", default-features = false, version = "0.5.1" }
-[target.'cfg(not(any(target_family="wasm")))'.dependencies]
+prql-compiler = {path = "../../../../prql-compiler", default-features = false, version = "0.6.1" }
+
+# See Readme for details on Mac
+[target.'cfg(not(any(target_family="wasm", target_os = "macos")))'.dependencies]
rustler = "0.27.0"
diff --git a/prql-elixir/native/prql/README.md b/bindings/prql-elixir/native/prql/README.md
similarity index 100%
rename from prql-elixir/native/prql/README.md
rename to bindings/prql-elixir/native/prql/README.md
diff --git a/prql-elixir/native/prql/src/lib.rs b/bindings/prql-elixir/native/prql/src/lib.rs
similarity index 94%
rename from prql-elixir/native/prql/src/lib.rs
rename to bindings/prql-elixir/native/prql/src/lib.rs
index 8ff3aeea7303..97eaa11f1c97 100644
--- a/prql-elixir/native/prql/src/lib.rs
+++ b/bindings/prql-elixir/native/prql/src/lib.rs
@@ -1,3 +1,5 @@
+// See Readme for more information on Mac compiling
+#![cfg(not(target_os = "macos"))]
// These bindings aren't relevant on wasm
#![cfg(not(target_family = "wasm"))]
// TODO: unclear why we need this `allow`; it's required in `CompileOptions`,
@@ -118,7 +120,7 @@ pub struct Response {
#[rustler::nif]
/// compile a prql query into sql
pub fn compile(prql_query: &str, options: CompileOptions) -> NifResult {
- to_result_tuple(prql_compiler::compile(prql_query, options.into()))
+ to_result_tuple(prql_compiler::compile(prql_query, &options.into()))
}
#[rustler::nif]
@@ -150,7 +152,7 @@ pub fn rq_to_sql(rq_json: &str) -> NifResult {
.and_then(prql_compiler::json::to_rq)
// Currently just using default options here; probably should pass
// an argument from this func.
- .and_then(|x| prql_compiler::rq_to_sql(x, prql_compiler::Options::default())),
+ .and_then(|x| prql_compiler::rq_to_sql(x, &prql_compiler::Options::default())),
)
}
diff --git a/prql-elixir/test/prql_test.exs b/bindings/prql-elixir/test/prql_test.exs
similarity index 58%
rename from prql-elixir/test/prql_test.exs
rename to bindings/prql-elixir/test/prql_test.exs
index 9053244598ce..bb7648b371a1 100644
--- a/prql-elixir/test/prql_test.exs
+++ b/bindings/prql-elixir/test/prql_test.exs
@@ -16,7 +16,7 @@ defmodule PRQLTest do
test "return errors on invalid query" do
excepted_result =
- "{\"inner\":[{\"reason\":\"Unknown name invalid\",\"hint\":null,\"span\":{\"start\":0,\"end\":7},\"display\":\"Error: \\n โญโ[:1:1]\\n โ\\n 1 โ invalid\\n ยท โโโโฌโโโ \\n ยท โฐโโโโโ Unknown name invalid\\nโโโโฏ\\n\",\"location\":{\"start\":[0,0],\"end\":[0,7]}}]}"
+ "{\"inner\":[{\"code\":null,\"reason\":\"Unknown name invalid\",\"hint\":null,\"span\":{\"start\":0,\"end\":7},\"display\":\"Error: \\n โญโ[:1:1]\\n โ\\n 1 โ invalid\\n ยท โโโโฌโโโ \\n ยท โฐโโโโโ Unknown name invalid\\nโโโโฏ\\n\",\"location\":{\"start\":[0,0],\"end\":[0,7]}}]}"
assert PRQL.compile("invalid", @compile_opts) == {:error, excepted_result}
end
diff --git a/prql-elixir/test/test_helper.exs b/bindings/prql-elixir/test/test_helper.exs
similarity index 100%
rename from prql-elixir/test/test_helper.exs
rename to bindings/prql-elixir/test/test_helper.exs
diff --git a/prql-java/.gitignore b/bindings/prql-java/.gitignore
similarity index 100%
rename from prql-java/.gitignore
rename to bindings/prql-java/.gitignore
diff --git a/prql-java/Cargo.toml b/bindings/prql-java/Cargo.toml
similarity index 82%
rename from prql-java/Cargo.toml
rename to bindings/prql-java/Cargo.toml
index 6a225e972546..4253773dbff8 100644
--- a/prql-java/Cargo.toml
+++ b/bindings/prql-java/Cargo.toml
@@ -15,7 +15,7 @@ test = false
[dependencies]
jni = "0.20.0"
-prql-compiler = {path = "../prql-compiler", default-features = false}
+prql-compiler = {path = "../../prql-compiler", default-features = false}
[package.metadata.release]
tag-name = "{{version}}"
diff --git a/prql-java/DEVELOPMENT.md b/bindings/prql-java/DEVELOPMENT.md
similarity index 93%
rename from prql-java/DEVELOPMENT.md
rename to bindings/prql-java/DEVELOPMENT.md
index a8dc766aa1eb..5d2933a86a32 100644
--- a/prql-java/DEVELOPMENT.md
+++ b/bindings/prql-java/DEVELOPMENT.md
@@ -8,8 +8,8 @@ We implement Rust bindings to Java with
[JNI](https://docs.oracle.com/javase/8/docs/technotes/guides/jni/).
First, define a native method --
-`public static native String toSql(String query)` for PrqlCompiler, `toJson` is
-same.
+`public static native String toSql(String query, String target, boolean format, boolean signature)`
+for PrqlCompiler, `toJson` is same.
And then implement it in Rust with this
[crate](https://docs.rs/jni/latest/jni/).
diff --git a/prql-java/README.md b/bindings/prql-java/README.md
similarity index 100%
rename from prql-java/README.md
rename to bindings/prql-java/README.md
diff --git a/prql-java/cross.sh b/bindings/prql-java/cross.sh
similarity index 100%
rename from prql-java/cross.sh
rename to bindings/prql-java/cross.sh
diff --git a/prql-java/java/.mvn/wrapper/maven-wrapper.jar b/bindings/prql-java/java/.mvn/wrapper/maven-wrapper.jar
similarity index 100%
rename from prql-java/java/.mvn/wrapper/maven-wrapper.jar
rename to bindings/prql-java/java/.mvn/wrapper/maven-wrapper.jar
diff --git a/prql-java/java/.mvn/wrapper/maven-wrapper.properties b/bindings/prql-java/java/.mvn/wrapper/maven-wrapper.properties
similarity index 100%
rename from prql-java/java/.mvn/wrapper/maven-wrapper.properties
rename to bindings/prql-java/java/.mvn/wrapper/maven-wrapper.properties
diff --git a/prql-java/java/build.sh b/bindings/prql-java/java/build.sh
similarity index 80%
rename from prql-java/java/build.sh
rename to bindings/prql-java/java/build.sh
index 97ade6799fd5..faa4a5ba092a 100755
--- a/prql-java/java/build.sh
+++ b/bindings/prql-java/java/build.sh
@@ -1,6 +1,8 @@
#!/bin/sh
set -e
+# TODO: use a task file for these build scripts
+
JAVA_SRC_HOME=$1
ARCH="$(uname -m)"
KERNEL_NAME="$(uname -s)"
@@ -9,7 +11,6 @@ KERNEL_VERSION="$(uname -r)"
echo JAVA_SRC_HOME="$JAVA_SRC_HOME"
cd "$JAVA_SRC_HOME"
-# cd prql-java/
cd ../
echo Platform Info: "$ARCH" "$KERNEL_NAME" "$KERNEL_VERSION"
@@ -17,7 +18,7 @@ echo Platform Info: "$ARCH" "$KERNEL_NAME" "$KERNEL_VERSION"
echo building...
cargo build --release
echo building successfully
-ls -la ../target/release
+ls -la ../../target/release
if [ "$KERNEL_NAME" = 'Linux' ]; then
if [ "$ARCH" = 'arm64' ] || [ "$ARCH" = 'aarch64' ]; then
@@ -27,7 +28,7 @@ if [ "$KERNEL_NAME" = 'Linux' ]; then
else
target='libprql_java-linux32.so'
fi
- cp -f ../target/release/libprql_java.so java/src/test/resources/${target}
+ cp -f ../../target/release/libprql_java.so java/src/test/resources/${target}
elif [ "$KERNEL_NAME" = 'Darwin' ]; then
if [ "$ARCH" = 'arm64' ] || [ "$ARCH" = 'aarch64' ]; then
target='libprql_java-osx-arm64.dylib'
@@ -37,7 +38,7 @@ elif [ "$KERNEL_NAME" = 'Darwin' ]; then
echo [ERROR] have not support $ARCH:$$KERNEL_NAME yet
exit 1
fi
- cp -f ../target/release/libprql_java.dylib java/src/test/resources/${target}
+ cp -f ../../target/release/libprql_java.dylib java/src/test/resources/${target}
fi
ls -la ./java/src/main/resources
diff --git a/prql-java/java/mvnw b/bindings/prql-java/java/mvnw
similarity index 100%
rename from prql-java/java/mvnw
rename to bindings/prql-java/java/mvnw
diff --git a/prql-java/java/mvnw.cmd b/bindings/prql-java/java/mvnw.cmd
similarity index 100%
rename from prql-java/java/mvnw.cmd
rename to bindings/prql-java/java/mvnw.cmd
diff --git a/prql-java/java/pom.xml b/bindings/prql-java/java/pom.xml
similarity index 99%
rename from prql-java/java/pom.xml
rename to bindings/prql-java/java/pom.xml
index 84d8bddd2339..d7276e6edff1 100644
--- a/prql-java/java/pom.xml
+++ b/bindings/prql-java/java/pom.xml
@@ -6,7 +6,7 @@
org.prqllang
prql-java
- 0.2.1
+ 0.5.2
${project.groupId}:${project.artifactId}
prql-compiler api for java
diff --git a/prql-java/java/src/main/java/org/prql/prql4j/Environment.java b/bindings/prql-java/java/src/main/java/org/prql/prql4j/Environment.java
similarity index 100%
rename from prql-java/java/src/main/java/org/prql/prql4j/Environment.java
rename to bindings/prql-java/java/src/main/java/org/prql/prql4j/Environment.java
diff --git a/prql-java/java/src/main/java/org/prql/prql4j/NativeLibraryLoader.java b/bindings/prql-java/java/src/main/java/org/prql/prql4j/NativeLibraryLoader.java
similarity index 100%
rename from prql-java/java/src/main/java/org/prql/prql4j/NativeLibraryLoader.java
rename to bindings/prql-java/java/src/main/java/org/prql/prql4j/NativeLibraryLoader.java
diff --git a/bindings/prql-java/java/src/main/java/org/prql/prql4j/PrqlCompiler.java b/bindings/prql-java/java/src/main/java/org/prql/prql4j/PrqlCompiler.java
new file mode 100644
index 000000000000..3ced22ce59ad
--- /dev/null
+++ b/bindings/prql-java/java/src/main/java/org/prql/prql4j/PrqlCompiler.java
@@ -0,0 +1,27 @@
+package org.prql.prql4j;
+
+import java.io.IOException;
+
+public class PrqlCompiler {
+
+ /**
+ * compile PRQL to SQL
+ * @param query PRQL query
+ * @param target target dialect, such as sql.mysql etc. Please refer PRQL Target and Version
+ * @param format format SQL or not
+ * @param signature comment signature or not
+ * @return SQL
+ * @throws Exception PRQL compile exception
+ */
+ public static native String toSql(String query, String target, boolean format, boolean signature) throws Exception;
+ public static native String toJson(String query) throws Exception;
+ public static native String format(String query) throws Exception;
+
+ static {
+ try {
+ NativeLibraryLoader.getInstance().loadLibrary(null);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/prql-java/java/src/main/resources/.gitkeep b/bindings/prql-java/java/src/main/resources/.gitkeep
similarity index 100%
rename from prql-java/java/src/main/resources/.gitkeep
rename to bindings/prql-java/java/src/main/resources/.gitkeep
diff --git a/prql-java/java/src/test/java/org/prql/prql4j/PrqlCompilerTest.java b/bindings/prql-java/java/src/test/java/org/prql/prql4j/PrqlCompilerTest.java
similarity index 53%
rename from prql-java/java/src/test/java/org/prql/prql4j/PrqlCompilerTest.java
rename to bindings/prql-java/java/src/test/java/org/prql/prql4j/PrqlCompilerTest.java
index 4ca948b87959..5a8627d62c57 100644
--- a/prql-java/java/src/test/java/org/prql/prql4j/PrqlCompilerTest.java
+++ b/bindings/prql-java/java/src/test/java/org/prql/prql4j/PrqlCompilerTest.java
@@ -4,8 +4,8 @@
public class PrqlCompilerTest {
@Test
- public void compile() {
- String found = PrqlCompiler.toSql("from table");
+ public void compile() throws Exception {
+ String found = PrqlCompiler.toSql("from table", "sql.mysql", true, true);
// remove signature
found = found.substring(0, found.indexOf("\n\n--"));
@@ -16,4 +16,9 @@ public void compile() {
" table";
assert expected.equalsIgnoreCase(found);
}
+
+ @Test(expected = Exception.class)
+ public void compileWithError() throws Exception {
+ PrqlCompiler.toSql("from table | filter id >> 1", "sql.mysql", true, true);
+ }
}
diff --git a/prql-java/java/src/test/resources/.gitkeep b/bindings/prql-java/java/src/test/resources/.gitkeep
similarity index 100%
rename from prql-java/java/src/test/resources/.gitkeep
rename to bindings/prql-java/java/src/test/resources/.gitkeep
diff --git a/bindings/prql-java/src/lib.rs b/bindings/prql-java/src/lib.rs
new file mode 100644
index 000000000000..93e7052dc160
--- /dev/null
+++ b/bindings/prql-java/src/lib.rs
@@ -0,0 +1,77 @@
+use jni::objects::{JClass, JString};
+use jni::sys::{jboolean, jstring};
+use jni::JNIEnv;
+use prql_compiler::{json, pl_to_prql, prql_to_pl, ErrorMessages, Options, Target};
+use std::str::FromStr;
+
+#[no_mangle]
+#[allow(non_snake_case)]
+pub extern "system" fn Java_org_prql_prql4j_PrqlCompiler_toSql(
+ env: JNIEnv,
+ _class: JClass,
+ query: JString,
+ target: JString,
+ format: jboolean,
+ signature: jboolean,
+) -> jstring {
+ let prql_query: String = env
+ .get_string(query)
+ .expect("Couldn't get java string!")
+ .into();
+ let target_str: String = env
+ .get_string(target)
+ .expect("Couldn't get java string")
+ .into();
+ let prql_dialect: Target = Target::from_str(&target_str).unwrap_or(Target::Sql(None));
+ let opt = Options {
+ format: format != 0,
+ target: prql_dialect,
+ signature_comment: signature != 0,
+ };
+ let result = prql_compiler::compile(&prql_query, &opt);
+ java_string_with_exception(result, &env)
+}
+
+#[no_mangle]
+#[allow(non_snake_case)]
+pub extern "system" fn Java_org_prql_prql4j_PrqlCompiler_format(
+ env: JNIEnv,
+ _class: JClass,
+ query: JString,
+) -> jstring {
+ let prql_query: String = env
+ .get_string(query)
+ .expect("Couldn't get java string!")
+ .into();
+ let result = prql_to_pl(&prql_query).and_then(pl_to_prql);
+ java_string_with_exception(result, &env)
+}
+
+#[no_mangle]
+#[allow(non_snake_case)]
+pub extern "system" fn Java_org_prql_prql4j_PrqlCompiler_toJson(
+ env: JNIEnv,
+ _class: JClass,
+ query: JString,
+) -> jstring {
+ let prql_query: String = env
+ .get_string(query)
+ .expect("Couldn't get java string!")
+ .into();
+ let result = prql_to_pl(&prql_query).and_then(json::from_pl);
+ java_string_with_exception(result, &env)
+}
+
+fn java_string_with_exception(result: Result, env: &JNIEnv) -> jstring {
+ if let Ok(text) = result {
+ env.new_string(text)
+ .expect("Couldn't create java string!")
+ .into_raw()
+ } else {
+ let exception = env.find_class("java/lang/Exception").unwrap();
+ if let Err(e) = env.throw_new(exception, result.err().unwrap().to_string()) {
+ println!("Error throwing exception: {:?}", e);
+ }
+ std::ptr::null_mut() as jstring
+ }
+}
diff --git a/prql-js/Cargo.toml b/bindings/prql-js/Cargo.toml
similarity index 58%
rename from prql-js/Cargo.toml
rename to bindings/prql-js/Cargo.toml
index 2a3755f5fa25..b0c8cf259dbe 100644
--- a/prql-js/Cargo.toml
+++ b/bindings/prql-js/Cargo.toml
@@ -22,8 +22,13 @@ test = false
default = ["console_error_panic_hook"]
[dependencies]
-prql-compiler = {path = "../prql-compiler", default-features = false}
-wasm-bindgen = "0.2.80"
+prql-compiler = {path = "../../prql-compiler", default-features = false}
+# This was preventing the playground from working. It's possibly
+# https://github.com/rustwasm/wasm-bindgen/issues/3276
+# If the playground works with a later version, we can unpin this. It's likely
+# related to wasm-pack. So https://github.com/PRQL/prql/issues/1836 would likely
+# solve it, along with simplifying the build process.
+wasm-bindgen = "=0.2.83"
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
@@ -44,12 +49,19 @@ tag-prefix = ""
[[package.metadata.release.pre-release-replacements]]
exactly = 1
file = "package.json"
-replace = ' "version": "{{version}}"'
-search = ' "version": "(\d+\.\d+\.\d+)"'
+replace = '$1"{{version}}"'
+search = '( "version": )"(\d+\.\d+\.\d+)"'
+
+[[package.metadata.release.pre-release-replacements]]
+exactly = 2
+file = "package-lock.json"
+replace = '''
+$1
+$2"{{version}}"'''
+search = '(\s+"prql-js",)\n(\s+"version": )"[\d\.]+"'
[[package.metadata.release.pre-release-replacements]]
exactly = 1
-file = "../playground/package-lock.json"
-replace = ''' "../prql-js": {
- "version": "{{version}}"'''
-search = ' "../prql-js": \{\n "version": "[\d\.]+"'
+file = "../../web/playground/package-lock.json"
+replace = '''$1"{{version}}"'''
+search = '( "../prql-js": \{\n "version": )"[\d\.]+"'
diff --git a/prql-js/README.md b/bindings/prql-js/README.md
similarity index 97%
rename from prql-js/README.md
rename to bindings/prql-js/README.md
index ba0606c2664a..500e55ee8d90 100644
--- a/prql-js/README.md
+++ b/bindings/prql-js/README.md
@@ -173,4 +173,4 @@ npm test
[^1]:
Though we would be very open to other approaches, given wasm-pack does not
seem maintained, and we're eliding many of its features to build for three
- targets.
+ targets. See for more details.
diff --git a/prql-js/package-lock.json b/bindings/prql-js/package-lock.json
similarity index 55%
rename from prql-js/package-lock.json
rename to bindings/prql-js/package-lock.json
index db2e089642e7..025d9190129d 100644
--- a/prql-js/package-lock.json
+++ b/bindings/prql-js/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "prql-js",
- "version": "0.4.2",
- "lockfileVersion": 2,
+ "version": "0.6.1",
+ "lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "prql-js",
- "version": "0.4.2",
+ "version": "0.6.1",
"license": "Apache-2.0",
"devDependencies": {
"chai": "^4.3.6",
@@ -997,709 +997,5 @@
"url": "https://github.com/sponsors/sindresorhus"
}
}
- },
- "dependencies": {
- "ansi-colors": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
- "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
- "dev": true
- },
- "ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "dev": true
- },
- "ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "requires": {
- "color-convert": "^2.0.1"
- }
- },
- "anymatch": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
- "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
- "dev": true,
- "requires": {
- "normalize-path": "^3.0.0",
- "picomatch": "^2.0.4"
- }
- },
- "argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "assertion-error": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
- "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
- "dev": true
- },
- "balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "binary-extensions": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
- "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
- "dev": true
- },
- "brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0"
- }
- },
- "braces": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
- "dev": true,
- "requires": {
- "fill-range": "^7.0.1"
- }
- },
- "browser-stdout": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
- "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
- "dev": true
- },
- "camelcase": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
- "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
- "dev": true
- },
- "chai": {
- "version": "4.3.7",
- "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz",
- "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==",
- "dev": true,
- "requires": {
- "assertion-error": "^1.1.0",
- "check-error": "^1.0.2",
- "deep-eql": "^4.1.2",
- "get-func-name": "^2.0.0",
- "loupe": "^2.3.1",
- "pathval": "^1.1.1",
- "type-detect": "^4.0.5"
- }
- },
- "chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "dependencies": {
- "supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- }
- }
- },
- "check-error": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
- "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==",
- "dev": true
- },
- "chokidar": {
- "version": "3.5.3",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
- "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
- "dev": true,
- "requires": {
- "anymatch": "~3.1.2",
- "braces": "~3.0.2",
- "fsevents": "~2.3.2",
- "glob-parent": "~5.1.2",
- "is-binary-path": "~2.1.0",
- "is-glob": "~4.0.1",
- "normalize-path": "~3.0.0",
- "readdirp": "~3.6.0"
- }
- },
- "cliui": {
- "version": "7.0.4",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
- "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
- "dev": true,
- "requires": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.0",
- "wrap-ansi": "^7.0.0"
- }
- },
- "color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "requires": {
- "color-name": "~1.1.4"
- }
- },
- "color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
- "dev": true
- },
- "debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
- "dev": true,
- "requires": {
- "ms": "2.1.2"
- },
- "dependencies": {
- "ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- }
- }
- },
- "decamelize": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
- "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
- "dev": true
- },
- "deep-eql": {
- "version": "4.1.3",
- "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz",
- "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==",
- "dev": true,
- "requires": {
- "type-detect": "^4.0.0"
- }
- },
- "diff": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
- "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
- "dev": true
- },
- "emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
- "dev": true
- },
- "escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "dev": true
- },
- "escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true
- },
- "fill-range": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
- "dev": true,
- "requires": {
- "to-regex-range": "^5.0.1"
- }
- },
- "find-up": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
- "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
- "dev": true,
- "requires": {
- "locate-path": "^6.0.0",
- "path-exists": "^4.0.0"
- }
- },
- "flat": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
- "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
- "dev": true
- },
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "dev": true
- },
- "fsevents": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
- "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
- "dev": true,
- "optional": true
- },
- "get-caller-file": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "dev": true
- },
- "get-func-name": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
- "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==",
- "dev": true
- },
- "glob": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
- "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "dependencies": {
- "brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- }
- }
- },
- "glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "requires": {
- "is-glob": "^4.0.1"
- }
- },
- "has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true
- },
- "he": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
- "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
- "dev": true
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "dev": true
- },
- "is-binary-path": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
- "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
- "dev": true,
- "requires": {
- "binary-extensions": "^2.0.0"
- }
- },
- "is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true
- },
- "is-fullwidth-code-point": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true
- },
- "is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
- "requires": {
- "is-extglob": "^2.1.1"
- }
- },
- "is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true
- },
- "is-plain-obj": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
- "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
- "dev": true
- },
- "is-unicode-supported": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
- "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
- "dev": true
- },
- "js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "requires": {
- "argparse": "^2.0.1"
- }
- },
- "locate-path": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
- "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
- "dev": true,
- "requires": {
- "p-locate": "^5.0.0"
- }
- },
- "log-symbols": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
- "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
- "dev": true,
- "requires": {
- "chalk": "^4.1.0",
- "is-unicode-supported": "^0.1.0"
- }
- },
- "loupe": {
- "version": "2.3.6",
- "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz",
- "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==",
- "dev": true,
- "requires": {
- "get-func-name": "^2.0.0"
- }
- },
- "minimatch": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
- "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
- "dev": true,
- "requires": {
- "brace-expansion": "^2.0.1"
- }
- },
- "mocha": {
- "version": "10.2.0",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
- "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==",
- "dev": true,
- "requires": {
- "ansi-colors": "4.1.1",
- "browser-stdout": "1.3.1",
- "chokidar": "3.5.3",
- "debug": "4.3.4",
- "diff": "5.0.0",
- "escape-string-regexp": "4.0.0",
- "find-up": "5.0.0",
- "glob": "7.2.0",
- "he": "1.2.0",
- "js-yaml": "4.1.0",
- "log-symbols": "4.1.0",
- "minimatch": "5.0.1",
- "ms": "2.1.3",
- "nanoid": "3.3.3",
- "serialize-javascript": "6.0.0",
- "strip-json-comments": "3.1.1",
- "supports-color": "8.1.1",
- "workerpool": "6.2.1",
- "yargs": "16.2.0",
- "yargs-parser": "20.2.4",
- "yargs-unparser": "2.0.0"
- }
- },
- "ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
- "dev": true
- },
- "nanoid": {
- "version": "3.3.3",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
- "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
- "dev": true
- },
- "normalize-path": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
- "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
- "dev": true
- },
- "once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
- "dev": true,
- "requires": {
- "wrappy": "1"
- }
- },
- "p-limit": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
- "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
- "dev": true,
- "requires": {
- "yocto-queue": "^0.1.0"
- }
- },
- "p-locate": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
- "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
- "dev": true,
- "requires": {
- "p-limit": "^3.0.2"
- }
- },
- "path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "dev": true
- },
- "pathval": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz",
- "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
- "dev": true
- },
- "picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true
- },
- "randombytes": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
- "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
- "dev": true,
- "requires": {
- "safe-buffer": "^5.1.0"
- }
- },
- "readdirp": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
- "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
- "dev": true,
- "requires": {
- "picomatch": "^2.2.1"
- }
- },
- "require-directory": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
- "dev": true
- },
- "safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "dev": true
- },
- "serialize-javascript": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
- "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
- "dev": true,
- "requires": {
- "randombytes": "^2.1.0"
- }
- },
- "string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
- "dev": true,
- "requires": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
- }
- },
- "strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dev": true,
- "requires": {
- "ansi-regex": "^5.0.1"
- }
- },
- "strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true
- },
- "supports-color": {
- "version": "8.1.1",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
- "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
- "dev": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- },
- "to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "requires": {
- "is-number": "^7.0.0"
- }
- },
- "type-detect": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
- "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
- "dev": true
- },
- "workerpool": {
- "version": "6.2.1",
- "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
- "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
- "dev": true
- },
- "wrap-ansi": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- }
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true
- },
- "y18n": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
- "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
- "dev": true
- },
- "yargs": {
- "version": "16.2.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
- "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
- "dev": true,
- "requires": {
- "cliui": "^7.0.2",
- "escalade": "^3.1.1",
- "get-caller-file": "^2.0.5",
- "require-directory": "^2.1.1",
- "string-width": "^4.2.0",
- "y18n": "^5.0.5",
- "yargs-parser": "^20.2.2"
- }
- },
- "yargs-parser": {
- "version": "20.2.4",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
- "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
- "dev": true
- },
- "yargs-unparser": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz",
- "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==",
- "dev": true,
- "requires": {
- "camelcase": "^6.0.0",
- "decamelize": "^4.0.0",
- "flat": "^5.0.2",
- "is-plain-obj": "^2.1.0"
- }
- },
- "yocto-queue": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
- "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
- "dev": true
- }
}
}
diff --git a/prql-js/package.json b/bindings/prql-js/package.json
similarity index 78%
rename from prql-js/package.json
rename to bindings/prql-js/package.json
index e3f7b8c0fc09..b20e185bd64d 100644
--- a/prql-js/package.json
+++ b/bindings/prql-js/package.json
@@ -18,11 +18,11 @@
},
"scripts": {
"build": "npm run build:node && npm run build:bundler && npm run build:web",
- "build:bundler": "wasm-pack build --target bundler --release --out-dir dist/bundler",
- "build:node": "wasm-pack build --target nodejs --release --out-dir dist/node",
- "build:web": "wasm-pack build --target no-modules --release --out-dir dist/web",
- "test": "wasm-pack test --firefox && mocha tests"
+ "build:bundler": "wasm-pack build --target bundler --release --out-dir dist/bundler && rm dist/bundler/.gitignore",
+ "build:node": "wasm-pack build --target nodejs --release --out-dir dist/node && rm dist/node/.gitignore",
+ "build:web": "wasm-pack build --target no-modules --release --out-dir dist/web && rm dist/web/.gitignore",
+ "test": "mocha tests"
},
"types": "dist/node/prql_js.d.ts",
- "version": "0.5.1"
+ "version": "0.6.1"
}
diff --git a/prql-js/src/lib.rs b/bindings/prql-js/src/lib.rs
similarity index 90%
rename from prql-js/src/lib.rs
rename to bindings/prql-js/src/lib.rs
index aa4caca95c46..6a7a7add9571 100644
--- a/prql-js/src/lib.rs
+++ b/bindings/prql-js/src/lib.rs
@@ -10,7 +10,7 @@ use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn compile(prql_query: &str, options: Option) -> Option {
return_or_throw(
- prql_compiler::compile(prql_query, options.map(|x| x.into()).unwrap_or_default())
+ prql_compiler::compile(prql_query, &options.map(|x| x.into()).unwrap_or_default())
.map_err(|e| e.composed("", prql_query, false)),
)
}
@@ -39,7 +39,7 @@ pub fn rq_to_sql(rq_json: &str) -> Option {
return_or_throw(
Ok(rq_json)
.and_then(prql_compiler::json::to_rq)
- .and_then(|x| prql_compiler::rq_to_sql(x, prql_compiler::Options::default())),
+ .and_then(|x| prql_compiler::rq_to_sql(x, &prql_compiler::Options::default())),
)
}
@@ -53,9 +53,6 @@ pub struct CompileOptions {
/// Defaults to true.
pub format: bool,
- /// Target to compile to (e.g. sql.postgres)
- ///
- /// If `None` is used, the `target` argument from the query header is used.
#[wasm_bindgen(skip)]
pub target: String,
@@ -90,6 +87,10 @@ impl CompileOptions {
Self::default()
}
+ /// Target to compile to (e.g. sql.postgres)
+ ///
+ /// Defaults to `sql.any`, which uses `target` argument from the query header to determine
+ /// the SQL dialect.
#[wasm_bindgen(getter)]
pub fn target(&self) -> String {
self.target.clone()
diff --git a/prql-js/src/utils.rs b/bindings/prql-js/src/utils.rs
similarity index 100%
rename from prql-js/src/utils.rs
rename to bindings/prql-js/src/utils.rs
diff --git a/prql-js/tests/test_all.js b/bindings/prql-js/tests/test_all.js
similarity index 79%
rename from prql-js/tests/test_all.js
rename to bindings/prql-js/tests/test_all.js
index 624ab4040efb..5fb0b8a5256f 100644
--- a/prql-js/tests/test_all.js
+++ b/bindings/prql-js/tests/test_all.js
@@ -35,7 +35,7 @@ describe("prql-js", () => {
it("should throw an error on invalid prql", () => {
expect(() =>
- prql.compile("Mississippi has four Sโs and four Iโs.")
+ prql.compile("Mississippi has four Ss and four Is.")
).to.throw("Error");
});
@@ -86,7 +86,7 @@ describe("prql-js", () => {
it("should fallback to the target in header", () => {
const opts = new prql.CompileOptions();
- opts.target = "sql.not_existing";
+ opts.target = "sql.any";
const res = prql.compile("prql target:sql.mssql\nfrom a | take 1", opts);
assert(res.includes("TOP (1)"));
@@ -100,4 +100,28 @@ describe("prql-js", () => {
assert(targets.includes("sql.sqlite"));
});
});
+
+ describe("compile error", () => {
+ it("should contain json", () => {
+ try {
+ prql.compile("from x | select a | select b");
+ } catch (error) {
+ const errorMessages = JSON.parse(error.message).inner;
+
+ assert(errorMessages.length > 0);
+ assert(errorMessages[0].display.includes("\n"));
+ assert(!errorMessages[0].reason.includes("\n"));
+ }
+ });
+
+ it("should contain error code", () => {
+ try {
+ prql.compile("let a = (from x)");
+ } catch (error) {
+ const errorMessages = JSON.parse(error.message).inner;
+
+ assert(errorMessages[0].code == "E0001");
+ }
+ });
+ });
});
diff --git a/prql-lib/Cargo.toml b/bindings/prql-lib/Cargo.toml
similarity index 83%
rename from prql-lib/Cargo.toml
rename to bindings/prql-lib/Cargo.toml
index b1ea6bc72b77..0057fd96f4eb 100644
--- a/prql-lib/Cargo.toml
+++ b/bindings/prql-lib/Cargo.toml
@@ -15,7 +15,7 @@ test = false
[dependencies]
libc = "0.2"
-prql-compiler = {path = "../prql-compiler", default-features = false}
+prql-compiler = {path = "../../prql-compiler", default-features = false}
serde_json = "1.0"
[package.metadata.release]
diff --git a/prql-lib/README.md b/bindings/prql-lib/README.md
similarity index 76%
rename from prql-lib/README.md
rename to bindings/prql-lib/README.md
index 9c17b3da2b21..eaea13af9701 100644
--- a/prql-lib/README.md
+++ b/bindings/prql-lib/README.md
@@ -1,18 +1,23 @@
-# PRQL library target
+# PRQL C library
## Description
This module compiles PRQL as a library (both `.a` and `.so` are generated). This
allows embedding in languages that support FFI - looking at Golang.
-## Usage
+## Linking
+
+See [examples/minimal-c/Makefile](examples/minimal-c/Makefile).
Copy the `.a` and `.so` files in a convenient place and add the following
compile flags to Go (cgo):
`CGO_LDFLAGS="-L/path/to/libprql_lib.a -lprql_lib -pthread -ldl" go build`
-## Code
+## Examples
+
+For a minimal example, see
+[examples/minimal-c/main.c](examples/minimal-c/main.c).
Below is an example from an actual application that is using PRQL in Go.
@@ -82,3 +87,20 @@ func ToJSON(prql string) (string, error) {
return "", errors.New(C.GoString(cstr))
}
```
+
+## Development
+
+### C header file
+
+The C header file `libprql_lib.h` was generated using
+[cbindgen](https://github.com/eqrion/cbindgen). To generate a new one run:
+
+ cargo install --force cbindgen
+ cbindgen --crate prql-lib --output libprql_lib.h
+
+### C++ header file
+
+The C++ header file `libprql_lib.hpp` was generated using cbindgen. To generate
+a new one run:
+
+ cbindgen --crate prql-lib --lang C++ --output libprql_lib.hpp
diff --git a/bindings/prql-lib/cbindgen.toml b/bindings/prql-lib/cbindgen.toml
new file mode 100644
index 000000000000..73fbadea44a7
--- /dev/null
+++ b/bindings/prql-lib/cbindgen.toml
@@ -0,0 +1,12 @@
+language = "C"
+
+header = '''/*
+ * PRQL is a modern language for transforming data โ a simple, powerful, pipelined SQL replacement
+ *
+ * License: Apache-2.0
+ * Website: https://prql-lang.org/
+ */'''
+
+autogen_warning = "/* This file is autogenerated. Do not modify this file manually. */"
+
+after_includes = '#define FFI_SCOPE "PRQL"'
diff --git a/bindings/prql-lib/examples/minimal-c/Makefile b/bindings/prql-lib/examples/minimal-c/Makefile
new file mode 100644
index 000000000000..dfd78af60a5f
--- /dev/null
+++ b/bindings/prql-lib/examples/minimal-c/Makefile
@@ -0,0 +1,18 @@
+PRQL_PROJECT=../../../..
+
+build-prql:
+ cargo build -p prql-lib --release
+
+# TODO: would be helpful to allow running with a debug build too.
+build: main.c build-prql
+ gcc main.c -o main.out \
+ -I${PRQL_PROJECT}/bindings/prql-lib \
+ -L${PRQL_PROJECT}/target/release \
+ -l:libprql_lib.a \
+ -pthread -ldl -lm
+
+run: build
+ ./main.out
+
+valgrind: build
+ valgrind ./main.out
diff --git a/bindings/prql-lib/examples/minimal-c/README.md b/bindings/prql-lib/examples/minimal-c/README.md
new file mode 100644
index 000000000000..b1762921ca3f
--- /dev/null
+++ b/bindings/prql-lib/examples/minimal-c/README.md
@@ -0,0 +1,7 @@
+# Basic C example
+
+A minimal example for using prql-lib with `gcc` and `make`.
+
+## How to run
+
+ make run
diff --git a/bindings/prql-lib/examples/minimal-c/main.c b/bindings/prql-lib/examples/minimal-c/main.c
new file mode 100644
index 000000000000..e61638c67842
--- /dev/null
+++ b/bindings/prql-lib/examples/minimal-c/main.c
@@ -0,0 +1,65 @@
+#include
+
+#include
+
+void print_result(CompileResult res) {
+ printf("---- [ Compiled with %ld errors ]----\n", res.messages_len);
+ for (int i = 0; i < res.messages_len; i++) {
+ Message const* e = &res.messages[i];
+ if (e->display != NULL) {
+ printf("%s", *e->display);
+ } else if (e->code != NULL) {
+ printf("[%s] Error: %s\n", *e->code, e->reason);
+ } else {
+ printf("Error: %s", e->reason);
+ }
+ }
+ if (*res.output == '\0') {
+ printf("Output: \n\n");
+ } else {
+ printf("Output:\n%s\n\n", res.output);
+ }
+}
+
+int main() {
+ char *prql_query;
+ prql_query = "from albums | select [album_id, title] | take 3";
+ CompileResult res;
+ CompileResult res2;
+
+ // default compile option
+ res = compile(prql_query, NULL);
+ print_result(res);
+ result_destroy(res);
+
+ // custom compile options
+ Options opts;
+ opts.format = false;
+ opts.signature_comment = false;
+ opts.target = "sql.mssql";
+ res = compile(prql_query, &opts);
+ print_result(res);
+ result_destroy(res);
+
+ // error handling
+ res = compile("from album | select [album_id] | select [title]", NULL);
+ print_result(res);
+ result_destroy(res);
+
+ // error handling
+ res = compile("let a = (from album)", NULL);
+ print_result(res);
+ result_destroy(res);
+
+ // intermediate results
+ res = prql_to_pl(prql_query);
+ print_result(res);
+
+ res2 = pl_to_rq(res.output);
+ result_destroy(res);
+
+ print_result(res2);
+ result_destroy(res2);
+
+ return 0;
+}
diff --git a/bindings/prql-lib/libprql_lib.h b/bindings/prql-lib/libprql_lib.h
new file mode 100644
index 000000000000..e8c5f7f38993
--- /dev/null
+++ b/bindings/prql-lib/libprql_lib.h
@@ -0,0 +1,189 @@
+/*
+ * PRQL is a modern language for transforming data โ a simple, powerful, pipelined SQL replacement
+ *
+ * License: Apache-2.0
+ * Website: https://prql-lang.org/
+ */
+
+/* This file is autogenerated. Do not modify this file manually. */
+
+#include
+#include
+#include
+#include
+#define FFI_SCOPE "PRQL"
+
+/**
+ * Compile message kind. Currently only Error is implemented.
+ */
+typedef enum MessageKind {
+ Error,
+ Warning,
+ Lint,
+} MessageKind;
+
+/**
+ * Identifier of a location in source.
+ * Contains offsets in terms of chars.
+ */
+typedef struct Span {
+ size_t start;
+ size_t end;
+} Span;
+
+/**
+ * Location within a source file.
+ */
+typedef struct SourceLocation {
+ size_t start_line;
+ size_t start_col;
+ size_t end_line;
+ size_t end_col;
+} SourceLocation;
+
+/**
+ * Compile result message.
+ *
+ * Calling code is responsible for freeing all memory allocated
+ * for fields as well as strings.
+ */
+typedef struct Message {
+ /**
+ * Message kind. Currently only Error is implemented.
+ */
+ enum MessageKind kind;
+ /**
+ * Machine-readable identifier of the error
+ */
+ const int8_t *const *code;
+ /**
+ * Plain text of the error
+ */
+ const int8_t *reason;
+ /**
+ * A list of suggestions of how to fix the error
+ */
+ const int8_t *const *hint;
+ /**
+ * Character offset of error origin within a source file
+ */
+ const struct Span *span;
+ /**
+ * Annotated code, containing cause and hints.
+ */
+ const int8_t *const *display;
+ /**
+ * Line and column number of error origin within a source file
+ */
+ const struct SourceLocation *location;
+} Message;
+
+/**
+ * Result of compilation.
+ */
+typedef struct CompileResult {
+ const int8_t *output;
+ const struct Message *messages;
+ size_t messages_len;
+} CompileResult;
+
+/**
+ * Compilation options
+ */
+typedef struct Options {
+ /**
+ * Pass generated SQL string trough a formatter that splits it
+ * into multiple lines and prettifies indentation and spacing.
+ *
+ * Defaults to true.
+ */
+ bool format;
+ /**
+ * Target and dialect to compile to.
+ *
+ * Defaults to `sql.any`, which uses `target` argument from the query header to determine
+ * the SQL dialect.
+ */
+ char *target;
+ /**
+ * Emits the compiler signature as a comment after generated SQL
+ *
+ * Defaults to true.
+ */
+ bool signature_comment;
+} Options;
+
+/**
+ * Compile a PRQL string into a SQL string.
+ *
+ * This is a wrapper for: `prql_to_pl`, `pl_to_rq` and `rq_to_sql` without converting to JSON
+ * between each of the functions.
+ *
+ * See `Options` struct for available compilation options.
+ *
+ * # Safety
+ *
+ * This function assumes zero-terminated input strings.
+ * Calling code is responsible for freeing memory allocated for `CompileResult`
+ * by calling `result_destroy`.
+ */
+struct CompileResult compile(const char *prql_query, const struct Options *options);
+
+/**
+ * Build PL AST from a PRQL string. PL in documented in the
+ * [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast/pl).
+ *
+ * Takes PRQL source buffer and writes PL serialized as JSON to `out` buffer.
+ *
+ * Returns 0 on success and a negative number -1 on failure.
+ *
+ * # Safety
+ *
+ * This function assumes zero-terminated input strings.
+ * Calling code is responsible for freeing memory allocated for `CompileResult`
+ * by calling `result_destroy`.
+ */
+struct CompileResult prql_to_pl(const char *prql_query);
+
+/**
+ * Finds variable references, validates functions calls, determines frames and converts PL to RQ.
+ * PL and RQ are documented in the
+ * [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast).
+ *
+ * Takes PL serialized as JSON buffer and writes RQ serialized as JSON to `out` buffer.
+ *
+ * Returns 0 on success and a negative number -1 on failure.
+ *
+ * # Safety
+ *
+ * This function assumes zero-terminated input strings.
+ * Calling code is responsible for freeing memory allocated for `CompileResult`
+ * by calling `result_destroy`.
+ */
+struct CompileResult pl_to_rq(const char *pl_json);
+
+/**
+ * Convert RQ AST into an SQL string. RQ is documented in the
+ * [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast/rq).
+ *
+ * Takes RQ serialized as JSON buffer and writes SQL source to `out` buffer.
+ *
+ * Returns 0 on success and a negative number -1 on failure.
+ *
+ * # Safety
+ *
+ * This function assumes zero-terminated input strings.
+ * Calling code is responsible for freeing memory allocated for `CompileResult`
+ * by calling `result_destroy`.
+ */
+struct CompileResult rq_to_sql(const char *rq_json, const struct Options *options);
+
+/**
+ * Destroy a `CompileResult` once you are done with it.
+ *
+ * # Safety
+ *
+ * This function expects to be called exactly once after the call of any the functions
+ * that return CompileResult. No fields should be freed manually.
+ */
+void result_destroy(struct CompileResult res);
diff --git a/bindings/prql-lib/libprql_lib.hpp b/bindings/prql-lib/libprql_lib.hpp
new file mode 100644
index 000000000000..01730ea43e56
--- /dev/null
+++ b/bindings/prql-lib/libprql_lib.hpp
@@ -0,0 +1,152 @@
+/*
+ * PRQL is a modern language for transforming data โ a simple, powerful, pipelined SQL replacement
+ *
+ * License: Apache-2.0
+ * Website: https://prql-lang.org/
+ */
+
+/* This file is autogenerated. Do not modify this file manually. */
+
+#include
+#include
+#include
+#include
+#include
+#define FFI_SCOPE "PRQL"
+
+/// Compile message kind. Currently only Error is implemented.
+enum class MessageKind {
+ Error,
+ Warning,
+ Lint,
+};
+
+/// Identifier of a location in source.
+/// Contains offsets in terms of chars.
+struct Span {
+ size_t start;
+ size_t end;
+};
+
+/// Location within a source file.
+struct SourceLocation {
+ size_t start_line;
+ size_t start_col;
+ size_t end_line;
+ size_t end_col;
+};
+
+/// Compile result message.
+///
+/// Calling code is responsible for freeing all memory allocated
+/// for fields as well as strings.
+struct Message {
+ /// Message kind. Currently only Error is implemented.
+ MessageKind kind;
+ /// Machine-readable identifier of the error
+ const int8_t *const *code;
+ /// Plain text of the error
+ const int8_t *reason;
+ /// A list of suggestions of how to fix the error
+ const int8_t *const *hint;
+ /// Character offset of error origin within a source file
+ const Span *span;
+ /// Annotated code, containing cause and hints.
+ const int8_t *const *display;
+ /// Line and column number of error origin within a source file
+ const SourceLocation *location;
+};
+
+/// Result of compilation.
+struct CompileResult {
+ const int8_t *output;
+ const Message *messages;
+ size_t messages_len;
+};
+
+/// Compilation options
+struct Options {
+ /// Pass generated SQL string trough a formatter that splits it
+ /// into multiple lines and prettifies indentation and spacing.
+ ///
+ /// Defaults to true.
+ bool format;
+ /// Target and dialect to compile to.
+ ///
+ /// Defaults to `sql.any`, which uses `target` argument from the query header to determine
+ /// the SQL dialect.
+ char *target;
+ /// Emits the compiler signature as a comment after generated SQL
+ ///
+ /// Defaults to true.
+ bool signature_comment;
+};
+
+extern "C" {
+
+/// Compile a PRQL string into a SQL string.
+///
+/// This is a wrapper for: `prql_to_pl`, `pl_to_rq` and `rq_to_sql` without converting to JSON
+/// between each of the functions.
+///
+/// See `Options` struct for available compilation options.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+CompileResult compile(const char *prql_query, const Options *options);
+
+/// Build PL AST from a PRQL string. PL in documented in the
+/// [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast/pl).
+///
+/// Takes PRQL source buffer and writes PL serialized as JSON to `out` buffer.
+///
+/// Returns 0 on success and a negative number -1 on failure.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+CompileResult prql_to_pl(const char *prql_query);
+
+/// Finds variable references, validates functions calls, determines frames and converts PL to RQ.
+/// PL and RQ are documented in the
+/// [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast).
+///
+/// Takes PL serialized as JSON buffer and writes RQ serialized as JSON to `out` buffer.
+///
+/// Returns 0 on success and a negative number -1 on failure.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+CompileResult pl_to_rq(const char *pl_json);
+
+/// Convert RQ AST into an SQL string. RQ is documented in the
+/// [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast/rq).
+///
+/// Takes RQ serialized as JSON buffer and writes SQL source to `out` buffer.
+///
+/// Returns 0 on success and a negative number -1 on failure.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+CompileResult rq_to_sql(const char *rq_json, const Options *options);
+
+/// Destroy a `CompileResult` once you are done with it.
+///
+/// # Safety
+///
+/// This function expects to be called exactly once after the call of any the functions
+/// that return CompileResult. No fields should be freed manually.
+void result_destroy(CompileResult res);
+
+} // extern "C"
diff --git a/bindings/prql-lib/src/lib.rs b/bindings/prql-lib/src/lib.rs
new file mode 100644
index 000000000000..6ab3f3f01fed
--- /dev/null
+++ b/bindings/prql-lib/src/lib.rs
@@ -0,0 +1,327 @@
+#![cfg(not(target_family = "wasm"))]
+
+extern crate libc;
+
+use libc::{c_char, size_t};
+use prql_compiler::ErrorMessages;
+use prql_compiler::Target;
+use std::ffi::CStr;
+use std::ffi::CString;
+use std::str::FromStr;
+
+/// Compile a PRQL string into a SQL string.
+///
+/// This is a wrapper for: `prql_to_pl`, `pl_to_rq` and `rq_to_sql` without converting to JSON
+/// between each of the functions.
+///
+/// See `Options` struct for available compilation options.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+#[no_mangle]
+pub unsafe extern "C" fn compile(
+ prql_query: *const c_char,
+ options: *const Options,
+) -> CompileResult {
+ let prql_query: String = c_str_to_string(prql_query);
+
+ let options = options.as_ref().map(convert_options).transpose();
+
+ let result = options
+ .and_then(|opts| {
+ Ok(prql_query.as_str())
+ .and_then(prql_compiler::prql_to_pl)
+ .and_then(prql_compiler::pl_to_rq)
+ .and_then(|rq| prql_compiler::rq_to_sql(rq, &opts.unwrap_or_default()))
+ })
+ .map_err(|e| e.composed("", &prql_query, false));
+
+ result_into_c_str(result)
+}
+
+/// Build PL AST from a PRQL string. PL in documented in the
+/// [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast/pl).
+///
+/// Takes PRQL source buffer and writes PL serialized as JSON to `out` buffer.
+///
+/// Returns 0 on success and a negative number -1 on failure.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+#[no_mangle]
+pub unsafe extern "C" fn prql_to_pl(prql_query: *const c_char) -> CompileResult {
+ let prql_query: String = c_str_to_string(prql_query);
+
+ let result = Ok(prql_query.as_str())
+ .and_then(prql_compiler::prql_to_pl)
+ .and_then(prql_compiler::json::from_pl);
+ result_into_c_str(result)
+}
+
+/// Finds variable references, validates functions calls, determines frames and converts PL to RQ.
+/// PL and RQ are documented in the
+/// [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast).
+///
+/// Takes PL serialized as JSON buffer and writes RQ serialized as JSON to `out` buffer.
+///
+/// Returns 0 on success and a negative number -1 on failure.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+#[no_mangle]
+pub unsafe extern "C" fn pl_to_rq(pl_json: *const c_char) -> CompileResult {
+ let pl_json: String = c_str_to_string(pl_json);
+
+ let result = Ok(pl_json.as_str())
+ .and_then(prql_compiler::json::to_pl)
+ .and_then(prql_compiler::pl_to_rq)
+ .and_then(prql_compiler::json::from_rq);
+ result_into_c_str(result)
+}
+
+/// Convert RQ AST into an SQL string. RQ is documented in the
+/// [prql-compiler Rust crate](https://docs.rs/prql-compiler/latest/prql_compiler/ast/rq).
+///
+/// Takes RQ serialized as JSON buffer and writes SQL source to `out` buffer.
+///
+/// Returns 0 on success and a negative number -1 on failure.
+///
+/// # Safety
+///
+/// This function assumes zero-terminated input strings.
+/// Calling code is responsible for freeing memory allocated for `CompileResult`
+/// by calling `result_destroy`.
+#[no_mangle]
+pub unsafe extern "C" fn rq_to_sql(
+ rq_json: *const c_char,
+ options: *const Options,
+) -> CompileResult {
+ let rq_json: String = c_str_to_string(rq_json);
+
+ let options = options.as_ref().map(convert_options).transpose();
+
+ let result = options.and_then(|options| {
+ Ok(rq_json.as_str())
+ .and_then(prql_compiler::json::to_rq)
+ .and_then(|x| prql_compiler::rq_to_sql(x, &options.unwrap_or_default()))
+ });
+ result_into_c_str(result)
+}
+
+/// Compilation options
+#[repr(C)]
+pub struct Options {
+ /// Pass generated SQL string trough a formatter that splits it
+ /// into multiple lines and prettifies indentation and spacing.
+ ///
+ /// Defaults to true.
+ pub format: bool,
+
+ /// Target and dialect to compile to.
+ ///
+ /// Defaults to `sql.any`, which uses `target` argument from the query header to determine
+ /// the SQL dialect.
+ pub target: *mut c_char,
+
+ /// Emits the compiler signature as a comment after generated SQL
+ ///
+ /// Defaults to true.
+ pub signature_comment: bool,
+}
+
+/// Result of compilation.
+#[repr(C)]
+pub struct CompileResult {
+ pub output: *const i8,
+ pub messages: *const Message,
+ pub messages_len: size_t,
+}
+
+/// Compile message kind. Currently only Error is implemented.
+#[repr(C)]
+pub enum MessageKind {
+ Error,
+ Warning,
+ Lint,
+}
+
+/// Compile result message.
+///
+/// Calling code is responsible for freeing all memory allocated
+/// for fields as well as strings.
+// Make sure to keep in sync with prql_compiler::ErrorMessage
+#[repr(C)]
+pub struct Message {
+ /// Message kind. Currently only Error is implemented.
+ pub kind: MessageKind,
+ /// Machine-readable identifier of the error
+ pub code: *const *const i8,
+ /// Plain text of the error
+ pub reason: *const i8,
+ /// A list of suggestions of how to fix the error
+ pub hint: *const *const i8,
+ /// Character offset of error origin within a source file
+ pub span: *const Span,
+
+ /// Annotated code, containing cause and hints.
+ pub display: *const *const i8,
+ /// Line and column number of error origin within a source file
+ pub location: *const SourceLocation,
+}
+
+/// Identifier of a location in source.
+/// Contains offsets in terms of chars.
+// Make sure to keep in sync with prql_compiler::Span
+#[repr(C)]
+pub struct Span {
+ pub start: size_t,
+ pub end: size_t,
+}
+
+/// Location within a source file.
+// Make sure to keep in sync with prql_compiler::SourceLocation
+#[repr(C)]
+pub struct SourceLocation {
+ pub start_line: size_t,
+ pub start_col: size_t,
+
+ pub end_line: size_t,
+ pub end_col: size_t,
+}
+
+/// Destroy a `CompileResult` once you are done with it.
+///
+/// # Safety
+///
+/// This function expects to be called exactly once after the call of any the functions
+/// that return CompileResult. No fields should be freed manually.
+#[no_mangle]
+pub unsafe extern "C" fn result_destroy(res: CompileResult) {
+ // This is required because we are allocating memory for
+ // strings, vectors and options.
+ // For strings and vectors this is required, but options may be
+ // able to live entirely within the struct, instead of the heap.
+
+ for i in 0..res.messages_len {
+ let e = &*res.messages.add(i);
+
+ if !e.code.is_null() {
+ drop(CString::from_raw(*e.code as *mut i8));
+ drop(Box::from_raw(e.code as *mut *const i8));
+ }
+ drop(CString::from_raw(e.reason as *mut i8));
+ if !e.hint.is_null() {
+ drop(CString::from_raw(*e.hint as *mut i8));
+ drop(Box::from_raw(e.hint as *mut *const i8));
+ }
+ if !e.span.is_null() {
+ drop(Box::from_raw(e.span as *mut Span));
+ }
+ if !e.display.is_null() {
+ drop(CString::from_raw(*e.display as *mut i8));
+ drop(Box::from_raw(e.display as *mut *const i8));
+ }
+ if !e.location.is_null() {
+ drop(Box::from_raw(e.location as *mut SourceLocation));
+ }
+ }
+ drop(Vec::from_raw_parts(
+ res.messages as *mut i8,
+ res.messages_len,
+ res.messages_len,
+ ));
+ drop(CString::from_raw(res.output as *mut i8));
+}
+
+unsafe fn result_into_c_str(result: Result) -> CompileResult {
+ match result {
+ Ok(output) => CompileResult {
+ output: convert_string(output),
+ messages: ::std::ptr::null_mut(),
+ messages_len: 0,
+ },
+ Err(err) => {
+ let mut errors = Vec::with_capacity(err.inner.len());
+ errors.extend(err.inner.into_iter().map(|e| Message {
+ kind: MessageKind::Error,
+ code: option_to_ptr(e.code.map(convert_string)),
+ reason: convert_string(e.reason),
+ hint: option_to_ptr(e.hint.map(convert_string)),
+ span: option_to_ptr(e.span.map(convert_span)),
+ display: option_to_ptr(e.display.map(convert_string)),
+ location: option_to_ptr(e.location.map(convert_source_location)),
+ }));
+ CompileResult {
+ output: CString::default().into_raw(),
+ messages_len: errors.len(),
+ messages: errors.leak().as_ptr(),
+ }
+ }
+ }
+}
+
+/// Allocates the value on the heap and returns a pointer to it.
+/// If the input is None, it returns null pointer.
+fn option_to_ptr(o: Option) -> *const T {
+ match o {
+ Some(x) => {
+ let b = Box::new(x);
+ Box::into_raw(b)
+ }
+ None => ::std::ptr::null(),
+ }
+}
+
+fn convert_string(x: String) -> *const i8 {
+ CString::new(x).unwrap_or_default().into_raw()
+}
+
+fn convert_span(x: prql_compiler::Span) -> Span {
+ Span {
+ start: x.start,
+ end: x.end,
+ }
+}
+
+fn convert_source_location(x: prql_compiler::SourceLocation) -> SourceLocation {
+ SourceLocation {
+ start_line: x.start.0,
+ start_col: x.start.1,
+ end_line: x.end.0,
+ end_col: x.end.1,
+ }
+}
+
+unsafe fn c_str_to_string(c_str: *const c_char) -> String {
+ // inefficient, but simple
+ CStr::from_ptr(c_str).to_string_lossy().into_owned()
+}
+
+fn convert_options(o: &Options) -> Result {
+ let target = if !o.target.is_null() {
+ Some(unsafe { c_str_to_string(o.target) })
+ } else {
+ None
+ };
+ let target = target
+ .as_deref()
+ .filter(|x| !x.is_empty())
+ .unwrap_or("sql.any");
+
+ let target = Target::from_str(target).map_err(|e| prql_compiler::downcast(e.into()))?;
+
+ Ok(prql_compiler::Options {
+ format: o.format,
+ target,
+ signature_comment: o.signature_comment,
+ })
+}
diff --git a/bindings/prql-php/.gitignore b/bindings/prql-php/.gitignore
new file mode 100644
index 000000000000..4c802cd562b2
--- /dev/null
+++ b/bindings/prql-php/.gitignore
@@ -0,0 +1,2 @@
+vendor/
+lib/
diff --git a/bindings/prql-php/README.md b/bindings/prql-php/README.md
new file mode 100644
index 000000000000..73ae351e1958
--- /dev/null
+++ b/bindings/prql-php/README.md
@@ -0,0 +1,69 @@
+# prql-php
+
+`prql-php` offers PHP bindings to `prql-compiler` crate through FFI.
+
+It provides the `Compiler` class which contains `compile`, `prqlToPL`, `plToRQ`
+and `rqToSQL` functions.
+
+It's still at an early stage, and isn't published to Composer. Contributions are
+welcome.
+
+## Installation
+
+The [PHP FFI extension](https://www.php.net/manual/en/book.ffi.php) needs to be
+enabled. Set `ffi.enable` in your php.ini configuration file to `"true"`.
+
+## Usage
+
+```php
+compile("from employees");
+
+echo $result->output;
+```
+
+## Development
+
+### Environment
+
+A way to establish a dev environment with PHP, the ext-ffi extension and
+Composer is to use a [nix flake](https://github.com/loophp/nix-shell). After
+installing nix, enable experimental flakes feature:
+
+```
+mkdir -p ~/.config/nix
+echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
+```
+
+Now you can spawn a shell from `prql-php/`:
+
+```
+nix shell github:loophp/nix-shell#env-php81 --impure
+```
+
+This will pull-in ext-ffi extension, because it's declared in `composer.json`.
+
+### Building
+
+There is a `build.sh` script that:
+
+- runs cargo to build `libprql_lib`,
+- copies `libprql_lib.so` into `lib`,
+- copies `libprql_lib.h` into `lib`.
+
+### Tests
+
+```
+sh build.sh
+./vendor/bin/phpunit tests
+```
+
+### Code style
+
+```
+./vendor/bin/phpcs --standard=PSR12 src tests
+```
diff --git a/bindings/prql-php/build.sh b/bindings/prql-php/build.sh
new file mode 100644
index 000000000000..6964f183f88d
--- /dev/null
+++ b/bindings/prql-php/build.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# TODO: use a task file for these build scripts
+
+cargo build -p prql-lib --release
+
+mkdir -p lib
+cp ../../target/release/libprql_lib.so ../prql-lib/libprql_lib.h lib
diff --git a/bindings/prql-php/composer.json b/bindings/prql-php/composer.json
new file mode 100644
index 000000000000..e224fe1ca46f
--- /dev/null
+++ b/bindings/prql-php/composer.json
@@ -0,0 +1,38 @@
+{
+ "name": "prql/compiler",
+ "description": "PRQL compiler bindings.",
+ "keywords": [
+ "prql",
+ "sql"
+ ],
+ "homepage": "https://prql-lang.org/",
+ "type": "library",
+ "license": "Apache-2.0",
+ "autoload": {
+ "psr-4": {
+ "Prql\\Compiler\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Prql\\Tests\\": "tests/"
+ }
+ },
+ "authors": [
+ {
+ "name": "Jonathan"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/PRQL/prql/issues",
+ "source": "https://github.com/PRQL/prql",
+ "docs": "https://prql-lang.org/book/"
+ },
+ "require": {
+ "ext-ffi": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10",
+ "squizlabs/php_codesniffer": "^3.7"
+ }
+}
diff --git a/bindings/prql-php/composer.lock b/bindings/prql-php/composer.lock
new file mode 100644
index 000000000000..d1c8a284c6c4
--- /dev/null
+++ b/bindings/prql-php/composer.lock
@@ -0,0 +1,1519 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "6463be3ca6ff9224f299805a4a534a78",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.11.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614",
+ "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "conflict": {
+ "doctrine/collections": "<1.6.8",
+ "doctrine/common": "<2.13.3 || >=3,<3.2.2"
+ },
+ "require-dev": {
+ "doctrine/collections": "^1.6.8",
+ "doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
+ },
+ "type": "library",
+ "autoload": {
+ "files": ["src/DeepCopy/deep_copy.php"],
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["MIT"],
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": ["clone", "copy", "duplicate", "object", "object graph"],
+ "support": {
+ "issues": "https://github.com/myclabs/DeepCopy/issues",
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0"
+ },
+ "funding": [
+ {
+ "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-03-03T13:19:32+00:00"
+ },
+ {
+ "name": "nikic/php-parser",
+ "version": "v4.15.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nikic/PHP-Parser.git",
+ "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039",
+ "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=7.0"
+ },
+ "require-dev": {
+ "ircmaxell/php-yacc": "^0.0.7",
+ "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
+ },
+ "bin": ["bin/php-parse"],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpParser\\": "lib/PhpParser"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Nikita Popov"
+ }
+ ],
+ "description": "A PHP parser written in PHP",
+ "keywords": ["parser", "php"],
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3"
+ },
+ "time": "2023-01-16T22:05:37+00:00"
+ },
+ {
+ "name": "phar-io/manifest",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/manifest.git",
+ "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
+ "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-phar": "*",
+ "ext-xmlwriter": "*",
+ "phar-io/version": "^3.0.1",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
+ "support": {
+ "issues": "https://github.com/phar-io/manifest/issues",
+ "source": "https://github.com/phar-io/manifest/tree/2.0.3"
+ },
+ "time": "2021-07-20T11:28:43+00:00"
+ },
+ {
+ "name": "phar-io/version",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/version.git",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Library for handling version information and constraints",
+ "support": {
+ "issues": "https://github.com/phar-io/version/issues",
+ "source": "https://github.com/phar-io/version/tree/3.2.1"
+ },
+ "time": "2022-02-21T01:04:05+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "10.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "bf4fbc9c13af7da12b3ea807574fb460f255daba"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bf4fbc9c13af7da12b3ea807574fb460f255daba",
+ "reference": "bf4fbc9c13af7da12b3ea807574fb460f255daba",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-xmlwriter": "*",
+ "nikic/php-parser": "^4.14",
+ "php": ">=8.1",
+ "phpunit/php-file-iterator": "^4.0",
+ "phpunit/php-text-template": "^3.0",
+ "sebastian/code-unit-reverse-lookup": "^3.0",
+ "sebastian/complexity": "^3.0",
+ "sebastian/environment": "^6.0",
+ "sebastian/lines-of-code": "^2.0",
+ "sebastian/version": "^4.0",
+ "theseer/tokenizer": "^1.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "suggest": {
+ "ext-pcov": "*",
+ "ext-xdebug": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "10.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": ["coverage", "testing", "xunit"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:14:34+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "4.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd",
+ "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": ["filesystem", "iterator"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-10T16:53:14+00:00"
+ },
+ {
+ "name": "phpunit/php-invoker",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
+ "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^10.0"
+ },
+ "suggest": {
+ "ext-pcntl": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
+ "keywords": ["process"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:56:09+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d",
+ "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": ["template"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:56:46+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d",
+ "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": ["timer"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-timer/issues",
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:57:52+00:00"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "10.0.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "a6f61c5629dd95db79af72f1e94d56702187479a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6f61c5629dd95db79af72f1e94d56702187479a",
+ "reference": "a6f61c5629dd95db79af72f1e94d56702187479a",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
+ "ext-xmlwriter": "*",
+ "myclabs/deep-copy": "^1.10.1",
+ "phar-io/manifest": "^2.0.3",
+ "phar-io/version": "^3.0.2",
+ "php": ">=8.1",
+ "phpunit/php-code-coverage": "^10.0",
+ "phpunit/php-file-iterator": "^4.0",
+ "phpunit/php-invoker": "^4.0",
+ "phpunit/php-text-template": "^3.0",
+ "phpunit/php-timer": "^6.0",
+ "sebastian/cli-parser": "^2.0",
+ "sebastian/code-unit": "^2.0",
+ "sebastian/comparator": "^5.0",
+ "sebastian/diff": "^5.0",
+ "sebastian/environment": "^6.0",
+ "sebastian/exporter": "^5.0",
+ "sebastian/global-state": "^6.0",
+ "sebastian/object-enumerator": "^5.0",
+ "sebastian/recursion-context": "^5.0",
+ "sebastian/type": "^4.0",
+ "sebastian/version": "^4.0"
+ },
+ "suggest": {
+ "ext-soap": "*"
+ },
+ "bin": ["phpunit"],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "10.0-dev"
+ }
+ },
+ "autoload": {
+ "files": ["src/Framework/Assert/Functions.php"],
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": ["phpunit", "testing", "xunit"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/phpunit/issues",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.7"
+ },
+ "funding": [
+ {
+ "url": "https://phpunit.de/sponsors.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-02-08T15:16:31+00:00"
+ },
+ {
+ "name": "sebastian/cli-parser",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/cli-parser.git",
+ "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae",
+ "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for parsing CLI options",
+ "homepage": "https://github.com/sebastianbergmann/cli-parser",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:58:15+00:00"
+ },
+ {
+ "name": "sebastian/code-unit",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit.git",
+ "reference": "a81fee9eef0b7a76af11d121767abc44c104e503"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503",
+ "reference": "a81fee9eef0b7a76af11d121767abc44c104e503",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/code-unit",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:58:43+00:00"
+ },
+ {
+ "name": "sebastian/code-unit-reverse-lookup",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
+ "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Looks up which function or method a line of code belongs to",
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:59:15+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c",
+ "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-mbstring": "*",
+ "php": ">=8.1",
+ "sebastian/diff": "^5.0",
+ "sebastian/exporter": "^5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "https://github.com/sebastianbergmann/comparator",
+ "keywords": ["comparator", "compare", "equality"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/comparator/issues",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:07:16+00:00"
+ },
+ {
+ "name": "sebastian/complexity",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/complexity.git",
+ "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6",
+ "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.10",
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for calculating the complexity of PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/complexity",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/complexity/issues",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:59:47+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "70dd1b20bc198da394ad542e988381b44e64e39f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/70dd1b20bc198da394ad542e988381b44e64e39f",
+ "reference": "70dd1b20bc198da394ad542e988381b44e64e39f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0",
+ "symfony/process": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": ["diff", "udiff", "unidiff", "unified diff"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:00:31+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc",
+ "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "suggest": {
+ "ext-posix": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "https://github.com/sebastianbergmann/environment",
+ "keywords": ["Xdebug", "environment", "hhvm"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/environment/issues",
+ "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:03:04+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0",
+ "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": ">=8.1",
+ "sebastian/recursion-context": "^5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
+ "keywords": ["export", "exporter"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:06:49+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "aab257c712de87b90194febd52e4d184551c2d44"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44",
+ "reference": "aab257c712de87b90194febd52e4d184551c2d44",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "sebastian/object-reflector": "^3.0",
+ "sebastian/recursion-context": "^5.0"
+ },
+ "require-dev": {
+ "ext-dom": "*",
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": ["global state"],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/global-state/issues",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:07:38+00:00"
+ },
+ {
+ "name": "sebastian/lines-of-code",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/lines-of-code.git",
+ "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130",
+ "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.10",
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for counting the lines of code in PHP source code",
+ "homepage": "https://github.com/sebastianbergmann/lines-of-code",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:08:02+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906",
+ "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "sebastian/object-reflector": "^3.0",
+ "sebastian/recursion-context": "^5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:08:32+00:00"
+ },
+ {
+ "name": "sebastian/object-reflector",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-reflector.git",
+ "reference": "24ed13d98130f0e7122df55d06c5c4942a577957"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957",
+ "reference": "24ed13d98130f0e7122df55d06c5c4942a577957",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Allows reflection of object attributes, including inherited and non-public ones",
+ "homepage": "https://github.com/sebastianbergmann/object-reflector/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:06:18+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "05909fb5bc7df4c52992396d0116aed689f93712"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712",
+ "reference": "05909fb5bc7df4c52992396d0116aed689f93712",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:05:40+00:00"
+ },
+ {
+ "name": "sebastian/type",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "462699a16464c3944eefc02ebdd77882bd3925bf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf",
+ "reference": "462699a16464c3944eefc02ebdd77882bd3925bf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/type/issues",
+ "source": "https://github.com/sebastianbergmann/type/tree/4.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:10:45+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "4.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17",
+ "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/version/issues",
+ "source": "https://github.com/sebastianbergmann/version/tree/4.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-07T11:34:05+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.7.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879",
+ "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ },
+ "bin": ["bin/phpcs", "bin/phpcbf"],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "keywords": ["phpcs", "standards", "static analysis"],
+ "support": {
+ "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
+ "source": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
+ },
+ "time": "2023-02-22T23:07:41+00:00"
+ },
+ {
+ "name": "theseer/tokenizer",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theseer/tokenizer.git",
+ "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": ["src/"]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": ["BSD-3-Clause"],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues",
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2021-07-28T10:34:58+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "ext-ffi": "*"
+ },
+ "platform-dev": [],
+ "plugin-api-version": "2.3.0"
+}
diff --git a/bindings/prql-php/phpstan.neon b/bindings/prql-php/phpstan.neon
new file mode 100644
index 000000000000..e68e067527ee
--- /dev/null
+++ b/bindings/prql-php/phpstan.neon
@@ -0,0 +1,16 @@
+parameters:
+ level: 9
+ paths:
+ - src
+ - tests
+ ignoreErrors:
+ # Since PHPStan doesn't know about the existence of the functions in libprql,
+ # it complains since they get dynamically invoked on the FFI object instance
+ # without being statically defined, so they're unknown.
+ - '#Call to an undefined method FFI::compile\(\)\.#'
+ - '#Call to an undefined method FFI::prql_to_pl\(\)\.#'
+ - '#Call to an undefined method FFI::pl_to_rq\(\)\.#'
+ - '#Call to an undefined method FFI::rq_to_sql\(\)\.#'
+ - '#Cannot access property \$format on FFI\\CData\|null\.#'
+ - '#Cannot access property \$signature_comment on FFI\\CData\|null\.#'
+ - '#Cannot access property \$target on FFI\\CData\|null\.#'
diff --git a/bindings/prql-php/src/Compiler.php b/bindings/prql-php/src/Compiler.php
new file mode 100644
index 000000000000..c56a3a1f8eb0
--- /dev/null
+++ b/bindings/prql-php/src/Compiler.php
@@ -0,0 +1,277 @@
+optionsInit($options);
+
+ $res = self::$ffi->compile($prql_query, \FFI::addr($ffi_options));
+
+ $this->optionsDestroy($ffi_options);
+
+ return $this->convertResult($res);
+ }
+
+ /**
+ * Compile a PRQL string into PL.
+ *
+ * @param string $prql_query PRQL query
+ *
+ * @return Result compilation result containing PL serialized as JSON
+ *
+ * @throws \InvalidArgumentException on NULL input
+ *
+ * @api
+ */
+ public function prqlToPL(string $prql_query): Result
+ {
+ if (!$prql_query) {
+ throw new \InvalidArgumentException('No query given.');
+ }
+
+ $res = self::$ffi->prql_to_pl($prql_query);
+
+ return $this->convertResult($res);
+ }
+
+ /**
+ * Converts PL to RQ.
+ *
+ * @param string $pl_json PL serialized as JSON
+ *
+ * @return Result compilation result containing RQ serialized as JSON
+ *
+ * @throws \InvalidArgumentException on NULL input
+ *
+ * @api
+ */
+ public function plToRQ(string $pl_json): Result
+ {
+ if (!$pl_json) {
+ throw new \InvalidArgumentException('No query given.');
+ }
+
+ $res = self::$ffi->pl_to_rq($pl_json);
+
+ return $this->convertResult($res);
+ }
+
+ /**
+ * Converts RQ to SQL.
+ *
+ * @param string $rq_json RQ serialized as JSON
+ * @param Options|null $options compile options
+ *
+ * @return Result compilation result containing SQL query
+ *
+ * @throws \InvalidArgumentException on NULL input
+ *
+ * @api
+ */
+ public function rqToSQL(string $rq_json, ?Options $options = null): Result
+ {
+ if (!$rq_json) {
+ throw new \InvalidArgumentException('No query given.');
+ }
+
+ $ffi_options = $this->optionsInit($options);
+
+ $res = self::$ffi->rq_to_sql($rq_json, \FFI::addr($ffi_options));
+
+ $this->optionsDestroy($ffi_options);
+
+ return $this->convertResult($res);
+ }
+
+ private function optionsInit(?Options $options = null)
+ {
+ if ($options === null) {
+ $options = new Options();
+ }
+
+ $ffi_options = self::$ffi->new('struct Options');
+ $ffi_options->format = $options->format;
+ $ffi_options->signature_comment = $options->signature_comment;
+
+ if (isset($options->target)) {
+ $len = strlen($options->target) + 1;
+ $ffi_options->target = \FFI::new("char[$len]", false);
+ \FFI::memcpy($ffi_options->target, $options->target, $len - 1);
+ }
+
+ return $ffi_options;
+ }
+
+ private function optionsDestroy($ffi_options)
+ {
+ if (!\FFI::isNull($ffi_options->target)) {
+ \FFI::free($ffi_options->target);
+ }
+
+ unset($ffi_options);
+ }
+
+ private function convertResult($ffi_res): Result
+ {
+ $res = new Result();
+
+ // convert string
+ $res->output = $this->convertString($ffi_res->output);
+
+ $res->messages = [];
+ for ($i = 0; $i < $ffi_res->messages_len; ++$i) {
+ $res->messages[$i] = $this->convertMessage($ffi_res->messages[$i]);
+ }
+
+ // free the ffi_result
+ self::$ffi->result_destroy($ffi_res);
+
+ return $res;
+ }
+
+ private function convertMessage($ffi_msg): Message
+ {
+ $msg = new Message();
+
+ // I'm using numbers here, I cannot find a way to refer to MessageKind.Error
+ if ($ffi_msg->kind == 0) {
+ $msg->kind = MessageKind::Error;
+ } elseif ($ffi_msg->kind == 1) {
+ $msg->kind = MessageKind::Warning;
+ } elseif ($ffi_msg->kind == 2) {
+ $msg->kind = MessageKind::Lint;
+ }
+
+ $msg->code = $this->convertNullableString($ffi_msg->code);
+ $msg->reason = $this->convertString($ffi_msg->reason);
+ $msg->span = $this->convertSpan($ffi_msg->span);
+ $msg->hint = $this->convertNullableString($ffi_msg->hint);
+
+ $msg->display = $this->convertNullableString($ffi_msg->display);
+ $msg->location = $this->convertLocation($ffi_msg->location);
+
+ return $msg;
+ }
+
+ private function convertSpan($ffi_ptr): ?Span
+ {
+ if (is_null($ffi_ptr) || \FFI::isNull($ffi_ptr)) {
+ return null;
+ }
+
+ $span = new Span();
+ $span->start = $ffi_ptr[0]->start;
+ $span->end = $ffi_ptr[0]->end;
+
+ return $span;
+ }
+
+ private function convertLocation($ffi_ptr): ?SourceLocation
+ {
+ if (is_null($ffi_ptr) || \FFI::isNull($ffi_ptr)) {
+ return null;
+ }
+
+ $location = new SourceLocation();
+ $location->start_line = $ffi_ptr[0]->start_line;
+ $location->start_col = $ffi_ptr[0]->start_col;
+ $location->end_line = $ffi_ptr[0]->end_line;
+ $location->end_col = $ffi_ptr[0]->end_col;
+
+ return $location;
+ }
+
+ private function convertNullableString($ffi_ptr): ?string
+ {
+ if (is_null($ffi_ptr) || \FFI::isNull($ffi_ptr)) {
+ return null;
+ }
+ // dereference
+ return $this->convertString($ffi_ptr[0]);
+ }
+
+ private function convertString($ffi_ptr): string
+ {
+ return \FFI::string(\FFI::cast(\FFI::type('char*'), $ffi_ptr));
+ }
+}
diff --git a/bindings/prql-php/src/Message.php b/bindings/prql-php/src/Message.php
new file mode 100644
index 000000000000..9029fb7fd889
--- /dev/null
+++ b/bindings/prql-php/src/Message.php
@@ -0,0 +1,40 @@
+
+ */
+ public array $messages;
+}
diff --git a/bindings/prql-php/src/SourceLocation.php b/bindings/prql-php/src/SourceLocation.php
new file mode 100644
index 000000000000..e051549cb493
--- /dev/null
+++ b/bindings/prql-php/src/SourceLocation.php
@@ -0,0 +1,31 @@
+assertTrue(extension_loaded("ffi"));
+ }
+
+ public function testPrqlLibraryFileExists(): void
+ {
+ $this->assertFileExists("lib/libprql_lib.so");
+ }
+
+ public function testPrqlHeaderFileExists(): void
+ {
+ $this->assertFileExists("lib/libprql_lib.h");
+ }
+
+ public function testInvalidQuery(): void
+ {
+ $prql = new Compiler();
+ $res = $prql->compile("invalid");
+
+ $this->assertCount(1, $res->messages);
+ }
+
+ public function testCompileWorks(): void
+ {
+ $options = new Options();
+ $options->format = false;
+ $options->signature_comment = false;
+ $options->target = "sql.mssql";
+ $prql = new Compiler();
+
+ $actual = $prql->compile("from employees | take 10", $options);
+ $this->assertCount(0, $actual->messages);
+
+ $this->assertEquals("SELECT TOP (10) * FROM employees", $actual->output);
+ }
+
+ public function testOtherFunctions(): void
+ {
+ $prql = new Compiler();
+
+ $query = "
+ let a = (from employees | take 10)
+
+ from a | select [first_name]
+ ";
+
+ $pl = $prql->prqlToPL($query);
+ $this->assertCount(0, $pl->messages);
+
+ $rq = $prql->plToRQ($pl->output);
+ $this->assertCount(0, $rq->messages);
+
+ $via_json = $prql->rqToSQL($rq->output);
+ $this->assertCount(0, $via_json->messages);
+
+ $direct = $prql->compile($query);
+ $this->assertCount(0, $direct->messages);
+
+ $this->assertEquals($via_json, $direct);
+ }
+}
diff --git a/prql-python/.gitignore b/bindings/prql-python/.gitignore
similarity index 100%
rename from prql-python/.gitignore
rename to bindings/prql-python/.gitignore
diff --git a/prql-python/Cargo.toml b/bindings/prql-python/Cargo.toml
similarity index 88%
rename from prql-python/Cargo.toml
rename to bindings/prql-python/Cargo.toml
index 0f5adc08c9dd..23933f393284 100644
--- a/prql-python/Cargo.toml
+++ b/bindings/prql-python/Cargo.toml
@@ -17,7 +17,7 @@ name = "prql_python"
pyo3 = {version = "0.18.0", features = ["abi3-py37"]}
[dependencies]
-prql-compiler = {path = "../prql-compiler", default-features = false}
+prql-compiler = {path = "../../prql-compiler", default-features = false}
[dev-dependencies]
insta = {version = "1.28", features = ["colors", "glob", "yaml"]}
diff --git a/prql-python/README.md b/bindings/prql-python/README.md
similarity index 100%
rename from prql-python/README.md
rename to bindings/prql-python/README.md
diff --git a/prql-python/build.rs b/bindings/prql-python/build.rs
similarity index 100%
rename from prql-python/build.rs
rename to bindings/prql-python/build.rs
diff --git a/prql-python/noxfile.py b/bindings/prql-python/noxfile.py
similarity index 86%
rename from prql-python/noxfile.py
rename to bindings/prql-python/noxfile.py
index a695600cfbed..101a38c7e9e0 100644
--- a/prql-python/noxfile.py
+++ b/bindings/prql-python/noxfile.py
@@ -22,7 +22,7 @@ def tests(session: Session) -> None:
"""Run the test suite with pytest."""
print("CWD", os.getcwd())
session.install(
- "-v", "--no-index", f"--find-links={Path('..', 'dist')}", "prql_python"
+ "-v", "--no-index", f"--find-links={Path('..', '..', 'dist')}", "prql_python"
)
session.install("-v", "-r", "requirements.txt")
session.run("pytest", str(Path("python", "tests")))
diff --git a/prql-python/pyproject.toml b/bindings/prql-python/pyproject.toml
similarity index 100%
rename from prql-python/pyproject.toml
rename to bindings/prql-python/pyproject.toml
diff --git a/prql-python/python/tests/conftest.py b/bindings/prql-python/python/tests/conftest.py
similarity index 83%
rename from prql-python/python/tests/conftest.py
rename to bindings/prql-python/python/tests/conftest.py
index 9bfb40dab01f..a12d02b8049e 100644
--- a/prql-python/python/tests/conftest.py
+++ b/bindings/prql-python/python/tests/conftest.py
@@ -5,7 +5,7 @@
@pytest.fixture()
def example_queries():
- website_path = "../website/content/_index.md"
+ website_path = "../../web/website/content/_index.md"
with open(website_path, "r") as f:
website = f.read()
website_yaml = yaml.safe_load(website.replace("---", ""))
diff --git a/prql-python/python/tests/test_all.py b/bindings/prql-python/python/tests/test_all.py
similarity index 82%
rename from prql-python/python/tests/test_all.py
rename to bindings/prql-python/python/tests/test_all.py
index a1a364f0a840..481f9055cae2 100644
--- a/prql-python/python/tests/test_all.py
+++ b/bindings/prql-python/python/tests/test_all.py
@@ -49,24 +49,28 @@ def test_compile_options():
"""
query_mssql = "prql target:sql.mssql\nfrom a | take 3"
+ assert prql.compile(query_mssql).startswith("SELECT\n TOP (3) *\nFROM\n a")
+
options_with_known_target = prql.CompileOptions(
format=False, signature_comment=False, target="sql.sqlite"
)
- options_without_target = prql.CompileOptions(format=False, signature_comment=False)
- options_with_unknown_target = prql.CompileOptions(
- format=False, signature_comment=False, target="foo"
- )
-
- assert prql.compile(query_mssql).startswith("SELECT\n TOP (3) *\nFROM\n a")
assert (
prql.compile(query_mssql, options_with_known_target)
== "SELECT * FROM a LIMIT 3"
)
+
+ options_without_target = prql.CompileOptions(format=False, signature_comment=False)
assert (
prql.compile(query_mssql, options_without_target) == "SELECT TOP (3) * FROM a"
)
- # TODO: This should be unknown target error?
+
+ options_with_any_target = prql.CompileOptions(
+ format=False, signature_comment=False, target="sql.any"
+ )
assert (
- prql.compile(query_mssql, options_with_unknown_target)
- == "SELECT TOP (3) * FROM a"
+ prql.compile(query_mssql, options_with_any_target) == "SELECT TOP (3) * FROM a"
)
+
+ options_default = prql.CompileOptions()
+ res = prql.compile(query_mssql, options_default)
+ assert res.startswith("SELECT\n TOP (3)")
diff --git a/prql-python/python/tests/test_website_queries.py b/bindings/prql-python/python/tests/test_website_queries.py
similarity index 100%
rename from prql-python/python/tests/test_website_queries.py
rename to bindings/prql-python/python/tests/test_website_queries.py
diff --git a/prql-python/requirements.txt b/bindings/prql-python/requirements.txt
similarity index 100%
rename from prql-python/requirements.txt
rename to bindings/prql-python/requirements.txt
diff --git a/prql-python/src/lib.rs b/bindings/prql-python/src/lib.rs
similarity index 69%
rename from prql-python/src/lib.rs
rename to bindings/prql-python/src/lib.rs
index 4e7919d3aff7..332afdcd6df4 100644
--- a/prql-python/src/lib.rs
+++ b/bindings/prql-python/src/lib.rs
@@ -1,17 +1,22 @@
#![cfg(not(target_family = "wasm"))]
use std::str::FromStr;
-use prql_compiler::{self, IntoOnly, Target};
+use prql_compiler::{self, Target};
use pyo3::{exceptions, prelude::*};
#[pyfunction]
pub fn compile(prql_query: &str, options: Option) -> PyResult {
- Ok(prql_query)
- .and_then(prql_compiler::prql_to_pl)
- .and_then(prql_compiler::pl_to_rq)
- .and_then(|rq| prql_compiler::rq_to_sql(rq, options.map(|o| o.into()).unwrap_or_default()))
+ let options = options.map(convert_options).transpose();
+
+ options
+ .and_then(|opts| {
+ Ok(prql_query)
+ .and_then(prql_compiler::prql_to_pl)
+ .and_then(prql_compiler::pl_to_rq)
+ .and_then(|rq| prql_compiler::rq_to_sql(rq, &opts.unwrap_or_default()))
+ })
.map_err(|e| e.composed("", prql_query, false))
- .map_err(|e| (PyErr::new::(e.into_only().unwrap().reason)))
+ .map_err(|e| (PyErr::new::(e.to_string())))
}
#[pyfunction]
@@ -35,7 +40,7 @@ pub fn pl_to_rq(pl_json: &str) -> PyResult {
pub fn rq_to_sql(rq_json: &str) -> PyResult {
Ok(rq_json)
.and_then(prql_compiler::json::to_rq)
- .and_then(|x| prql_compiler::rq_to_sql(x, prql_compiler::Options::default()))
+ .and_then(|x| prql_compiler::rq_to_sql(x, &prql_compiler::Options::default()))
.map_err(|err| (PyErr::new::(err.to_json())))
}
@@ -63,16 +68,10 @@ pub struct CompileOptions {
/// Defaults to true.
pub format: bool,
- /// Target dialect to compile to.
- ///
- /// This is only changes the output for a relatively small subset of
- /// features.
+ /// Target to compile to.
///
- /// If something does not work in a specific dialect, please raise in a
- /// GitHub issue.
- ///
- /// If `None` is used, the `target` argument from the query header is used.
- /// If it does not exist, [Dialect::Generic] is used.
+ /// Defaults to "sql.any", which uses the `target` argument from the query
+ /// header to determine The SQL dialect.
pub target: String,
/// Emits the compiler signature as a comment after generated SQL
@@ -84,8 +83,8 @@ pub struct CompileOptions {
#[pymethods]
impl CompileOptions {
#[new]
- pub fn new(format: bool, signature_comment: bool, target: Option) -> Self {
- let target = target.unwrap_or_default();
+ #[pyo3(signature = (*, format=true, signature_comment=true, target="sql.any".to_string()))]
+ pub fn new(format: bool, signature_comment: bool, target: String) -> Self {
CompileOptions {
format,
target,
@@ -94,16 +93,16 @@ impl CompileOptions {
}
}
-impl From for prql_compiler::Options {
- fn from(o: CompileOptions) -> Self {
- let target = Target::from_str(&o.target).unwrap_or_default();
+fn convert_options(
+ o: CompileOptions,
+) -> Result {
+ let target = Target::from_str(&o.target).map_err(|e| prql_compiler::downcast(e.into()))?;
- prql_compiler::Options {
- format: o.format,
- target,
- signature_comment: o.signature_comment,
- }
- }
+ Ok(prql_compiler::Options {
+ format: o.format,
+ target,
+ signature_comment: o.signature_comment,
+ })
}
#[pyfunction]
@@ -121,7 +120,7 @@ mod test {
fn parse_for_python() {
let opts = Some(CompileOptions {
format: true,
- target: String::new(),
+ target: "sql.any".to_string(),
signature_comment: false,
});
diff --git a/book/src/bindings/README.md b/book/src/bindings/README.md
deleted file mode 100644
index f7056439154f..000000000000
--- a/book/src/bindings/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Bindings
-
-PRQL has bindings for many languages. These include:
-
-- [Java](./java.md)
-- [JavaScript](./javascript.md)
-- [Python](./python.md)
-- [R](./r.md)
-- [Rust](./rust.md)
-- [Elixir](./elixir.md)
diff --git a/book/src/bindings/elixir.md b/book/src/bindings/elixir.md
deleted file mode 100644
index c2874dcf8a07..000000000000
--- a/book/src/bindings/elixir.md
+++ /dev/null
@@ -1 +0,0 @@
-{{#include ../../../prql-elixir/README.md}}
diff --git a/book/src/bindings/javascript.md b/book/src/bindings/javascript.md
deleted file mode 100644
index ea88f1817685..000000000000
--- a/book/src/bindings/javascript.md
+++ /dev/null
@@ -1 +0,0 @@
-{{#include ../../../prql-js/README.md}}
diff --git a/book/src/bindings/rust.md b/book/src/bindings/rust.md
deleted file mode 100644
index b9511f4fd427..000000000000
--- a/book/src/bindings/rust.md
+++ /dev/null
@@ -1 +0,0 @@
-{{#include ../../../prql-compiler/README.md}}
diff --git a/book/src/integrations/rill.md b/book/src/integrations/rill.md
deleted file mode 100644
index 950e0b5fb50d..000000000000
--- a/book/src/integrations/rill.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Rill
-
-PRQL has had some work to integrate with Rill. See the
-[Rill Issues](https://github.com/PRQL/prql/issues?q=is%3Aissue+rill) for more
-details.
diff --git a/book/src/language-features/switch.md b/book/src/language-features/switch.md
deleted file mode 100644
index 9570570eeb9c..000000000000
--- a/book/src/language-features/switch.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Switch
-
-```admonish note
-`switch` is currently experimental and may change behavior in the near future
-```
-
-PRQL uses `switch` for both SQL's `CASE` and `IF` statements. Here's an example:
-
-```prql
-from employees
-derive distance = switch [
- city == "Calgary" -> 0,
- city == "Edmonton" -> 300,
-]
-```
-
-If no condition is met, the value takes a `null` value. To set a default, use a
-`true` condition:
-
-```prql
-from employees
-derive distance = switch [
- city == "Calgary" -> 0,
- city == "Edmonton" -> 300,
- true -> "Unknown",
-]
-```
diff --git a/book/tests/prql/examples/cte-0.prql b/book/tests/prql/examples/cte-0.prql
deleted file mode 100644
index c5d23ce84ec6..000000000000
--- a/book/tests/prql/examples/cte-0.prql
+++ /dev/null
@@ -1,16 +0,0 @@
-let newest_employees = (
- from employees
- sort tenure
- take 50
-)
-
-let average_salaries = (
- from salaries
- group country (
- aggregate average_country_salary = (average salary)
- )
-)
-
-from newest_employees
-join average_salaries [==country]
-select [name, salary, average_country_salary]
diff --git a/book/tests/prql/examples/employees-0.prql b/book/tests/prql/examples/employees-0.prql
deleted file mode 100644
index 78e6ad12a5d6..000000000000
--- a/book/tests/prql/examples/employees-0.prql
+++ /dev/null
@@ -1,11 +0,0 @@
-from salaries
-group [emp_no] (
- aggregate [emp_salary = average salary]
-)
-join t=titles [==emp_no]
-join dept_emp side:left [==emp_no]
-group [dept_emp.dept_no, t.title] (
- aggregate [avg_salary = average emp_salary]
-)
-join departments [==dept_no]
-select [dept_name, title, avg_salary]
diff --git a/book/tests/prql/examples/employees-1.prql b/book/tests/prql/examples/employees-1.prql
deleted file mode 100644
index a568c2949aa9..000000000000
--- a/book/tests/prql/examples/employees-1.prql
+++ /dev/null
@@ -1,16 +0,0 @@
-from e=employees
-join salaries [==emp_no]
-group [e.emp_no, e.gender] (
- aggregate [
- emp_salary = average salaries.salary
- ]
-)
-join de=dept_emp [==emp_no] side:left
-group [de.dept_no, gender] (
- aggregate [
- salary_avg = average emp_salary,
- salary_sd = stddev emp_salary,
- ]
-)
-join departments [==dept_no]
-select [dept_name, gender, salary_avg, salary_sd]
diff --git a/book/tests/prql/examples/employees-2.prql b/book/tests/prql/examples/employees-2.prql
deleted file mode 100644
index 6164d8077a4a..000000000000
--- a/book/tests/prql/examples/employees-2.prql
+++ /dev/null
@@ -1,21 +0,0 @@
-from e=employees
-join salaries [==emp_no]
-group [e.emp_no, e.gender] (
- aggregate [
- emp_salary = average salaries.salary
- ]
-)
-join de=dept_emp [==emp_no]
-join dm=dept_manager [
- (dm.dept_no == de.dept_no) and s"(de.from_date, de.to_date) OVERLAPS (dm.from_date, dm.to_date)"
-]
-group [dm.emp_no, gender] (
- aggregate [
- salary_avg = average emp_salary,
- salary_sd = stddev emp_salary
- ]
-)
-derive mng_no = emp_no
-join managers=employees [==emp_no]
-derive mng_name = s"managers.first_name || ' ' || managers.last_name"
-select [mng_name, managers.gender, salary_avg, salary_sd]
diff --git a/book/tests/prql/examples/employees-3.prql b/book/tests/prql/examples/employees-3.prql
deleted file mode 100644
index 9e9d9e47855f..000000000000
--- a/book/tests/prql/examples/employees-3.prql
+++ /dev/null
@@ -1,11 +0,0 @@
-from de=dept_emp
-join s=salaries side:left [
- (s.emp_no == de.emp_no),
- s"({s.from_date}, {s.to_date}) OVERLAPS ({de.from_date}, {de.to_date})"
-]
-group [de.emp_no, de.dept_no] (
- aggregate salary = (average s.salary)
-)
-join employees [==emp_no]
-join titles [==emp_no]
-select [dept_no, salary, employees.gender, titles.title]
diff --git a/book/tests/prql/examples/list-equivalence-0.prql b/book/tests/prql/examples/list-equivalence-0.prql
deleted file mode 100644
index ce126ab4c459..000000000000
--- a/book/tests/prql/examples/list-equivalence-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select salary
diff --git a/book/tests/prql/examples/list-equivalence-1.prql b/book/tests/prql/examples/list-equivalence-1.prql
deleted file mode 100644
index 3b89f4256948..000000000000
--- a/book/tests/prql/examples/list-equivalence-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select [salary]
diff --git a/book/tests/prql/examples/list-equivalence-2.prql b/book/tests/prql/examples/list-equivalence-2.prql
deleted file mode 100644
index f49937a6bfc6..000000000000
--- a/book/tests/prql/examples/list-equivalence-2.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-derive [
- gross_salary = salary + payroll_tax,
- gross_cost = gross_salary + benefits_cost
-]
diff --git a/book/tests/prql/examples/list-equivalence-3.prql b/book/tests/prql/examples/list-equivalence-3.prql
deleted file mode 100644
index f539c32d0469..000000000000
--- a/book/tests/prql/examples/list-equivalence-3.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-derive gross_salary = salary + payroll_tax
-derive gross_cost = gross_salary + benefits_cost
diff --git a/book/tests/prql/examples/misc-0.prql b/book/tests/prql/examples/misc-0.prql
deleted file mode 100644
index e29792bf8486..000000000000
--- a/book/tests/prql/examples/misc-0.prql
+++ /dev/null
@@ -1,15 +0,0 @@
-# TODO: this table should have a column `part` with values 1..5,
-# but such data declaration is not yet supported, see #286
-let parts = (
- from seq_1_to_5
-)
-
-from pl=prospect_lists_prospects
-filter prospect_list_id == 'cc675eee-8bd1-237f-be5e-622ba511d65e'
-join a=accounts [a.id == pl.related_id]
-join er=email_addr_bean_rel [er.bean_id == a.id and er.primary_address == '1']
-join ea=email_addresses [ea.id == er.email_address_id]
-select ea.email_address
-derive prefix = s"regexp_replace(SUBSTRING_INDEX({email_address}, '@', 1), '[.0-9-_:]+', '.')"
-derive stub = s"SUBSTRING_INDEX(SUBSTRING_INDEX({prefix}, '.', part), '.', -1)"
-select [email_address, stub]
diff --git a/book/tests/prql/examples/misc-1.prql b/book/tests/prql/examples/misc-1.prql
deleted file mode 100644
index 7fc71d21985a..000000000000
--- a/book/tests/prql/examples/misc-1.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-from club_ratings
-filter rating != null
-# TODO: this is real ugly. `average rating` should not require parenthesis
-# TODO: why cannot we put comments in group's pipeline?
-group year (
- derive [rating_norm = rating - (average rating) / (stddev rating)]
-)
diff --git a/book/tests/prql/examples/variables-1.prql b/book/tests/prql/examples/variables-1.prql
deleted file mode 100644
index e0a4b962bb21..000000000000
--- a/book/tests/prql/examples/variables-1.prql
+++ /dev/null
@@ -1,15 +0,0 @@
-from employees
-group [emp_no] (
- aggregate [
- emp_salary = average salary # average salary resolves to "AVG(salary)" (from stdlib)
- ]
-)
-join titles [==emp_no]
-group [title] (
- aggregate [
- avg_salary = average emp_salary
- ]
-)
-select salary_k = avg_salary / 1000 # avg_salary should resolve to "AVG(emp_salary)"
-take 10 # induces new SELECT
-derive salary = salary_k * 1000 # salary_k should not resolve to "avg_salary / 1000"
diff --git a/book/tests/prql/internals/functional-lang-0.prql b/book/tests/prql/internals/functional-lang-0.prql
deleted file mode 100644
index 4b2a2780ffbd..000000000000
--- a/book/tests/prql/internals/functional-lang-0.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-filter age > 50
-sort name
diff --git a/book/tests/prql/internals/functional-lang-1.prql b/book/tests/prql/internals/functional-lang-1.prql
deleted file mode 100644
index b73c3e233564..000000000000
--- a/book/tests/prql/internals/functional-lang-1.prql
+++ /dev/null
@@ -1 +0,0 @@
-from employees | filter age > 50 | sort name
diff --git a/book/tests/prql/internals/functional-lang-2.prql b/book/tests/prql/internals/functional-lang-2.prql
deleted file mode 100644
index d2277f25634f..000000000000
--- a/book/tests/prql/internals/functional-lang-2.prql
+++ /dev/null
@@ -1 +0,0 @@
-filter age > 50 (from employees) | sort name
diff --git a/book/tests/prql/internals/functional-lang-3.prql b/book/tests/prql/internals/functional-lang-3.prql
deleted file mode 100644
index 40177f3353f9..000000000000
--- a/book/tests/prql/internals/functional-lang-3.prql
+++ /dev/null
@@ -1 +0,0 @@
-sort name (filter age > 50 (from employees))
diff --git a/book/tests/prql/internals/name-resolving-0.prql b/book/tests/prql/internals/name-resolving-0.prql
deleted file mode 100644
index ec44dd3366e8..000000000000
--- a/book/tests/prql/internals/name-resolving-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select first_name
diff --git a/book/tests/prql/internals/name-resolving-1.prql b/book/tests/prql/internals/name-resolving-1.prql
deleted file mode 100644
index 9a0ec0db2a53..000000000000
--- a/book/tests/prql/internals/name-resolving-1.prql
+++ /dev/null
@@ -1,4 +0,0 @@
-from employees
-derive [first_name, dept_id]
-join d=departments [==dept_id]
-select [first_name, d.title]
diff --git a/book/tests/prql/introduction-0.prql b/book/tests/prql/introduction-0.prql
deleted file mode 100644
index 9a6969d51382..000000000000
--- a/book/tests/prql/introduction-0.prql
+++ /dev/null
@@ -1,18 +0,0 @@
-from employees
-filter start_date > @2021-01-01 # Clear date syntax
-derive [ # `derive` adds columns / variables
- gross_salary = salary + (tax ?? 0), # Terse coalesce
- gross_cost = gross_salary + benefits_cost, # Variables can use other variables
-]
-filter gross_cost > 0
-group [title, country] ( # `group` runs a pipeline over each group
- aggregate [ # `aggregate` reduces each group to a value
- average gross_salary,
- sum_gross_cost = sum gross_cost, # `=` sets a column name
- ]
-)
-filter sum_gross_cost > 100_000 # `filter` replaces both of SQL's `WHERE` & `HAVING`
-derive id = f"{title}_{country}" # F-strings like Python
-derive country_code = s"LEFT(country, 2)" # S-strings allow using SQL as an escape hatch
-sort [sum_gross_cost, -country] # `-country` means descending order
-take 1..20 # Range expressions (also valid here as `take 20`)
diff --git a/book/tests/prql/language-features/coalesce-0.prql b/book/tests/prql/language-features/coalesce-0.prql
deleted file mode 100644
index 86640dac1782..000000000000
--- a/book/tests/prql/language-features/coalesce-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from orders
-derive amount ?? 0
diff --git a/book/tests/prql/language-features/dates-and-times-0.prql b/book/tests/prql/language-features/dates-and-times-0.prql
deleted file mode 100644
index 9bc1efe5bcae..000000000000
--- a/book/tests/prql/language-features/dates-and-times-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-derive age_at_year_end = (@2022-12-31 - dob)
diff --git a/book/tests/prql/language-features/dates-and-times-1.prql b/book/tests/prql/language-features/dates-and-times-1.prql
deleted file mode 100644
index 83107818e462..000000000000
--- a/book/tests/prql/language-features/dates-and-times-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from orders
-derive should_have_shipped_today = (order_time < @08:30)
diff --git a/book/tests/prql/language-features/dates-and-times-2.prql b/book/tests/prql/language-features/dates-and-times-2.prql
deleted file mode 100644
index 12687310b181..000000000000
--- a/book/tests/prql/language-features/dates-and-times-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from commits
-derive first_prql_commit = @2020-01-01T13:19:55-0800
diff --git a/book/tests/prql/language-features/dates-and-times-3.prql b/book/tests/prql/language-features/dates-and-times-3.prql
deleted file mode 100644
index a22537d03c8e..000000000000
--- a/book/tests/prql/language-features/dates-and-times-3.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from projects
-derive first_check_in = start + 10days
diff --git a/book/tests/prql/language-features/distinct-0.prql b/book/tests/prql/language-features/distinct-0.prql
deleted file mode 100644
index ed8a37d174b7..000000000000
--- a/book/tests/prql/language-features/distinct-0.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-select department
-group department (
- take 1
-)
diff --git a/book/tests/prql/language-features/distinct-1.prql b/book/tests/prql/language-features/distinct-1.prql
deleted file mode 100644
index 70764167a1ab..000000000000
--- a/book/tests/prql/language-features/distinct-1.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-select department
-group department (take 1)
diff --git a/book/tests/prql/language-features/distinct-2.prql b/book/tests/prql/language-features/distinct-2.prql
deleted file mode 100644
index f224527e39e3..000000000000
--- a/book/tests/prql/language-features/distinct-2.prql
+++ /dev/null
@@ -1,6 +0,0 @@
-# youngest employee from each department
-from employees
-group department (
- sort age
- take 1
-)
diff --git a/book/tests/prql/language-features/f-strings-0.prql b/book/tests/prql/language-features/f-strings-0.prql
deleted file mode 100644
index 5916b81e2865..000000000000
--- a/book/tests/prql/language-features/f-strings-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select full_name = f"{first_name} {last_name}"
diff --git a/book/tests/prql/language-features/f-strings-1.prql b/book/tests/prql/language-features/f-strings-1.prql
deleted file mode 100644
index 6e8e37a471a0..000000000000
--- a/book/tests/prql/language-features/f-strings-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from web
-select url = f"http{tls}://www.{domain}.{tld}/{page}"
diff --git a/book/tests/prql/language-features/null-0.prql b/book/tests/prql/language-features/null-0.prql
deleted file mode 100644
index 59e730264398..000000000000
--- a/book/tests/prql/language-features/null-0.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-filter first_name == null
-filter null != last_name
diff --git a/book/tests/prql/language-features/ranges-0.prql b/book/tests/prql/language-features/ranges-0.prql
deleted file mode 100644
index d200b9b61999..000000000000
--- a/book/tests/prql/language-features/ranges-0.prql
+++ /dev/null
@@ -1,4 +0,0 @@
-from events
-filter (date | in @1776-07-04..@1787-09-17)
-filter (magnitude | in 50..100)
-derive is_northern = (latitude | in 0..)
diff --git a/book/tests/prql/language-features/ranges-1.prql b/book/tests/prql/language-features/ranges-1.prql
deleted file mode 100644
index f6939b843a7c..000000000000
--- a/book/tests/prql/language-features/ranges-1.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from orders
-sort [-value, date]
-take 101..110
diff --git a/book/tests/prql/language-features/s-strings-0.prql b/book/tests/prql/language-features/s-strings-0.prql
deleted file mode 100644
index 58aeda7a72fc..000000000000
--- a/book/tests/prql/language-features/s-strings-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from my_table
-select db_version = s"version()"
diff --git a/book/tests/prql/language-features/s-strings-1.prql b/book/tests/prql/language-features/s-strings-1.prql
deleted file mode 100644
index 00a434b7d91c..000000000000
--- a/book/tests/prql/language-features/s-strings-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-aggregate [average salary]
diff --git a/book/tests/prql/language-features/s-strings-2.prql b/book/tests/prql/language-features/s-strings-2.prql
deleted file mode 100644
index 60f8731d9746..000000000000
--- a/book/tests/prql/language-features/s-strings-2.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-from de=dept_emp
-join s=salaries side:left [
- (s.emp_no == de.emp_no),
- s"""({s.from_date}, {s.to_date})
- OVERLAPS
- ({de.from_date}, {de.to_date})"""
-]
diff --git a/book/tests/prql/language-features/s-strings-3.prql b/book/tests/prql/language-features/s-strings-3.prql
deleted file mode 100644
index bca882d48c32..000000000000
--- a/book/tests/prql/language-features/s-strings-3.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from s"SELECT DISTINCT ON first_name, id, age FROM employees ORDER BY age ASC"
-join s = s"SELECT * FROM salaries" [==id]
diff --git a/book/tests/prql/language-features/s-strings-4.prql b/book/tests/prql/language-features/s-strings-4.prql
deleted file mode 100644
index 782542d16c58..000000000000
--- a/book/tests/prql/language-features/s-strings-4.prql
+++ /dev/null
@@ -1,4 +0,0 @@
-from employees
-derive [
- has_valid_title = s"regexp_contains(title, '([a-z0-9]*-){{2,}}')"
-]
diff --git a/book/tests/prql/language-features/s-strings-5.prql b/book/tests/prql/language-features/s-strings-5.prql
deleted file mode 100644
index 58a535b9d514..000000000000
--- a/book/tests/prql/language-features/s-strings-5.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-derive [
- gross_salary = salary + benefits,
- daily_rate = s"{gross_salary} / 365"
-]
diff --git a/book/tests/prql/language-features/s-strings-6.prql b/book/tests/prql/language-features/s-strings-6.prql
deleted file mode 100644
index e8ba3a5b3cf2..000000000000
--- a/book/tests/prql/language-features/s-strings-6.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-derive [
- gross_salary = salary + benefits,
- daily_rate = s"({gross_salary}) / 365"
-]
diff --git a/book/tests/prql/language-features/standard-library-0.prql b/book/tests/prql/language-features/standard-library-0.prql
deleted file mode 100644
index 1a362939ebc3..000000000000
--- a/book/tests/prql/language-features/standard-library-0.prql
+++ /dev/null
@@ -1,6 +0,0 @@
-from employees
-derive [
- gross_salary = (salary + payroll_tax | as int),
- gross_salary_rounded = (gross_salary | round 0),
- time = s"NOW()", # an s-string, given no `now` function exists in PRQL
-]
diff --git a/book/tests/prql/language-features/strings-0.prql b/book/tests/prql/language-features/strings-0.prql
deleted file mode 100644
index 294ce2444927..000000000000
--- a/book/tests/prql/language-features/strings-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from my_table
-select x = "hello world"
diff --git a/book/tests/prql/language-features/strings-1.prql b/book/tests/prql/language-features/strings-1.prql
deleted file mode 100644
index 3591aa871e1b..000000000000
--- a/book/tests/prql/language-features/strings-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from my_table
-select x = 'hello world'
diff --git a/book/tests/prql/language-features/strings-2.prql b/book/tests/prql/language-features/strings-2.prql
deleted file mode 100644
index d91760c6bcd4..000000000000
--- a/book/tests/prql/language-features/strings-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from my_table
-select x = '"hello world"'
diff --git a/book/tests/prql/language-features/strings-3.prql b/book/tests/prql/language-features/strings-3.prql
deleted file mode 100644
index be93bbf93a6a..000000000000
--- a/book/tests/prql/language-features/strings-3.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from my_table
-select x = """I said "hello world"!"""
diff --git a/book/tests/prql/language-features/strings-4.prql b/book/tests/prql/language-features/strings-4.prql
deleted file mode 100644
index 92d3be607db4..000000000000
--- a/book/tests/prql/language-features/strings-4.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from my_table
-select x = """""I said """hello world"""!"""""
diff --git a/book/tests/prql/language-features/switch-0.prql b/book/tests/prql/language-features/switch-0.prql
deleted file mode 100644
index e3284d640b83..000000000000
--- a/book/tests/prql/language-features/switch-0.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-derive distance = switch [
- city == "Calgary" -> 0,
- city == "Edmonton" -> 300,
-]
diff --git a/book/tests/prql/language-features/switch-1.prql b/book/tests/prql/language-features/switch-1.prql
deleted file mode 100644
index f8d840c11cb5..000000000000
--- a/book/tests/prql/language-features/switch-1.prql
+++ /dev/null
@@ -1,6 +0,0 @@
-from employees
-derive distance = switch [
- city == "Calgary" -> 0,
- city == "Edmonton" -> 300,
- true -> "Unknown",
-]
diff --git a/book/tests/prql/language-features/target-0.prql b/book/tests/prql/language-features/target-0.prql
deleted file mode 100644
index 21e54d9840c3..000000000000
--- a/book/tests/prql/language-features/target-0.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-prql target:sql.postgres
-
-from employees
-sort age
-take 10
diff --git a/book/tests/prql/language-features/target-1.prql b/book/tests/prql/language-features/target-1.prql
deleted file mode 100644
index 53433b4b16c0..000000000000
--- a/book/tests/prql/language-features/target-1.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-prql target:sql.mssql
-
-from employees
-sort age
-take 10
diff --git a/book/tests/prql/language-features/target-2.prql b/book/tests/prql/language-features/target-2.prql
deleted file mode 100644
index c452ea2a5aad..000000000000
--- a/book/tests/prql/language-features/target-2.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-prql version:"0.5"
-
-from employees
diff --git a/book/tests/prql/queries/functions-0.prql b/book/tests/prql/queries/functions-0.prql
deleted file mode 100644
index b09007f54290..000000000000
--- a/book/tests/prql/queries/functions-0.prql
+++ /dev/null
@@ -1,4 +0,0 @@
-func fahrenheit_to_celsius temp -> (temp - 32) / 1.8
-
-from cities
-derive temp_c = (fahrenheit_to_celsius temp_f)
diff --git a/book/tests/prql/queries/functions-1.prql b/book/tests/prql/queries/functions-1.prql
deleted file mode 100644
index f2da76bdaed6..000000000000
--- a/book/tests/prql/queries/functions-1.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-func interp lower:0 higher x -> (x - lower) / (higher - lower)
-
-from students
-derive [
- sat_proportion_1 = (interp 1600 sat_score),
- sat_proportion_2 = (interp lower:0 1600 sat_score),
-]
diff --git a/book/tests/prql/queries/functions-2.prql b/book/tests/prql/queries/functions-2.prql
deleted file mode 100644
index f7d6afdbd8ac..000000000000
--- a/book/tests/prql/queries/functions-2.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-func interp lower:0 higher x -> (x - lower) / (higher - lower)
-
-from students
-derive [
- sat_proportion_1 = (sat_score | interp 1600),
- sat_proportion_2 = (sat_score | interp lower:0 1600),
-]
diff --git a/book/tests/prql/queries/functions-3.prql b/book/tests/prql/queries/functions-3.prql
deleted file mode 100644
index fc9447867a1c..000000000000
--- a/book/tests/prql/queries/functions-3.prql
+++ /dev/null
@@ -1,4 +0,0 @@
-func fahrenheit_to_celsius temp -> (temp - 32) / 1.8
-
-from cities
-derive temp_c = (temp_f | fahrenheit_to_celsius)
diff --git a/book/tests/prql/queries/functions-4.prql b/book/tests/prql/queries/functions-4.prql
deleted file mode 100644
index f692e9ffbeb7..000000000000
--- a/book/tests/prql/queries/functions-4.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-func fahrenheit_to_celsius temp -> (temp - 32) / 1.8
-func interp lower:0 higher x -> (x - lower) / (higher - lower)
-
-from kettles
-derive boiling_proportion = (temp_c | fahrenheit_to_celsius | interp 100)
diff --git a/book/tests/prql/queries/pipelines-0.prql b/book/tests/prql/queries/pipelines-0.prql
deleted file mode 100644
index 782143755f3b..000000000000
--- a/book/tests/prql/queries/pipelines-0.prql
+++ /dev/null
@@ -1 +0,0 @@
-from employees
diff --git a/book/tests/prql/queries/pipelines-1.prql b/book/tests/prql/queries/pipelines-1.prql
deleted file mode 100644
index c3b39d069fa8..000000000000
--- a/book/tests/prql/queries/pipelines-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-derive gross_salary = (salary + payroll_tax)
diff --git a/book/tests/prql/queries/pipelines-2.prql b/book/tests/prql/queries/pipelines-2.prql
deleted file mode 100644
index dee17ddc0e63..000000000000
--- a/book/tests/prql/queries/pipelines-2.prql
+++ /dev/null
@@ -1,6 +0,0 @@
-from e = employees
-derive gross_salary = (salary + payroll_tax)
-sort gross_salary
-take 10
-join d = department [==dept_no]
-select [e.name, gross_salary, d.name]
diff --git a/book/tests/prql/queries/variables-0.prql b/book/tests/prql/queries/variables-0.prql
deleted file mode 100644
index f130b7179c73..000000000000
--- a/book/tests/prql/queries/variables-0.prql
+++ /dev/null
@@ -1,8 +0,0 @@
-let top_50 = (
- from employees
- sort salary
- take 50
- aggregate [total_salary = sum salary]
-)
-
-from top_50 # Starts a new pipeline
diff --git a/book/tests/prql/queries/variables-1.prql b/book/tests/prql/queries/variables-1.prql
deleted file mode 100644
index 320c82b3ddd9..000000000000
--- a/book/tests/prql/queries/variables-1.prql
+++ /dev/null
@@ -1,9 +0,0 @@
-let grouping = s"""
- SELECT SUM(a)
- FROM tbl
- GROUP BY
- GROUPING SETS
- ((b, c, d), (d), (b, d))
-"""
-
-from grouping
diff --git a/book/tests/prql/syntax-0.prql b/book/tests/prql/syntax-0.prql
deleted file mode 100644
index d8b0ec6dd72e..000000000000
--- a/book/tests/prql/syntax-0.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-filter department == "Product"
-select [first_name, last_name]
diff --git a/book/tests/prql/syntax-1.prql b/book/tests/prql/syntax-1.prql
deleted file mode 100644
index f28aaf723a02..000000000000
--- a/book/tests/prql/syntax-1.prql
+++ /dev/null
@@ -1 +0,0 @@
-from employees | filter department == "Product" | select [first_name, last_name]
diff --git a/book/tests/prql/syntax-10.prql b/book/tests/prql/syntax-10.prql
deleted file mode 100644
index b2ebba1b6488..000000000000
--- a/book/tests/prql/syntax-10.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-prql target:sql.postgres
-from employees
-select `first name`
diff --git a/book/tests/prql/syntax-11.prql b/book/tests/prql/syntax-11.prql
deleted file mode 100644
index e855d0393136..000000000000
--- a/book/tests/prql/syntax-11.prql
+++ /dev/null
@@ -1 +0,0 @@
-from `dir/*.parquet`
diff --git a/book/tests/prql/syntax-12.prql b/book/tests/prql/syntax-12.prql
deleted file mode 100644
index a634b9554275..000000000000
--- a/book/tests/prql/syntax-12.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-prql target:sql.bigquery
-from `project-foo.dataset.table`
-join `project-bar.dataset.table` [==col_bax]
diff --git a/book/tests/prql/syntax-13.prql b/book/tests/prql/syntax-13.prql
deleted file mode 100644
index a9ccfe89ed66..000000000000
--- a/book/tests/prql/syntax-13.prql
+++ /dev/null
@@ -1 +0,0 @@
-from `music.albums`
diff --git a/book/tests/prql/syntax-14.prql b/book/tests/prql/syntax-14.prql
deleted file mode 100644
index 15be2cb62f61..000000000000
--- a/book/tests/prql/syntax-14.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-filter id == $1
diff --git a/book/tests/prql/syntax-15.prql b/book/tests/prql/syntax-15.prql
deleted file mode 100644
index 290e626cf825..000000000000
--- a/book/tests/prql/syntax-15.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from numbers
-select [
- small = 1.000_000_1,
- big = 5_000_000,
-]
diff --git a/book/tests/prql/syntax-2.prql b/book/tests/prql/syntax-2.prql
deleted file mode 100644
index 738ad9c85a11..000000000000
--- a/book/tests/prql/syntax-2.prql
+++ /dev/null
@@ -1,10 +0,0 @@
-from numbers
-derive [x = 1, y = 2]
-derive [
- a = x,
- b = y
-]
-derive [
- c = a,
- d = b,
-]
diff --git a/book/tests/prql/syntax-3.prql b/book/tests/prql/syntax-3.prql
deleted file mode 100644
index 7badae90b98a..000000000000
--- a/book/tests/prql/syntax-3.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select [first_name]
diff --git a/book/tests/prql/syntax-4.prql b/book/tests/prql/syntax-4.prql
deleted file mode 100644
index ec44dd3366e8..000000000000
--- a/book/tests/prql/syntax-4.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select first_name
diff --git a/book/tests/prql/syntax-5.prql b/book/tests/prql/syntax-5.prql
deleted file mode 100644
index 79e709893b7c..000000000000
--- a/book/tests/prql/syntax-5.prql
+++ /dev/null
@@ -1,6 +0,0 @@
-from foo
-select [
- circumference = diameter * 3.14159,
- color,
-]
-filter circumference > 10 and color != "red"
diff --git a/book/tests/prql/syntax-6.prql b/book/tests/prql/syntax-6.prql
deleted file mode 100644
index 9ce71c723b6a..000000000000
--- a/book/tests/prql/syntax-6.prql
+++ /dev/null
@@ -1,26 +0,0 @@
-from employees
-# Requires parentheses, because it's contains a pipe
-derive is_proximate = (distance | in 0..20)
-# Requires parentheses, because it's a function call
-derive total_distance = (sum distance)
-# `??` doesn't require parentheses, as it's not a function call
-derive min_capped_distance = (min distance ?? 5)
-# No parentheses needed, because no function call
-derive travel_time = distance / 40
-# No inner parentheses needed around `1+1` because no function call
-derive distance_rounded_2_dp = (round 1+1 distance)
-derive [
- # Requires parentheses, because it contains a pipe
- is_far = (distance | in 100..),
- # The left value of the range requires parentheses,
- # because of the minus sign
- is_negative = (distance | in (-100..0)),
- # ...this is equivalent
- is_negative = (distance | in (-100)..0),
- # Doesn't require parentheses, because it's in a list (confusing, see footnote)!
- average_distance = average distance,
-]
-# Requires parentheses because of the minus sign
-sort (-distance)
-# A list is fine too
-sort [-distance]
diff --git a/book/tests/prql/syntax-7.prql b/book/tests/prql/syntax-7.prql
deleted file mode 100644
index f655f4637971..000000000000
--- a/book/tests/prql/syntax-7.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-from employees
-group [title, country] (
- aggregate [
- average salary,
- ct = count
- ]
-)
diff --git a/book/tests/prql/syntax-8.prql b/book/tests/prql/syntax-8.prql
deleted file mode 100644
index 7ee340a4259a..000000000000
--- a/book/tests/prql/syntax-8.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees # Comment 1
-# Comment 2
-aggregate [average salary]
diff --git a/book/tests/prql/syntax-9.prql b/book/tests/prql/syntax-9.prql
deleted file mode 100644
index d768dedf3f09..000000000000
--- a/book/tests/prql/syntax-9.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-prql target:sql.mysql
-from employees
-select `first name`
diff --git a/book/tests/prql/transforms/aggregate-0.prql b/book/tests/prql/transforms/aggregate-0.prql
deleted file mode 100644
index 12e9ff298a1a..000000000000
--- a/book/tests/prql/transforms/aggregate-0.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-aggregate [
- average salary,
- ct = count
-]
diff --git a/book/tests/prql/transforms/aggregate-1.prql b/book/tests/prql/transforms/aggregate-1.prql
deleted file mode 100644
index f655f4637971..000000000000
--- a/book/tests/prql/transforms/aggregate-1.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-from employees
-group [title, country] (
- aggregate [
- average salary,
- ct = count
- ]
-)
diff --git a/book/tests/prql/transforms/aggregate-2.prql b/book/tests/prql/transforms/aggregate-2.prql
deleted file mode 100644
index d3276634b6af..000000000000
--- a/book/tests/prql/transforms/aggregate-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-derive [avg_sal = average salary]
diff --git a/book/tests/prql/transforms/append-0.prql b/book/tests/prql/transforms/append-0.prql
deleted file mode 100644
index ecadad3ed3d0..000000000000
--- a/book/tests/prql/transforms/append-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees_1
-append employees_2
diff --git a/book/tests/prql/transforms/append-1.prql b/book/tests/prql/transforms/append-1.prql
deleted file mode 100644
index 427597e3dbad..000000000000
--- a/book/tests/prql/transforms/append-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees_1
-remove employees_2
diff --git a/book/tests/prql/transforms/append-2.prql b/book/tests/prql/transforms/append-2.prql
deleted file mode 100644
index 08c142df97fe..000000000000
--- a/book/tests/prql/transforms/append-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees_1
-intersect employees_2
diff --git a/book/tests/prql/transforms/derive-0.prql b/book/tests/prql/transforms/derive-0.prql
deleted file mode 100644
index 0ca92150a0a9..000000000000
--- a/book/tests/prql/transforms/derive-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-derive gross_salary = salary + payroll_tax
diff --git a/book/tests/prql/transforms/derive-1.prql b/book/tests/prql/transforms/derive-1.prql
deleted file mode 100644
index f49937a6bfc6..000000000000
--- a/book/tests/prql/transforms/derive-1.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-derive [
- gross_salary = salary + payroll_tax,
- gross_cost = gross_salary + benefits_cost
-]
diff --git a/book/tests/prql/transforms/filter-0.prql b/book/tests/prql/transforms/filter-0.prql
deleted file mode 100644
index 6ecce44d63af..000000000000
--- a/book/tests/prql/transforms/filter-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-filter age > 25
diff --git a/book/tests/prql/transforms/filter-1.prql b/book/tests/prql/transforms/filter-1.prql
deleted file mode 100644
index 60ca713cdfe8..000000000000
--- a/book/tests/prql/transforms/filter-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-filter (age > 25 or department != "IT")
diff --git a/book/tests/prql/transforms/filter-2.prql b/book/tests/prql/transforms/filter-2.prql
deleted file mode 100644
index fe81ad79a5fb..000000000000
--- a/book/tests/prql/transforms/filter-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-filter (age | in 25..40)
diff --git a/book/tests/prql/transforms/from-0.prql b/book/tests/prql/transforms/from-0.prql
deleted file mode 100644
index 782143755f3b..000000000000
--- a/book/tests/prql/transforms/from-0.prql
+++ /dev/null
@@ -1 +0,0 @@
-from employees
diff --git a/book/tests/prql/transforms/from-1.prql b/book/tests/prql/transforms/from-1.prql
deleted file mode 100644
index f9ec0ba68c54..000000000000
--- a/book/tests/prql/transforms/from-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from e = employees
-select e.first_name
diff --git a/book/tests/prql/transforms/from_text-0.prql b/book/tests/prql/transforms/from_text-0.prql
deleted file mode 100644
index cc3dd3464e80..000000000000
--- a/book/tests/prql/transforms/from_text-0.prql
+++ /dev/null
@@ -1,9 +0,0 @@
-from_text """
-a,b,c
-1,2,3
-4,5,6
-"""
-derive [
- d = b + c,
- answer = 20 * 2 + 2,
-]
diff --git a/book/tests/prql/transforms/from_text-1.prql b/book/tests/prql/transforms/from_text-1.prql
deleted file mode 100644
index 588486d405c0..000000000000
--- a/book/tests/prql/transforms/from_text-1.prql
+++ /dev/null
@@ -1,10 +0,0 @@
-let temp_format_lookup = from_text format:csv """
-country_code,format
-uk,C
-us,F
-lr,F
-de,C
-"""
-
-from temperatures
-join temp_format_lookup [==country_code]
diff --git a/book/tests/prql/transforms/from_text-2.prql b/book/tests/prql/transforms/from_text-2.prql
deleted file mode 100644
index be9c55da39b9..000000000000
--- a/book/tests/prql/transforms/from_text-2.prql
+++ /dev/null
@@ -1,16 +0,0 @@
-let x = from_text format:json """{
- "columns": ["a", "b", "c"],
- "data": [
- [1, "x", false],
- [4, "y", null]
- ]
-}"""
-
-let y = from_text format:json """
- [
- {"a": 1, "m": "5"},
- {"a": 4, "n": "6"}
- ]
-"""
-
-from x | join y [==a]
diff --git a/book/tests/prql/transforms/group-0.prql b/book/tests/prql/transforms/group-0.prql
deleted file mode 100644
index f655f4637971..000000000000
--- a/book/tests/prql/transforms/group-0.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-from employees
-group [title, country] (
- aggregate [
- average salary,
- ct = count
- ]
-)
diff --git a/book/tests/prql/transforms/group-1.prql b/book/tests/prql/transforms/group-1.prql
deleted file mode 100644
index 1d1d99b09ba3..000000000000
--- a/book/tests/prql/transforms/group-1.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-sort join_date
-take 1
diff --git a/book/tests/prql/transforms/group-2.prql b/book/tests/prql/transforms/group-2.prql
deleted file mode 100644
index 47024bedc68e..000000000000
--- a/book/tests/prql/transforms/group-2.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-group role (
- sort join_date # taken from above
- take 1
-)
diff --git a/book/tests/prql/transforms/join-0.prql b/book/tests/prql/transforms/join-0.prql
deleted file mode 100644
index df05df8dbed5..000000000000
--- a/book/tests/prql/transforms/join-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-join side:left positions [employees.id==positions.employee_id]
diff --git a/book/tests/prql/transforms/join-1.prql b/book/tests/prql/transforms/join-1.prql
deleted file mode 100644
index e074ffd3e034..000000000000
--- a/book/tests/prql/transforms/join-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-join side:left p=positions [employees.id==p.employee_id]
diff --git a/book/tests/prql/transforms/join-2.prql b/book/tests/prql/transforms/join-2.prql
deleted file mode 100644
index 37c18f95467b..000000000000
--- a/book/tests/prql/transforms/join-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-join positions [==emp_no]
diff --git a/book/tests/prql/transforms/select-0.prql b/book/tests/prql/transforms/select-0.prql
deleted file mode 100644
index 69ff35c8a5b6..000000000000
--- a/book/tests/prql/transforms/select-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select name = f"{first_name} {last_name}"
diff --git a/book/tests/prql/transforms/select-1.prql b/book/tests/prql/transforms/select-1.prql
deleted file mode 100644
index 346904e522e0..000000000000
--- a/book/tests/prql/transforms/select-1.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-select [
- name = f"{first_name} {last_name}",
- age_eoy = dob - @2022-12-31,
-]
diff --git a/book/tests/prql/transforms/select-2.prql b/book/tests/prql/transforms/select-2.prql
deleted file mode 100644
index ec44dd3366e8..000000000000
--- a/book/tests/prql/transforms/select-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-select first_name
diff --git a/book/tests/prql/transforms/select-3.prql b/book/tests/prql/transforms/select-3.prql
deleted file mode 100644
index d0f3f99260cb..000000000000
--- a/book/tests/prql/transforms/select-3.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from e=employees
-select [e.first_name, e.last_name]
diff --git a/book/tests/prql/transforms/select-4.prql b/book/tests/prql/transforms/select-4.prql
deleted file mode 100644
index a473a7832655..000000000000
--- a/book/tests/prql/transforms/select-4.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-prql target:sql.bigquery
-from tracks
-select ![milliseconds,bytes]
diff --git a/book/tests/prql/transforms/select-5.prql b/book/tests/prql/transforms/select-5.prql
deleted file mode 100644
index 06d8486c28a7..000000000000
--- a/book/tests/prql/transforms/select-5.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from tracks
-select [track_id, title, composer, bytes]
-select ![title, composer]
diff --git a/book/tests/prql/transforms/select-6.prql b/book/tests/prql/transforms/select-6.prql
deleted file mode 100644
index 78a496224d09..000000000000
--- a/book/tests/prql/transforms/select-6.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from artists
-derive nick = name
-select ![artists.*]
diff --git a/book/tests/prql/transforms/sort-0.prql b/book/tests/prql/transforms/sort-0.prql
deleted file mode 100644
index e019af01c2eb..000000000000
--- a/book/tests/prql/transforms/sort-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-sort age
diff --git a/book/tests/prql/transforms/sort-1.prql b/book/tests/prql/transforms/sort-1.prql
deleted file mode 100644
index a5b15d8d0fbf..000000000000
--- a/book/tests/prql/transforms/sort-1.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-sort [-age]
diff --git a/book/tests/prql/transforms/sort-2.prql b/book/tests/prql/transforms/sort-2.prql
deleted file mode 100644
index 7809593be39c..000000000000
--- a/book/tests/prql/transforms/sort-2.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-sort [age, -tenure, +salary]
diff --git a/book/tests/prql/transforms/sort-3.prql b/book/tests/prql/transforms/sort-3.prql
deleted file mode 100644
index c4c9bbd5e7a4..000000000000
--- a/book/tests/prql/transforms/sort-3.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-sort [s"substr({first_name}, 2, 5)"]
diff --git a/book/tests/prql/transforms/sort-4.prql b/book/tests/prql/transforms/sort-4.prql
deleted file mode 100644
index 7f4df2d22a48..000000000000
--- a/book/tests/prql/transforms/sort-4.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-sort tenure
-derive name = f"{first_name} {last_name}"
diff --git a/book/tests/prql/transforms/sort-5.prql b/book/tests/prql/transforms/sort-5.prql
deleted file mode 100644
index 812dcdc7bdbe..000000000000
--- a/book/tests/prql/transforms/sort-5.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-sort tenure
-join locations [==employee_id]
diff --git a/book/tests/prql/transforms/take-0.prql b/book/tests/prql/transforms/take-0.prql
deleted file mode 100644
index 63d11c6b23f7..000000000000
--- a/book/tests/prql/transforms/take-0.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-take 10
diff --git a/book/tests/prql/transforms/take-1.prql b/book/tests/prql/transforms/take-1.prql
deleted file mode 100644
index f6939b843a7c..000000000000
--- a/book/tests/prql/transforms/take-1.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from orders
-sort [-value, date]
-take 101..110
diff --git a/book/tests/prql/transforms/window-0.prql b/book/tests/prql/transforms/window-0.prql
deleted file mode 100644
index 6259783650c6..000000000000
--- a/book/tests/prql/transforms/window-0.prql
+++ /dev/null
@@ -1,7 +0,0 @@
-from employees
-group employee_id (
- sort month
- window rolling:12 (
- derive [trail_12_m_comp = sum paycheck]
- )
-)
diff --git a/book/tests/prql/transforms/window-1.prql b/book/tests/prql/transforms/window-1.prql
deleted file mode 100644
index 551a99f49293..000000000000
--- a/book/tests/prql/transforms/window-1.prql
+++ /dev/null
@@ -1,11 +0,0 @@
-from orders
-sort day
-window rows:-3..3 (
- derive [centered_weekly_average = average value]
-)
-group [order_month] (
- sort day
- window expanding:true (
- derive [monthly_running_total = sum value]
- )
-)
diff --git a/book/tests/prql/transforms/window-2.prql b/book/tests/prql/transforms/window-2.prql
deleted file mode 100644
index 0093d51081cf..000000000000
--- a/book/tests/prql/transforms/window-2.prql
+++ /dev/null
@@ -1,3 +0,0 @@
-from employees
-sort age
-derive rnk = rank
diff --git a/book/tests/prql/transforms/window-3.prql b/book/tests/prql/transforms/window-3.prql
deleted file mode 100644
index ed779ac389a2..000000000000
--- a/book/tests/prql/transforms/window-3.prql
+++ /dev/null
@@ -1,5 +0,0 @@
-from employees
-group department (
- sort age
- derive rnk = rank
-)
diff --git a/book/tests/prql/transforms/window-4.prql b/book/tests/prql/transforms/window-4.prql
deleted file mode 100644
index a28ee16df128..000000000000
--- a/book/tests/prql/transforms/window-4.prql
+++ /dev/null
@@ -1,2 +0,0 @@
-from employees
-filter salary < (average salary)
diff --git a/book/tests/snapshot.rs b/book/tests/snapshot.rs
deleted file mode 100644
index e86b59ae20fc..000000000000
--- a/book/tests/snapshot.rs
+++ /dev/null
@@ -1,166 +0,0 @@
-#![cfg(not(target_family = "wasm"))]
-/// This test:
-/// - Extracts PRQL code blocks into the `examples` path.
-/// - Converts them to SQL using insta, raising an error if there's a diff.
-/// - Replaces the PRQL code block with a comparison table.
-///
-/// We also use this test to run tests on our Display trait output, currently as
-/// another set of snapshots (more comments inline).
-//
-// Overall, this is overengineered โย it's complicated and took a long time to
-// write. The intention is good โ have a version of the SQL that's committed
-// into the repo, and join our tests with our docs. But it feels like overly
-// custom code for quite a general problem, even if our preferences are slightly
-// different from the general case.
-//
-// Possibly we should be using something like pandoc /
-// https://github.com/gpoore/codebraid / which would run the transformation for
-// us. They introduce a bunch of non-rust dependencies, which is not ideal, but
-// passable. They don't let us customize our formatting (e.g. in a table).
-//
-use anyhow::{bail, Result};
-use globset::Glob;
-use insta::{assert_display_snapshot, assert_snapshot, glob};
-use log::warn;
-use prql_compiler::*;
-use pulldown_cmark::{CodeBlockKind, Event, Parser, Tag};
-use std::fs;
-use std::path::Path;
-use walkdir::WalkDir;
-
-#[test]
-fn run_examples() -> Result<()> {
- // TODO: In CI this could pass by replacing incorrect files. To catch that,
- // we could check if there are any diffs after this has run?
-
- // Note that on windows, markdown is read differently, and so
- // writing on Windows. ref https://github.com/PRQL/prql/issues/356
- #[cfg(not(target_family = "windows"))]
- write_reference_prql()?;
- run_reference_prql();
-
- // TODO: Currently we run this in the same test, since we need the
- // `write_reference_prql` function to have been run. If we could iterate
- // over the PRQL examples without writing them to disk, we could run this as
- // a separate test. (Though then we'd lose the deferred failures feature
- // that insta's `glob!` macro provides.)
- run_display_reference_prql();
-
- Ok(())
-}
-
-/// Extract reference examples from the PRQL docs and write them to the
-/// `tests/prql` path, one in each file.
-// We could alternatively have used something like
-// https://github.com/earldouglas/codedown, but it's not much code, and it
-// requires no dependencies.
-//
-// We allow dead_code because of the window issue described above. (Can we allow
-// it only for windows?)
-#[allow(dead_code)]
-fn write_reference_prql() -> Result<()> {
- // Remove old .prql files, since we're going to rewrite them, and we don't want
- // old files which wouldn't be rewritten from hanging around.
- // We use `trash`, since we don't want to be removing files with test code
- // in case there's a bug.
- //
- // A more elegant approach would be to keep a list of the files and remove
- // the ones we don't write.
-
- let examples_path = Path::new("tests/prql");
- if examples_path.exists() {
- trash::delete(Path::new("tests/prql")).unwrap_or_else(|e| {
- warn!("Failed to delete old examples: {}", e);
- });
- }
-
- let glob = Glob::new("**/*.md")?.compile_matcher();
-
- WalkDir::new(Path::new("./src/"))
- .into_iter()
- .flatten()
- .filter(|x| glob.is_match(x.path()))
- .try_for_each(|dir_entry| {
- let text = fs::read_to_string(dir_entry.path())?;
- let mut parser = Parser::new(&text);
- let mut prql_blocks = vec![];
- while let Some(event) = parser.next() {
- match event.clone() {
- // At the start of a PRQL code block, push the _next_ item.
- // Note that on windows, we only get the next _line_, and so
- // we exclude the writing in windows below;
- // https://github.com/PRQL/prql/issues/356
- Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(lang)))
- if lang == "prql".into() =>
- {
- if let Some(Event::Text(text)) = parser.next() {
- prql_blocks.push(text);
- } else {
- bail!("Expected text after PRQL code block");
- }
- }
- _ => {}
- }
- }
-
- // Write each one to a new file.
- prql_blocks
- .iter()
- .enumerate()
- .try_for_each(|(i, example)| {
- let file_relative = &dir_entry
- .path()
- .strip_prefix("./src/")?
- .to_str()
- .unwrap()
- .trim_end_matches(".md");
- let prql_path = format!("tests/prql/{file_relative}-{i}.prql");
-
- fs::create_dir_all(Path::new(&prql_path).parent().unwrap())?;
- fs::write(prql_path, example.to_string())?;
-
- Ok::<(), anyhow::Error>(())
- })?;
- Ok(())
- })?;
-
- Ok(())
-}
-
-/// Snapshot the output of each example.
-fn run_reference_prql() {
- glob!("prql/**/*.prql", |path| {
- let prql = fs::read_to_string(path).unwrap();
-
- if prql.contains("skip_test") {
- return;
- }
-
- let opts = Options::default().no_signature();
- let sql = compile(&prql, opts).unwrap_or_else(|e| format!("{prql}\n\n{e}"));
- // `glob!` gives us the file path in the test name anyway, so we pass an
- // empty name. We pass `&prql` so the prql is in the snapshot (albeit in
- // a single line, and, in the rare case that the SQL doesn't change, the
- // PRQL only updates on running cargo insta with `--force-update-snapshots`).
- assert_snapshot!("", &sql, &prql);
- });
-}
-
-/// Snapshot the display trait output of each example.
-// Currently not a separate test, see notes in caller.
-//
-// TODO: this involves writing out almost the same PRQL again โ instead we could
-// compare the output of Display to the auto-formatted source. But we need an
-// autoformatter for that (unless we want to raise on any non-matching input,
-// which seems very strict)
-fn run_display_reference_prql() {
- glob!("prql/**/*.prql", |path| {
- let prql = fs::read_to_string(path).unwrap();
-
- if prql.contains("skip_test") {
- return;
- }
-
- assert_display_snapshot!(prql_to_pl(&prql).and_then(pl_to_prql).unwrap());
- });
-}
diff --git a/book/tests/snapshots/snapshot__@examples__cte-0.prql.snap b/book/tests/snapshots/snapshot__@examples__cte-0.prql.snap
deleted file mode 100644
index 5e55e6c27d2b..000000000000
--- a/book/tests/snapshots/snapshot__@examples__cte-0.prql.snap
+++ /dev/null
@@ -1,31 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "table newest_employees = (\n from employees\n sort tenure\n take 50\n)\n\ntable average_salaries = (\n from salaries\n group country (\n aggregate average_country_salary = (average salary)\n )\n)\n\nfrom newest_employees\njoin average_salaries [==country]\nselect [name, salary, average_country_salary]\n"
-input_file: book/tests/prql/examples/cte-0.prql
----
-WITH average_salaries AS (
- SELECT
- country,
- AVG(salary) AS average_country_salary
- FROM
- salaries
- GROUP BY
- country
-),
-newest_employees AS (
- SELECT
- *
- FROM
- employees
- ORDER BY
- tenure
- LIMIT
- 50
-)
-SELECT
- newest_employees.name,
- newest_employees.salary,
- average_salaries.average_country_salary
-FROM
- newest_employees
- JOIN average_salaries ON newest_employees.country = average_salaries.country
diff --git a/book/tests/snapshots/snapshot__@examples__employees-3.prql.snap b/book/tests/snapshots/snapshot__@examples__employees-3.prql.snap
deleted file mode 100644
index fa439fbf23c0..000000000000
--- a/book/tests/snapshots/snapshot__@examples__employees-3.prql.snap
+++ /dev/null
@@ -1,27 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from de=dept_emp\njoin s=salaries side:left [\n (s.emp_no == de.emp_no),\n s\"({s.from_date}, {s.to_date}) OVERLAPS ({de.from_date}, {de.to_date})\"\n]\ngroup [de.emp_no, de.dept_no] (\n aggregate salary = (average s.salary)\n)\njoin employees [==emp_no]\njoin titles [==emp_no]\nselect [dept_no, salary, employees.gender, titles.title]\n"
-input_file: book/tests/prql/examples/employees-3.prql
----
-WITH table_1 AS (
- SELECT
- de.dept_no,
- AVG(s.salary) AS salary,
- de.emp_no
- FROM
- dept_emp AS de
- LEFT JOIN salaries AS s ON s.emp_no = de.emp_no
- AND (s.from_date, s.to_date) OVERLAPS (de.from_date, de.to_date)
- GROUP BY
- de.emp_no,
- de.dept_no
-)
-SELECT
- table_1.dept_no,
- table_1.salary,
- employees.gender,
- titles.title
-FROM
- table_1
- JOIN employees ON table_1.emp_no = employees.emp_no
- JOIN titles ON table_1.emp_no = titles.emp_no
diff --git a/book/tests/snapshots/snapshot__@examples__misc-0.prql.snap b/book/tests/snapshots/snapshot__@examples__misc-0.prql.snap
deleted file mode 100644
index b12126c24dd3..000000000000
--- a/book/tests/snapshots/snapshot__@examples__misc-0.prql.snap
+++ /dev/null
@@ -1,40 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "# TODO: this table should have a column `part` with values 1..5,\n# but such data declaration is not yet supported, see #286\ntable parts = (\n from seq_1_to_5\n)\n\nfrom pl=prospect_lists_prospects\nfilter prospect_list_id == 'cc675eee-8bd1-237f-be5e-622ba511d65e'\njoin a=accounts [a.id == pl.related_id]\njoin er=email_addr_bean_rel [er.bean_id == a.id and er.primary_address == '1']\njoin ea=email_addresses [ea.id == er.email_address_id]\nselect ea.email_address\nderive prefix = s\"regexp_replace(SUBSTRING_INDEX({email_address}, '@', 1), '[.0-9-_:]+', '.')\"\nderive stub = s\"SUBSTRING_INDEX(SUBSTRING_INDEX({prefix}, '.', part), '.', -1)\"\nselect [email_address, stub]\n"
-input_file: book/tests/prql/examples/misc-0.prql
----
-WITH parts AS (
- SELECT
- *
- FROM
- seq_1_to_5
-),
-table_1 AS (
- SELECT
- related_id
- FROM
- prospect_lists_prospects AS pl
- WHERE
- prospect_list_id = 'cc675eee-8bd1-237f-be5e-622ba511d65e'
-)
-SELECT
- ea.email_address,
- SUBSTRING_INDEX(
- SUBSTRING_INDEX(
- regexp_replace(
- SUBSTRING_INDEX(ea.email_address, '@', 1),
- '[.0-9-_:]+',
- '.'
- ),
- '.',
- part
- ),
- '.',
- -1
- ) AS stub
-FROM
- table_1
- JOIN accounts AS a ON a.id = table_1.related_id
- JOIN email_addr_bean_rel AS er ON er.bean_id = a.id
- AND er.primary_address = '1'
- JOIN email_addresses AS ea ON ea.id = er.email_address_id
diff --git a/book/tests/snapshots/snapshot__@language-features__dates-and-times-2.prql.snap b/book/tests/snapshots/snapshot__@language-features__dates-and-times-2.prql.snap
deleted file mode 100644
index c7886ddfa16a..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__dates-and-times-2.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from commits\nderive first_prql_commit = @2020-01-01T13:19:55-0800\n"
-input_file: book/tests/prql/language-features/dates-and-times-2.prql
----
-SELECT
- *,
- TIMESTAMP '2020-01-01T13:19:55-0800' AS first_prql_commit
-FROM
- commits
diff --git a/book/tests/snapshots/snapshot__@language-features__ranges-0.prql.snap b/book/tests/snapshots/snapshot__@language-features__ranges-0.prql.snap
deleted file mode 100644
index 79caec12df4b..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__ranges-0.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from events\nfilter (date | in @1776-07-04..@1787-09-17)\nfilter (magnitude | in 50..100)\nderive is_northern = (latitude | in 0..)\n"
-input_file: book/tests/prql/language-features/ranges-0.prql
----
-SELECT
- *,
- latitude >= 0 AS is_northern
-FROM
- events
-WHERE
- date BETWEEN DATE '1776-07-04' AND DATE '1787-09-17'
- AND magnitude BETWEEN 50 AND 100
diff --git a/book/tests/snapshots/snapshot__@language-features__ranges-1.prql.snap b/book/tests/snapshots/snapshot__@language-features__ranges-1.prql.snap
deleted file mode 100644
index 69b3698f9352..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__ranges-1.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from orders\nsort [-value, date]\ntake 101..110\n"
-input_file: book/tests/prql/language-features/ranges-1.prql
----
-SELECT
- *
-FROM
- orders
-ORDER BY
- value DESC,
- date
-LIMIT
- 10 OFFSET 100
diff --git a/book/tests/snapshots/snapshot__@language-features__s-strings-4.prql.snap b/book/tests/snapshots/snapshot__@language-features__s-strings-4.prql.snap
deleted file mode 100644
index 1c28726ce165..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__s-strings-4.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from employees\nderive [\n has_valid_title = s\"regexp_contains(title, '([a-z0-9]*-){{2,}}')\"\n]\n"
-input_file: book/tests/prql/language-features/s-strings-4.prql
----
-SELECT
- *,
- regexp_contains(title, '([a-z0-9]*-){2,}') AS has_valid_title
-FROM
- employees
diff --git a/book/tests/snapshots/snapshot__@language-features__switch-0.prql.snap b/book/tests/snapshots/snapshot__@language-features__switch-0.prql.snap
deleted file mode 100644
index 3fc3b672a06b..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__switch-0.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from employees\nderive distance = switch [\n city == \"Calgary\" -> 0,\n city == \"Edmonton\" -> 300,\n]\n"
-input_file: book/tests/prql/language-features/switch-0.prql
----
-SELECT
- *,
- CASE
- WHEN city = 'Calgary' THEN 0
- WHEN city = 'Edmonton' THEN 300
- ELSE NULL
- END AS distance
-FROM
- employees
diff --git a/book/tests/snapshots/snapshot__@language-features__switch-1.prql.snap b/book/tests/snapshots/snapshot__@language-features__switch-1.prql.snap
deleted file mode 100644
index 3ce88aec5690..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__switch-1.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from employees\nderive distance = switch [\n city == \"Calgary\" -> 0,\n city == \"Edmonton\" -> 300,\n true -> \"Unknown\",\n]\n"
-input_file: book/tests/prql/language-features/switch-1.prql
----
-SELECT
- *,
- CASE
- WHEN city = 'Calgary' THEN 0
- WHEN city = 'Edmonton' THEN 300
- ELSE 'Unknown'
- END AS distance
-FROM
- employees
diff --git a/book/tests/snapshots/snapshot__@language-features__target-1.prql.snap b/book/tests/snapshots/snapshot__@language-features__target-1.prql.snap
deleted file mode 100644
index 83b87715b88d..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__target-1.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "prql target:sql.mssql\n\nfrom employees\nsort age\ntake 10\n"
-input_file: book/tests/prql/language-features/target-1.prql
----
-SELECT
- TOP (10) *
-FROM
- employees
-ORDER BY
- age
diff --git a/book/tests/snapshots/snapshot__@language-features__target-2.prql.snap b/book/tests/snapshots/snapshot__@language-features__target-2.prql.snap
deleted file mode 100644
index 87aa49f8fbb7..000000000000
--- a/book/tests/snapshots/snapshot__@language-features__target-2.prql.snap
+++ /dev/null
@@ -1,9 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "prql version:\"0.4\"\n\nfrom employees\n"
-input_file: book/tests/prql/language-features/target-2.prql
----
-SELECT
- *
-FROM
- employees
diff --git a/book/tests/snapshots/snapshot__@queries__functions-0.prql.snap b/book/tests/snapshots/snapshot__@queries__functions-0.prql.snap
deleted file mode 100644
index 332c716ae9d9..000000000000
--- a/book/tests/snapshots/snapshot__@queries__functions-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "func fahrenheit_to_celsius temp -> (temp - 32) / 1.8\n\nfrom cities\nderive temp_c = (fahrenheit_to_celsius temp_f)\n"
-input_file: book/tests/prql/queries/functions-0.prql
----
-SELECT
- *,
- (temp_f - 32) / 1.8 AS temp_c
-FROM
- cities
diff --git a/book/tests/snapshots/snapshot__@queries__functions-1.prql.snap b/book/tests/snapshots/snapshot__@queries__functions-1.prql.snap
deleted file mode 100644
index 0aaeb32b5b0d..000000000000
--- a/book/tests/snapshots/snapshot__@queries__functions-1.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "func interp lower:0 higher x -> (x - lower) / (higher - lower)\n\nfrom students\nderive [\n sat_proportion_1 = (interp 1600 sat_score),\n sat_proportion_2 = (interp lower:0 1600 sat_score),\n]\n"
-input_file: book/tests/prql/queries/functions-1.prql
----
-SELECT
- *,
- (sat_score - 0) / 1600 AS sat_proportion_1,
- (sat_score - 0) / 1600 AS sat_proportion_2
-FROM
- students
diff --git a/book/tests/snapshots/snapshot__@queries__functions-2.prql.snap b/book/tests/snapshots/snapshot__@queries__functions-2.prql.snap
deleted file mode 100644
index 273eb16a4244..000000000000
--- a/book/tests/snapshots/snapshot__@queries__functions-2.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "func interp lower:0 higher x -> (x - lower) / (higher - lower)\n\nfrom students\nderive [\n sat_proportion_1 = (sat_score | interp 1600),\n sat_proportion_2 = (sat_score | interp lower:0 1600),\n]\n"
-input_file: book/tests/prql/queries/functions-2.prql
----
-SELECT
- *,
- (sat_score - 0) / 1600 AS sat_proportion_1,
- (sat_score - 0) / 1600 AS sat_proportion_2
-FROM
- students
diff --git a/book/tests/snapshots/snapshot__@queries__functions-4.prql.snap b/book/tests/snapshots/snapshot__@queries__functions-4.prql.snap
deleted file mode 100644
index 86c5ba85d58a..000000000000
--- a/book/tests/snapshots/snapshot__@queries__functions-4.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "func fahrenheit_to_celsius temp -> (temp - 32) / 1.8\nfunc interp lower:0 higher x -> (x - lower) / (higher - lower)\n\nfrom kettles\nderive boiling_proportion = (temp_c | fahrenheit_to_celsius | interp 100)\n"
-input_file: book/tests/prql/queries/functions-4.prql
----
-SELECT
- *,
- ((temp_c - 32) / 1.8 - 0) / 100 AS boiling_proportion
-FROM
- kettles
diff --git a/book/tests/snapshots/snapshot__@syntax-6.prql.snap b/book/tests/snapshots/snapshot__@syntax-6.prql.snap
deleted file mode 100644
index 916f3d4cbe85..000000000000
--- a/book/tests/snapshots/snapshot__@syntax-6.prql.snap
+++ /dev/null
@@ -1,20 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from employees\n# Requires parentheses, because it's contains a pipe\nderive is_proximate = (distance | in 0..20)\n# Requires parentheses, because it's a function call\nderive total_distance = (sum distance)\n# `??` doesn't require parentheses, as it's not a function call\nderive min_capped_distance = (min distance ?? 5)\n# No parentheses needed, because no function call\nderive travel_time = distance / 40\n# No inner parentheses needed around `1+1` because no function call\nderive distance_rounded_2_dp = (round 1+1 distance)\nderive [\n # Requires parentheses, because it contains a pipe\n is_far = (distance | in 100..),\n # The left value of the range requires parentheses,\n # because of the minus sign\n is_negative = (distance | in (-100..0)),\n # ...this is equivalent\n is_negative = (distance | in (-100)..0),\n # Doesn't require parentheses, because it's in a list (confusing, see footnote)!\n average_distance = average distance,\n]\n# Requires parentheses because of the minus sign\nsort (-distance)\n# A list is fine too\nsort [-distance]\n"
-input_file: book/tests/prql/syntax-6.prql
----
-SELECT
- *,
- distance BETWEEN 0 AND 20 AS is_proximate,
- SUM(distance) OVER () AS total_distance,
- MIN(COALESCE(distance, 5)) OVER () AS min_capped_distance,
- distance / 40 AS travel_time,
- ROUND(distance, 2) AS distance_rounded_2_dp,
- distance >= 100 AS is_far,
- distance BETWEEN -100 AND 0,
- distance BETWEEN -100 AND 0 AS is_negative,
- AVG(distance) OVER () AS average_distance
-FROM
- employees
-ORDER BY
- distance DESC
diff --git a/book/tests/snapshots/snapshot__@transforms__select-4.prql.snap b/book/tests/snapshots/snapshot__@transforms__select-4.prql.snap
deleted file mode 100644
index 3419030604ce..000000000000
--- a/book/tests/snapshots/snapshot__@transforms__select-4.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "prql target:sql.bigquery\nfrom tracks\nselect ![milliseconds,bytes]\n"
-input_file: book/tests/prql/transforms/select-4.prql
----
-SELECT
- *
-EXCEPT
- (milliseconds, bytes)
-FROM
- tracks
diff --git a/book/tests/snapshots/snapshot__@transforms__select-5.prql.snap b/book/tests/snapshots/snapshot__@transforms__select-5.prql.snap
deleted file mode 100644
index 33337b07109a..000000000000
--- a/book/tests/snapshots/snapshot__@transforms__select-5.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from tracks\nselect [track_id, title, composer, bytes]\nselect ![title, composer]\n"
-input_file: book/tests/prql/transforms/select-5.prql
----
-SELECT
- track_id,
- bytes
-FROM
- tracks
diff --git a/book/tests/snapshots/snapshot__@transforms__select-6.prql.snap b/book/tests/snapshots/snapshot__@transforms__select-6.prql.snap
deleted file mode 100644
index 7aa04a75c903..000000000000
--- a/book/tests/snapshots/snapshot__@transforms__select-6.prql.snap
+++ /dev/null
@@ -1,9 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from artists\nderive nick = name\nselect ![artists.*]\n"
-input_file: book/tests/prql/transforms/select-6.prql
----
-SELECT
- name AS nick
-FROM
- artists
diff --git a/book/tests/snapshots/snapshot__@transforms__sort-3.prql.snap b/book/tests/snapshots/snapshot__@transforms__sort-3.prql.snap
deleted file mode 100644
index 7b6e784e1da0..000000000000
--- a/book/tests/snapshots/snapshot__@transforms__sort-3.prql.snap
+++ /dev/null
@@ -1,18 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from employees\nsort [s\"substr({first_name}, 2, 5)\"]\n"
-input_file: book/tests/prql/transforms/sort-3.prql
----
-WITH table_1 AS (
- SELECT
- *,
- substr(first_name, 2, 5) AS _expr_0
- FROM
- employees
- ORDER BY
- _expr_0
-)
-SELECT
- *
-FROM
- table_1
diff --git a/book/tests/snapshots/snapshot__@transforms__take-1.prql.snap b/book/tests/snapshots/snapshot__@transforms__take-1.prql.snap
deleted file mode 100644
index 0e739ad8c893..000000000000
--- a/book/tests/snapshots/snapshot__@transforms__take-1.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: "from orders\nsort [-value, date]\ntake 101..110\n"
-input_file: book/tests/prql/transforms/take-1.prql
----
-SELECT
- *
-FROM
- orders
-ORDER BY
- value DESC,
- date
-LIMIT
- 10 OFFSET 100
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__cte-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__cte-0.prql.snap
deleted file mode 100644
index b246de058091..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__cte-0.prql.snap
+++ /dev/null
@@ -1,34 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/cte-0.prql
----
-let newest_employees = (
- from employees
- sort tenure
- take 50
-)
-
-
-
-let average_salaries = (
- from salaries
- group country (
- aggregate (
- average_country_salary = average salary
-)
-)
-)
-
-
-
-from newest_employees
-join average_salaries [==country]
-select [
- name,
- salary,
- average_country_salary,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-0.prql.snap
deleted file mode 100644
index 692c476512cc..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-0.prql.snap
+++ /dev/null
@@ -1,26 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/employees-0.prql
----
-from salaries
-group [emp_no] (
- aggregate [emp_salary = average salary]
-)
-join t = titles [==emp_no]
-join side:left dept_emp [==emp_no]
-group [
- dept_emp.dept_no,
- t.title,
-] (
- aggregate [avg_salary = average emp_salary]
-)
-join departments [==dept_no]
-select [
- dept_name,
- title,
- avg_salary,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-1.prql.snap
deleted file mode 100644
index 665754bd3fb5..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-1.prql.snap
+++ /dev/null
@@ -1,33 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/employees-1.prql
----
-from e = employees
-join salaries [==emp_no]
-group [
- e.emp_no,
- e.gender,
-] (
- aggregate [emp_salary = average salaries.salary]
-)
-join side:left de = dept_emp [==emp_no]
-group [
- de.dept_no,
- gender,
-] (
- aggregate [
- salary_avg = average emp_salary,
- salary_sd = stddev emp_salary,
-]
-)
-join departments [==dept_no]
-select [
- dept_name,
- gender,
- salary_avg,
- salary_sd,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-2.prql.snap
deleted file mode 100644
index 3823173006c7..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-2.prql.snap
+++ /dev/null
@@ -1,36 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/employees-2.prql
----
-from e = employees
-join salaries [==emp_no]
-group [
- e.emp_no,
- e.gender,
-] (
- aggregate [emp_salary = average salaries.salary]
-)
-join de = dept_emp [==emp_no]
-join dm = dept_manager [dm.dept_no == de.dept_no and s"(de.from_date, de.to_date) OVERLAPS (dm.from_date, dm.to_date)"]
-group [
- dm.emp_no,
- gender,
-] (
- aggregate [
- salary_avg = average emp_salary,
- salary_sd = stddev emp_salary,
-]
-)
-derive mng_no = emp_no
-join managers = employees [==emp_no]
-derive mng_name = s"managers.first_name || ' ' || managers.last_name"
-select [
- mng_name,
- managers.gender,
- salary_avg,
- salary_sd,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-3.prql.snap
deleted file mode 100644
index 611769e8f06d..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__employees-3.prql.snap
+++ /dev/null
@@ -1,29 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/employees-3.prql
----
-from de = dept_emp
-join side:left s = salaries [
- s.emp_no == de.emp_no,
- s"({s.from_date}, {s.to_date}) OVERLAPS ({de.from_date}, {de.to_date})",
-]
-group [
- de.emp_no,
- de.dept_no,
-] (
- aggregate (
- salary = average s.salary
-)
-)
-join employees [==emp_no]
-join titles [==emp_no]
-select [
- dept_no,
- salary,
- employees.gender,
- titles.title,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-0.prql.snap
deleted file mode 100644
index 085bada98319..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/list-equivalence-0.prql
----
-from employees
-select salary
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-1.prql.snap
deleted file mode 100644
index 6ab6d90cdd10..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/list-equivalence-1.prql
----
-from employees
-select [salary]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-2.prql.snap
deleted file mode 100644
index 5ba483c522d7..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-2.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/list-equivalence-2.prql
----
-from employees
-derive [
- gross_salary = salary + payroll_tax,
- gross_cost = gross_salary + benefits_cost,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-3.prql.snap
deleted file mode 100644
index c1c8e138f806..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__list-equivalence-3.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/list-equivalence-3.prql
----
-from employees
-derive gross_salary = salary + payroll_tax
-derive gross_cost = gross_salary + benefits_cost
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__misc-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__misc-0.prql.snap
deleted file mode 100644
index 930d29f6d477..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__misc-0.prql.snap
+++ /dev/null
@@ -1,26 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/misc-0.prql
----
-let parts = (
- from seq_1_to_5
-)
-
-
-
-from pl = prospect_lists_prospects
-filter prospect_list_id == "cc675eee-8bd1-237f-be5e-622ba511d65e"
-join a = accounts [a.id == pl.related_id]
-join er = email_addr_bean_rel [er.bean_id == a.id and er.primary_address == "1"]
-join ea = email_addresses [ea.id == er.email_address_id]
-select ea.email_address
-derive prefix = s"regexp_replace(SUBSTRING_INDEX({email_address}, '@', 1), '[.0-9-_:]+', '.')"
-derive stub = s"SUBSTRING_INDEX(SUBSTRING_INDEX({prefix}, '.', part), '.', -1)"
-select [
- email_address,
- stub,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__misc-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__misc-1.prql.snap
deleted file mode 100644
index d48e3fe1307a..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__misc-1.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/misc-1.prql
----
-from club_ratings
-filter rating != null
-group year (
- derive [rating_norm = rating - ( average rating ) / ( stddev rating )]
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__variables-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__variables-0.prql.snap
deleted file mode 100644
index c4e1df527811..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__variables-0.prql.snap
+++ /dev/null
@@ -1,32 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/variables-0.prql
----
-from employees
-filter country == "USA"
-derive [
- gross_salary = salary + payroll_tax,
- gross_cost = gross_salary + benefits_cost,
-]
-filter gross_cost > 0
-group [
- title,
- country,
-] (
- aggregate [
- average salary,
- average gross_salary,
- sum salary,
- sum gross_salary,
- average gross_cost,
- sum_gross_cost = sum gross_cost,
- ct = count,
-]
-)
-sort sum_gross_cost
-filter ct > 200
-take 20
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__variables-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@examples__variables-1.prql.snap
deleted file mode 100644
index 1f588bf0d309..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@examples__variables-1.prql.snap
+++ /dev/null
@@ -1,19 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/examples/variables-1.prql
----
-from employees
-group [emp_no] (
- aggregate [emp_salary = average salary]
-)
-join titles [==emp_no]
-group [title] (
- aggregate [avg_salary = average emp_salary]
-)
-select salary_k = avg_salary / 1000
-take 10
-derive salary = salary_k * 1000
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-0.prql.snap
deleted file mode 100644
index 96d5d50a00e1..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-0.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/internals/functional-lang-0.prql
----
-from employees
-filter age > 50
-sort name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-1.prql.snap
deleted file mode 100644
index ae83420f23d3..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-1.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/internals/functional-lang-1.prql
----
-from employees
-filter age > 50
-sort name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-2.prql.snap
deleted file mode 100644
index f15a84e195b3..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-2.prql.snap
+++ /dev/null
@@ -1,12 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/internals/functional-lang-2.prql
----
-filter age > 50 (
- from employees
-)
-sort name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-3.prql.snap
deleted file mode 100644
index aa777d923706..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__functional-lang-3.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/internals/functional-lang-3.prql
----
-sort name (
- filter age > 50 (
- from employees
-)
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__name-resolving-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@internals__name-resolving-0.prql.snap
deleted file mode 100644
index a7bd8bc3730a..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__name-resolving-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/internals/name-resolving-0.prql
----
-from employees
-select first_name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__name-resolving-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@internals__name-resolving-1.prql.snap
deleted file mode 100644
index 6161fd5892e6..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@internals__name-resolving-1.prql.snap
+++ /dev/null
@@ -1,18 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/internals/name-resolving-1.prql
----
-from employees
-derive [
- first_name,
- dept_id,
-]
-join d = departments [==dept_id]
-select [
- first_name,
- d.title,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@introduction-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@introduction-0.prql.snap
deleted file mode 100644
index bc40a390e21a..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@introduction-0.prql.snap
+++ /dev/null
@@ -1,32 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/introduction-0.prql
----
-from employees
-filter start_date > @2021-01-01
-derive [
- gross_salary = salary + tax ?? 0,
- gross_cost = gross_salary + benefits_cost,
-]
-filter gross_cost > 0
-group [
- title,
- country,
-] (
- aggregate [
- average gross_salary,
- sum_gross_cost = sum gross_cost,
-]
-)
-filter sum_gross_cost > 100000
-derive id = f"{title}_{country}"
-derive country_code = s"LEFT(country, 2)"
-sort [
- sum_gross_cost,
- -country,
-]
-take 1..20
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__coalesce-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__coalesce-0.prql.snap
deleted file mode 100644
index 16833c5f8cfa..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__coalesce-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/coalesce-0.prql
----
-from orders
-derive amount ?? 0
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-0.prql.snap
deleted file mode 100644
index ca08e6d69631..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/dates-and-times-0.prql
----
-from employees
-derive age_at_year_end = @2022-12-31 - dob
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-1.prql.snap
deleted file mode 100644
index 07d9b568eac6..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/dates-and-times-1.prql
----
-from orders
-derive should_have_shipped_today = order_time < @08:30
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-2.prql.snap
deleted file mode 100644
index 6e0b688f7f7a..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-2.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/dates-and-times-2.prql
----
-from commits
-derive first_prql_commit = @2020-01-01T13:19:55-0800
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-3.prql.snap
deleted file mode 100644
index 5080f647a12c..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__dates-and-times-3.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/dates-and-times-3.prql
----
-from projects
-derive first_check_in = start + 10days
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-0.prql.snap
deleted file mode 100644
index 587f75ff1bd2..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-0.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/distinct-0.prql
----
-from employees
-select department
-group department (
- take 1
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-1.prql.snap
deleted file mode 100644
index d6bcee7acf86..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-1.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/distinct-1.prql
----
-from employees
-select department
-group department (
- take 1
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-2.prql.snap
deleted file mode 100644
index 4f2e5f381a88..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__distinct-2.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/distinct-2.prql
----
-from employees
-group department (
- sort age
- take 1
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__f-strings-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__f-strings-0.prql.snap
deleted file mode 100644
index 2b8a822ba481..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__f-strings-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/f-strings-0.prql
----
-from employees
-select full_name = f"{first_name} {last_name}"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__f-strings-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__f-strings-1.prql.snap
deleted file mode 100644
index b61f8780aa34..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__f-strings-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/f-strings-1.prql
----
-from web
-select url = f"http{tls}://www.{domain}.{tld}/{page}"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__null-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__null-0.prql.snap
deleted file mode 100644
index 016809741efe..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__null-0.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/null-0.prql
----
-from employees
-filter first_name == null
-filter null != last_name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__ranges-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__ranges-0.prql.snap
deleted file mode 100644
index e20b2b97240c..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__ranges-0.prql.snap
+++ /dev/null
@@ -1,21 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/ranges-0.prql
----
-from events
-filter (
- date
- in @1776-07-04..@1787-09-17
-)
-filter (
- magnitude
- in 50..100
-)
-derive is_northern = (
- latitude
- in 0..
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__ranges-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__ranges-1.prql.snap
deleted file mode 100644
index 46ce8b767eb3..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__ranges-1.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/ranges-1.prql
----
-from orders
-sort [
- -value,
- date,
-]
-take 101..110
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-0.prql.snap
deleted file mode 100644
index fa9c95fb9f4c..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/s-strings-0.prql
----
-from my_table
-select db_version = s"version()"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-1.prql.snap
deleted file mode 100644
index 7de6990c149c..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/s-strings-1.prql
----
-from employees
-aggregate [average salary]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-2.prql.snap
deleted file mode 100644
index 8d39feed0f0d..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-2.prql.snap
+++ /dev/null
@@ -1,15 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/s-strings-2.prql
----
-from de = dept_emp
-join side:left s = salaries [
- s.emp_no == de.emp_no,
- s"({s.from_date}, {s.to_date})
- OVERLAPS
- ({de.from_date}, {de.to_date})",
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-3.prql.snap
deleted file mode 100644
index 85661196009c..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-3.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/s-strings-3.prql
----
-from s"SELECT DISTINCT ON first_name, id, age FROM employees ORDER BY age ASC"
-join s = s"SELECT * FROM salaries" [==id]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-4.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-4.prql.snap
deleted file mode 100644
index d7482d2f4cfb..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-4.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/s-strings-4.prql
----
-from employees
-derive [has_valid_title = s"regexp_contains(title, '([a-z0-9]*-){2,}')"]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-5.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-5.prql.snap
deleted file mode 100644
index 4313e1e554a7..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-5.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/s-strings-5.prql
----
-from employees
-derive [
- gross_salary = salary + benefits,
- daily_rate = s"{gross_salary} / 365",
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-6.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-6.prql.snap
deleted file mode 100644
index 8ac94b9d968f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__s-strings-6.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/s-strings-6.prql
----
-from employees
-derive [
- gross_salary = salary + benefits,
- daily_rate = s"({gross_salary}) / 365",
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__standard-library-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__standard-library-0.prql.snap
deleted file mode 100644
index 691cabab4a62..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__standard-library-0.prql.snap
+++ /dev/null
@@ -1,20 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/standard-library-0.prql
----
-from employees
-derive [
- gross_salary = (
- salary + payroll_tax
- as int
-),
- gross_salary_rounded = (
- gross_salary
- round 0
-),
- time = s"NOW()",
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-0.prql.snap
deleted file mode 100644
index 08b198a45ab3..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/strings-0.prql
----
-from my_table
-select x = "hello world"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-1.prql.snap
deleted file mode 100644
index 014e0927ce0e..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/strings-1.prql
----
-from my_table
-select x = "hello world"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-2.prql.snap
deleted file mode 100644
index 52b190fec22a..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-2.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/strings-2.prql
----
-from my_table
-select x = '"hello world"'
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-3.prql.snap
deleted file mode 100644
index eddb87ee8834..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-3.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/strings-3.prql
----
-from my_table
-select x = 'I said "hello world"!'
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-4.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-4.prql.snap
deleted file mode 100644
index 5966be260e48..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__strings-4.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/strings-4.prql
----
-from my_table
-select x = 'I said """hello world"""!'
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__switch-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__switch-0.prql.snap
deleted file mode 100644
index 85bb6bac32b8..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__switch-0.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/switch-0.prql
----
-from employees
-derive distance = switch [
- city == "Calgary" => 0
- city == "Edmonton" => 300
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__switch-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__switch-1.prql.snap
deleted file mode 100644
index dd4c64e0b6b0..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__switch-1.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/switch-1.prql
----
-from employees
-derive distance = switch [
- city == "Calgary" => 0
- city == "Edmonton" => 300
- true => "Unknown"
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-0.prql.snap
deleted file mode 100644
index 8d46fc69595c..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-0.prql.snap
+++ /dev/null
@@ -1,15 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/target-0.prql
----
-prql target:sql.postgres
-
-
-
-from employees
-sort age
-take 10
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-1.prql.snap
deleted file mode 100644
index 2719c8e16911..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-1.prql.snap
+++ /dev/null
@@ -1,15 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/target-1.prql
----
-prql target:sql.mssql
-
-
-
-from employees
-sort age
-take 10
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-2.prql.snap
deleted file mode 100644
index 5bf77265c6a4..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@language-features__target-2.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/language-features/target-2.prql
----
-prql version:^0.5
-
-
-
-from employees
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-0.prql.snap
deleted file mode 100644
index bde459b05cf8..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-0.prql.snap
+++ /dev/null
@@ -1,16 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/functions-0.prql
----
-func fahrenheit_to_celsius temp -> temp - 32 / 1.8
-
-
-
-from cities
-derive (
- temp_c = fahrenheit_to_celsius temp_f
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-1.prql.snap
deleted file mode 100644
index d8d3e0185fd9..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-1.prql.snap
+++ /dev/null
@@ -1,17 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/functions-1.prql
----
-func interp higher x lower:0 -> x - lower / higher - lower
-
-
-
-from students
-derive [
- sat_proportion_1 = interp 1600 sat_score,
- sat_proportion_2 = interp lower:0 1600 sat_score,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-2.prql.snap
deleted file mode 100644
index 49560fe48496..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-2.prql.snap
+++ /dev/null
@@ -1,23 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/functions-2.prql
----
-func interp higher x lower:0 -> x - lower / higher - lower
-
-
-
-from students
-derive [
- sat_proportion_1 = (
- sat_score
- interp 1600
-),
- sat_proportion_2 = (
- sat_score
- interp lower:0 1600
-),
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-3.prql.snap
deleted file mode 100644
index 83e91977fe3f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-3.prql.snap
+++ /dev/null
@@ -1,17 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/functions-3.prql
----
-func fahrenheit_to_celsius temp -> temp - 32 / 1.8
-
-
-
-from cities
-derive temp_c = (
- temp_f
- fahrenheit_to_celsius
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-4.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-4.prql.snap
deleted file mode 100644
index 8ed62cca5158..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__functions-4.prql.snap
+++ /dev/null
@@ -1,22 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/functions-4.prql
----
-func fahrenheit_to_celsius temp -> temp - 32 / 1.8
-
-
-
-func interp higher x lower:0 -> x - lower / higher - lower
-
-
-
-from kettles
-derive boiling_proportion = (
- temp_c
- fahrenheit_to_celsius
- interp 100
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-0.prql.snap
deleted file mode 100644
index 7162e861b213..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-0.prql.snap
+++ /dev/null
@@ -1,9 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/pipelines-0.prql
----
-from employees
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-1.prql.snap
deleted file mode 100644
index f64f5d68dc56..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/pipelines-1.prql
----
-from employees
-derive gross_salary = salary + payroll_tax
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-2.prql.snap
deleted file mode 100644
index e3ff662251a8..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__pipelines-2.prql.snap
+++ /dev/null
@@ -1,18 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/pipelines-2.prql
----
-from e = employees
-derive gross_salary = salary + payroll_tax
-sort gross_salary
-take 10
-join d = department [==dept_no]
-select [
- e.name,
- gross_salary,
- d.name,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__variables-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__variables-0.prql.snap
deleted file mode 100644
index fbb8c9dfa00f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__variables-0.prql.snap
+++ /dev/null
@@ -1,18 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/variables-0.prql
----
-let top_50 = (
- from employees
- sort salary
- take 50
- aggregate [total_salary = sum salary]
-)
-
-
-
-from top_50
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__variables-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@queries__variables-1.prql.snap
deleted file mode 100644
index f7a3cbcd9431..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@queries__variables-1.prql.snap
+++ /dev/null
@@ -1,19 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/queries/variables-1.prql
----
-let grouping = s"
- SELECT SUM(a)
- FROM tbl
- GROUP BY
- GROUPING SETS
- ((b, c, d), (d), (b, d))
-"
-
-
-
-from grouping
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-0.prql.snap
deleted file mode 100644
index 16788f8c5410..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-0.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-0.prql
----
-from employees
-filter department == "Product"
-select [
- first_name,
- last_name,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-1.prql.snap
deleted file mode 100644
index 7d3684118966..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-1.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-1.prql
----
-from employees
-filter department == "Product"
-select [
- first_name,
- last_name,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-10.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-10.prql.snap
deleted file mode 100644
index e12239744931..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-10.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-10.prql
----
-prql target:sql.postgres
-
-
-
-from employees
-select `first name`
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-11.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-11.prql.snap
deleted file mode 100644
index f719b0acbbd4..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-11.prql.snap
+++ /dev/null
@@ -1,9 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-11.prql
----
-from `dir/*.parquet`
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-12.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-12.prql.snap
deleted file mode 100644
index 79ec4c9aa74d..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-12.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-12.prql
----
-prql target:sql.bigquery
-
-
-
-from `project-foo.dataset.table`
-join `project-bar.dataset.table` [==col_bax]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-13.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-13.prql.snap
deleted file mode 100644
index 6316d2280516..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-13.prql.snap
+++ /dev/null
@@ -1,9 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-13.prql
----
-from `music.albums`
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-14.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-14.prql.snap
deleted file mode 100644
index a38f2f750602..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-14.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-14.prql
----
-from employees
-filter id == $1
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-15.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-15.prql.snap
deleted file mode 100644
index 34d44267ba17..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-15.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-15.prql
----
-from numbers
-select [
- small = 1.0000001,
- big = 5000000,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-2.prql.snap
deleted file mode 100644
index 8c5b5825e8c4..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-2.prql.snap
+++ /dev/null
@@ -1,21 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-2.prql
----
-from numbers
-derive [
- x = 1,
- y = 2,
-]
-derive [
- a = x,
- b = y,
-]
-derive [
- c = a,
- d = b,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-3.prql.snap
deleted file mode 100644
index 6820f7c5e628..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-3.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-3.prql
----
-from employees
-select [first_name]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-4.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-4.prql.snap
deleted file mode 100644
index 6e06fe3ee2e5..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-4.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-4.prql
----
-from employees
-select first_name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-5.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-5.prql.snap
deleted file mode 100644
index f3ebf960c4bf..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-5.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-5.prql
----
-from foo
-select [
- circumference = diameter * 3.14159,
- color,
-]
-filter circumference > 10 and color != "red"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-6.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-6.prql.snap
deleted file mode 100644
index d6668fe305c7..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-6.prql.snap
+++ /dev/null
@@ -1,40 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-6.prql
----
-from employees
-derive is_proximate = (
- distance
- in 0..20
-)
-derive (
- total_distance = sum distance
-)
-derive (
- min_capped_distance = min distance ?? 5
-)
-derive travel_time = distance / 40
-derive (
- distance_rounded_2_dp = round 1 + 1 distance
-)
-derive [
- is_far = (
- distance
- in 100..
-),
- is_negative = (
- distance
- in -100..0
-),
- is_negative = (
- distance
- in -100..0
-),
- average_distance = average distance,
-]
-sort -distance
-sort [-distance]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-7.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-7.prql.snap
deleted file mode 100644
index 29e0c6d26c1e..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-7.prql.snap
+++ /dev/null
@@ -1,18 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-7.prql
----
-from employees
-group [
- title,
- country,
-] (
- aggregate [
- average salary,
- ct = count,
-]
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-8.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-8.prql.snap
deleted file mode 100644
index 55a51e5d833f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-8.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-8.prql
----
-from employees
-aggregate [average salary]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-9.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-9.prql.snap
deleted file mode 100644
index 9e5a61c3e446..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@syntax-9.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/syntax-9.prql
----
-prql target:sql.mysql
-
-
-
-from employees
-select `first name`
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-0.prql.snap
deleted file mode 100644
index 89e3271c8316..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-0.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/aggregate-0.prql
----
-from employees
-aggregate [
- average salary,
- ct = count,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-1.prql.snap
deleted file mode 100644
index bbf253ec6dd5..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-1.prql.snap
+++ /dev/null
@@ -1,18 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/aggregate-1.prql
----
-from employees
-group [
- title,
- country,
-] (
- aggregate [
- average salary,
- ct = count,
-]
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-2.prql.snap
deleted file mode 100644
index 21468ff11aeb..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__aggregate-2.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/aggregate-2.prql
----
-from employees
-derive [avg_sal = average salary]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-0.prql.snap
deleted file mode 100644
index 821c0f010d36..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/append-0.prql
----
-from employees_1
-append employees_2
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-1.prql.snap
deleted file mode 100644
index 2a61ec1251b1..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/append-1.prql
----
-from employees_1
-remove employees_2
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-2.prql.snap
deleted file mode 100644
index dddeb63b7c9f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__append-2.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/append-2.prql
----
-from employees_1
-intersect employees_2
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__derive-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__derive-0.prql.snap
deleted file mode 100644
index e90d9add3db4..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__derive-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/derive-0.prql
----
-from employees
-derive gross_salary = salary + payroll_tax
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__derive-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__derive-1.prql.snap
deleted file mode 100644
index f2b9dd7bd20d..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__derive-1.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/derive-1.prql
----
-from employees
-derive [
- gross_salary = salary + payroll_tax,
- gross_cost = gross_salary + benefits_cost,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-0.prql.snap
deleted file mode 100644
index 8a68bf997bd7..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/filter-0.prql
----
-from employees
-filter age > 25
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-1.prql.snap
deleted file mode 100644
index 1bc8cf6d4a34..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/filter-1.prql
----
-from employees
-filter age > 25 or department != "IT"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-2.prql.snap
deleted file mode 100644
index ad800e09070f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__filter-2.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/filter-2.prql
----
-from employees
-filter (
- age
- in 25..40
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from-0.prql.snap
deleted file mode 100644
index 0adcf6191d9e..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from-0.prql.snap
+++ /dev/null
@@ -1,9 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/from-0.prql
----
-from employees
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from-1.prql.snap
deleted file mode 100644
index b90898f6f93e..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/from-1.prql
----
-from e = employees
-select e.first_name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-0.prql.snap
deleted file mode 100644
index d86f2e1e86bb..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-0.prql.snap
+++ /dev/null
@@ -1,17 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/from_text-0.prql
----
-from_text "
-a,b,c
-1,2,3
-4,5,6
-"
-derive [
- d = b + c,
- answer = 20 * 2 + 2,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-1.prql.snap
deleted file mode 100644
index 740349748e00..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-1.prql.snap
+++ /dev/null
@@ -1,22 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/from_text-1.prql
----
-let temp_format_lookup = (
- from_text format:csv "
-country_code,format
-uk,C
-us,F
-lr,F
-de,C
-"
-)
-
-
-
-from temperatures
-join temp_format_lookup [==country_code]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-2.prql.snap
deleted file mode 100644
index a0aaabe15cb7..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__from_text-2.prql.snap
+++ /dev/null
@@ -1,33 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/from_text-2.prql
----
-let x = (
- from_text format:json '{
- "columns": ["a", "b", "c"],
- "data": [
- [1, "x", false],
- [4, "y", null]
- ]
-}'
-)
-
-
-
-let y = (
- from_text format:json '
- [
- {"a": 1, "m": "5"},
- {"a": 4, "n": "6"}
- ]
-'
-)
-
-
-
-from x
-join y [==a]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-0.prql.snap
deleted file mode 100644
index 754f23c1d76e..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-0.prql.snap
+++ /dev/null
@@ -1,18 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/group-0.prql
----
-from employees
-group [
- title,
- country,
-] (
- aggregate [
- average salary,
- ct = count,
-]
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-1.prql.snap
deleted file mode 100644
index f916e255f991..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-1.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/group-1.prql
----
-from employees
-sort join_date
-take 1
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-2.prql.snap
deleted file mode 100644
index 6b2cb62586b3..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__group-2.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/group-2.prql
----
-from employees
-group role (
- sort join_date
- take 1
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-0.prql.snap
deleted file mode 100644
index 0334411b6614..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/join-0.prql
----
-from employees
-join side:left positions [employees.id == positions.employee_id]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-1.prql.snap
deleted file mode 100644
index 073e5b79b5ee..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/join-1.prql
----
-from employees
-join side:left p = positions [employees.id == p.employee_id]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-2.prql.snap
deleted file mode 100644
index 19b950c9d24b..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__join-2.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/join-2.prql
----
-from employees
-join positions [==emp_no]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-0.prql.snap
deleted file mode 100644
index 9841ec3d8249..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/select-0.prql
----
-from employees
-select name = f"{first_name} {last_name}"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-1.prql.snap
deleted file mode 100644
index 1ecfbb0be8f6..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-1.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/select-1.prql
----
-from employees
-select [
- name = f"{first_name} {last_name}",
- age_eoy = dob - @2022-12-31,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-2.prql.snap
deleted file mode 100644
index 522050c7dd99..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-2.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/select-2.prql
----
-from employees
-select first_name
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-3.prql.snap
deleted file mode 100644
index d6596a9ce634..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-3.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/select-3.prql
----
-from e = employees
-select [
- e.first_name,
- e.last_name,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-4.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-4.prql.snap
deleted file mode 100644
index c8837e7a5780..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-4.prql.snap
+++ /dev/null
@@ -1,17 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/select-4.prql
----
-prql target:sql.bigquery
-
-
-
-from tracks
-select not [
- milliseconds,
- bytes,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-5.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-5.prql.snap
deleted file mode 100644
index ee470cf35cf6..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-5.prql.snap
+++ /dev/null
@@ -1,19 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/select-5.prql
----
-from tracks
-select [
- track_id,
- title,
- composer,
- bytes,
-]
-select not [
- title,
- composer,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-6.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-6.prql.snap
deleted file mode 100644
index 102555240bdb..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__select-6.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/select-6.prql
----
-from artists
-derive nick = name
-select not [artists.`*`]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-0.prql.snap
deleted file mode 100644
index 91b36c10532f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/sort-0.prql
----
-from employees
-sort age
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-1.prql.snap
deleted file mode 100644
index d7f443472fc9..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-1.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/sort-1.prql
----
-from employees
-sort [-age]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-2.prql.snap
deleted file mode 100644
index 1df292e0b57f..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-2.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/sort-2.prql
----
-from employees
-sort [
- age,
- -tenure,
- salary,
-]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-3.prql.snap
deleted file mode 100644
index 3ef53a4676e9..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-3.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/sort-3.prql
----
-from employees
-sort [s"substr({first_name}, 2, 5)"]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-4.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-4.prql.snap
deleted file mode 100644
index 01b5c740c41a..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-4.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/sort-4.prql
----
-from employees
-sort tenure
-derive name = f"{first_name} {last_name}"
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-5.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-5.prql.snap
deleted file mode 100644
index 52f805544586..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__sort-5.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/sort-5.prql
----
-from employees
-sort tenure
-join locations [==employee_id]
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__take-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__take-0.prql.snap
deleted file mode 100644
index 7f798967b647..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__take-0.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/take-0.prql
----
-from employees
-take 10
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__take-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__take-1.prql.snap
deleted file mode 100644
index 4107c86bfd92..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__take-1.prql.snap
+++ /dev/null
@@ -1,14 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/take-1.prql
----
-from orders
-sort [
- -value,
- date,
-]
-take 101..110
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-0.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-0.prql.snap
deleted file mode 100644
index 2366506585b0..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-0.prql.snap
+++ /dev/null
@@ -1,15 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/window-0.prql
----
-from employees
-group employee_id (
- sort month
- window rolling:12 (
- derive [trail_12_m_comp = sum paycheck]
-)
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-1.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-1.prql.snap
deleted file mode 100644
index afffeb8eb185..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-1.prql.snap
+++ /dev/null
@@ -1,19 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/window-1.prql
----
-from orders
-sort day
-window rows:-3..3 (
- derive [centered_weekly_average = average value]
-)
-group [order_month] (
- sort day
- window expanding:true (
- derive [monthly_running_total = sum value]
-)
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-2.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-2.prql.snap
deleted file mode 100644
index 3015829b90db..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-2.prql.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/window-2.prql
----
-from employees
-sort age
-derive rnk = rank
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-3.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-3.prql.snap
deleted file mode 100644
index 26a5eb5d9d46..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-3.prql.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/window-3.prql
----
-from employees
-group department (
- sort age
- derive rnk = rank
-)
-
-
-
diff --git a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-4.prql.snap b/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-4.prql.snap
deleted file mode 100644
index be549656354d..000000000000
--- a/book/tests/snapshots/snapshot__run_display_reference_prql@transforms__window-4.prql.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: book/tests/snapshot.rs
-expression: prql_to_pl(&prql).and_then(pl_to_prql).unwrap()
-input_file: book/tests/prql/transforms/window-4.prql
----
-from employees
-filter salary < ( average salary )
-
-
-
diff --git a/book/theme/highlight.js b/book/theme/highlight.js
deleted file mode 100644
index 070264e2e698..000000000000
--- a/book/theme/highlight.js
+++ /dev/null
@@ -1 +0,0 @@
-var hljs=function(){"use strict";var e={exports:{}};function n(e){return e instanceof Map?e.clear=e.delete=e.set=()=>{throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{throw Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{var a=e[t];"object"!=typeof a||Object.isFrozen(a)||n(a)}),e}e.exports=n,e.exports.default=n;var t=e.exports;class a{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach(e=>{for(const n in e)t[n]=e[n]}),t}const s=e=>!!e.kind;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let n=e.kind;n=e.sublanguage?"language-"+n:((e,{prefix:n})=>{if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map((e,n)=>`${e}${"_".repeat(n+1)}`)].join(" ")}return`${n}${e}`})(n,{prefix:this.classPrefix}),this.span(n)}closeNode(e){s(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){return!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function g(e){return m("(?=",e,")")}function u(e){return m("(?:",e,")*")}function b(e){return m("(?:",e,")?")}function m(...e){return e.map(e=>d(e)).join("")}function p(...e){const n=(e=>{const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}})(e);return"("+(n.capture?"":"?:")+e.map(e=>d(e)).join("|")+")"}function _(e){return RegExp(e.toString()+"|").exec("").length-1}const h=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function f(e,{joinWith:n}){let t=0;return e.map(e=>{t+=1;const n=t;let a=d(e),i="";for(;a.length>0;){const e=h.exec(a);if(!e){i+=a;break}i+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0],"("===e[0]&&t++)}return i}).map(e=>`(${e})`).join(n)}const E="[a-zA-Z]\\w*",y="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",k={begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[k]},x={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[k]},M=(e,n,t={})=>{const a=r({scope:"comment",begin:e,end:n,contains:[]},t);a.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return a.contains.push({begin:m(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a},S=M("//","$"),A=M("/\\*","\\*/"),C=M("#","$");var T=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:E,UNDERSCORE_IDENT_RE:y,NUMBER_RE:w,C_NUMBER_RE:N,BINARY_NUMBER_RE:v,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=m(n,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:k,APOS_STRING_MODE:O,QUOTE_STRING_MODE:x,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:A,HASH_COMMENT_MODE:C,NUMBER_MODE:{scope:"number",begin:w,relevance:0},C_NUMBER_MODE:{scope:"number",begin:N,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:v,relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[k,{begin:/\[/,end:/\]/,relevance:0,contains:[k]}]}]},TITLE_MODE:{scope:"title",begin:E,relevance:0},UNDERSCORE_TITLE_MODE:{scope:"title",begin:y,relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})});function R(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function D(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function I(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=R,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function L(e,n){Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function B(e,n){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function $(e,n){void 0===e.relevance&&(e.relevance=1)}const z=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=t.keywords,e.begin=m(t.beforeMatch,g(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},F=["of","and","for","in","not","or","if","then","parent","list","value"];function U(e,n,t="keyword"){const a=Object.create(null);return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach(t=>{Object.assign(a,U(e[t],n,t))}),a;function i(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach(n=>{const t=n.split("|");a[t[0]]=[e,j(t[0],t[1])]})}}function j(e,n){return n?Number(n):(e=>F.includes(e.toLowerCase()))(e)?0:1}const P={},K=e=>{console.error(e)},H=(e,...n)=>{console.log("WARN: "+e,...n)},q=(e,n)=>{P[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),P[`${e}/${n}`]=!0)},Z=Error();function G(e,n,{key:t}){let a=0;const i=e[t],r={},s={};for(let e=1;e<=n.length;e++)s[e+a]=i[e],r[e+a]=!0,a+=_(n[e-1]);e[t]=s,e[t]._emit=r,e[t]._multi=!0}function W(e){(e=>{e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),(e=>{if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Z;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"),Z;G(e,e.begin,{key:"beginScope"}),e.begin=f(e.begin,{joinWith:""})}})(e),(e=>{if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Z;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"),Z;G(e,e.end,{key:"endScope"}),e.end=f(e.end,{joinWith:""})}})(e)}function Q(e){function n(n,t){return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=_(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(f(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex((e,n)=>n>0&&void 0!==e),a=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,a)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function t(i,s){const o=i;if(i.isCompiled)return o;[D,B,W,z].forEach(e=>e(i,s)),e.compilerExtensions.forEach(e=>e(i,s)),i.__beforeBegin=null,[I,L,$].forEach(e=>e(i,s)),i.isCompiled=!0;let l=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=U(i.keywords,e.case_insensitive)),o.keywordPatternRe=n(l,!0),s&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(o.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=n(o.end)),o.terminatorEnd=d(o.end)||"",i.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(o.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(n=>r(e,{variants:null},n))),e.cachedVariants?e.cachedVariants:X(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e))("self"===e?i:e))),i.contains.forEach(e=>{t(e,o)}),i.starts&&t(i.starts,s),o.matcher=(e=>{const n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function X(e){return!!e&&(e.endsWithParent||X(e.starts))}class V extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const J=i,Y=r,ee=Symbol("nomatch");var ne=(e=>{const n=Object.create(null),i=Object.create(null),r=[];let s=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let d={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function _(e){return d.noHighlightRe.test(e)}function h(e,n,t){let a="",i="";"object"==typeof n?(a=e,t=n.ignoreIllegals,i=n.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."),q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};x("before:highlight",r);const s=r.result?r.result:f(r.language,r.code,t);return s.code=r.code,x("after:highlight",s),s}function f(e,t,i,r){const l=Object.create(null);function c(){if(!O.keywords)return void M.addText(S);let e=0;O.keywordPatternRe.lastIndex=0;let n=O.keywordPatternRe.exec(S),t="";for(;n;){t+=S.substring(e,n.index);const i=w.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,O.keywords[a]);if(r){const[e,a]=r;if(M.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(A+=a),e.startsWith("_"))t+=n[0];else{const t=w.classNameAliases[e]||e;M.addKeyword(n[0],t)}}else t+=n[0];e=O.keywordPatternRe.lastIndex,n=O.keywordPatternRe.exec(S)}var a;t+=S.substr(e),M.addText(t)}function g(){null!=O.subLanguage?(()=>{if(""===S)return;let e=null;if("string"==typeof O.subLanguage){if(!n[O.subLanguage])return void M.addText(S);e=f(O.subLanguage,S,!0,x[O.subLanguage]),x[O.subLanguage]=e._top}else e=E(S,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(A+=e.relevance),M.addSublanguage(e._emitter,e.language)})():c(),S=""}function u(e,n){let t=1;const a=n.length-1;for(;t<=a;){if(!e._emit[t]){t++;continue}const a=w.classNameAliases[e[t]]||e[t],i=n[t];a?M.addKeyword(i,a):(S=i,c(),S=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&M.openNode(w.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),S=""):e.beginScope._multi&&(u(e.beginScope,n),S="")),O=Object.create(e,{parent:{value:O}}),O}function m(e,n,t){let i=((e,n)=>{const t=e&&e.exec(n);return t&&0===t.index})(e.endRe,t);if(i){if(e["on:end"]){const t=new a(e);e["on:end"](n,t),t.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return m(e.parent,n,t)}function p(e){return 0===O.matcher.regexIndex?(S+=e[0],1):(R=!0,0)}function _(e){const n=e[0],a=t.substr(e.index),i=m(O,e,a);if(!i)return ee;const r=O;O.endScope&&O.endScope._wrap?(g(),M.addKeyword(n,O.endScope._wrap)):O.endScope&&O.endScope._multi?(g(),u(O.endScope,e)):r.skip?S+=n:(r.returnEnd||r.excludeEnd||(S+=n),g(),r.excludeEnd&&(S=n));do{O.scope&&M.closeNode(),O.skip||O.subLanguage||(A+=O.relevance),O=O.parent}while(O!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:n.length}let h={};function y(n,r){const o=r&&r[0];if(S+=n,null==o)return g(),0;if("begin"===h.type&&"end"===r.type&&h.index===r.index&&""===o){if(S+=t.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=h.rule,n}return 1}if(h=r,"begin"===r.type)return(e=>{const n=e[0],t=e.rule,i=new a(t),r=[t.__beforeBegin,t["on:begin"]];for(const t of r)if(t&&(t(e,i),i.isMatchIgnored))return p(n);return t.skip?S+=n:(t.excludeBegin&&(S+=n),g(),t.returnBegin||t.excludeBegin||(S=n)),b(t,e),t.returnBegin?0:n.length})(r);if("illegal"===r.type&&!i){const e=Error('Illegal lexeme "'+o+'" for mode "'+(O.scope||"")+'"');throw e.mode=O,e}if("end"===r.type){const e=_(r);if(e!==ee)return e}if("illegal"===r.type&&""===o)return 1;if(T>1e5&&T>3*r.index)throw Error("potential infinite loop, way more iterations than matches");return S+=o,o.length}const w=v(e);if(!w)throw K(o.replace("{}",e)),Error('Unknown language: "'+e+'"');const N=Q(w);let k="",O=r||N;const x={},M=new d.__emitter(d);(()=>{const e=[];for(let n=O;n!==w;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach(e=>M.openNode(e))})();let S="",A=0,C=0,T=0,R=!1;try{for(O.matcher.considerAll();;){T++,R?R=!1:O.matcher.considerAll(),O.matcher.lastIndex=C;const e=O.matcher.exec(t);if(!e)break;const n=y(t.substring(C,e.index),e);C=e.index+n}return y(t.substr(C)),M.closeAllNodes(),M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:A,illegal:!1,_emitter:M,_top:O}}catch(n){if(n.message&&n.message.includes("Illegal"))return{language:e,value:J(t),illegal:!0,relevance:0,_illegalBy:{message:n.message,index:C,context:t.slice(C-100,C+100),mode:n.mode,resultSoFar:k},_emitter:M};if(s)return{language:e,value:J(t),illegal:!1,relevance:0,errorRaised:n,_emitter:M,_top:O};throw n}}function E(e,t){t=t||d.languages||Object.keys(n);const a=(e=>{const n={value:J(e),illegal:!1,relevance:0,_top:l,_emitter:new d.__emitter(d)};return n._emitter.addText(e),n})(e),i=t.filter(v).filter(O).map(n=>f(n,e,!1));i.unshift(a);const r=i.sort((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1;if(v(n.language).supersetOf===e.language)return-1}return 0}),[s,o]=r,c=s;return c.secondBest=o,c}function y(e){let n=null;const t=(e=>{let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=d.languageDetectRe.exec(n);if(t){const n=v(t[1]);return n||(H(o.replace("{}",t[1])),H("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find(e=>_(e)||v(e))})(e);if(_(t))return;if(x("before:highlightElement",{el:e,language:t}),e.children.length>0&&(d.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),d.throwUnescapedHTML))throw new V("One of your code blocks includes unescaped HTML.",e.innerHTML);n=e;const a=n.textContent,r=t?h(a,{language:t,ignoreIllegals:!0}):E(a);e.innerHTML=r.value,((e,n,t)=>{const a=n&&i[n]||t;e.classList.add("hljs"),e.classList.add("language-"+a)})(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),x("after:highlightElement",{el:e,result:r,text:a})}let w=!1;function N(){"loading"!==document.readyState?document.querySelectorAll(d.cssSelector).forEach(y):w=!0}function v(e){return e=(e||"").toLowerCase(),n[e]||n[i[e]]}function k(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=n})}function O(e){const n=v(e);return n&&!n.disableAutodetect}function x(e,n){const t=e;r.forEach(e=>{e[t]&&e[t](n)})}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",()=>{w&&N()},!1),Object.assign(e,{highlight:h,highlightAuto:E,highlightAll:N,highlightElement:y,highlightBlock:e=>(q("10.7.0","highlightBlock will be removed entirely in v12.0"),q("10.7.0","Please use highlightElement now."),y(e)),configure:e=>{d=Y(d,e)},initHighlighting:()=>{N(),q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:()=>{N(),q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:(t,a)=>{let i=null;try{i=a(e)}catch(e){if(K("Language definition for '{}' could not be registered.".replace("{}",t)),!s)throw e;K(e),i=l}i.name||(i.name=t),n[t]=i,i.rawDefinition=a.bind(null,e),i.aliases&&k(i.aliases,{languageName:t})},unregisterLanguage:e=>{delete n[e];for(const n of Object.keys(i))i[n]===e&&delete i[n]},listLanguages:()=>Object.keys(n),getLanguage:v,registerAliases:k,autoDetection:O,inherit:Y,addPlugin:e=>{(e=>{e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),r.push(e)}}),e.debugMode=()=>{s=!1},e.safeMode=()=>{s=!0},e.versionString="11.5.0",e.regex={concat:m,lookahead:g,either:p,optional:b,anyNumberOfTimes:u};for(const e in T)"object"==typeof T[e]&&t(T[e]);return Object.assign(e,T),e})({});const te=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),ae=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ie=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],re=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],se=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],oe=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),le=re.concat(se);var ce="\\.([0-9](_*[0-9])*)",de="[0-9a-fA-F](_*[0-9a-fA-F])*",ge={className:"number",variants:[{begin:`(\\b([0-9](_*[0-9])*)((${ce})|\\.)?|(${ce}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:`\\b([0-9](_*[0-9])*)((${ce})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ce})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:`\\b0[xX]((${de})\\.?|(${de})?\\.(${de}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${de})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ue(e,n,t){return-1===t?"":e.replace(n,a=>ue(e,n,t-1))}const be="[A-Za-z$_][0-9A-Za-z$_]*",me=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],pe=["true","false","null","undefined","NaN","Infinity"],_e=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],he=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ee=["arguments","this","super","console","window","document","localStorage","module","global"],ye=[].concat(fe,_e,he);function we(e){const n=e.regex,t=be,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,a=e.input[t];if("<"===a||","===a)return void n.ignoreMatch();let i;">"===a&&(((e,{after:n})=>{const t=""+e[0].slice(1);return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch()),(i=e.input.substr(t).match(/^\s+extends\s+/))&&0===i.index&&n.ignoreMatch()}},i={$pattern:be,keyword:me,literal:pe,built_in:ye,"variable.language":Ee},r="\\.([0-9](_?[0-9])*)",s="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",o={className:"number",variants:[{begin:`(\\b(${s})((${r})|\\.)?|(${r}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{begin:`\\b(${s})\\b((${r})\\b|\\.)?|(${r})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},l={className:"subst",begin:"\\$\\{",end:"\\}",keywords:i,contains:[]},c={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,l],subLanguage:"xml"}},d={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,l],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,l]},u={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,d,g,o];l.contains=b.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(b)});const m=[].concat(u,l.contains),p=m.concat([{begin:/\(/,end:/\)/,keywords:i,contains:["self"].concat(m)}]),_={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:p},h={variants:[{match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},f={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._e,...he]}},E={variants:[{match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},y={match:n.concat(/\b/,(w=[...fe,"super"],n.concat("(?!",w.join("|"),")")),t,n.lookahead(/\(/)),className:"title.function",relevance:0};var w;const N={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},v={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{PARAMS_CONTAINS:p,CLASS_REFERENCE:f},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,d,g,u,o,f,{className:"attr",begin:t+n.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[u,e.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:">"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},E,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},N,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},y,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},h,v,{match:/\$[(.]/}]}}const Ne=e=>m(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ve=["Protocol","Type"].map(Ne),ke=["init","self"].map(Ne),Oe=["Any","Self"],xe=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Me=["false","nil","true"],Se=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ae=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Ce=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Te=p(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Re=p(Te,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),De=m(Te,Re,"*"),Ie=p(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Le=p(Ie,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Be=m(Ie,Le,"*"),$e=m(/[A-Z]/,Le,"*"),ze=["autoclosure",m(/convention\(/,p("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",m(/objc\(/,Be,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Fe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var Ue=Object.freeze({__proto__:null,grmr_bash:e=>{const n=e.regex,t={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(s);const o={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,o,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}},grmr_c:e=>{const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="[a-zA-Z_]\\w*::",i="(decltype\\(auto\\)|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0},d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},u=[l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:u.concat([{begin:/\(/,end:/\)/,keywords:g,contains:u.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(c,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,s,o,r,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,o,r]}]},r,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"",contains:[].concat(b,m,u,[l,{begin:e.IDENT_RE+"::",keywords:g},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:s,keywords:g}}},grmr_cpp:e=>{const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="[a-zA-Z_]\\w*::",i="(?!struct)(decltype\\(auto\\)|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0},d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},u={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},b=[u,l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:b.concat([{begin:/\(/,end:/\)/,keywords:g,contains:b.concat(["self"]),relevance:0}]),relevance:0},p={className:"function",begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,o]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,s,o,r,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,o,r]}]},r,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:g,illegal:"",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,p,u,b,[l,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:g,contains:["self",r]},{begin:e.IDENT_RE+"::",keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const n={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},r=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:n},o=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,o]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]});s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],o.contains=[d,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},t]},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial",relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0,contains:[g,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},grmr_css:e=>{const n=e.regex,t=te(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+re.join("|")+")"},{begin:":(:)?("+se.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+oe.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ie.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ae.join("|")+")\\b"}]}},grmr_diff:e=>{const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},grmr_go:e=>{const n={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:n,illegal:"",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,illegal:/["']/}]}]}},grmr_ini:e=>{const n=e.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[a,r,i,s,t,"self"],relevance:0},l=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[a,o,r,i,s,t]}}]}},grmr_java:e=>{const n=e.regex,t="[ร-สธa-zA-Z_$][ร-สธa-zA-Z_$0-9]*",a=t+ue("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),i={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},r={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,ge,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},ge,r]}},grmr_javascript:we,grmr_json:e=>({name:"JSON",contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{beginKeywords:"true false null"},e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}),grmr_kotlin:e=>{const n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(r);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(r,{className:"string"})]}]},l=ge,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},g=d;return g.variants[1].contains=[d],d.variants[1].contains=[g],{name:"Kotlin",aliases:["kt","kts"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},t,s,o,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,o,r,e.C_NUMBER_MODE]},c]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},s,o]},r,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}},grmr_less:e=>{const n=te(e),t=le,a="([\\w-]+|@\\{[\\w-]+\\})",i=[],r=[],s=e=>({className:"string",begin:"~?"+e+".*?"+e}),o=(e,n,t)=>({className:e,begin:n,relevance:t}),l={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ie.join(" ")},c={begin:"\\(",end:"\\)",contains:r,keywords:l,relevance:0};r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),n.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},n.HEXCOLOR,c,o("variable","@@?[\\w-]+",10),o("variable","@\\{[\\w-]+\\}"),o("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},n.IMPORTANT);const d=r.concat({begin:/\{/,end:/\}/,contains:i}),g={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(r)},u={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+oe.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:r}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:r,relevance:0}},m={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:d}},p={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,o("keyword","all\\b"),o("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+ae.join("|")+")\\b",className:"selector-tag"},n.CSS_NUMBER_MODE,o("selector-tag",a,0),o("selector-id","#"+a),o("selector-class","\\."+a,0),o("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+re.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+se.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},n.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${t.join("|")})`,returnBegin:!0,contains:[p]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,m,_,u,p),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}},grmr_lua:e=>{const n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"]},i=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",t,{contains:[a],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{const n={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%\^\+\*]/}]},t={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n]},a={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[n]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},r={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,n,t,a,i,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},r]}},grmr_xml:e=>{const n=e.regex,t=n.concat(/[A-Z_]/,n.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),a={className:"symbol",begin:/&[a-z]+;|[0-9]+;|[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/,relevance:0,contains:[{className:"attr",begin:/[A-Za-z0-9._:-]+/,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,o,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,r,o,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[o]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/