Compare commits
2 Commits
feat/corpu
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
21d776dfc0
|
|||
|
|
3b45888622 |
40
.gitea/ISSUE_TEMPLATE/bug_report.md
Normal file
40
.gitea/ISSUE_TEMPLATE/bug_report.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ""
|
||||
labels: ""
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
19
.gitea/ISSUE_TEMPLATE/feature_request.md
Normal file
19
.gitea/ISSUE_TEMPLATE/feature_request.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ""
|
||||
labels: ""
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
20
.gitea/actions/setup-pixi/action.yml
Normal file
20
.gitea/actions/setup-pixi/action.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
name: "Setup Pixi"
|
||||
description: "setup pixi"
|
||||
|
||||
inputs:
|
||||
environments:
|
||||
description: "The pixi environments to install (e.g. default, docs, test)"
|
||||
required: false
|
||||
default: "default"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Pixi
|
||||
uses: prefix-dev/setup-pixi@v0.9.3
|
||||
with:
|
||||
pixi-version: v0.67.0
|
||||
environments: ${{ inputs.environments }}
|
||||
activate-environment: true
|
||||
cache: true
|
||||
locked: true
|
||||
44
.gitea/workflows/benchmark.yml
Normal file
44
.gitea/workflows/benchmark.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
name: benchmark
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
benchmark:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-24.04, macos-15, windows-2025]
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
|
||||
- name: Build scan_benchmark
|
||||
run: |
|
||||
pixi run cmake-config RelWithDebInfo ON -- -DCLICE_ENABLE_BENCHMARK=ON
|
||||
cmake --build build/RelWithDebInfo --target scan_benchmark
|
||||
|
||||
- name: Clone LLVM
|
||||
run: git clone --depth 1 https://github.com/llvm/llvm-project.git
|
||||
|
||||
- name: Generate CDB
|
||||
run: |
|
||||
cmake -B llvm-build -G Ninja \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DCMAKE_TOOLCHAIN_FILE="$(pwd)/cmake/toolchain.cmake" \
|
||||
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;mlir;polly;flang;bolt" \
|
||||
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
|
||||
llvm-project/llvm
|
||||
|
||||
- name: Run benchmark
|
||||
run: ./build/RelWithDebInfo/bin/scan_benchmark --runs 20 llvm-build/compile_commands.json
|
||||
|
||||
- name: Stop sccache server
|
||||
if: runner.os == 'Windows'
|
||||
run: pixi run -- sccache --stop-server || true
|
||||
446
.gitea/workflows/build-llvm.yml
Normal file
446
.gitea/workflows/build-llvm.yml
Normal file
@@ -0,0 +1,446 @@
|
||||
name: build llvm
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
llvm_version:
|
||||
description: "LLVM version to build (e.g., 21.1.8)"
|
||||
required: true
|
||||
type: string
|
||||
skip_upload:
|
||||
description: "Skip upload and PR creation (build-only mode)"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
skip_pr:
|
||||
description: "Skip PR creation (upload only, no PR)"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
pull_request:
|
||||
# if you want to run this workflow, change the branch name to main,
|
||||
# if you want to turn off it, change it to non existent branch.
|
||||
branches: [main-turn-off]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Native builds
|
||||
- os: windows-2025
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: OFF
|
||||
- os: windows-2025
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: ON
|
||||
- os: ubuntu-24.04
|
||||
llvm_mode: Debug
|
||||
lto: OFF
|
||||
- os: ubuntu-24.04
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: OFF
|
||||
- os: ubuntu-24.04
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: ON
|
||||
- os: macos-15
|
||||
llvm_mode: Debug
|
||||
lto: OFF
|
||||
- os: macos-15
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: OFF
|
||||
- os: macos-15
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: ON
|
||||
|
||||
# Cross-compilation builds
|
||||
# macOS x64 (from arm64 macos-15)
|
||||
- os: macos-15
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: OFF
|
||||
target_triple: x86_64-apple-darwin
|
||||
- os: macos-15
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: ON
|
||||
target_triple: x86_64-apple-darwin
|
||||
|
||||
# Linux aarch64 (from x64 ubuntu-24.04)
|
||||
- os: ubuntu-24.04
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: OFF
|
||||
target_triple: aarch64-linux-gnu
|
||||
pixi_env: cross-linux-aarch64
|
||||
- os: ubuntu-24.04
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: ON
|
||||
target_triple: aarch64-linux-gnu
|
||||
pixi_env: cross-linux-aarch64
|
||||
|
||||
# Windows arm64 (from x64 windows-2025)
|
||||
- os: windows-2025
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: OFF
|
||||
target_triple: aarch64-pc-windows-msvc
|
||||
pixi_env: cross-windows-arm64
|
||||
- os: windows-2025
|
||||
llvm_mode: RelWithDebInfo
|
||||
lto: ON
|
||||
target_triple: aarch64-pc-windows-msvc
|
||||
pixi_env: cross-windows-arm64
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Free Disk Space
|
||||
if: runner.os == 'Linux'
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
|
||||
- name: Increase Swap Space
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
echo "===== Initial Status ====="
|
||||
sudo swapon --show
|
||||
free -h
|
||||
|
||||
echo "===== Creating Swap File ====="
|
||||
sudo swapoff -a
|
||||
sudo fallocate -l 16G /mnt/swapfile
|
||||
sudo chmod 600 /mnt/swapfile
|
||||
sudo mkswap /mnt/swapfile
|
||||
sudo swapon /mnt/swapfile
|
||||
|
||||
echo "===== Final Status ====="
|
||||
sudo swapon --show
|
||||
free -h
|
||||
df -h
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: ${{ matrix.pixi_env || 'package' }}
|
||||
|
||||
- name: Clone llvm-project
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION="${{ inputs.llvm_version || '21.1.8' }}"
|
||||
echo "Cloning LLVM ${VERSION}..."
|
||||
git clone --branch "llvmorg-${VERSION}" --depth 1 https://github.com/llvm/llvm-project.git .llvm
|
||||
|
||||
- name: Validate distribution components
|
||||
shell: bash
|
||||
run: |
|
||||
python3 scripts/validate-llvm-components.py \
|
||||
--llvm-src=.llvm \
|
||||
--components-file=scripts/llvm-components.json
|
||||
|
||||
- name: Build LLVM (install-distribution)
|
||||
shell: bash
|
||||
run: |
|
||||
ENV="${{ matrix.pixi_env || 'package' }}"
|
||||
EXTRA_ARGS=""
|
||||
if [[ -n "${{ matrix.target_triple }}" ]]; then
|
||||
EXTRA_ARGS="--target-triple=${{ matrix.target_triple }}"
|
||||
fi
|
||||
pixi run -e "$ENV" build-llvm \
|
||||
--llvm-src=.llvm \
|
||||
--mode="${{ matrix.llvm_mode }}" \
|
||||
--lto="${{ matrix.lto }}" \
|
||||
--build-dir=build \
|
||||
${EXTRA_ARGS}
|
||||
|
||||
- name: Build clice using installed LLVM
|
||||
if: ${{ !matrix.target_triple }}
|
||||
shell: bash
|
||||
run: |
|
||||
pixi run cmake-config ${{ matrix.llvm_mode }} ON -- \
|
||||
"-DCLICE_ENABLE_LTO=${{ matrix.lto }}" \
|
||||
"-DLLVM_INSTALL_PATH=.llvm/build-install"
|
||||
pixi run cmake-build ${{ matrix.llvm_mode }}
|
||||
|
||||
- name: Build clice using installed LLVM (cross-compile)
|
||||
if: ${{ matrix.target_triple }}
|
||||
shell: bash
|
||||
run: |
|
||||
ENV="${{ matrix.pixi_env || 'package' }}"
|
||||
pixi run -e "$ENV" cmake-config ${{ matrix.llvm_mode }} ON -- \
|
||||
"-DCLICE_ENABLE_LTO=${{ matrix.lto }}" \
|
||||
"-DCLICE_TARGET_TRIPLE=${{ matrix.target_triple }}" \
|
||||
"-DLLVM_INSTALL_PATH=.llvm/build-install"
|
||||
pixi run -e "$ENV" cmake-build ${{ matrix.llvm_mode }}
|
||||
|
||||
- name: Verify cross-compiled binary architecture
|
||||
if: ${{ matrix.target_triple && runner.os != 'Windows' }}
|
||||
shell: bash
|
||||
run: |
|
||||
BINARY="build/${{ matrix.llvm_mode }}/bin/clice"
|
||||
echo "Binary info:"
|
||||
file "$BINARY"
|
||||
case "${{ matrix.target_triple }}" in
|
||||
aarch64-linux-gnu) file "$BINARY" | grep -q "aarch64" ;;
|
||||
x86_64-apple-darwin) file "$BINARY" | grep -q "x86_64" ;;
|
||||
esac
|
||||
|
||||
- name: Upload cross-compiled clice for functional test
|
||||
if: ${{ matrix.target_triple && matrix.lto == 'OFF' }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cross-clice-${{ matrix.target_triple }}-${{ matrix.llvm_mode }}
|
||||
path: |
|
||||
build/${{ matrix.llvm_mode }}/bin/
|
||||
build/${{ matrix.llvm_mode }}/lib/
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
- name: Run tests
|
||||
if: ${{ !matrix.target_triple }}
|
||||
shell: bash
|
||||
run: pixi run test ${{ matrix.llvm_mode }}
|
||||
|
||||
# Prune is only supported for native builds (requires linking clice to test).
|
||||
# Cross-compiled targets reuse the native prune manifest of the same OS.
|
||||
- name: Prune LLVM static libraries (Debug/RelWithDebInfo no LTO)
|
||||
if: (!matrix.target_triple) && (matrix.llvm_mode == 'Debug' || (matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'OFF'))
|
||||
shell: bash
|
||||
run: |
|
||||
MANIFEST="pruned-libs-${{ matrix.os }}.json"
|
||||
echo "LLVM_PRUNED_MANIFEST=${MANIFEST}" >> "${GITHUB_ENV}"
|
||||
python3 scripts/prune-llvm-bin.py \
|
||||
--action discover \
|
||||
--install-dir ".llvm/build-install/lib" \
|
||||
--build-dir "build/${{ matrix.llvm_mode }}" \
|
||||
--max-attempts 60 \
|
||||
--sleep-seconds 60 \
|
||||
--manifest "${MANIFEST}"
|
||||
|
||||
- name: Upload pruned-libs manifest
|
||||
if: (!matrix.target_triple) && matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'OFF'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: llvm-pruned-libs-${{ matrix.os }}
|
||||
path: ${{ env.LLVM_PRUNED_MANIFEST }}
|
||||
if-no-files-found: error
|
||||
compression-level: 0
|
||||
|
||||
- name: Apply pruned-libs manifest (RelWithDebInfo + LTO, native only)
|
||||
if: (!matrix.target_triple) && matrix.llvm_mode == 'RelWithDebInfo' && matrix.lto == 'ON'
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
MANIFEST="pruned-libs-${{ matrix.os }}.json"
|
||||
python3 scripts/prune-llvm-bin.py \
|
||||
--action apply \
|
||||
--manifest "${MANIFEST}" \
|
||||
--install-dir ".llvm/build-install/lib" \
|
||||
--build-dir "build/${{ matrix.llvm_mode }}" \
|
||||
--gh-run-id "${{ github.run_id }}" \
|
||||
--gh-artifact "llvm-pruned-libs-${{ matrix.os }}" \
|
||||
--gh-download-dir "artifacts" \
|
||||
--max-attempts 60 \
|
||||
--sleep-seconds 60
|
||||
|
||||
# For cross-compiled LTO builds, apply the native prune manifest.
|
||||
# The unused library set is arch-independent (same API surface).
|
||||
- name: Apply pruned-libs manifest (cross-compile + LTO)
|
||||
if: matrix.target_triple && matrix.lto == 'ON'
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
MANIFEST="pruned-libs-${{ matrix.os }}.json"
|
||||
python3 scripts/prune-llvm-bin.py \
|
||||
--action apply \
|
||||
--manifest "${MANIFEST}" \
|
||||
--install-dir ".llvm/build-install/lib" \
|
||||
--build-dir "build/${{ matrix.llvm_mode }}" \
|
||||
--gh-run-id "${{ github.run_id }}" \
|
||||
--gh-artifact "llvm-pruned-libs-${{ matrix.os }}" \
|
||||
--gh-download-dir "artifacts" \
|
||||
--max-attempts 60 \
|
||||
--sleep-seconds 60
|
||||
|
||||
- name: Package LLVM install directory
|
||||
shell: bash
|
||||
run: |
|
||||
MODE_TAG="releasedbg"
|
||||
if [[ "${{ matrix.llvm_mode }}" == "Debug" ]]; then
|
||||
MODE_TAG="debug"
|
||||
fi
|
||||
|
||||
# Determine arch/platform/toolchain from target triple or runner OS
|
||||
if [[ -n "${{ matrix.target_triple }}" ]]; then
|
||||
case "${{ matrix.target_triple }}" in
|
||||
x86_64-apple-darwin)
|
||||
ARCH="x64"; PLATFORM="macos"; TOOLCHAIN="clang" ;;
|
||||
aarch64-linux-gnu)
|
||||
ARCH="aarch64"; PLATFORM="linux"; TOOLCHAIN="gnu" ;;
|
||||
aarch64-pc-windows-msvc)
|
||||
ARCH="aarch64"; PLATFORM="windows"; TOOLCHAIN="msvc" ;;
|
||||
esac
|
||||
else
|
||||
ARCH="x64"
|
||||
PLATFORM="linux"
|
||||
TOOLCHAIN="gnu"
|
||||
if [[ "${{ matrix.os }}" == windows-* ]]; then
|
||||
PLATFORM="windows"
|
||||
TOOLCHAIN="msvc"
|
||||
elif [[ "${{ matrix.os }}" == macos-* ]]; then
|
||||
ARCH="arm64"
|
||||
PLATFORM="macos"
|
||||
TOOLCHAIN="clang"
|
||||
fi
|
||||
fi
|
||||
|
||||
SUFFIX=""
|
||||
if [[ "${{ matrix.lto }}" == "ON" ]]; then
|
||||
SUFFIX="-lto"
|
||||
fi
|
||||
if [[ "${{ matrix.llvm_mode }}" == "Debug" && "${{ matrix.os }}" != windows-* ]]; then
|
||||
SUFFIX="${SUFFIX}-asan"
|
||||
fi
|
||||
|
||||
ARCHIVE="${ARCH}-${PLATFORM}-${TOOLCHAIN}-${MODE_TAG}${SUFFIX}.tar.xz"
|
||||
|
||||
set -eo pipefail
|
||||
tar -C .llvm -cf - build-install | xz -T0 -9 -c > "${ARCHIVE}"
|
||||
echo "LLVM_INSTALL_ARCHIVE=${ARCHIVE}" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Upload LLVM install artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.LLVM_INSTALL_ARCHIVE }}
|
||||
path: ${{ env.LLVM_INSTALL_ARCHIVE }}
|
||||
if-no-files-found: error
|
||||
|
||||
test-cross:
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-15-intel
|
||||
llvm_mode: RelWithDebInfo
|
||||
target_triple: x86_64-apple-darwin
|
||||
- os: ubuntu-24.04-arm
|
||||
llvm_mode: RelWithDebInfo
|
||||
target_triple: aarch64-linux-gnu
|
||||
- os: windows-11-arm
|
||||
llvm_mode: RelWithDebInfo
|
||||
target_triple: aarch64-pc-windows-msvc
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: test-run
|
||||
|
||||
- name: Download cross-compiled clice
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cross-clice-${{ matrix.target_triple }}-${{ matrix.llvm_mode }}
|
||||
path: build/${{ matrix.llvm_mode }}/
|
||||
|
||||
- name: Make binaries executable
|
||||
if: runner.os != 'Windows'
|
||||
run: chmod +x build/${{ matrix.llvm_mode }}/bin/*
|
||||
|
||||
- name: Run tests
|
||||
run: pixi run -e test-run test ${{ matrix.llvm_mode }}
|
||||
|
||||
upload:
|
||||
needs: build
|
||||
if: ${{ !cancelled() && inputs.llvm_version && !inputs.skip_upload }}
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download all build artifacts
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: scripts/download-llvm.sh "${{ github.run_id }}"
|
||||
|
||||
- name: Upload to clice-llvm
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.UPLOAD_LLVM }}
|
||||
TARGET_REPO: clice-io/clice-llvm
|
||||
run: python3 scripts/upload-llvm.py "${{ inputs.llvm_version }}" "${TARGET_REPO}" "${{ github.run_id }}"
|
||||
|
||||
- name: Save manifest for update-clice job
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: llvm-manifest-final
|
||||
path: artifacts/llvm-manifest.json
|
||||
if-no-files-found: error
|
||||
compression-level: 0
|
||||
|
||||
update-clice:
|
||||
needs: upload
|
||||
if: ${{ !inputs.skip_pr }}
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download manifest
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: llvm-manifest-final
|
||||
path: .
|
||||
|
||||
- name: Update manifest and version
|
||||
run: |
|
||||
python3 scripts/update-llvm-version.py \
|
||||
--version "${{ inputs.llvm_version }}" \
|
||||
--manifest-src llvm-manifest.json \
|
||||
--manifest-dest config/llvm-manifest.json \
|
||||
--package-cmake cmake/package.cmake
|
||||
|
||||
- name: Create or update PR
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
VERSION="${{ inputs.llvm_version }}"
|
||||
BRANCH="chore/update-llvm-${VERSION}"
|
||||
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
RELEASE_URL="https://github.com/clice-io/clice-llvm/releases/tag/${VERSION}"
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git checkout -b "${BRANCH}"
|
||||
git add config/llvm-manifest.json cmake/package.cmake
|
||||
git commit -m "chore: update LLVM to ${VERSION}"
|
||||
git push --force-with-lease origin "${BRANCH}"
|
||||
|
||||
# Check if PR already exists for this branch
|
||||
EXISTING_PR=$(gh pr list --head "${BRANCH}" --json number --jq '.[0].number // empty')
|
||||
|
||||
BODY="$(cat <<EOF
|
||||
## Summary
|
||||
- Update LLVM prebuilt binaries to version ${VERSION}
|
||||
- Updated \`config/llvm-manifest.json\` with new SHA256 hashes
|
||||
- Updated \`cmake/package.cmake\` version string
|
||||
|
||||
**Artifacts:** [clice-llvm release](${RELEASE_URL})
|
||||
**Build:** [workflow run](${RUN_URL})
|
||||
|
||||
> Auto-generated by build-llvm workflow
|
||||
EOF
|
||||
)"
|
||||
|
||||
if [[ -n "${EXISTING_PR}" ]]; then
|
||||
echo "Updating existing PR #${EXISTING_PR}"
|
||||
gh pr edit "${EXISTING_PR}" --body "${BODY}"
|
||||
else
|
||||
gh pr create \
|
||||
--title "chore: update LLVM to ${VERSION}" \
|
||||
--body "${BODY}" \
|
||||
--base main
|
||||
fi
|
||||
40
.gitea/workflows/check-format.yml
Normal file
40
.gitea/workflows/check-format.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: format
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
check-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: format
|
||||
|
||||
- name: Validate update-llvm-version.py can still patch package.cmake
|
||||
run: |
|
||||
python3 scripts/update-llvm-version.py --check \
|
||||
--manifest-dest config/llvm-manifest.json \
|
||||
--package-cmake cmake/package.cmake
|
||||
|
||||
- name: Run formatter
|
||||
run: pixi run format
|
||||
continue-on-error: true
|
||||
|
||||
- name: Auto correct
|
||||
uses: huacnlee/autocorrect-action@v2
|
||||
with:
|
||||
args: --lint ./docs
|
||||
continue-on-error: true
|
||||
|
||||
- name: Check diff
|
||||
run: |
|
||||
if ! git diff --quiet; then
|
||||
echo "::error::Formatting changes detected. Please run 'pixi run format' and commit the result."
|
||||
git --no-pager diff --stat
|
||||
git --no-pager diff
|
||||
exit 1
|
||||
fi
|
||||
30
.gitea/workflows/deploy-docs.yml
Normal file
30
.gitea/workflows/deploy-docs.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
name: deploy
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy-docs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: node
|
||||
|
||||
- name: Build docs
|
||||
run: pixi run build-docs
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
personal_token: ${{ secrets.PUBLISH_DOCS }}
|
||||
external_repository: clice-io/docs
|
||||
publish_dir: ./docs/.vitepress/dist
|
||||
destination_dir: clice
|
||||
keep_files: true
|
||||
137
.gitea/workflows/main.yml
Normal file
137
.gitea/workflows/main.yml
Normal file
@@ -0,0 +1,137 @@
|
||||
name: main
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["v*"]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
outputs:
|
||||
format: ${{ steps.filter.outputs.format }}
|
||||
docs: ${{ steps.filter.outputs.docs }}
|
||||
clice: ${{ steps.filter.outputs.clice }}
|
||||
vscode: ${{ steps.filter.outputs.vscode }}
|
||||
cmake: ${{ steps.filter.outputs.cmake }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
format:
|
||||
- '**/*.{h,c,cpp,hpp,ts,js,lua,md,yml,yaml}'
|
||||
docs:
|
||||
- 'docs/**'
|
||||
- '.github/workflows/deploy-docs.yml'
|
||||
clice:
|
||||
- 'src/**'
|
||||
- 'include/**'
|
||||
- 'CMakeLists.txt'
|
||||
- '.github/workflows/publish-clice.yml'
|
||||
vscode:
|
||||
- 'editors/vscode/**'
|
||||
- '.github/workflows/publish-vscode.yml'
|
||||
cmake:
|
||||
- 'CMakeLists.txt'
|
||||
- 'src/**'
|
||||
- 'include/**'
|
||||
- 'tests/**'
|
||||
- 'config/**'
|
||||
- '.github/workflows/test-cmake.yml'
|
||||
|
||||
conventional-commit:
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check conventional commit format
|
||||
env:
|
||||
IS_PR: ${{ github.event_name == 'pull_request' }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
||||
run: |
|
||||
pattern='^(feat|fix|refactor|chore|build|ci|docs|test|perf|style|revert)(\(.+\))?: .+'
|
||||
if [[ "$IS_PR" == "true" ]]; then
|
||||
subject="$PR_TITLE"
|
||||
label="PR title"
|
||||
else
|
||||
subject=$(echo "$COMMIT_MSG" | head -n1)
|
||||
label="Commit message"
|
||||
fi
|
||||
if [[ ! "$subject" =~ $pattern ]]; then
|
||||
echo "::error::$label must follow conventional commit format: type(scope)?: description"
|
||||
echo " Valid types: feat, fix, refactor, chore, build, ci, docs, test, perf, style, revert"
|
||||
echo " Got: '$subject'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
format:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.format == 'true' }}
|
||||
uses: ./.github/workflows/check-format.yml
|
||||
|
||||
deploy:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.docs == 'true' }}
|
||||
permissions:
|
||||
contents: write
|
||||
uses: ./.github/workflows/deploy-docs.yml
|
||||
secrets: inherit
|
||||
|
||||
# clice:
|
||||
# needs: changes
|
||||
# if: ${{ needs.changes.outputs.clice == 'true' }}
|
||||
# uses: ./.github/workflows/publish-clice.yml
|
||||
|
||||
vscode:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.vscode == 'true' }}
|
||||
uses: ./.github/workflows/publish-vscode.yml
|
||||
|
||||
cmake:
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.cmake == 'true' }}
|
||||
uses: ./.github/workflows/test-cmake.yml
|
||||
|
||||
release-clice:
|
||||
permissions:
|
||||
contents: write
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: ./.github/workflows/publish-clice.yml
|
||||
secrets: inherit
|
||||
|
||||
release-vscode:
|
||||
permissions:
|
||||
contents: write
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: ./.github/workflows/publish-vscode.yml
|
||||
secrets: inherit
|
||||
|
||||
checks-passed:
|
||||
if: ${{ always() && !startsWith(github.ref, 'refs/tags/') }}
|
||||
needs:
|
||||
- conventional-commit
|
||||
- format
|
||||
- deploy
|
||||
# - clice
|
||||
- vscode
|
||||
- cmake
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check results
|
||||
uses: re-actors/alls-green@release/v1
|
||||
with:
|
||||
allowed-skips: conventional-commit,format,deploy,clice,vscode,cmake
|
||||
jobs: ${{ toJSON(needs) }}
|
||||
100
.gitea/workflows/publish-clice.yml
Normal file
100
.gitea/workflows/publish-clice.yml
Normal file
@@ -0,0 +1,100 @@
|
||||
name: clice
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
publish-clice:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Native builds
|
||||
- os: windows-2025
|
||||
artifact_name: clice.zip
|
||||
asset_name: clice-x64-windows-msvc.zip
|
||||
symbol_artifact_name: clice-symbol.zip
|
||||
symbol_asset_name: clice-x64-windows-msvc-symbol.zip
|
||||
|
||||
- os: ubuntu-24.04
|
||||
artifact_name: clice.tar.gz
|
||||
asset_name: clice-x86_64-linux-gnu.tar.gz
|
||||
symbol_artifact_name: clice-symbol.tar.gz
|
||||
symbol_asset_name: clice-x86_64-linux-gnu-symbol.tar.gz
|
||||
|
||||
- os: macos-15
|
||||
artifact_name: clice.tar.gz
|
||||
asset_name: clice-arm64-macos-darwin.tar.gz
|
||||
symbol_artifact_name: clice-symbol.tar.gz
|
||||
symbol_asset_name: clice-arm64-macos-darwin-symbol.tar.gz
|
||||
|
||||
# Cross-compilation builds
|
||||
- os: macos-15
|
||||
target_triple: x86_64-apple-darwin
|
||||
pixi_env: cross-macos-x64
|
||||
artifact_name: clice.tar.gz
|
||||
asset_name: clice-x86_64-macos-darwin.tar.gz
|
||||
symbol_artifact_name: clice-symbol.tar.gz
|
||||
symbol_asset_name: clice-x86_64-macos-darwin-symbol.tar.gz
|
||||
|
||||
- os: ubuntu-24.04
|
||||
target_triple: aarch64-linux-gnu
|
||||
pixi_env: cross-linux-aarch64
|
||||
artifact_name: clice.tar.gz
|
||||
asset_name: clice-aarch64-linux-gnu.tar.gz
|
||||
symbol_artifact_name: clice-symbol.tar.gz
|
||||
symbol_asset_name: clice-aarch64-linux-gnu-symbol.tar.gz
|
||||
|
||||
- os: windows-2025
|
||||
target_triple: aarch64-pc-windows-msvc
|
||||
pixi_env: cross-windows-arm64
|
||||
artifact_name: clice.zip
|
||||
asset_name: clice-aarch64-windows-msvc.zip
|
||||
symbol_artifact_name: clice-symbol.zip
|
||||
symbol_asset_name: clice-aarch64-windows-msvc-symbol.zip
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: ${{ matrix.pixi_env || 'package' }}
|
||||
|
||||
- name: Package (native)
|
||||
if: ${{ !matrix.target_triple }}
|
||||
run: pixi run package
|
||||
|
||||
- name: Package (cross-compile)
|
||||
if: ${{ matrix.target_triple }}
|
||||
run: |
|
||||
ENV="${{ matrix.pixi_env }}"
|
||||
pixi run -e "$ENV" package-config -- \
|
||||
"-DCLICE_TARGET_TRIPLE=${{ matrix.target_triple }}"
|
||||
pixi run -e "$ENV" cmake-build
|
||||
|
||||
- name: Upload Main Package to Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: build/RelWithDebInfo/${{ matrix.artifact_name }}
|
||||
asset_name: ${{ matrix.asset_name }}
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
|
||||
- name: Upload Symbol Package to Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: build/RelWithDebInfo/${{ matrix.symbol_artifact_name }}
|
||||
asset_name: ${{ matrix.symbol_asset_name }}
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
38
.gitea/workflows/publish-vscode.yml
Normal file
38
.gitea/workflows/publish-vscode.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
name: vscode
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
publish-vscode:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: editors/vscode
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: node
|
||||
|
||||
- name: Publish and Package to Marketplace
|
||||
env:
|
||||
VSCE_PAT: ${{ secrets.VSCE_PAT }}
|
||||
run: |
|
||||
FLAG="${{ contains(github.ref_name, '-') && '--pre-release' || '' }}"
|
||||
pixi run build-vscode $FLAG
|
||||
|
||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||
pixi run publish-vscode -p "$VSCE_PAT" $FLAG
|
||||
fi
|
||||
|
||||
- name: Upload .vsix to Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
with:
|
||||
files: "editors/vscode/*.vsix"
|
||||
tag_name: ${{ github.ref }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
170
.gitea/workflows/test-cmake.yml
Normal file
170
.gitea/workflows/test-cmake.yml
Normal file
@@ -0,0 +1,170 @@
|
||||
name: cmake
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.cache/ccache
|
||||
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
|
||||
CCACHE_BASEDIR: ${{ github.workspace }}
|
||||
SCCACHE_BASEDIRS: ${{ github.workspace }}
|
||||
CCACHE_COMPILERCHECK: content
|
||||
CCACHE_MAXSIZE: 2G
|
||||
SCCACHE_CACHE_SIZE: 2G
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Native builds
|
||||
- os: windows-2025
|
||||
build_type: RelWithDebInfo
|
||||
- os: ubuntu-24.04
|
||||
build_type: Debug
|
||||
- os: ubuntu-24.04
|
||||
build_type: RelWithDebInfo
|
||||
- os: macos-15
|
||||
build_type: Debug
|
||||
- os: macos-15
|
||||
build_type: RelWithDebInfo
|
||||
# Cross-compile (build only; tests run on native runners)
|
||||
- os: macos-15
|
||||
build_type: RelWithDebInfo
|
||||
target_triple: x86_64-apple-darwin
|
||||
build_only: true
|
||||
- os: ubuntu-24.04
|
||||
build_type: RelWithDebInfo
|
||||
target_triple: aarch64-linux-gnu
|
||||
build_only: true
|
||||
pixi_env: cross-linux-aarch64
|
||||
- os: windows-2025
|
||||
build_type: RelWithDebInfo
|
||||
target_triple: aarch64-pc-windows-msvc
|
||||
build_only: true
|
||||
pixi_env: cross-windows-arm64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: ${{ matrix.pixi_env || 'default' }}
|
||||
|
||||
- name: Restore compiler cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.os == 'Windows' && '.cache/sccache' || '.cache/ccache' }}
|
||||
key: ${{ runner.os }}-${{ matrix.build_type }}-${{ matrix.target_triple || 'native' }}-ccache-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.build_type }}-${{ matrix.target_triple || 'native' }}-ccache-
|
||||
|
||||
- name: Zero cache stats
|
||||
run: |
|
||||
ENV="${{ matrix.pixi_env || 'default' }}"
|
||||
if [ "$RUNNER_OS" = "Windows" ]; then
|
||||
pixi run -e "$ENV" -- sccache --stop-server || true
|
||||
pixi run -e "$ENV" -- sccache --zero-stats || true
|
||||
else
|
||||
pixi run -e "$ENV" -- ccache --zero-stats || true
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Build (native)
|
||||
if: ${{ !matrix.target_triple }}
|
||||
run: pixi run build ${{ matrix.build_type }} ON
|
||||
|
||||
- name: Build (cross-compile)
|
||||
if: ${{ matrix.target_triple }}
|
||||
shell: bash
|
||||
run: |
|
||||
ENV="${{ matrix.pixi_env || 'default' }}"
|
||||
pixi run -e "$ENV" cmake-config ${{ matrix.build_type }} OFF -- \
|
||||
"-DCLICE_TARGET_TRIPLE=${{ matrix.target_triple }}"
|
||||
pixi run -e "$ENV" cmake-build ${{ matrix.build_type }}
|
||||
|
||||
- name: Upload cross-compiled binaries
|
||||
if: ${{ matrix.build_only }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cross-build-${{ matrix.target_triple }}
|
||||
path: |
|
||||
build/${{ matrix.build_type }}/bin/
|
||||
build/${{ matrix.build_type }}/lib/
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
- name: Unit tests
|
||||
if: ${{ !matrix.build_only }}
|
||||
timeout-minutes: 5
|
||||
run: pixi run unit-test ${{ matrix.build_type }}
|
||||
|
||||
- name: Integration tests
|
||||
if: ${{ !matrix.build_only }}
|
||||
timeout-minutes: 20
|
||||
run: pixi run integration-test ${{ matrix.build_type }}
|
||||
|
||||
- name: Smoke tests
|
||||
if: ${{ !matrix.build_only }}
|
||||
timeout-minutes: 15
|
||||
run: pixi run smoke-test ${{ matrix.build_type }}
|
||||
|
||||
- name: Print cache stats and stop server
|
||||
if: always()
|
||||
run: |
|
||||
ENV="${{ matrix.pixi_env || 'default' }}"
|
||||
if [ "$RUNNER_OS" = "Windows" ]; then
|
||||
pixi run -e "$ENV" -- sccache --show-stats
|
||||
pixi run -e "$ENV" -- sccache --stop-server || true
|
||||
else
|
||||
pixi run -e "$ENV" -- ccache --show-stats
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
test-cross:
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-15-intel
|
||||
build_type: RelWithDebInfo
|
||||
target_triple: x86_64-apple-darwin
|
||||
- os: ubuntu-24.04-arm
|
||||
build_type: RelWithDebInfo
|
||||
target_triple: aarch64-linux-gnu
|
||||
- os: windows-11-arm
|
||||
build_type: RelWithDebInfo
|
||||
target_triple: aarch64-pc-windows-msvc
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/setup-pixi
|
||||
with:
|
||||
environments: test-run
|
||||
|
||||
- name: Download cross-compiled binaries
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cross-build-${{ matrix.target_triple }}
|
||||
path: build/${{ matrix.build_type }}/
|
||||
|
||||
- name: Make binaries executable
|
||||
if: runner.os != 'Windows'
|
||||
run: chmod +x build/${{ matrix.build_type }}/bin/*
|
||||
|
||||
- name: Unit tests
|
||||
timeout-minutes: 5
|
||||
run: pixi run -e test-run unit-test ${{ matrix.build_type }}
|
||||
|
||||
- name: Integration tests
|
||||
timeout-minutes: 20
|
||||
run: pixi run -e test-run integration-test ${{ matrix.build_type }}
|
||||
|
||||
- name: Smoke tests
|
||||
timeout-minutes: 10
|
||||
run: pixi run -e test-run smoke-test ${{ matrix.build_type }}
|
||||
38
.gitea/workflows/upload-llvm.yml
Normal file
38
.gitea/workflows/upload-llvm.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
name: upload-llvm
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
# if you want to run this workflow, change the branch name to main,
|
||||
# if you want to turn off it, change it to non existent branch.
|
||||
branches: [main-turn-off]
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
workflow_id:
|
||||
description: "Workflow run ID to pull artifacts from"
|
||||
required: true
|
||||
type: string
|
||||
version:
|
||||
description: "Release version/tag to publish (e.g., v1.2.3)"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download artifacts from workflow
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: scripts/download-llvm.sh "${{ inputs.workflow_id }}"
|
||||
|
||||
- name: Recreate release with artifacts
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.UPLOAD_LLVM }}
|
||||
TARGET_REPO: clice-io/clice-llvm
|
||||
run: python3 scripts/upload-llvm.py "${{ inputs.version }}" "${TARGET_REPO}" "${{ inputs.workflow_id }}"
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -68,8 +68,7 @@ tests/unit/Local/
|
||||
.pixi/*
|
||||
!.pixi/config.toml
|
||||
|
||||
.codex/
|
||||
.codex
|
||||
.claude/*
|
||||
!.claude/CLAUDE.md
|
||||
!.claude/commands/
|
||||
openspec/
|
||||
|
||||
@@ -34,6 +34,34 @@ bool is_dependent(const clang::Decl* D) {
|
||||
return isa<clang::UnresolvedUsingValueDecl>(D);
|
||||
}
|
||||
|
||||
/// Whether a declaration name is backed by source text that should be highlighted.
|
||||
bool can_highlight_name(clang::DeclarationName name) {
|
||||
switch(name.getNameKind()) {
|
||||
case clang::DeclarationName::Identifier: {
|
||||
auto* info = name.getAsIdentifierInfo();
|
||||
return info && !info->getName().empty();
|
||||
}
|
||||
|
||||
case clang::DeclarationName::CXXConstructorName:
|
||||
case clang::DeclarationName::CXXDestructorName: {
|
||||
return true;
|
||||
}
|
||||
|
||||
case clang::DeclarationName::CXXConversionFunctionName:
|
||||
case clang::DeclarationName::CXXOperatorName:
|
||||
case clang::DeclarationName::CXXDeductionGuideName:
|
||||
case clang::DeclarationName::CXXLiteralOperatorName:
|
||||
case clang::DeclarationName::CXXUsingDirective:
|
||||
case clang::DeclarationName::ObjCZeroArgSelector:
|
||||
case clang::DeclarationName::ObjCOneArgSelector:
|
||||
case clang::DeclarationName::ObjCMultiArgSelector: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::unreachable();
|
||||
}
|
||||
|
||||
/// Returns true if `decl` is considered to be from a default/system library.
|
||||
/// This currently checks the systemness of the file by include type, although
|
||||
/// different heuristics may be used in the future (e.g. sysroot paths).
|
||||
@@ -171,6 +199,10 @@ public:
|
||||
void handleDeclOccurrence(const clang::NamedDecl* decl,
|
||||
RelationKind relation,
|
||||
clang::SourceLocation location) {
|
||||
if(relation.isReference() && !can_highlight_name(decl->getDeclName())) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::uint32_t modifiers = 0;
|
||||
if(relation.is_one_of(RelationKind::Definition)) {
|
||||
// todo: clangd add both Declaration and Definition modifiers for definitions.
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
// if-else chain patterns and compound conditions
|
||||
namespace if_chain {
|
||||
|
||||
int classify_char(char c) {
|
||||
if(c >= 'a' && c <= 'z')
|
||||
return 1; // lowercase
|
||||
else if(c >= 'A' && c <= 'Z')
|
||||
return 2; // uppercase
|
||||
else if(c >= '0' && c <= '9')
|
||||
return 3; // digit
|
||||
else
|
||||
return 0; // other
|
||||
}
|
||||
|
||||
// early return pattern
|
||||
bool validate(int x, int y, int z) {
|
||||
if(x < 0)
|
||||
return false;
|
||||
if(y < 0)
|
||||
return false;
|
||||
if(z < 0)
|
||||
return false;
|
||||
if(x + y + z > 100)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// if with compound statement and multiple effects
|
||||
int process(int* data, int size) {
|
||||
int sum = 0;
|
||||
for(int i = 0; i < size; ++i) {
|
||||
if(data[i] > 0) {
|
||||
sum += data[i];
|
||||
data[i] = 0;
|
||||
} else if(data[i] < -10) {
|
||||
sum -= data[i];
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
void test() {
|
||||
[[maybe_unused]] int r1 = classify_char('a');
|
||||
[[maybe_unused]] bool r2 = validate(1, 2, 3);
|
||||
int arr[] = {1, -20, 3, -5};
|
||||
[[maybe_unused]] int r3 = process(arr, 4);
|
||||
}
|
||||
|
||||
} // namespace if_chain
|
||||
@@ -1,46 +0,0 @@
|
||||
// C++23 if consteval
|
||||
namespace if_consteval {
|
||||
|
||||
constexpr int compute(int x) {
|
||||
if consteval {
|
||||
return x * x; // compile-time path
|
||||
} else {
|
||||
return x + x; // runtime path
|
||||
}
|
||||
}
|
||||
|
||||
// negated form: if !consteval
|
||||
constexpr int runtime_prefer(int x) {
|
||||
if !consteval {
|
||||
return x + 1; // runtime path
|
||||
} else {
|
||||
return x - 1; // compile-time path
|
||||
}
|
||||
}
|
||||
|
||||
// consteval function callable only at compile time
|
||||
consteval int ct_only(int x) {
|
||||
return x * 3;
|
||||
}
|
||||
|
||||
constexpr int dispatch(int x) {
|
||||
if consteval {
|
||||
return ct_only(x); // OK: in immediate context
|
||||
} else {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
// if consteval without else
|
||||
constexpr int maybe_optimize(int x) {
|
||||
if consteval {
|
||||
return x * x * x;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
static_assert(compute(5) == 25);
|
||||
static_assert(dispatch(3) == 9);
|
||||
static_assert(maybe_optimize(4) == 64);
|
||||
|
||||
} // namespace if_consteval
|
||||
@@ -1,38 +0,0 @@
|
||||
// if constexpr: basic compile-time branching
|
||||
namespace if_constexpr_basic {
|
||||
|
||||
template <typename T>
|
||||
constexpr int type_rank() {
|
||||
if constexpr(__is_same(T, char)) {
|
||||
return 1;
|
||||
} else if constexpr(__is_same(T, int)) {
|
||||
return 2;
|
||||
} else if constexpr(__is_same(T, long long)) {
|
||||
return 3;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static_assert(type_rank<char>() == 1);
|
||||
static_assert(type_rank<int>() == 2);
|
||||
static_assert(type_rank<long long>() == 3);
|
||||
static_assert(type_rank<float>() == 0);
|
||||
|
||||
// discarded branch not instantiated
|
||||
template <typename T>
|
||||
auto dereference(T val) {
|
||||
if constexpr(__is_pointer(T)) {
|
||||
return *val;
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
void test() {
|
||||
int x = 42;
|
||||
[[maybe_unused]] int r1 = dereference(&x);
|
||||
[[maybe_unused]] int r2 = dereference(x);
|
||||
}
|
||||
|
||||
} // namespace if_constexpr_basic
|
||||
@@ -1,37 +0,0 @@
|
||||
// if constexpr with requires-expression
|
||||
namespace if_constexpr_requires {
|
||||
|
||||
template <typename T>
|
||||
int get_length(const T& x) {
|
||||
if constexpr(requires { x.size(); }) {
|
||||
return static_cast<int>(x.size());
|
||||
} else if constexpr(requires { x.length; }) {
|
||||
return x.length;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
struct WithLength {
|
||||
int length;
|
||||
};
|
||||
|
||||
struct Container {
|
||||
int data[4];
|
||||
|
||||
int size() const {
|
||||
return 4;
|
||||
}
|
||||
};
|
||||
|
||||
void test() {
|
||||
Container c{};
|
||||
[[maybe_unused]] int r1 = get_length(c);
|
||||
|
||||
WithLength wl{10};
|
||||
[[maybe_unused]] int r2 = get_length(wl);
|
||||
|
||||
[[maybe_unused]] int r3 = get_length(42);
|
||||
}
|
||||
|
||||
} // namespace if_constexpr_requires
|
||||
@@ -1,35 +0,0 @@
|
||||
// if constexpr with variadic templates
|
||||
namespace if_constexpr_variadic {
|
||||
|
||||
// recursive fold with if constexpr
|
||||
template <typename T, typename... Rest>
|
||||
constexpr T sum(T first, Rest... rest) {
|
||||
if constexpr(sizeof...(rest) == 0) {
|
||||
return first;
|
||||
} else {
|
||||
return first + sum(rest...);
|
||||
}
|
||||
}
|
||||
|
||||
static_assert(sum(1) == 1);
|
||||
static_assert(sum(1, 2, 3) == 6);
|
||||
static_assert(sum(1, 2, 3, 4, 5) == 15);
|
||||
|
||||
// process each element differently
|
||||
template <typename T>
|
||||
constexpr int count_one() {
|
||||
if constexpr(__is_integral(T)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
constexpr int count_integrals() {
|
||||
return (count_one<Ts>() + ...);
|
||||
}
|
||||
|
||||
static_assert(count_integrals<int, float, char, double>() == 2);
|
||||
|
||||
} // namespace if_constexpr_variadic
|
||||
@@ -1,47 +0,0 @@
|
||||
// if with declaration as condition
|
||||
namespace if_declaration {
|
||||
|
||||
struct Optional {
|
||||
int value;
|
||||
bool valid;
|
||||
|
||||
explicit operator bool() const {
|
||||
return valid;
|
||||
}
|
||||
};
|
||||
|
||||
Optional try_parse(int x) {
|
||||
if(x >= 0)
|
||||
return {x * 2, true};
|
||||
return {0, false};
|
||||
}
|
||||
|
||||
int use_declaration_condition(int x) {
|
||||
if(Optional result = try_parse(x)) {
|
||||
return result.value;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// pointer declaration as condition
|
||||
struct Node {
|
||||
int data;
|
||||
Node* next;
|
||||
};
|
||||
|
||||
int walk_list(Node* head) {
|
||||
int sum = 0;
|
||||
if(Node* p = head) {
|
||||
sum += p->data;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
void test() {
|
||||
[[maybe_unused]] int r1 = use_declaration_condition(5);
|
||||
[[maybe_unused]] int r2 = use_declaration_condition(-1);
|
||||
Node n{42, nullptr};
|
||||
[[maybe_unused]] int r3 = walk_list(&n);
|
||||
}
|
||||
|
||||
} // namespace if_declaration
|
||||
@@ -1,49 +0,0 @@
|
||||
// C++17 if with init-statement
|
||||
namespace if_init {
|
||||
|
||||
struct Result {
|
||||
int value;
|
||||
bool ok;
|
||||
};
|
||||
|
||||
Result compute(int x) {
|
||||
if(x > 0)
|
||||
return {x * 10, true};
|
||||
return {0, false};
|
||||
}
|
||||
|
||||
int with_init(int x) {
|
||||
if(auto r = compute(x); r.ok) {
|
||||
return r.value;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// init-statement with array
|
||||
bool find_char(const char* str, char target) {
|
||||
if(int i = 0; str) {
|
||||
while(str[i]) {
|
||||
if(str[i] == target)
|
||||
return true;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// init-statement scoping: variables not visible outside
|
||||
int scoping_demo(int x) {
|
||||
if(int doubled = x * 2; doubled > 10) {
|
||||
return doubled;
|
||||
} else {
|
||||
return doubled + 1; // doubled visible in else
|
||||
}
|
||||
}
|
||||
|
||||
void test() {
|
||||
[[maybe_unused]] int r1 = with_init(5);
|
||||
[[maybe_unused]] bool r2 = find_char("hello", 'l');
|
||||
[[maybe_unused]] int r3 = scoping_demo(3);
|
||||
}
|
||||
|
||||
} // namespace if_init
|
||||
@@ -1,46 +0,0 @@
|
||||
// if with init-statement using structured bindings
|
||||
namespace if_init_sb {
|
||||
|
||||
struct Pair {
|
||||
int first;
|
||||
int second;
|
||||
};
|
||||
|
||||
Pair divide(int a, int b) {
|
||||
if(b == 0)
|
||||
return {0, 0};
|
||||
return {a / b, a % b};
|
||||
}
|
||||
|
||||
int safe_divide(int a, int b) {
|
||||
if(auto [quot, rem] = divide(a, b); b != 0) {
|
||||
return quot;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct ParseResult {
|
||||
bool success;
|
||||
int value;
|
||||
const char* error;
|
||||
};
|
||||
|
||||
ParseResult parse(int x) {
|
||||
if(x < 0)
|
||||
return {false, 0, "negative"};
|
||||
return {true, x, nullptr};
|
||||
}
|
||||
|
||||
int try_parse(int x) {
|
||||
if(auto [ok, val, err] = parse(x); ok) {
|
||||
return val;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void test() {
|
||||
[[maybe_unused]] int r1 = safe_divide(10, 3);
|
||||
[[maybe_unused]] int r2 = try_parse(42);
|
||||
}
|
||||
|
||||
} // namespace if_init_sb
|
||||
@@ -1,40 +0,0 @@
|
||||
// if with null statement and single-statement bodies
|
||||
namespace if_null {
|
||||
|
||||
// null init-statement in C++17 if
|
||||
int with_null_init(int x) {
|
||||
if(; x > 0) {
|
||||
return x;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// single statement body (no braces)
|
||||
int single_stmt(int x) {
|
||||
if(x > 10)
|
||||
return x;
|
||||
if(x > 5)
|
||||
return x + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// scope of variable declared in if body
|
||||
void scope_test() {
|
||||
if(true) {
|
||||
[[maybe_unused]] int x = 42;
|
||||
}
|
||||
// x is out of scope here
|
||||
|
||||
if(int y = 10; y > 0) {
|
||||
[[maybe_unused]] int z = y;
|
||||
}
|
||||
// y and z are out of scope here
|
||||
}
|
||||
|
||||
void test() {
|
||||
[[maybe_unused]] int r1 = with_null_init(5);
|
||||
[[maybe_unused]] int r2 = single_stmt(7);
|
||||
scope_test();
|
||||
}
|
||||
|
||||
} // namespace if_null
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_chain_patterns.cpp
|
||||
---
|
||||
- { name: "if_chain", kind: Namespace, range: "1:0-48:1", selection_range: "1:10-1:18" }
|
||||
- { name: "classify_char", kind: Function, range: "3:0-12:1", selection_range: "3:4-3:17", detail: "int (char)" }
|
||||
- { name: "validate", kind: Function, range: "15:0-25:1", selection_range: "15:5-15:13", detail: "bool (int, int, int)" }
|
||||
- { name: "process", kind: Function, range: "28:0-39:1", selection_range: "28:4-28:11", detail: "int (int *, int)" }
|
||||
- { name: "sum", kind: Variable, range: "29:4-29:15", selection_range: "29:8-29:11", detail: "int" }
|
||||
- { name: "i", kind: Variable, range: "30:8-30:17", selection_range: "30:12-30:13", detail: "int" }
|
||||
- { name: "test", kind: Function, range: "41:0-46:1", selection_range: "41:5-41:9", detail: "void ()" }
|
||||
- { name: "r1", kind: Variable, range: "42:21-42:48", selection_range: "42:25-42:27", detail: "int" }
|
||||
- { name: "r2", kind: Variable, range: "43:21-43:48", selection_range: "43:26-43:28", detail: "bool" }
|
||||
- { name: "arr", kind: Variable, range: "44:4-44:31", selection_range: "44:8-44:11", detail: "int[4]" }
|
||||
- { name: "r3", kind: Variable, range: "45:21-45:45", selection_range: "45:25-45:27", detail: "int" }
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_consteval.cpp
|
||||
---
|
||||
- { name: "if_consteval", kind: Namespace, range: "1:0-45:1", selection_range: "1:10-1:22" }
|
||||
- { name: "compute", kind: Function, range: "3:0-9:1", selection_range: "3:14-3:21", detail: "int (int)" }
|
||||
- { name: "runtime_prefer", kind: Function, range: "12:0-18:1", selection_range: "12:14-12:28", detail: "int (int)" }
|
||||
- { name: "ct_only", kind: Function, range: "21:0-23:1", selection_range: "21:14-21:21", detail: "int (int)" }
|
||||
- { name: "dispatch", kind: Function, range: "25:0-31:1", selection_range: "25:14-25:22", detail: "int (int)" }
|
||||
- { name: "maybe_optimize", kind: Function, range: "34:0-39:1", selection_range: "34:14-34:28", detail: "int (int)" }
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_basic.cpp
|
||||
---
|
||||
- { name: "if_constexpr_basic", kind: Namespace, range: "1:0-37:1", selection_range: "1:10-1:28" }
|
||||
- { name: "type_rank", kind: Function, range: "4:0-14:1", selection_range: "4:14-4:23", detail: "template int ()" }
|
||||
- { name: "dereference", kind: Function, range: "23:0-29:1", selection_range: "23:5-23:16", detail: "template auto (T)" }
|
||||
- { name: "test", kind: Function, range: "31:0-35:1", selection_range: "31:5-31:9", detail: "void ()" }
|
||||
- { name: "x", kind: Variable, range: "32:4-32:14", selection_range: "32:8-32:9", detail: "int" }
|
||||
- { name: "r1", kind: Variable, range: "33:21-33:45", selection_range: "33:25-33:27", detail: "int" }
|
||||
- { name: "r2", kind: Variable, range: "34:21-34:44", selection_range: "34:25-34:27", detail: "int" }
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_requires.cpp
|
||||
---
|
||||
- { name: "if_constexpr_requires", kind: Namespace, range: "1:0-36:1", selection_range: "1:10-1:31" }
|
||||
- { name: "get_length", kind: Function, range: "4:0-12:1", selection_range: "4:4-4:14", detail: "template int (const T &)" }
|
||||
- { name: "WithLength", kind: Struct, range: "14:0-16:1", selection_range: "14:7-14:17", detail: "struct" }
|
||||
- { name: "length", kind: Field, range: "15:4-15:14", selection_range: "15:8-15:14", detail: "int" }
|
||||
- { name: "Container", kind: Struct, range: "18:0-24:1", selection_range: "18:7-18:16", detail: "struct" }
|
||||
- { name: "data", kind: Field, range: "19:4-19:15", selection_range: "19:8-19:12", detail: "int[4]" }
|
||||
- { name: "size", kind: Method, range: "21:4-23:5", selection_range: "21:8-21:12", detail: "int () const" }
|
||||
- { name: "test", kind: Function, range: "26:0-34:1", selection_range: "26:5-26:9", detail: "void ()" }
|
||||
- { name: "c", kind: Variable, range: "27:4-27:17", selection_range: "27:14-27:15", detail: "Container" }
|
||||
- { name: "r1", kind: Variable, range: "28:21-28:43", selection_range: "28:25-28:27", detail: "int" }
|
||||
- { name: "wl", kind: Variable, range: "30:4-30:21", selection_range: "30:15-30:17", detail: "WithLength" }
|
||||
- { name: "r2", kind: Variable, range: "31:21-31:44", selection_range: "31:25-31:27", detail: "int" }
|
||||
- { name: "r3", kind: Variable, range: "33:21-33:44", selection_range: "33:25-33:27", detail: "int" }
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_variadic.cpp
|
||||
---
|
||||
- { name: "if_constexpr_variadic", kind: Namespace, range: "1:0-34:1", selection_range: "1:10-1:31" }
|
||||
- { name: "sum", kind: Function, range: "5:0-11:1", selection_range: "5:12-5:15", detail: "template T (T, Rest...)" }
|
||||
- { name: "count_one", kind: Function, range: "19:0-25:1", selection_range: "19:14-19:23", detail: "template int ()" }
|
||||
- { name: "count_integrals", kind: Function, range: "28:0-30:1", selection_range: "28:14-28:29", detail: "template int ()" }
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_declaration_condition.cpp
|
||||
---
|
||||
- { name: "if_declaration", kind: Namespace, range: "1:0-46:1", selection_range: "1:10-1:24" }
|
||||
- { name: "Optional", kind: Struct, range: "3:0-10:1", selection_range: "3:7-3:15", detail: "struct" }
|
||||
- { name: "value", kind: Field, range: "4:4-4:13", selection_range: "4:8-4:13", detail: "int" }
|
||||
- { name: "valid", kind: Field, range: "5:4-5:14", selection_range: "5:9-5:14", detail: "bool" }
|
||||
- { name: "operator bool", kind: Method, range: "7:4-9:5", selection_range: "7:13-7:21", detail: "bool () const" }
|
||||
- { name: "try_parse", kind: Function, range: "12:0-16:1", selection_range: "12:9-12:18", detail: "Optional (int)" }
|
||||
- { name: "use_declaration_condition", kind: Function, range: "18:0-23:1", selection_range: "18:4-18:29", detail: "int (int)" }
|
||||
- { name: "result", kind: Variable, range: "19:7-19:37", selection_range: "19:16-19:22", detail: "Optional" }
|
||||
- { name: "Node", kind: Struct, range: "26:0-29:1", selection_range: "26:7-26:11", detail: "struct" }
|
||||
- { name: "data", kind: Field, range: "27:4-27:12", selection_range: "27:8-27:12", detail: "int" }
|
||||
- { name: "next", kind: Field, range: "28:4-28:14", selection_range: "28:10-28:14", detail: "Node *" }
|
||||
- { name: "walk_list", kind: Function, range: "31:0-37:1", selection_range: "31:4-31:13", detail: "int (Node *)" }
|
||||
- { name: "sum", kind: Variable, range: "32:4-32:15", selection_range: "32:8-32:11", detail: "int" }
|
||||
- { name: "p", kind: Variable, range: "33:7-33:21", selection_range: "33:13-33:14", detail: "Node *" }
|
||||
- { name: "test", kind: Function, range: "39:0-44:1", selection_range: "39:5-39:9", detail: "void ()" }
|
||||
- { name: "r1", kind: Variable, range: "40:21-40:58", selection_range: "40:25-40:27", detail: "int" }
|
||||
- { name: "r2", kind: Variable, range: "41:21-41:59", selection_range: "41:25-41:27", detail: "int" }
|
||||
- { name: "n", kind: Variable, range: "42:4-42:23", selection_range: "42:9-42:10", detail: "Node" }
|
||||
- { name: "r3", kind: Variable, range: "43:21-43:43", selection_range: "43:25-43:27", detail: "int" }
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_statement.cpp
|
||||
---
|
||||
- { name: "if_init", kind: Namespace, range: "1:0-48:1", selection_range: "1:10-1:17" }
|
||||
- { name: "Result", kind: Struct, range: "3:0-6:1", selection_range: "3:7-3:13", detail: "struct" }
|
||||
- { name: "value", kind: Field, range: "4:4-4:13", selection_range: "4:8-4:13", detail: "int" }
|
||||
- { name: "ok", kind: Field, range: "5:4-5:11", selection_range: "5:9-5:11", detail: "bool" }
|
||||
- { name: "compute", kind: Function, range: "8:0-12:1", selection_range: "8:7-8:14", detail: "Result (int)" }
|
||||
- { name: "with_init", kind: Function, range: "14:0-19:1", selection_range: "14:4-14:13", detail: "int (int)" }
|
||||
- { name: "r", kind: Variable, range: "15:7-15:26", selection_range: "15:12-15:13", detail: "Result" }
|
||||
- { name: "find_char", kind: Function, range: "22:0-31:1", selection_range: "22:5-22:14", detail: "bool (const char *, char)" }
|
||||
- { name: "i", kind: Variable, range: "23:7-23:16", selection_range: "23:11-23:12", detail: "int" }
|
||||
- { name: "scoping_demo", kind: Function, range: "34:0-40:1", selection_range: "34:4-34:16", detail: "int (int)" }
|
||||
- { name: "doubled", kind: Variable, range: "35:7-35:26", selection_range: "35:11-35:18", detail: "int" }
|
||||
- { name: "test", kind: Function, range: "42:0-46:1", selection_range: "42:5-42:9", detail: "void ()" }
|
||||
- { name: "r1", kind: Variable, range: "43:21-43:42", selection_range: "43:25-43:27", detail: "int" }
|
||||
- { name: "r2", kind: Variable, range: "44:21-44:54", selection_range: "44:26-44:28", detail: "bool" }
|
||||
- { name: "r3", kind: Variable, range: "45:21-45:45", selection_range: "45:25-45:27", detail: "int" }
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_structured_binding.cpp
|
||||
---
|
||||
- { name: "if_init_sb", kind: Namespace, range: "1:0-45:1", selection_range: "1:10-1:20" }
|
||||
- { name: "Pair", kind: Struct, range: "3:0-6:1", selection_range: "3:7-3:11", detail: "struct" }
|
||||
- { name: "first", kind: Field, range: "4:4-4:13", selection_range: "4:8-4:13", detail: "int" }
|
||||
- { name: "second", kind: Field, range: "5:4-5:14", selection_range: "5:8-5:14", detail: "int" }
|
||||
- { name: "divide", kind: Function, range: "8:0-12:1", selection_range: "8:5-8:11", detail: "Pair (int, int)" }
|
||||
- { name: "safe_divide", kind: Function, range: "14:0-19:1", selection_range: "14:4-14:15", detail: "int (int, int)" }
|
||||
- { name: "quot", kind: Variable, range: "15:13-15:17", selection_range: "15:13-15:17", detail: "int" }
|
||||
- { name: "rem", kind: Variable, range: "15:19-15:22", selection_range: "15:19-15:22", detail: "int" }
|
||||
- { name: "ParseResult", kind: Struct, range: "21:0-25:1", selection_range: "21:7-21:18", detail: "struct" }
|
||||
- { name: "success", kind: Field, range: "22:4-22:16", selection_range: "22:9-22:16", detail: "bool" }
|
||||
- { name: "value", kind: Field, range: "23:4-23:13", selection_range: "23:8-23:13", detail: "int" }
|
||||
- { name: "error", kind: Field, range: "24:4-24:21", selection_range: "24:16-24:21", detail: "const char *" }
|
||||
- { name: "parse", kind: Function, range: "27:0-31:1", selection_range: "27:12-27:17", detail: "ParseResult (int)" }
|
||||
- { name: "try_parse", kind: Function, range: "33:0-38:1", selection_range: "33:4-33:13", detail: "int (int)" }
|
||||
- { name: "ok", kind: Variable, range: "34:13-34:15", selection_range: "34:13-34:15", detail: "bool" }
|
||||
- { name: "val", kind: Variable, range: "34:17-34:20", selection_range: "34:17-34:20", detail: "int" }
|
||||
- { name: "err", kind: Variable, range: "34:22-34:25", selection_range: "34:22-34:25", detail: "const char *" }
|
||||
- { name: "test", kind: Function, range: "40:0-43:1", selection_range: "40:5-40:9", detail: "void ()" }
|
||||
- { name: "r1", kind: Variable, range: "41:21-41:48", selection_range: "41:25-41:27", detail: "int" }
|
||||
- { name: "r2", kind: Variable, range: "42:21-42:43", selection_range: "42:25-42:27", detail: "int" }
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
source: document_symbol_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_null_statement.cpp
|
||||
---
|
||||
- { name: "if_null", kind: Namespace, range: "1:0-39:1", selection_range: "1:10-1:17" }
|
||||
- { name: "with_null_init", kind: Function, range: "4:0-9:1", selection_range: "4:4-4:18", detail: "int (int)" }
|
||||
- { name: "single_stmt", kind: Function, range: "12:0-18:1", selection_range: "12:4-12:15", detail: "int (int)" }
|
||||
- { name: "scope_test", kind: Function, range: "21:0-31:1", selection_range: "21:5-21:15", detail: "void ()" }
|
||||
- { name: "x", kind: Variable, range: "23:25-23:35", selection_range: "23:29-23:30", detail: "int" }
|
||||
- { name: "y", kind: Variable, range: "27:7-27:17", selection_range: "27:11-27:12", detail: "int" }
|
||||
- { name: "z", kind: Variable, range: "28:25-28:34", selection_range: "28:29-28:30", detail: "int" }
|
||||
- { name: "test", kind: Function, range: "33:0-37:1", selection_range: "33:5-33:9", detail: "void ()" }
|
||||
- { name: "r1", kind: Variable, range: "34:21-34:47", selection_range: "34:25-34:27", detail: "int" }
|
||||
- { name: "r2", kind: Variable, range: "35:21-35:44", selection_range: "35:25-35:27", detail: "int" }
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_chain_patterns.cpp
|
||||
---
|
||||
- { range: "1:19-48:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "3:26-12:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "15:35-25:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "28:33-39:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "41:12-46:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_consteval.cpp
|
||||
---
|
||||
- { range: "1:23-45:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "3:29-9:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "12:36-18:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "21:29-23:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "25:30-31:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "34:36-39:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_basic.cpp
|
||||
---
|
||||
- { range: "1:29-37:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "4:26-14:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "23:24-29:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "31:12-35:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_requires.cpp
|
||||
---
|
||||
- { range: "1:32-36:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "4:27-12:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "14:18-16:1", kind: struct, collapsed_text: "{...}" }
|
||||
- { range: "18:17-24:1", kind: struct, collapsed_text: "{...}" }
|
||||
- { range: "21:21-23:5", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "26:12-34:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_variadic.cpp
|
||||
---
|
||||
- { range: "1:32-34:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "5:39-11:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "19:26-25:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "28:32-30:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_declaration_condition.cpp
|
||||
---
|
||||
- { range: "1:25-46:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "3:16-10:1", kind: struct, collapsed_text: "{...}" }
|
||||
- { range: "7:35-9:5", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "12:26-16:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "18:37-23:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "26:12-29:1", kind: struct, collapsed_text: "{...}" }
|
||||
- { range: "31:26-37:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "39:12-44:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_statement.cpp
|
||||
---
|
||||
- { range: "1:18-48:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "3:14-6:1", kind: struct, collapsed_text: "{...}" }
|
||||
- { range: "8:22-12:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "14:21-19:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "22:45-31:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "34:24-40:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "42:12-46:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_structured_binding.cpp
|
||||
---
|
||||
- { range: "1:21-45:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "3:12-6:1", kind: struct, collapsed_text: "{...}" }
|
||||
- { range: "8:26-12:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "14:30-19:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "21:19-25:1", kind: struct, collapsed_text: "{...}" }
|
||||
- { range: "27:25-31:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "33:21-38:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "40:12-43:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
source: folding_range_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_null_statement.cpp
|
||||
---
|
||||
- { range: "1:18-39:1", kind: namespace, collapsed_text: "{...}" }
|
||||
- { range: "4:26-9:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "12:23-18:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "21:18-31:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
- { range: "33:12-37:1", kind: functionBody, collapsed_text: "{...}" }
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_chain_patterns.cpp
|
||||
---
|
||||
- { pos: "42:44", kind: Parameter, label: "c:", padding_right: true }
|
||||
- { pos: "43:40", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "43:43", kind: Parameter, label: "y:", padding_right: true }
|
||||
- { pos: "43:46", kind: Parameter, label: "z:", padding_right: true }
|
||||
- { pos: "45:38", kind: Parameter, label: "data:", padding_right: true }
|
||||
- { pos: "45:43", kind: Parameter, label: "size:", padding_right: true }
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_consteval.cpp
|
||||
---
|
||||
- { pos: "41:22", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "42:23", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "43:29", kind: Parameter, label: "x:", padding_right: true }
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_basic.cpp
|
||||
---
|
||||
- { pos: "33:42", kind: Parameter, label: "val:", padding_right: true }
|
||||
- { pos: "34:42", kind: Parameter, label: "val:", padding_right: true }
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_requires.cpp
|
||||
---
|
||||
- { pos: "28:41", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "31:41", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "33:41", kind: Parameter, label: "x:", padding_right: true }
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_variadic.cpp
|
||||
---
|
||||
- { pos: "13:18", kind: Parameter, label: "first:", padding_right: true }
|
||||
- { pos: "14:18", kind: Parameter, label: "first:", padding_right: true }
|
||||
- { pos: "15:18", kind: Parameter, label: "first:", padding_right: true }
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_declaration_condition.cpp
|
||||
---
|
||||
- { pos: "40:56", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "41:56", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "43:40", kind: Parameter, label: "head:", padding_right: true }
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_statement.cpp
|
||||
---
|
||||
- { pos: "15:13", kind: Type, label: ": Result" }
|
||||
- { pos: "43:40", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "44:41", kind: Parameter, label: "str:", padding_right: true }
|
||||
- { pos: "44:50", kind: Parameter, label: "target:", padding_right: true }
|
||||
- { pos: "45:43", kind: Parameter, label: "x:", padding_right: true }
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_structured_binding.cpp
|
||||
---
|
||||
- { pos: "15:17", kind: Type, label: ": int" }
|
||||
- { pos: "15:22", kind: Type, label: ": int" }
|
||||
- { pos: "34:15", kind: Type, label: ": bool" }
|
||||
- { pos: "34:20", kind: Type, label: ": int" }
|
||||
- { pos: "34:25", kind: Type, label: ": const char *" }
|
||||
- { pos: "41:42", kind: Parameter, label: "a:", padding_right: true }
|
||||
- { pos: "41:46", kind: Parameter, label: "b:", padding_right: true }
|
||||
- { pos: "42:40", kind: Parameter, label: "x:", padding_right: true }
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
source: inlay_hint_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_null_statement.cpp
|
||||
---
|
||||
- { pos: "34:45", kind: Parameter, label: "x:", padding_right: true }
|
||||
- { pos: "35:42", kind: Parameter, label: "x:", padding_right: true }
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_chain_patterns.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// if-else chain patterns and compound conditions", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_chain", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "int", kind: Keyword }
|
||||
- { loc: "3:4", text: "classify_char", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "3:18", text: "char", kind: Keyword }
|
||||
- { loc: "3:23", text: "c", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "4:4", text: "if", kind: Keyword }
|
||||
- { loc: "4:7", text: "c", kind: Parameter }
|
||||
- { loc: "4:12", text: "'a'", kind: Character }
|
||||
- { loc: "4:19", text: "c", kind: Parameter }
|
||||
- { loc: "4:24", text: "'z'", kind: Character }
|
||||
- { loc: "5:8", text: "return", kind: Keyword }
|
||||
- { loc: "5:15", text: "1", kind: Number }
|
||||
- { loc: "5:19", text: "// lowercase", kind: Comment }
|
||||
- { loc: "6:4", text: "else", kind: Keyword }
|
||||
- { loc: "6:9", text: "if", kind: Keyword }
|
||||
- { loc: "6:12", text: "c", kind: Parameter }
|
||||
- { loc: "6:17", text: "'A'", kind: Character }
|
||||
- { loc: "6:24", text: "c", kind: Parameter }
|
||||
- { loc: "6:29", text: "'Z'", kind: Character }
|
||||
- { loc: "7:8", text: "return", kind: Keyword }
|
||||
- { loc: "7:15", text: "2", kind: Number }
|
||||
- { loc: "7:19", text: "// uppercase", kind: Comment }
|
||||
- { loc: "8:4", text: "else", kind: Keyword }
|
||||
- { loc: "8:9", text: "if", kind: Keyword }
|
||||
- { loc: "8:12", text: "c", kind: Parameter }
|
||||
- { loc: "8:17", text: "'0'", kind: Character }
|
||||
- { loc: "8:24", text: "c", kind: Parameter }
|
||||
- { loc: "8:29", text: "'9'", kind: Character }
|
||||
- { loc: "9:8", text: "return", kind: Keyword }
|
||||
- { loc: "9:15", text: "3", kind: Number }
|
||||
- { loc: "9:19", text: "// digit", kind: Comment }
|
||||
- { loc: "10:4", text: "else", kind: Keyword }
|
||||
- { loc: "11:8", text: "return", kind: Keyword }
|
||||
- { loc: "11:15", text: "0", kind: Number }
|
||||
- { loc: "11:19", text: "// other", kind: Comment }
|
||||
- { loc: "14:0", text: "// early return pattern", kind: Comment }
|
||||
- { loc: "15:0", text: "bool", kind: Keyword }
|
||||
- { loc: "15:5", text: "validate", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "15:14", text: "int", kind: Keyword }
|
||||
- { loc: "15:18", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "15:21", text: "int", kind: Keyword }
|
||||
- { loc: "15:25", text: "y", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "15:28", text: "int", kind: Keyword }
|
||||
- { loc: "15:32", text: "z", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "16:4", text: "if", kind: Keyword }
|
||||
- { loc: "16:7", text: "x", kind: Parameter }
|
||||
- { loc: "16:11", text: "0", kind: Number }
|
||||
- { loc: "17:8", text: "return", kind: Keyword }
|
||||
- { loc: "17:15", text: "false", kind: Keyword }
|
||||
- { loc: "18:4", text: "if", kind: Keyword }
|
||||
- { loc: "18:7", text: "y", kind: Parameter }
|
||||
- { loc: "18:11", text: "0", kind: Number }
|
||||
- { loc: "19:8", text: "return", kind: Keyword }
|
||||
- { loc: "19:15", text: "false", kind: Keyword }
|
||||
- { loc: "20:4", text: "if", kind: Keyword }
|
||||
- { loc: "20:7", text: "z", kind: Parameter }
|
||||
- { loc: "20:11", text: "0", kind: Number }
|
||||
- { loc: "21:8", text: "return", kind: Keyword }
|
||||
- { loc: "21:15", text: "false", kind: Keyword }
|
||||
- { loc: "22:4", text: "if", kind: Keyword }
|
||||
- { loc: "22:7", text: "x", kind: Parameter }
|
||||
- { loc: "22:11", text: "y", kind: Parameter }
|
||||
- { loc: "22:15", text: "z", kind: Parameter }
|
||||
- { loc: "22:19", text: "100", kind: Number }
|
||||
- { loc: "23:8", text: "return", kind: Keyword }
|
||||
- { loc: "23:15", text: "false", kind: Keyword }
|
||||
- { loc: "24:4", text: "return", kind: Keyword }
|
||||
- { loc: "24:11", text: "true", kind: Keyword }
|
||||
- { loc: "27:0", text: "// if with compound statement and multiple effects", kind: Comment }
|
||||
- { loc: "28:0", text: "int", kind: Keyword }
|
||||
- { loc: "28:4", text: "process", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "28:12", text: "int", kind: Keyword }
|
||||
- { loc: "28:17", text: "data", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "28:23", text: "int", kind: Keyword }
|
||||
- { loc: "28:27", text: "size", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "29:4", text: "int", kind: Keyword }
|
||||
- { loc: "29:8", text: "sum", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "29:14", text: "0", kind: Number }
|
||||
- { loc: "30:4", text: "for", kind: Keyword }
|
||||
- { loc: "30:8", text: "int", kind: Keyword }
|
||||
- { loc: "30:12", text: "i", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "30:16", text: "0", kind: Number }
|
||||
- { loc: "30:19", text: "i", kind: Variable }
|
||||
- { loc: "30:23", text: "size", kind: Parameter }
|
||||
- { loc: "30:31", text: "i", kind: Variable }
|
||||
- { loc: "31:8", text: "if", kind: Keyword }
|
||||
- { loc: "31:11", text: "data", kind: Parameter }
|
||||
- { loc: "31:16", text: "i", kind: Variable }
|
||||
- { loc: "31:21", text: "0", kind: Number }
|
||||
- { loc: "32:12", text: "sum", kind: Variable }
|
||||
- { loc: "32:19", text: "data", kind: Parameter }
|
||||
- { loc: "32:24", text: "i", kind: Variable }
|
||||
- { loc: "33:12", text: "data", kind: Parameter }
|
||||
- { loc: "33:17", text: "i", kind: Variable }
|
||||
- { loc: "33:22", text: "0", kind: Number }
|
||||
- { loc: "34:10", text: "else", kind: Keyword }
|
||||
- { loc: "34:15", text: "if", kind: Keyword }
|
||||
- { loc: "34:18", text: "data", kind: Parameter }
|
||||
- { loc: "34:23", text: "i", kind: Variable }
|
||||
- { loc: "34:29", text: "10", kind: Number }
|
||||
- { loc: "35:12", text: "sum", kind: Variable }
|
||||
- { loc: "35:19", text: "data", kind: Parameter }
|
||||
- { loc: "35:24", text: "i", kind: Variable }
|
||||
- { loc: "38:4", text: "return", kind: Keyword }
|
||||
- { loc: "38:11", text: "sum", kind: Variable }
|
||||
- { loc: "41:0", text: "void", kind: Keyword }
|
||||
- { loc: "41:5", text: "test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "42:21", text: "int", kind: Keyword }
|
||||
- { loc: "42:25", text: "r1", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "42:30", text: "classify_char", kind: Function }
|
||||
- { loc: "42:44", text: "'a'", kind: Character }
|
||||
- { loc: "43:21", text: "bool", kind: Keyword }
|
||||
- { loc: "43:26", text: "r2", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "43:31", text: "validate", kind: Function }
|
||||
- { loc: "43:40", text: "1", kind: Number }
|
||||
- { loc: "43:43", text: "2", kind: Number }
|
||||
- { loc: "43:46", text: "3", kind: Number }
|
||||
- { loc: "44:4", text: "int", kind: Keyword }
|
||||
- { loc: "44:8", text: "arr", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "44:17", text: "1", kind: Number }
|
||||
- { loc: "44:21", text: "20", kind: Number }
|
||||
- { loc: "44:25", text: "3", kind: Number }
|
||||
- { loc: "44:29", text: "5", kind: Number }
|
||||
- { loc: "45:21", text: "int", kind: Keyword }
|
||||
- { loc: "45:25", text: "r3", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "45:30", text: "process", kind: Function }
|
||||
- { loc: "45:38", text: "arr", kind: Variable }
|
||||
- { loc: "45:43", text: "4", kind: Number }
|
||||
- { loc: "48:3", text: "// namespace if_chain", kind: Comment }
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_consteval.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// C++23 if consteval", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_consteval", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "3:10", text: "int", kind: Keyword }
|
||||
- { loc: "3:14", text: "compute", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "3:22", text: "int", kind: Keyword }
|
||||
- { loc: "3:26", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "4:4", text: "if", kind: Keyword }
|
||||
- { loc: "4:7", text: "consteval", kind: Keyword }
|
||||
- { loc: "5:8", text: "return", kind: Keyword }
|
||||
- { loc: "5:15", text: "x", kind: Parameter }
|
||||
- { loc: "5:19", text: "x", kind: Parameter }
|
||||
- { loc: "5:23", text: "// compile-time path", kind: Comment }
|
||||
- { loc: "6:6", text: "else", kind: Keyword }
|
||||
- { loc: "7:8", text: "return", kind: Keyword }
|
||||
- { loc: "7:15", text: "x", kind: Parameter }
|
||||
- { loc: "7:19", text: "x", kind: Parameter }
|
||||
- { loc: "7:23", text: "// runtime path", kind: Comment }
|
||||
- { loc: "11:0", text: "// negated form: if !consteval", kind: Comment }
|
||||
- { loc: "12:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "12:10", text: "int", kind: Keyword }
|
||||
- { loc: "12:14", text: "runtime_prefer", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "12:29", text: "int", kind: Keyword }
|
||||
- { loc: "12:33", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "13:4", text: "if", kind: Keyword }
|
||||
- { loc: "13:8", text: "consteval", kind: Keyword }
|
||||
- { loc: "14:8", text: "return", kind: Keyword }
|
||||
- { loc: "14:15", text: "x", kind: Parameter }
|
||||
- { loc: "14:19", text: "1", kind: Number }
|
||||
- { loc: "14:23", text: "// runtime path", kind: Comment }
|
||||
- { loc: "15:6", text: "else", kind: Keyword }
|
||||
- { loc: "16:8", text: "return", kind: Keyword }
|
||||
- { loc: "16:15", text: "x", kind: Parameter }
|
||||
- { loc: "16:19", text: "1", kind: Number }
|
||||
- { loc: "16:23", text: "// compile-time path", kind: Comment }
|
||||
- { loc: "20:0", text: "// consteval function callable only at compile time", kind: Comment }
|
||||
- { loc: "21:0", text: "consteval", kind: Keyword }
|
||||
- { loc: "21:10", text: "int", kind: Keyword }
|
||||
- { loc: "21:14", text: "ct_only", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "21:22", text: "int", kind: Keyword }
|
||||
- { loc: "21:26", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "22:4", text: "return", kind: Keyword }
|
||||
- { loc: "22:11", text: "x", kind: Parameter }
|
||||
- { loc: "22:15", text: "3", kind: Number }
|
||||
- { loc: "25:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "25:10", text: "int", kind: Keyword }
|
||||
- { loc: "25:14", text: "dispatch", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "25:23", text: "int", kind: Keyword }
|
||||
- { loc: "25:27", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "26:4", text: "if", kind: Keyword }
|
||||
- { loc: "26:7", text: "consteval", kind: Keyword }
|
||||
- { loc: "27:8", text: "return", kind: Keyword }
|
||||
- { loc: "27:15", text: "ct_only", kind: Function }
|
||||
- { loc: "27:23", text: "x", kind: Parameter }
|
||||
- { loc: "27:28", text: "// OK: in immediate context", kind: Comment }
|
||||
- { loc: "28:6", text: "else", kind: Keyword }
|
||||
- { loc: "29:8", text: "return", kind: Keyword }
|
||||
- { loc: "29:15", text: "x", kind: Parameter }
|
||||
- { loc: "33:0", text: "// if consteval without else", kind: Comment }
|
||||
- { loc: "34:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "34:10", text: "int", kind: Keyword }
|
||||
- { loc: "34:14", text: "maybe_optimize", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "34:29", text: "int", kind: Keyword }
|
||||
- { loc: "34:33", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "35:4", text: "if", kind: Keyword }
|
||||
- { loc: "35:7", text: "consteval", kind: Keyword }
|
||||
- { loc: "36:8", text: "return", kind: Keyword }
|
||||
- { loc: "36:15", text: "x", kind: Parameter }
|
||||
- { loc: "36:19", text: "x", kind: Parameter }
|
||||
- { loc: "36:23", text: "x", kind: Parameter }
|
||||
- { loc: "38:4", text: "return", kind: Keyword }
|
||||
- { loc: "38:11", text: "x", kind: Parameter }
|
||||
- { loc: "41:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "41:14", text: "compute", kind: Function }
|
||||
- { loc: "41:22", text: "5", kind: Number }
|
||||
- { loc: "41:28", text: "25", kind: Number }
|
||||
- { loc: "42:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "42:14", text: "dispatch", kind: Function }
|
||||
- { loc: "42:23", text: "3", kind: Number }
|
||||
- { loc: "42:29", text: "9", kind: Number }
|
||||
- { loc: "43:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "43:14", text: "maybe_optimize", kind: Function }
|
||||
- { loc: "43:29", text: "4", kind: Number }
|
||||
- { loc: "43:35", text: "64", kind: Number }
|
||||
- { loc: "45:3", text: "// namespace if_consteval", kind: Comment }
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_basic.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// if constexpr: basic compile-time branching", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_constexpr_basic", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "template", kind: Keyword }
|
||||
- { loc: "3:10", text: "typename", kind: Keyword }
|
||||
- { loc: "3:19", text: "T", kind: Type, modifiers: [Definition] }
|
||||
- { loc: "4:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "4:10", text: "int", kind: Keyword }
|
||||
- { loc: "4:14", text: "type_rank", kind: Function, modifiers: [Definition, Templated] }
|
||||
- { loc: "5:4", text: "if", kind: Keyword }
|
||||
- { loc: "5:7", text: "constexpr", kind: Keyword }
|
||||
- { loc: "5:17", text: "__is_same", kind: Keyword }
|
||||
- { loc: "5:27", text: "T", kind: Type }
|
||||
- { loc: "5:30", text: "char", kind: Keyword }
|
||||
- { loc: "6:8", text: "return", kind: Keyword }
|
||||
- { loc: "6:15", text: "1", kind: Number }
|
||||
- { loc: "7:6", text: "else", kind: Keyword }
|
||||
- { loc: "7:11", text: "if", kind: Keyword }
|
||||
- { loc: "7:14", text: "constexpr", kind: Keyword }
|
||||
- { loc: "7:24", text: "__is_same", kind: Keyword }
|
||||
- { loc: "7:34", text: "T", kind: Type }
|
||||
- { loc: "7:37", text: "int", kind: Keyword }
|
||||
- { loc: "8:8", text: "return", kind: Keyword }
|
||||
- { loc: "8:15", text: "2", kind: Number }
|
||||
- { loc: "9:6", text: "else", kind: Keyword }
|
||||
- { loc: "9:11", text: "if", kind: Keyword }
|
||||
- { loc: "9:14", text: "constexpr", kind: Keyword }
|
||||
- { loc: "9:24", text: "__is_same", kind: Keyword }
|
||||
- { loc: "9:34", text: "T", kind: Type }
|
||||
- { loc: "9:37", text: "long", kind: Keyword }
|
||||
- { loc: "9:42", text: "long", kind: Keyword }
|
||||
- { loc: "10:8", text: "return", kind: Keyword }
|
||||
- { loc: "10:15", text: "3", kind: Number }
|
||||
- { loc: "11:6", text: "else", kind: Keyword }
|
||||
- { loc: "12:8", text: "return", kind: Keyword }
|
||||
- { loc: "12:15", text: "0", kind: Number }
|
||||
- { loc: "16:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "16:14", text: "type_rank", kind: Function }
|
||||
- { loc: "16:24", text: "char", kind: Keyword }
|
||||
- { loc: "16:35", text: "1", kind: Number }
|
||||
- { loc: "17:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "17:14", text: "type_rank", kind: Function }
|
||||
- { loc: "17:24", text: "int", kind: Keyword }
|
||||
- { loc: "17:34", text: "2", kind: Number }
|
||||
- { loc: "18:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "18:14", text: "type_rank", kind: Function }
|
||||
- { loc: "18:24", text: "long", kind: Keyword }
|
||||
- { loc: "18:29", text: "long", kind: Keyword }
|
||||
- { loc: "18:40", text: "3", kind: Number }
|
||||
- { loc: "19:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "19:14", text: "type_rank", kind: Function }
|
||||
- { loc: "19:24", text: "float", kind: Keyword }
|
||||
- { loc: "19:36", text: "0", kind: Number }
|
||||
- { loc: "21:0", text: "// discarded branch not instantiated", kind: Comment }
|
||||
- { loc: "22:0", text: "template", kind: Keyword }
|
||||
- { loc: "22:10", text: "typename", kind: Keyword }
|
||||
- { loc: "22:19", text: "T", kind: Type, modifiers: [Definition] }
|
||||
- { loc: "23:0", text: "auto", kind: Keyword }
|
||||
- { loc: "23:5", text: "dereference", kind: Function, modifiers: [Definition, Templated] }
|
||||
- { loc: "23:17", text: "T", kind: Type }
|
||||
- { loc: "23:19", text: "val", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "24:4", text: "if", kind: Keyword }
|
||||
- { loc: "24:7", text: "constexpr", kind: Keyword }
|
||||
- { loc: "24:17", text: "__is_pointer", kind: Keyword }
|
||||
- { loc: "24:30", text: "T", kind: Type }
|
||||
- { loc: "25:8", text: "return", kind: Keyword }
|
||||
- { loc: "25:16", text: "val", kind: Parameter }
|
||||
- { loc: "26:6", text: "else", kind: Keyword }
|
||||
- { loc: "27:8", text: "return", kind: Keyword }
|
||||
- { loc: "27:15", text: "val", kind: Parameter }
|
||||
- { loc: "31:0", text: "void", kind: Keyword }
|
||||
- { loc: "31:5", text: "test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "32:4", text: "int", kind: Keyword }
|
||||
- { loc: "32:8", text: "x", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "32:12", text: "42", kind: Number }
|
||||
- { loc: "33:21", text: "int", kind: Keyword }
|
||||
- { loc: "33:25", text: "r1", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "33:30", text: "dereference", kind: Function }
|
||||
- { loc: "33:43", text: "x", kind: Variable }
|
||||
- { loc: "34:21", text: "int", kind: Keyword }
|
||||
- { loc: "34:25", text: "r2", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "34:30", text: "dereference", kind: Function }
|
||||
- { loc: "34:42", text: "x", kind: Variable }
|
||||
- { loc: "37:3", text: "// namespace if_constexpr_basic", kind: Comment }
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_requires.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// if constexpr with requires-expression", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_constexpr_requires", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "template", kind: Keyword }
|
||||
- { loc: "3:10", text: "typename", kind: Keyword }
|
||||
- { loc: "3:19", text: "T", kind: Type, modifiers: [Definition] }
|
||||
- { loc: "4:0", text: "int", kind: Keyword }
|
||||
- { loc: "4:4", text: "get_length", kind: Function, modifiers: [Definition, Templated] }
|
||||
- { loc: "4:15", text: "const", kind: Keyword }
|
||||
- { loc: "4:21", text: "T", kind: Type }
|
||||
- { loc: "4:24", text: "x", kind: Parameter, modifiers: [Definition, Readonly] }
|
||||
- { loc: "5:4", text: "if", kind: Keyword }
|
||||
- { loc: "5:7", text: "constexpr", kind: Keyword }
|
||||
- { loc: "5:17", text: "requires", kind: Keyword }
|
||||
- { loc: "5:28", text: "x", kind: Parameter, modifiers: [Readonly] }
|
||||
- { loc: "6:8", text: "return", kind: Keyword }
|
||||
- { loc: "6:15", text: "static_cast", kind: Keyword }
|
||||
- { loc: "6:27", text: "int", kind: Keyword }
|
||||
- { loc: "6:32", text: "x", kind: Parameter, modifiers: [Readonly] }
|
||||
- { loc: "7:6", text: "else", kind: Keyword }
|
||||
- { loc: "7:11", text: "if", kind: Keyword }
|
||||
- { loc: "7:14", text: "constexpr", kind: Keyword }
|
||||
- { loc: "7:24", text: "requires", kind: Keyword }
|
||||
- { loc: "7:35", text: "x", kind: Parameter, modifiers: [Readonly] }
|
||||
- { loc: "8:8", text: "return", kind: Keyword }
|
||||
- { loc: "8:15", text: "x", kind: Parameter, modifiers: [Readonly] }
|
||||
- { loc: "9:6", text: "else", kind: Keyword }
|
||||
- { loc: "10:8", text: "return", kind: Keyword }
|
||||
- { loc: "10:15", text: "1", kind: Number }
|
||||
- { loc: "14:0", text: "struct", kind: Keyword }
|
||||
- { loc: "14:7", text: "WithLength", kind: Struct, modifiers: [Definition] }
|
||||
- { loc: "15:4", text: "int", kind: Keyword }
|
||||
- { loc: "15:8", text: "length", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "18:0", text: "struct", kind: Keyword }
|
||||
- { loc: "18:7", text: "Container", kind: Struct, modifiers: [Definition] }
|
||||
- { loc: "19:4", text: "int", kind: Keyword }
|
||||
- { loc: "19:8", text: "data", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "19:13", text: "4", kind: Number }
|
||||
- { loc: "21:4", text: "int", kind: Keyword }
|
||||
- { loc: "21:8", text: "size", kind: Method, modifiers: [Definition, Readonly] }
|
||||
- { loc: "21:15", text: "const", kind: Keyword }
|
||||
- { loc: "22:8", text: "return", kind: Keyword }
|
||||
- { loc: "22:15", text: "4", kind: Number }
|
||||
- { loc: "26:0", text: "void", kind: Keyword }
|
||||
- { loc: "26:5", text: "test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "27:4", text: "Container", kind: Struct }
|
||||
- { loc: "27:14", text: "c", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "28:21", text: "int", kind: Keyword }
|
||||
- { loc: "28:25", text: "r1", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "28:30", text: "get_length", kind: Function }
|
||||
- { loc: "28:41", text: "c", kind: Variable }
|
||||
- { loc: "30:4", text: "WithLength", kind: Struct }
|
||||
- { loc: "30:15", text: "wl", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "30:18", text: "10", kind: Number }
|
||||
- { loc: "31:21", text: "int", kind: Keyword }
|
||||
- { loc: "31:25", text: "r2", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "31:30", text: "get_length", kind: Function }
|
||||
- { loc: "31:41", text: "wl", kind: Variable }
|
||||
- { loc: "33:21", text: "int", kind: Keyword }
|
||||
- { loc: "33:25", text: "r3", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "33:30", text: "get_length", kind: Function }
|
||||
- { loc: "33:41", text: "42", kind: Number }
|
||||
- { loc: "36:3", text: "// namespace if_constexpr_requires", kind: Comment }
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_variadic.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// if constexpr with variadic templates", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_constexpr_variadic", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "// recursive fold with if constexpr", kind: Comment }
|
||||
- { loc: "4:0", text: "template", kind: Keyword }
|
||||
- { loc: "4:10", text: "typename", kind: Keyword }
|
||||
- { loc: "4:19", text: "T", kind: Type, modifiers: [Definition] }
|
||||
- { loc: "4:22", text: "typename", kind: Keyword }
|
||||
- { loc: "4:34", text: "Rest", kind: Type, modifiers: [Definition] }
|
||||
- { loc: "5:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "5:10", text: "T", kind: Type }
|
||||
- { loc: "5:12", text: "sum", kind: Function, modifiers: [Definition, Templated] }
|
||||
- { loc: "5:16", text: "T", kind: Type }
|
||||
- { loc: "5:18", text: "first", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "5:25", text: "Rest", kind: Type }
|
||||
- { loc: "5:33", text: "rest", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "6:4", text: "if", kind: Keyword }
|
||||
- { loc: "6:7", text: "constexpr", kind: Keyword }
|
||||
- { loc: "6:17", text: "sizeof", kind: Keyword }
|
||||
- { loc: "6:36", text: "0", kind: Number }
|
||||
- { loc: "7:8", text: "return", kind: Keyword }
|
||||
- { loc: "7:15", text: "first", kind: Parameter }
|
||||
- { loc: "8:6", text: "else", kind: Keyword }
|
||||
- { loc: "9:8", text: "return", kind: Keyword }
|
||||
- { loc: "9:15", text: "first", kind: Parameter }
|
||||
- { loc: "9:27", text: "rest", kind: Parameter }
|
||||
- { loc: "13:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "13:14", text: "sum", kind: Function }
|
||||
- { loc: "13:18", text: "1", kind: Number }
|
||||
- { loc: "13:24", text: "1", kind: Number }
|
||||
- { loc: "14:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "14:14", text: "sum", kind: Function }
|
||||
- { loc: "14:18", text: "1", kind: Number }
|
||||
- { loc: "14:21", text: "2", kind: Number }
|
||||
- { loc: "14:24", text: "3", kind: Number }
|
||||
- { loc: "14:30", text: "6", kind: Number }
|
||||
- { loc: "15:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "15:14", text: "sum", kind: Function }
|
||||
- { loc: "15:18", text: "1", kind: Number }
|
||||
- { loc: "15:21", text: "2", kind: Number }
|
||||
- { loc: "15:24", text: "3", kind: Number }
|
||||
- { loc: "15:27", text: "4", kind: Number }
|
||||
- { loc: "15:30", text: "5", kind: Number }
|
||||
- { loc: "15:36", text: "15", kind: Number }
|
||||
- { loc: "17:0", text: "// process each element differently", kind: Comment }
|
||||
- { loc: "18:0", text: "template", kind: Keyword }
|
||||
- { loc: "18:10", text: "typename", kind: Keyword }
|
||||
- { loc: "18:19", text: "T", kind: Type, modifiers: [Definition] }
|
||||
- { loc: "19:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "19:10", text: "int", kind: Keyword }
|
||||
- { loc: "19:14", text: "count_one", kind: Function, modifiers: [Definition, Templated] }
|
||||
- { loc: "20:4", text: "if", kind: Keyword }
|
||||
- { loc: "20:7", text: "constexpr", kind: Keyword }
|
||||
- { loc: "20:17", text: "__is_integral", kind: Keyword }
|
||||
- { loc: "20:31", text: "T", kind: Type }
|
||||
- { loc: "21:8", text: "return", kind: Keyword }
|
||||
- { loc: "21:15", text: "1", kind: Number }
|
||||
- { loc: "22:6", text: "else", kind: Keyword }
|
||||
- { loc: "23:8", text: "return", kind: Keyword }
|
||||
- { loc: "23:15", text: "0", kind: Number }
|
||||
- { loc: "27:0", text: "template", kind: Keyword }
|
||||
- { loc: "27:10", text: "typename", kind: Keyword }
|
||||
- { loc: "27:22", text: "Ts", kind: Type, modifiers: [Definition] }
|
||||
- { loc: "28:0", text: "constexpr", kind: Keyword }
|
||||
- { loc: "28:10", text: "int", kind: Keyword }
|
||||
- { loc: "28:14", text: "count_integrals", kind: Function, modifiers: [Definition, Templated] }
|
||||
- { loc: "29:4", text: "return", kind: Keyword }
|
||||
- { loc: "29:22", text: "Ts", kind: Type }
|
||||
- { loc: "32:0", text: "static_assert", kind: Keyword }
|
||||
- { loc: "32:14", text: "count_integrals", kind: Function }
|
||||
- { loc: "32:30", text: "int", kind: Keyword }
|
||||
- { loc: "32:35", text: "float", kind: Keyword }
|
||||
- { loc: "32:42", text: "char", kind: Keyword }
|
||||
- { loc: "32:48", text: "double", kind: Keyword }
|
||||
- { loc: "32:61", text: "2", kind: Number }
|
||||
- { loc: "34:3", text: "// namespace if_constexpr_variadic", kind: Comment }
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_declaration_condition.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// if with declaration as condition", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_declaration", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "struct", kind: Keyword }
|
||||
- { loc: "3:7", text: "Optional", kind: Struct, modifiers: [Definition] }
|
||||
- { loc: "4:4", text: "int", kind: Keyword }
|
||||
- { loc: "4:8", text: "value", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "5:4", text: "bool", kind: Keyword }
|
||||
- { loc: "5:9", text: "valid", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "7:4", text: "explicit", kind: Keyword }
|
||||
- { loc: "7:13", text: "operator", kind: Conflict, modifiers: [Definition, Readonly] }
|
||||
- { loc: "7:22", text: "bool", kind: Keyword }
|
||||
- { loc: "7:29", text: "const", kind: Keyword }
|
||||
- { loc: "8:8", text: "return", kind: Keyword }
|
||||
- { loc: "8:15", text: "valid", kind: Field }
|
||||
- { loc: "12:0", text: "Optional", kind: Struct }
|
||||
- { loc: "12:9", text: "try_parse", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "12:19", text: "int", kind: Keyword }
|
||||
- { loc: "12:23", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "13:4", text: "if", kind: Keyword }
|
||||
- { loc: "13:7", text: "x", kind: Parameter }
|
||||
- { loc: "13:12", text: "0", kind: Number }
|
||||
- { loc: "14:8", text: "return", kind: Keyword }
|
||||
- { loc: "14:16", text: "x", kind: Parameter }
|
||||
- { loc: "14:20", text: "2", kind: Number }
|
||||
- { loc: "14:23", text: "true", kind: Keyword }
|
||||
- { loc: "15:4", text: "return", kind: Keyword }
|
||||
- { loc: "15:12", text: "0", kind: Number }
|
||||
- { loc: "15:15", text: "false", kind: Keyword }
|
||||
- { loc: "18:0", text: "int", kind: Keyword }
|
||||
- { loc: "18:4", text: "use_declaration_condition", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "18:30", text: "int", kind: Keyword }
|
||||
- { loc: "18:34", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "19:4", text: "if", kind: Keyword }
|
||||
- { loc: "19:7", text: "Optional", kind: Struct }
|
||||
- { loc: "19:16", text: "result", kind: Conflict, modifiers: [Definition] }
|
||||
- { loc: "19:25", text: "try_parse", kind: Function }
|
||||
- { loc: "19:35", text: "x", kind: Parameter }
|
||||
- { loc: "20:8", text: "return", kind: Keyword }
|
||||
- { loc: "20:15", text: "result", kind: Variable }
|
||||
- { loc: "20:22", text: "value", kind: Field }
|
||||
- { loc: "22:4", text: "return", kind: Keyword }
|
||||
- { loc: "22:12", text: "1", kind: Number }
|
||||
- { loc: "25:0", text: "// pointer declaration as condition", kind: Comment }
|
||||
- { loc: "26:0", text: "struct", kind: Keyword }
|
||||
- { loc: "26:7", text: "Node", kind: Struct, modifiers: [Definition] }
|
||||
- { loc: "27:4", text: "int", kind: Keyword }
|
||||
- { loc: "27:8", text: "data", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "28:4", text: "Node", kind: Struct }
|
||||
- { loc: "28:10", text: "next", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "31:0", text: "int", kind: Keyword }
|
||||
- { loc: "31:4", text: "walk_list", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "31:14", text: "Node", kind: Struct }
|
||||
- { loc: "31:20", text: "head", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "32:4", text: "int", kind: Keyword }
|
||||
- { loc: "32:8", text: "sum", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "32:14", text: "0", kind: Number }
|
||||
- { loc: "33:4", text: "if", kind: Keyword }
|
||||
- { loc: "33:7", text: "Node", kind: Struct }
|
||||
- { loc: "33:13", text: "p", kind: Conflict }
|
||||
- { loc: "33:17", text: "head", kind: Parameter }
|
||||
- { loc: "34:8", text: "sum", kind: Variable }
|
||||
- { loc: "34:15", text: "p", kind: Variable }
|
||||
- { loc: "34:18", text: "data", kind: Field }
|
||||
- { loc: "36:4", text: "return", kind: Keyword }
|
||||
- { loc: "36:11", text: "sum", kind: Variable }
|
||||
- { loc: "39:0", text: "void", kind: Keyword }
|
||||
- { loc: "39:5", text: "test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "40:21", text: "int", kind: Keyword }
|
||||
- { loc: "40:25", text: "r1", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "40:30", text: "use_declaration_condition", kind: Function }
|
||||
- { loc: "40:56", text: "5", kind: Number }
|
||||
- { loc: "41:21", text: "int", kind: Keyword }
|
||||
- { loc: "41:25", text: "r2", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "41:30", text: "use_declaration_condition", kind: Function }
|
||||
- { loc: "41:57", text: "1", kind: Number }
|
||||
- { loc: "42:4", text: "Node", kind: Struct }
|
||||
- { loc: "42:9", text: "n", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "42:11", text: "42", kind: Number }
|
||||
- { loc: "42:15", text: "nullptr", kind: Keyword }
|
||||
- { loc: "43:21", text: "int", kind: Keyword }
|
||||
- { loc: "43:25", text: "r3", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "43:30", text: "walk_list", kind: Function }
|
||||
- { loc: "43:41", text: "n", kind: Variable }
|
||||
- { loc: "46:3", text: "// namespace if_declaration", kind: Comment }
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_statement.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// C++17 if with init-statement", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_init", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "struct", kind: Keyword }
|
||||
- { loc: "3:7", text: "Result", kind: Struct, modifiers: [Definition] }
|
||||
- { loc: "4:4", text: "int", kind: Keyword }
|
||||
- { loc: "4:8", text: "value", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "5:4", text: "bool", kind: Keyword }
|
||||
- { loc: "5:9", text: "ok", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "8:0", text: "Result", kind: Struct }
|
||||
- { loc: "8:7", text: "compute", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "8:15", text: "int", kind: Keyword }
|
||||
- { loc: "8:19", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "9:4", text: "if", kind: Keyword }
|
||||
- { loc: "9:7", text: "x", kind: Parameter }
|
||||
- { loc: "9:11", text: "0", kind: Number }
|
||||
- { loc: "10:8", text: "return", kind: Keyword }
|
||||
- { loc: "10:16", text: "x", kind: Parameter }
|
||||
- { loc: "10:20", text: "10", kind: Number }
|
||||
- { loc: "10:24", text: "true", kind: Keyword }
|
||||
- { loc: "11:4", text: "return", kind: Keyword }
|
||||
- { loc: "11:12", text: "0", kind: Number }
|
||||
- { loc: "11:15", text: "false", kind: Keyword }
|
||||
- { loc: "14:0", text: "int", kind: Keyword }
|
||||
- { loc: "14:4", text: "with_init", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "14:14", text: "int", kind: Keyword }
|
||||
- { loc: "14:18", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "15:4", text: "if", kind: Keyword }
|
||||
- { loc: "15:7", text: "auto", kind: Keyword }
|
||||
- { loc: "15:12", text: "r", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "15:16", text: "compute", kind: Function }
|
||||
- { loc: "15:24", text: "x", kind: Parameter }
|
||||
- { loc: "15:28", text: "r", kind: Variable }
|
||||
- { loc: "15:30", text: "ok", kind: Field }
|
||||
- { loc: "16:8", text: "return", kind: Keyword }
|
||||
- { loc: "16:15", text: "r", kind: Variable }
|
||||
- { loc: "16:17", text: "value", kind: Field }
|
||||
- { loc: "18:4", text: "return", kind: Keyword }
|
||||
- { loc: "18:12", text: "1", kind: Number }
|
||||
- { loc: "21:0", text: "// init-statement with array", kind: Comment }
|
||||
- { loc: "22:0", text: "bool", kind: Keyword }
|
||||
- { loc: "22:5", text: "find_char", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "22:15", text: "const", kind: Keyword }
|
||||
- { loc: "22:21", text: "char", kind: Keyword }
|
||||
- { loc: "22:27", text: "str", kind: Parameter, modifiers: [Definition, Readonly] }
|
||||
- { loc: "22:32", text: "char", kind: Keyword }
|
||||
- { loc: "22:37", text: "target", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "23:4", text: "if", kind: Keyword }
|
||||
- { loc: "23:7", text: "int", kind: Keyword }
|
||||
- { loc: "23:11", text: "i", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "23:15", text: "0", kind: Number }
|
||||
- { loc: "23:18", text: "str", kind: Parameter, modifiers: [Readonly] }
|
||||
- { loc: "24:8", text: "while", kind: Keyword }
|
||||
- { loc: "24:14", text: "str", kind: Parameter, modifiers: [Readonly] }
|
||||
- { loc: "24:18", text: "i", kind: Variable }
|
||||
- { loc: "25:12", text: "if", kind: Keyword }
|
||||
- { loc: "25:15", text: "str", kind: Parameter, modifiers: [Readonly] }
|
||||
- { loc: "25:19", text: "i", kind: Variable }
|
||||
- { loc: "25:25", text: "target", kind: Parameter }
|
||||
- { loc: "26:16", text: "return", kind: Keyword }
|
||||
- { loc: "26:23", text: "true", kind: Keyword }
|
||||
- { loc: "27:14", text: "i", kind: Variable }
|
||||
- { loc: "30:4", text: "return", kind: Keyword }
|
||||
- { loc: "30:11", text: "false", kind: Keyword }
|
||||
- { loc: "33:0", text: "// init-statement scoping: variables not visible outside", kind: Comment }
|
||||
- { loc: "34:0", text: "int", kind: Keyword }
|
||||
- { loc: "34:4", text: "scoping_demo", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "34:17", text: "int", kind: Keyword }
|
||||
- { loc: "34:21", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "35:4", text: "if", kind: Keyword }
|
||||
- { loc: "35:7", text: "int", kind: Keyword }
|
||||
- { loc: "35:11", text: "doubled", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "35:21", text: "x", kind: Parameter }
|
||||
- { loc: "35:25", text: "2", kind: Number }
|
||||
- { loc: "35:28", text: "doubled", kind: Variable }
|
||||
- { loc: "35:38", text: "10", kind: Number }
|
||||
- { loc: "36:8", text: "return", kind: Keyword }
|
||||
- { loc: "36:15", text: "doubled", kind: Variable }
|
||||
- { loc: "37:6", text: "else", kind: Keyword }
|
||||
- { loc: "38:8", text: "return", kind: Keyword }
|
||||
- { loc: "38:15", text: "doubled", kind: Variable }
|
||||
- { loc: "38:25", text: "1", kind: Number }
|
||||
- { loc: "38:29", text: "// doubled visible in else", kind: Comment }
|
||||
- { loc: "42:0", text: "void", kind: Keyword }
|
||||
- { loc: "42:5", text: "test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "43:21", text: "int", kind: Keyword }
|
||||
- { loc: "43:25", text: "r1", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "43:30", text: "with_init", kind: Function }
|
||||
- { loc: "43:40", text: "5", kind: Number }
|
||||
- { loc: "44:21", text: "bool", kind: Keyword }
|
||||
- { loc: "44:26", text: "r2", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "44:31", text: "find_char", kind: Function }
|
||||
- { loc: "44:41", text: "\"hello\"", kind: String }
|
||||
- { loc: "44:50", text: "'l'", kind: Character }
|
||||
- { loc: "45:21", text: "int", kind: Keyword }
|
||||
- { loc: "45:25", text: "r3", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "45:30", text: "scoping_demo", kind: Function }
|
||||
- { loc: "45:43", text: "3", kind: Number }
|
||||
- { loc: "48:3", text: "// namespace if_init", kind: Comment }
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_structured_binding.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// if with init-statement using structured bindings", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_init_sb", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "struct", kind: Keyword }
|
||||
- { loc: "3:7", text: "Pair", kind: Struct, modifiers: [Definition] }
|
||||
- { loc: "4:4", text: "int", kind: Keyword }
|
||||
- { loc: "4:8", text: "first", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "5:4", text: "int", kind: Keyword }
|
||||
- { loc: "5:8", text: "second", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "8:0", text: "Pair", kind: Struct }
|
||||
- { loc: "8:5", text: "divide", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "8:12", text: "int", kind: Keyword }
|
||||
- { loc: "8:16", text: "a", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "8:19", text: "int", kind: Keyword }
|
||||
- { loc: "8:23", text: "b", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "9:4", text: "if", kind: Keyword }
|
||||
- { loc: "9:7", text: "b", kind: Parameter }
|
||||
- { loc: "9:12", text: "0", kind: Number }
|
||||
- { loc: "10:8", text: "return", kind: Keyword }
|
||||
- { loc: "10:16", text: "0", kind: Number }
|
||||
- { loc: "10:19", text: "0", kind: Number }
|
||||
- { loc: "11:4", text: "return", kind: Keyword }
|
||||
- { loc: "11:12", text: "a", kind: Parameter }
|
||||
- { loc: "11:16", text: "b", kind: Parameter }
|
||||
- { loc: "11:19", text: "a", kind: Parameter }
|
||||
- { loc: "11:23", text: "b", kind: Parameter }
|
||||
- { loc: "14:0", text: "int", kind: Keyword }
|
||||
- { loc: "14:4", text: "safe_divide", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "14:16", text: "int", kind: Keyword }
|
||||
- { loc: "14:20", text: "a", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "14:23", text: "int", kind: Keyword }
|
||||
- { loc: "14:27", text: "b", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "15:4", text: "if", kind: Keyword }
|
||||
- { loc: "15:7", text: "auto", kind: Keyword }
|
||||
- { loc: "15:12", text: "[quot", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "15:19", text: "rem", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "15:26", text: "divide", kind: Function }
|
||||
- { loc: "15:33", text: "a", kind: Parameter }
|
||||
- { loc: "15:36", text: "b", kind: Parameter }
|
||||
- { loc: "15:40", text: "b", kind: Parameter }
|
||||
- { loc: "15:45", text: "0", kind: Number }
|
||||
- { loc: "16:8", text: "return", kind: Keyword }
|
||||
- { loc: "16:15", text: "quot", kind: Variable }
|
||||
- { loc: "18:4", text: "return", kind: Keyword }
|
||||
- { loc: "18:12", text: "1", kind: Number }
|
||||
- { loc: "21:0", text: "struct", kind: Keyword }
|
||||
- { loc: "21:7", text: "ParseResult", kind: Struct, modifiers: [Definition] }
|
||||
- { loc: "22:4", text: "bool", kind: Keyword }
|
||||
- { loc: "22:9", text: "success", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "23:4", text: "int", kind: Keyword }
|
||||
- { loc: "23:8", text: "value", kind: Field, modifiers: [Definition] }
|
||||
- { loc: "24:4", text: "const", kind: Keyword }
|
||||
- { loc: "24:10", text: "char", kind: Keyword }
|
||||
- { loc: "24:16", text: "error", kind: Field, modifiers: [Definition, Readonly] }
|
||||
- { loc: "27:0", text: "ParseResult", kind: Struct }
|
||||
- { loc: "27:12", text: "parse", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "27:18", text: "int", kind: Keyword }
|
||||
- { loc: "27:22", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "28:4", text: "if", kind: Keyword }
|
||||
- { loc: "28:7", text: "x", kind: Parameter }
|
||||
- { loc: "28:11", text: "0", kind: Number }
|
||||
- { loc: "29:8", text: "return", kind: Keyword }
|
||||
- { loc: "29:16", text: "false", kind: Keyword }
|
||||
- { loc: "29:23", text: "0", kind: Number }
|
||||
- { loc: "29:26", text: "\"negative\"", kind: String }
|
||||
- { loc: "30:4", text: "return", kind: Keyword }
|
||||
- { loc: "30:12", text: "true", kind: Keyword }
|
||||
- { loc: "30:18", text: "x", kind: Parameter }
|
||||
- { loc: "30:21", text: "nullptr", kind: Keyword }
|
||||
- { loc: "33:0", text: "int", kind: Keyword }
|
||||
- { loc: "33:4", text: "try_parse", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "33:14", text: "int", kind: Keyword }
|
||||
- { loc: "33:18", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "34:4", text: "if", kind: Keyword }
|
||||
- { loc: "34:7", text: "auto", kind: Keyword }
|
||||
- { loc: "34:12", text: "[ok", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "34:17", text: "val", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "34:22", text: "err", kind: Variable, modifiers: [Definition, Readonly] }
|
||||
- { loc: "34:29", text: "parse", kind: Function }
|
||||
- { loc: "34:35", text: "x", kind: Parameter }
|
||||
- { loc: "34:39", text: "ok", kind: Variable }
|
||||
- { loc: "35:8", text: "return", kind: Keyword }
|
||||
- { loc: "35:15", text: "val", kind: Variable }
|
||||
- { loc: "37:4", text: "return", kind: Keyword }
|
||||
- { loc: "37:11", text: "0", kind: Number }
|
||||
- { loc: "40:0", text: "void", kind: Keyword }
|
||||
- { loc: "40:5", text: "test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "41:21", text: "int", kind: Keyword }
|
||||
- { loc: "41:25", text: "r1", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "41:30", text: "safe_divide", kind: Function }
|
||||
- { loc: "41:42", text: "10", kind: Number }
|
||||
- { loc: "41:46", text: "3", kind: Number }
|
||||
- { loc: "42:21", text: "int", kind: Keyword }
|
||||
- { loc: "42:25", text: "r2", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "42:30", text: "try_parse", kind: Function }
|
||||
- { loc: "42:40", text: "42", kind: Number }
|
||||
- { loc: "45:3", text: "// namespace if_init_sb", kind: Comment }
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
source: semantic_tokens_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_null_statement.cpp
|
||||
---
|
||||
- { loc: "0:0", text: "// if with null statement and single-statement bodies", kind: Comment }
|
||||
- { loc: "1:0", text: "namespace", kind: Keyword }
|
||||
- { loc: "1:10", text: "if_null", kind: Namespace, modifiers: [Definition] }
|
||||
- { loc: "3:0", text: "// null init-statement in C++17 if", kind: Comment }
|
||||
- { loc: "4:0", text: "int", kind: Keyword }
|
||||
- { loc: "4:4", text: "with_null_init", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "4:19", text: "int", kind: Keyword }
|
||||
- { loc: "4:23", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "5:4", text: "if", kind: Keyword }
|
||||
- { loc: "5:9", text: "x", kind: Parameter }
|
||||
- { loc: "5:13", text: "0", kind: Number }
|
||||
- { loc: "6:8", text: "return", kind: Keyword }
|
||||
- { loc: "6:15", text: "x", kind: Parameter }
|
||||
- { loc: "8:4", text: "return", kind: Keyword }
|
||||
- { loc: "8:11", text: "0", kind: Number }
|
||||
- { loc: "11:0", text: "// single statement body (no braces)", kind: Comment }
|
||||
- { loc: "12:0", text: "int", kind: Keyword }
|
||||
- { loc: "12:4", text: "single_stmt", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "12:16", text: "int", kind: Keyword }
|
||||
- { loc: "12:20", text: "x", kind: Parameter, modifiers: [Definition] }
|
||||
- { loc: "13:4", text: "if", kind: Keyword }
|
||||
- { loc: "13:7", text: "x", kind: Parameter }
|
||||
- { loc: "13:11", text: "10", kind: Number }
|
||||
- { loc: "14:8", text: "return", kind: Keyword }
|
||||
- { loc: "14:15", text: "x", kind: Parameter }
|
||||
- { loc: "15:4", text: "if", kind: Keyword }
|
||||
- { loc: "15:7", text: "x", kind: Parameter }
|
||||
- { loc: "15:11", text: "5", kind: Number }
|
||||
- { loc: "16:8", text: "return", kind: Keyword }
|
||||
- { loc: "16:15", text: "x", kind: Parameter }
|
||||
- { loc: "16:19", text: "1", kind: Number }
|
||||
- { loc: "17:4", text: "return", kind: Keyword }
|
||||
- { loc: "17:11", text: "0", kind: Number }
|
||||
- { loc: "20:0", text: "// scope of variable declared in if body", kind: Comment }
|
||||
- { loc: "21:0", text: "void", kind: Keyword }
|
||||
- { loc: "21:5", text: "scope_test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "22:4", text: "if", kind: Keyword }
|
||||
- { loc: "22:7", text: "true", kind: Keyword }
|
||||
- { loc: "23:25", text: "int", kind: Keyword }
|
||||
- { loc: "23:29", text: "x", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "23:33", text: "42", kind: Number }
|
||||
- { loc: "25:4", text: "// x is out of scope here", kind: Comment }
|
||||
- { loc: "27:4", text: "if", kind: Keyword }
|
||||
- { loc: "27:7", text: "int", kind: Keyword }
|
||||
- { loc: "27:11", text: "y", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "27:15", text: "10", kind: Number }
|
||||
- { loc: "27:19", text: "y", kind: Variable }
|
||||
- { loc: "27:23", text: "0", kind: Number }
|
||||
- { loc: "28:25", text: "int", kind: Keyword }
|
||||
- { loc: "28:29", text: "z", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "28:33", text: "y", kind: Variable }
|
||||
- { loc: "30:4", text: "// y and z are out of scope here", kind: Comment }
|
||||
- { loc: "33:0", text: "void", kind: Keyword }
|
||||
- { loc: "33:5", text: "test", kind: Function, modifiers: [Definition] }
|
||||
- { loc: "34:21", text: "int", kind: Keyword }
|
||||
- { loc: "34:25", text: "r1", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "34:30", text: "with_null_init", kind: Function }
|
||||
- { loc: "34:45", text: "5", kind: Number }
|
||||
- { loc: "35:21", text: "int", kind: Keyword }
|
||||
- { loc: "35:25", text: "r2", kind: Variable, modifiers: [Definition] }
|
||||
- { loc: "35:30", text: "single_stmt", kind: Function }
|
||||
- { loc: "35:42", text: "7", kind: Number }
|
||||
- { loc: "36:4", text: "scope_test", kind: Function }
|
||||
- { loc: "39:3", text: "// namespace if_null", kind: Comment }
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_chain_patterns.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_chain", relations: [Definition] }
|
||||
- { loc: "3:4", kind: Function, text: "classify_char", relations: [Definition] }
|
||||
- { loc: "3:23", kind: Parameter, text: "c", relations: [Definition] }
|
||||
- { loc: "4:7", kind: Parameter, text: "c", relations: [Reference] }
|
||||
- { loc: "4:19", kind: Parameter, text: "c", relations: [Reference] }
|
||||
- { loc: "6:12", kind: Parameter, text: "c", relations: [Reference] }
|
||||
- { loc: "6:24", kind: Parameter, text: "c", relations: [Reference] }
|
||||
- { loc: "8:12", kind: Parameter, text: "c", relations: [Reference] }
|
||||
- { loc: "8:24", kind: Parameter, text: "c", relations: [Reference] }
|
||||
- { loc: "15:5", kind: Function, text: "validate", relations: [Definition] }
|
||||
- { loc: "15:18", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "15:25", kind: Parameter, text: "y", relations: [Definition] }
|
||||
- { loc: "15:32", kind: Parameter, text: "z", relations: [Definition] }
|
||||
- { loc: "16:7", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "18:7", kind: Parameter, text: "y", relations: [Reference] }
|
||||
- { loc: "20:7", kind: Parameter, text: "z", relations: [Reference] }
|
||||
- { loc: "22:7", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "22:11", kind: Parameter, text: "y", relations: [Reference] }
|
||||
- { loc: "22:15", kind: Parameter, text: "z", relations: [Reference] }
|
||||
- { loc: "28:4", kind: Function, text: "process", relations: [Definition] }
|
||||
- { loc: "28:17", kind: Parameter, text: "data", relations: [Definition] }
|
||||
- { loc: "28:27", kind: Parameter, text: "size", relations: [Definition] }
|
||||
- { loc: "29:8", kind: Variable, text: "sum", relations: [Definition] }
|
||||
- { loc: "30:12", kind: Variable, text: "i", relations: [Definition] }
|
||||
- { loc: "30:19", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "30:23", kind: Parameter, text: "size", relations: [Reference] }
|
||||
- { loc: "30:31", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "31:11", kind: Parameter, text: "data", relations: [Reference] }
|
||||
- { loc: "31:16", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "32:12", kind: Variable, text: "sum", relations: [Reference] }
|
||||
- { loc: "32:19", kind: Parameter, text: "data", relations: [Reference] }
|
||||
- { loc: "32:24", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "33:12", kind: Parameter, text: "data", relations: [Reference] }
|
||||
- { loc: "33:17", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "34:18", kind: Parameter, text: "data", relations: [Reference] }
|
||||
- { loc: "34:23", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "35:12", kind: Variable, text: "sum", relations: [Reference] }
|
||||
- { loc: "35:19", kind: Parameter, text: "data", relations: [Reference] }
|
||||
- { loc: "35:24", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "38:11", kind: Variable, text: "sum", relations: [Reference] }
|
||||
- { loc: "41:5", kind: Function, text: "test", relations: [Definition] }
|
||||
- { loc: "42:25", kind: Variable, text: "r1", relations: [Definition] }
|
||||
- { loc: "42:30", kind: Function, text: "classify_char", relations: [Reference] }
|
||||
- { loc: "43:26", kind: Variable, text: "r2", relations: [Definition] }
|
||||
- { loc: "43:31", kind: Function, text: "validate", relations: [Reference] }
|
||||
- { loc: "44:8", kind: Variable, text: "arr", relations: [Definition] }
|
||||
- { loc: "45:25", kind: Variable, text: "r3", relations: [Definition] }
|
||||
- { loc: "45:30", kind: Function, text: "process", relations: [Reference] }
|
||||
- { loc: "45:38", kind: Variable, text: "arr", relations: [Reference] }
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_consteval.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_consteval", relations: [Definition] }
|
||||
- { loc: "3:14", kind: Function, text: "compute", relations: [Definition] }
|
||||
- { loc: "3:26", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "5:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "5:19", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "7:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "7:19", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "12:14", kind: Function, text: "runtime_prefer", relations: [Definition] }
|
||||
- { loc: "12:33", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "14:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "16:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "21:14", kind: Function, text: "ct_only", relations: [Definition] }
|
||||
- { loc: "21:26", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "22:11", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "25:14", kind: Function, text: "dispatch", relations: [Definition] }
|
||||
- { loc: "25:27", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "27:15", kind: Function, text: "ct_only", relations: [Reference] }
|
||||
- { loc: "27:23", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "29:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "34:14", kind: Function, text: "maybe_optimize", relations: [Definition] }
|
||||
- { loc: "34:33", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "36:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "36:19", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "36:23", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "38:11", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "41:14", kind: Function, text: "compute", relations: [Reference] }
|
||||
- { loc: "42:14", kind: Function, text: "dispatch", relations: [Reference] }
|
||||
- { loc: "43:14", kind: Function, text: "maybe_optimize", relations: [Reference] }
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_basic.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_constexpr_basic", relations: [Definition] }
|
||||
- { loc: "3:19", kind: Type, text: "T", relations: [Definition] }
|
||||
- { loc: "4:14", kind: Function, text: "type_rank", relations: [Definition] }
|
||||
- { loc: "5:27", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "7:34", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "9:34", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "16:14", kind: Function, text: "type_rank", relations: [Reference] }
|
||||
- { loc: "17:14", kind: Function, text: "type_rank", relations: [Reference] }
|
||||
- { loc: "18:14", kind: Function, text: "type_rank", relations: [Reference] }
|
||||
- { loc: "19:14", kind: Function, text: "type_rank", relations: [Reference] }
|
||||
- { loc: "22:19", kind: Type, text: "T", relations: [Definition] }
|
||||
- { loc: "23:5", kind: Function, text: "dereference", relations: [Definition] }
|
||||
- { loc: "23:17", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "23:19", kind: Parameter, text: "val", relations: [Definition] }
|
||||
- { loc: "24:30", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "25:16", kind: Parameter, text: "val", relations: [Reference] }
|
||||
- { loc: "27:15", kind: Parameter, text: "val", relations: [Reference] }
|
||||
- { loc: "31:5", kind: Function, text: "test", relations: [Definition] }
|
||||
- { loc: "32:8", kind: Variable, text: "x", relations: [Definition] }
|
||||
- { loc: "33:25", kind: Variable, text: "r1", relations: [Definition] }
|
||||
- { loc: "33:30", kind: Function, text: "dereference", relations: [Reference] }
|
||||
- { loc: "33:43", kind: Variable, text: "x", relations: [Reference] }
|
||||
- { loc: "34:25", kind: Variable, text: "r2", relations: [Definition] }
|
||||
- { loc: "34:30", kind: Function, text: "dereference", relations: [Reference] }
|
||||
- { loc: "34:42", kind: Variable, text: "x", relations: [Reference] }
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_requires.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_constexpr_requires", relations: [Definition] }
|
||||
- { loc: "3:19", kind: Type, text: "T", relations: [Definition] }
|
||||
- { loc: "4:4", kind: Function, text: "get_length", relations: [Definition] }
|
||||
- { loc: "4:21", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "4:24", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "5:28", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "6:32", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "7:35", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "8:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "14:7", kind: Struct, text: "WithLength", relations: [Definition] }
|
||||
- { loc: "15:8", kind: Field, text: "length", relations: [Definition] }
|
||||
- { loc: "18:7", kind: Struct, text: "Container", relations: [Definition] }
|
||||
- { loc: "19:8", kind: Field, text: "data", relations: [Definition] }
|
||||
- { loc: "21:8", kind: Method, text: "size", relations: [Definition] }
|
||||
- { loc: "26:5", kind: Function, text: "test", relations: [Definition] }
|
||||
- { loc: "27:4", kind: Struct, text: "Container", relations: [Reference] }
|
||||
- { loc: "27:14", kind: Variable, text: "c", relations: [Definition] }
|
||||
- { loc: "28:25", kind: Variable, text: "r1", relations: [Definition] }
|
||||
- { loc: "28:30", kind: Function, text: "get_length", relations: [Reference] }
|
||||
- { loc: "28:41", kind: Variable, text: "c", relations: [Reference] }
|
||||
- { loc: "30:4", kind: Struct, text: "WithLength", relations: [Reference] }
|
||||
- { loc: "30:15", kind: Variable, text: "wl", relations: [Definition] }
|
||||
- { loc: "31:25", kind: Variable, text: "r2", relations: [Definition] }
|
||||
- { loc: "31:30", kind: Function, text: "get_length", relations: [Reference] }
|
||||
- { loc: "31:41", kind: Variable, text: "wl", relations: [Reference] }
|
||||
- { loc: "33:25", kind: Variable, text: "r3", relations: [Definition] }
|
||||
- { loc: "33:30", kind: Function, text: "get_length", relations: [Reference] }
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_constexpr_variadic.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_constexpr_variadic", relations: [Definition] }
|
||||
- { loc: "4:19", kind: Type, text: "T", relations: [Definition] }
|
||||
- { loc: "4:34", kind: Type, text: "Rest", relations: [Definition] }
|
||||
- { loc: "5:10", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "5:12", kind: Function, text: "sum", relations: [Definition] }
|
||||
- { loc: "5:16", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "5:18", kind: Parameter, text: "first", relations: [Definition] }
|
||||
- { loc: "5:25", kind: Type, text: "Rest", relations: [Reference] }
|
||||
- { loc: "5:33", kind: Parameter, text: "rest", relations: [Definition] }
|
||||
- { loc: "7:15", kind: Parameter, text: "first", relations: [Reference] }
|
||||
- { loc: "9:15", kind: Parameter, text: "first", relations: [Reference] }
|
||||
- { loc: "9:27", kind: Parameter, text: "rest", relations: [Reference] }
|
||||
- { loc: "13:14", kind: Function, text: "sum", relations: [Reference] }
|
||||
- { loc: "14:14", kind: Function, text: "sum", relations: [Reference] }
|
||||
- { loc: "15:14", kind: Function, text: "sum", relations: [Reference] }
|
||||
- { loc: "18:19", kind: Type, text: "T", relations: [Definition] }
|
||||
- { loc: "19:14", kind: Function, text: "count_one", relations: [Definition] }
|
||||
- { loc: "20:31", kind: Type, text: "T", relations: [Reference] }
|
||||
- { loc: "27:22", kind: Type, text: "Ts", relations: [Definition] }
|
||||
- { loc: "28:14", kind: Function, text: "count_integrals", relations: [Definition] }
|
||||
- { loc: "29:22", kind: Type, text: "Ts", relations: [Reference] }
|
||||
- { loc: "32:14", kind: Function, text: "count_integrals", relations: [Reference] }
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_declaration_condition.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_declaration", relations: [Definition] }
|
||||
- { loc: "3:7", kind: Struct, text: "Optional", relations: [Definition] }
|
||||
- { loc: "4:8", kind: Field, text: "value", relations: [Definition] }
|
||||
- { loc: "5:9", kind: Field, text: "valid", relations: [Definition] }
|
||||
- { loc: "7:13", kind: Method, text: "operator", relations: [Definition] }
|
||||
- { loc: "8:15", kind: Field, text: "valid", relations: [Reference] }
|
||||
- { loc: "12:0", kind: Struct, text: "Optional", relations: [Reference] }
|
||||
- { loc: "12:9", kind: Function, text: "try_parse", relations: [Definition] }
|
||||
- { loc: "12:23", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "13:7", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "14:16", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "18:4", kind: Function, text: "use_declaration_condition", relations: [Definition] }
|
||||
- { loc: "18:34", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "19:7", kind: Struct, text: "Optional", relations: [Reference] }
|
||||
- { loc: "19:16", kind: Variable, text: "result", relations: [Definition, Reference] }
|
||||
- { loc: "19:25", kind: Function, text: "try_parse", relations: [Reference] }
|
||||
- { loc: "19:35", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "20:15", kind: Variable, text: "result", relations: [Reference] }
|
||||
- { loc: "20:22", kind: Field, text: "value", relations: [Reference] }
|
||||
- { loc: "26:7", kind: Struct, text: "Node", relations: [Definition] }
|
||||
- { loc: "27:8", kind: Field, text: "data", relations: [Definition] }
|
||||
- { loc: "28:4", kind: Struct, text: "Node", relations: [Reference] }
|
||||
- { loc: "28:10", kind: Field, text: "next", relations: [Definition] }
|
||||
- { loc: "31:4", kind: Function, text: "walk_list", relations: [Definition] }
|
||||
- { loc: "31:14", kind: Struct, text: "Node", relations: [Reference] }
|
||||
- { loc: "31:20", kind: Parameter, text: "head", relations: [Definition] }
|
||||
- { loc: "32:8", kind: Variable, text: "sum", relations: [Definition] }
|
||||
- { loc: "33:7", kind: Struct, text: "Node", relations: [Reference] }
|
||||
- { loc: "33:13", kind: Variable, text: "p", relations: [Definition, Reference] }
|
||||
- { loc: "33:17", kind: Parameter, text: "head", relations: [Reference] }
|
||||
- { loc: "34:8", kind: Variable, text: "sum", relations: [Reference] }
|
||||
- { loc: "34:15", kind: Variable, text: "p", relations: [Reference] }
|
||||
- { loc: "34:18", kind: Field, text: "data", relations: [Reference] }
|
||||
- { loc: "36:11", kind: Variable, text: "sum", relations: [Reference] }
|
||||
- { loc: "39:5", kind: Function, text: "test", relations: [Definition] }
|
||||
- { loc: "40:25", kind: Variable, text: "r1", relations: [Definition] }
|
||||
- { loc: "40:30", kind: Function, text: "use_declaration_condition", relations: [Reference] }
|
||||
- { loc: "41:25", kind: Variable, text: "r2", relations: [Definition] }
|
||||
- { loc: "41:30", kind: Function, text: "use_declaration_condition", relations: [Reference] }
|
||||
- { loc: "42:4", kind: Struct, text: "Node", relations: [Reference] }
|
||||
- { loc: "42:9", kind: Variable, text: "n", relations: [Definition] }
|
||||
- { loc: "43:25", kind: Variable, text: "r3", relations: [Definition] }
|
||||
- { loc: "43:30", kind: Function, text: "walk_list", relations: [Reference] }
|
||||
- { loc: "43:41", kind: Variable, text: "n", relations: [Reference] }
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_statement.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_init", relations: [Definition] }
|
||||
- { loc: "3:7", kind: Struct, text: "Result", relations: [Definition] }
|
||||
- { loc: "4:8", kind: Field, text: "value", relations: [Definition] }
|
||||
- { loc: "5:9", kind: Field, text: "ok", relations: [Definition] }
|
||||
- { loc: "8:0", kind: Struct, text: "Result", relations: [Reference] }
|
||||
- { loc: "8:7", kind: Function, text: "compute", relations: [Definition] }
|
||||
- { loc: "8:19", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "9:7", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "10:16", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "14:4", kind: Function, text: "with_init", relations: [Definition] }
|
||||
- { loc: "14:18", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "15:12", kind: Variable, text: "r", relations: [Definition] }
|
||||
- { loc: "15:16", kind: Function, text: "compute", relations: [Reference] }
|
||||
- { loc: "15:24", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "15:28", kind: Variable, text: "r", relations: [Reference] }
|
||||
- { loc: "15:30", kind: Field, text: "ok", relations: [Reference] }
|
||||
- { loc: "16:15", kind: Variable, text: "r", relations: [Reference] }
|
||||
- { loc: "16:17", kind: Field, text: "value", relations: [Reference] }
|
||||
- { loc: "22:5", kind: Function, text: "find_char", relations: [Definition] }
|
||||
- { loc: "22:27", kind: Parameter, text: "str", relations: [Definition] }
|
||||
- { loc: "22:37", kind: Parameter, text: "target", relations: [Definition] }
|
||||
- { loc: "23:11", kind: Variable, text: "i", relations: [Definition] }
|
||||
- { loc: "23:18", kind: Parameter, text: "str", relations: [Reference] }
|
||||
- { loc: "24:14", kind: Parameter, text: "str", relations: [Reference] }
|
||||
- { loc: "24:18", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "25:15", kind: Parameter, text: "str", relations: [Reference] }
|
||||
- { loc: "25:19", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "25:25", kind: Parameter, text: "target", relations: [Reference] }
|
||||
- { loc: "27:14", kind: Variable, text: "i", relations: [Reference] }
|
||||
- { loc: "34:4", kind: Function, text: "scoping_demo", relations: [Definition] }
|
||||
- { loc: "34:21", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "35:11", kind: Variable, text: "doubled", relations: [Definition] }
|
||||
- { loc: "35:21", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "35:28", kind: Variable, text: "doubled", relations: [Reference] }
|
||||
- { loc: "36:15", kind: Variable, text: "doubled", relations: [Reference] }
|
||||
- { loc: "38:15", kind: Variable, text: "doubled", relations: [Reference] }
|
||||
- { loc: "42:5", kind: Function, text: "test", relations: [Definition] }
|
||||
- { loc: "43:25", kind: Variable, text: "r1", relations: [Definition] }
|
||||
- { loc: "43:30", kind: Function, text: "with_init", relations: [Reference] }
|
||||
- { loc: "44:26", kind: Variable, text: "r2", relations: [Definition] }
|
||||
- { loc: "44:31", kind: Function, text: "find_char", relations: [Reference] }
|
||||
- { loc: "45:25", kind: Variable, text: "r3", relations: [Definition] }
|
||||
- { loc: "45:30", kind: Function, text: "scoping_demo", relations: [Reference] }
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_init_structured_binding.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_init_sb", relations: [Definition] }
|
||||
- { loc: "3:7", kind: Struct, text: "Pair", relations: [Definition] }
|
||||
- { loc: "4:8", kind: Field, text: "first", relations: [Definition] }
|
||||
- { loc: "5:8", kind: Field, text: "second", relations: [Definition] }
|
||||
- { loc: "8:0", kind: Struct, text: "Pair", relations: [Reference] }
|
||||
- { loc: "8:5", kind: Function, text: "divide", relations: [Definition] }
|
||||
- { loc: "8:16", kind: Parameter, text: "a", relations: [Definition] }
|
||||
- { loc: "8:23", kind: Parameter, text: "b", relations: [Definition] }
|
||||
- { loc: "9:7", kind: Parameter, text: "b", relations: [Reference] }
|
||||
- { loc: "11:12", kind: Parameter, text: "a", relations: [Reference] }
|
||||
- { loc: "11:16", kind: Parameter, text: "b", relations: [Reference] }
|
||||
- { loc: "11:19", kind: Parameter, text: "a", relations: [Reference] }
|
||||
- { loc: "11:23", kind: Parameter, text: "b", relations: [Reference] }
|
||||
- { loc: "14:4", kind: Function, text: "safe_divide", relations: [Definition] }
|
||||
- { loc: "14:20", kind: Parameter, text: "a", relations: [Definition] }
|
||||
- { loc: "14:27", kind: Parameter, text: "b", relations: [Definition] }
|
||||
- { loc: "15:12", kind: Variable, text: "[", relations: [Definition] }
|
||||
- { loc: "15:13", kind: Variable, text: "quot", relations: [Definition] }
|
||||
- { loc: "15:19", kind: Variable, text: "rem", relations: [Definition] }
|
||||
- { loc: "15:26", kind: Function, text: "divide", relations: [Reference] }
|
||||
- { loc: "15:33", kind: Parameter, text: "a", relations: [Reference] }
|
||||
- { loc: "15:36", kind: Parameter, text: "b", relations: [Reference] }
|
||||
- { loc: "15:40", kind: Parameter, text: "b", relations: [Reference] }
|
||||
- { loc: "16:15", kind: Variable, text: "quot", relations: [Reference] }
|
||||
- { loc: "21:7", kind: Struct, text: "ParseResult", relations: [Definition] }
|
||||
- { loc: "22:9", kind: Field, text: "success", relations: [Definition] }
|
||||
- { loc: "23:8", kind: Field, text: "value", relations: [Definition] }
|
||||
- { loc: "24:16", kind: Field, text: "error", relations: [Definition] }
|
||||
- { loc: "27:0", kind: Struct, text: "ParseResult", relations: [Reference] }
|
||||
- { loc: "27:12", kind: Function, text: "parse", relations: [Definition] }
|
||||
- { loc: "27:22", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "28:7", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "30:18", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "33:4", kind: Function, text: "try_parse", relations: [Definition] }
|
||||
- { loc: "33:18", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "34:12", kind: Variable, text: "[", relations: [Definition] }
|
||||
- { loc: "34:13", kind: Variable, text: "ok", relations: [Definition] }
|
||||
- { loc: "34:17", kind: Variable, text: "val", relations: [Definition] }
|
||||
- { loc: "34:22", kind: Variable, text: "err", relations: [Definition] }
|
||||
- { loc: "34:29", kind: Function, text: "parse", relations: [Reference] }
|
||||
- { loc: "34:35", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "34:39", kind: Variable, text: "ok", relations: [Reference] }
|
||||
- { loc: "35:15", kind: Variable, text: "val", relations: [Reference] }
|
||||
- { loc: "40:5", kind: Function, text: "test", relations: [Definition] }
|
||||
- { loc: "41:25", kind: Variable, text: "r1", relations: [Definition] }
|
||||
- { loc: "41:30", kind: Function, text: "safe_divide", relations: [Reference] }
|
||||
- { loc: "42:25", kind: Variable, text: "r2", relations: [Definition] }
|
||||
- { loc: "42:30", kind: Function, text: "try_parse", relations: [Reference] }
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
source: tu_index_tests.cpp
|
||||
created_at: 2026-05-24
|
||||
input_file: statements/if/if_null_statement.cpp
|
||||
---
|
||||
- { loc: "1:10", kind: Namespace, text: "if_null", relations: [Definition] }
|
||||
- { loc: "4:4", kind: Function, text: "with_null_init", relations: [Definition] }
|
||||
- { loc: "4:23", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "5:9", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "6:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "12:4", kind: Function, text: "single_stmt", relations: [Definition] }
|
||||
- { loc: "12:20", kind: Parameter, text: "x", relations: [Definition] }
|
||||
- { loc: "13:7", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "14:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "15:7", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "16:15", kind: Parameter, text: "x", relations: [Reference] }
|
||||
- { loc: "21:5", kind: Function, text: "scope_test", relations: [Definition] }
|
||||
- { loc: "23:29", kind: Variable, text: "x", relations: [Definition] }
|
||||
- { loc: "27:11", kind: Variable, text: "y", relations: [Definition] }
|
||||
- { loc: "27:19", kind: Variable, text: "y", relations: [Reference] }
|
||||
- { loc: "28:29", kind: Variable, text: "z", relations: [Definition] }
|
||||
- { loc: "28:33", kind: Variable, text: "y", relations: [Reference] }
|
||||
- { loc: "33:5", kind: Function, text: "test", relations: [Definition] }
|
||||
- { loc: "34:25", kind: Variable, text: "r1", relations: [Definition] }
|
||||
- { loc: "34:30", kind: Function, text: "with_null_init", relations: [Reference] }
|
||||
- { loc: "35:25", kind: Variable, text: "r2", relations: [Definition] }
|
||||
- { loc: "35:30", kind: Function, text: "single_stmt", relations: [Reference] }
|
||||
- { loc: "36:4", kind: Function, text: "scope_test", relations: [Reference] }
|
||||
|
||||
@@ -140,6 +140,10 @@ void EXPECT_TOKEN(llvm::StringRef name,
|
||||
ASSERT_EQ(token->modifiers, expected_modifiers);
|
||||
}
|
||||
|
||||
void EXPECT_NO_TOKEN(llvm::StringRef name) {
|
||||
ASSERT_TRUE(find_by_range(name) == nullptr);
|
||||
}
|
||||
|
||||
TEST_CASE(BasicLexicalKinds) {
|
||||
run_utf8(R"cpp(
|
||||
@d1[#define] @m0[FOO]
|
||||
@@ -266,6 +270,44 @@ int main() {
|
||||
EXPECT_TOKEN("x3", SymbolKind::Variable, 0);
|
||||
}
|
||||
|
||||
TEST_CASE(IneligibleOperatorReferenceIsSuppressed) {
|
||||
run_utf8(R"cpp(
|
||||
struct S {};
|
||||
|
||||
S operator+(S lhs, S rhs);
|
||||
|
||||
void use(S lhs, S rhs) {
|
||||
(void)(lhs @plus[+] rhs);
|
||||
}
|
||||
)cpp");
|
||||
|
||||
EXPECT_NO_TOKEN("plus");
|
||||
}
|
||||
|
||||
TEST_CASE(ConstructorAndDestructorNamesRemainHighlighted) {
|
||||
run_utf8(R"cpp(
|
||||
struct S {
|
||||
@ctor_decl[S]();
|
||||
@dtor_decl[~]S();
|
||||
};
|
||||
|
||||
S::@ctor_def[S]() {}
|
||||
|
||||
void use(S* value) {
|
||||
value->@dtor_ref[~]S();
|
||||
}
|
||||
)cpp");
|
||||
|
||||
auto declaration = modifier_mask({SymbolModifiers::Declaration});
|
||||
auto definition = modifier_mask({SymbolModifiers::Definition});
|
||||
auto special_member = modifier_mask({SymbolModifiers::ConstructorOrDestructor});
|
||||
|
||||
EXPECT_TOKEN("ctor_decl", SymbolKind::Method, declaration | special_member);
|
||||
EXPECT_TOKEN("dtor_decl", SymbolKind::Method, declaration | special_member);
|
||||
EXPECT_TOKEN("ctor_def", SymbolKind::Method, definition | special_member);
|
||||
EXPECT_TOKEN("dtor_ref", SymbolKind::Method, special_member);
|
||||
}
|
||||
|
||||
TEST_CASE(LegacyVarDeclTemplates) {
|
||||
run_utf8(R"cpp(
|
||||
extern int @x1[x];
|
||||
|
||||
Reference in New Issue
Block a user