Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,6 @@ jobs:
- name: Test
run: ctest --preset=test

- name: Build and Install
run: |
cmake --preset=default
cmake --build --preset=default
cmake --install build/default --prefix "${{ runner.temp }}/install"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
if: ${{ matrix.cc }}

- name: Build and Install
run: |
cmake --preset=default
cmake --build --preset=default
cmake --install build/default --prefix "${{ runner.temp }}/install"
if: ${{ !matrix.cc }}

- name: Check installed package artifacts
run: |
cmake "-DPACKAGE_TEST_PREFIX=${{ runner.temp }}/install" -P build/default/cpp-library-test-package.cmake

clang-tidy:
runs-on: ubuntu-latest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ last_accessed: 2026-11-18T06:48:35Z
last_reinforced: 2026-11-18T06:48:35Z
access_count: 2
sources:
- "include/cel/parser.hpp:62-80"
- "src/compiler.cpp:405-418"
- "src/parser.cpp:373-429"
- "src/compiler.cpp:415-419"
- "src/parser.cpp:379-422"
- "src/parser.cpp:793-825"
- "src/lexer.hpp:15-25"
- "tests/expression_test.cpp:157-194"
- "src/compiler.cpp:762-782"
- "tests/expression_test.cpp:125-136"
tags: ["parser", "literals", "rust-parity", "tuple-selectors"]
tier: knowledge
votes_up: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ last_accessed: 2026-11-19T05:47:01Z
last_reinforced: 2026-11-19T05:47:01Z
access_count: 1
sources:
- "src/parser.cpp:180-194"
- "tests/tests.cpp:129-153"
- "src/parser.cpp:578-592"
- "src/parser.cpp:1120-1144"
- "src/lexer.hpp:21-23"
- "docs/lexical-contract.md:105-109"
tags: ["parser", "floating-point", "macos", "locale", "compatibility"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ last_accessed: 2026-11-18T06:31:07Z
last_reinforced: 2026-11-18T06:31:07Z
access_count: 1
sources:
- "CMakeLists.txt:17-35"
- "docs/validation.md:121-130"
- "CMakeLists.txt:17-45"
- "docs/validation.md:117-138"
supersedes: "[[Initialize shared installation defaults before CPM runtime and parser targets]]"
tags: ["cmake", "cpm", "dependencies", "installation"]
tier: knowledge
Expand All @@ -24,4 +24,4 @@ last_voted: 2026-11-19T04:10:10Z

# Keep cel-runtime out of parser installation

Let `cpp_library_setup` initialize the default `CEL_INSTALL` option before adding `cel-runtime`. Add the runtime with its versioned commit URI and keep CPM's short-form `EXCLUDE_FROM_ALL` default; do not override it to `NO`. CPM registry resolution supplies the package/version without an explicit `cpp_library_map_dependency`. Package validation relies on cpp-library's generated component-presence check, without custom source-consumer or installed-consumer tests.
Let `cpp_library_setup` initialize the default `CEL_INSTALL` option before adding `cel-runtime`. Add the runtime with its versioned commit URI and keep CPM's short-form `EXCLUDE_FROM_ALL` default; do not override it to `NO`. CPM registry resolution supplies the package/version without an explicit `cpp_library_map_dependency`. The cpp-library 6.2 presets disable installation except in the explicit install preset. Validate source builds; do not add installation, package-artifact, or installed-consumer gates.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ last_reinforced: 2026-11-11T00:46:42Z
access_count: 1
sources:
- "src/compiler.cpp:258-291"
- "tests/expression_test.cpp:467-510"
- "tests/expression_test.cpp:416-461"
tags: ["parser", "recursion", "stack-usage", "MSVC"]
tier: knowledge
---

# Keep operator-local storage out of recursive precedence frames

Keep recursive precedence control in expression_compiler::binary separate from operator-local storage in binary_rhs (src/compiler.cpp:258-291). Every nested expression traverses the fixed precedence levels. Placing dyn_segment RHS builders and operator metadata in binary reserves their storage in every unoptimized frame, including frames that never encounter an operator; this can overflow the native MSVC Debug stack before the 128-production resource guard fires. binary_rhs runs only after operator_at(level), preserving operator consumption, lazy RHS ownership, source spans, lookup order, and non-chaining comparisons. Preserve the existing nesting contract rather than lowering its limit or enlarging test stacks. The public contract regression covers 32 and 127 parenthesis groups, resource rejection of excess nesting, and long iterative flat chains (tests/expression_test.cpp:467-510). Run that case with iterator debugging enabled when changing these frames.
Keep recursive precedence control in expression_compiler::binary separate from operator-local storage in binary_rhs (src/compiler.cpp:258-291). Every nested expression traverses the fixed precedence levels. Placing dyn_segment RHS builders and operator metadata in binary reserves their storage in every unoptimized frame, including frames that never encounter an operator; this can overflow the native MSVC Debug stack before the 128-production resource guard fires. binary_rhs runs only after operator_at(level), preserving operator consumption, lazy RHS ownership, source spans, lookup order, and non-chaining comparisons. Preserve the existing nesting contract rather than lowering its limit or enlarging test stacks. The public contract regression covers 32 and 127 parenthesis groups, resource rejection of excess nesting, and long iterative flat chains (tests/expression_test.cpp:416-461). Run that case with iterator debugging enabled when changing these frames.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ last_reinforced: 2026-11-18T06:31:11Z
access_count: 1
sources:
- "CMakeLists.txt:5-6"
- "CMakeLists.txt:33-35"
- "CMakeLists.txt:43-45"
- "docs/evidence.md:96-100"
supersedes: "[[Pin CPM dependencies to reviewed commits]]"
tags: ["cmake", "cpm", "dependencies", "supply-chain"]
Expand All @@ -27,4 +27,4 @@ last_voted: 2026-11-19T04:10:12Z

# Pin runtime source with a versioned CPM URI

Pin `cel-runtime` with a CPM URI that includes both the compatibility release (`1.1.2`) and reviewed full commit SHA `a819042cfa3fab8ede82052518f2b7f5175af5ad`. Keep the release tag-to-commit relationship in `docs/evidence.md`. `cpp-library` resolves the dependency from CPM's registry, so do not add a separate `cpp_library_map_dependency` for this CPM package.
Pin `cel-runtime` with a CPM URI that includes both the compatibility release (`1.1.3`) and reviewed full commit SHA `fc9fa3be8b0af9782a3491acacd6ba1f2e528a5b`. Keep the release tag-to-commit relationship in `docs/evidence.md`. `cpp-library` resolves the dependency from CPM's registry, so do not add a separate `cpp_library_map_dependency` for this CPM package.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"$gcc",
"$msCompile"
],
"detail": "Release build for installation with CPM_USE_LOCAL_PACKAGES enabled for testing installed packages Requires the CMake Tools extension (ms-vscode.cmake-tools) — without it, this task fails to start.",
"detail": "Release build for installation, preferring locally installed dependencies before fetching. Requires the CMake Tools extension (ms-vscode.cmake-tools) — without it, this task fails to start.",
"windows": {
"options": {
"shell": {
Expand Down
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.24)

include(cmake/CPM.cmake)

CPMAddPackage("gh:stlab/cpp-library@6.1.0")
CPMAddPackage("gh:stlab/cpp-library@6.2.0")
include(${cpp-library_SOURCE_DIR}/cpp-library.cmake)

# Enable dependency tracking before project()
Expand All @@ -20,7 +20,7 @@ cpp_library_setup(
HEADERS parser.hpp parser/diagnostic.hpp parser/lookup.hpp parser/compiler.hpp parser/all.hpp
SOURCES parser.cpp lookup.cpp type.cpp compiler.cpp
EXAMPLES example.cpp cached_decoded.cpp
TESTS tests.cpp lookup_test.cpp type_test.cpp expression_test.cpp cached_test.cpp parity_driver_test.cpp header_layers_test.cpp
TESTS lookup_test.cpp expression_test.cpp cached_test.cpp parity_driver_test.cpp header_layers_test.cpp
cursor_copy_fail.cpp lexer_copy_fail.cpp parser_copy_fail.cpp standard_library_fail.cpp
converting_registration_fail.cpp converting_result_fail.cpp nontrivial_registration_fail.cpp token_interface_fail.cpp
LICENSE_FILES licenses/Unicode-3.0.txt
Expand All @@ -30,8 +30,18 @@ cpp_library_setup(
DOCS_OPTIONS "USE_MDFILE_AS_MAINPAGE = ${CMAKE_CURRENT_SOURCE_DIR}/README.md"
)

# cpp-library adds src to tests directly and through the static implementation.
get_property(parser_targets DIRECTORY PROPERTY BUILDSYSTEM_TARGETS)
foreach(parser_target IN LISTS parser_targets)
get_target_property(parser_includes "${parser_target}" INCLUDE_DIRECTORIES)
if(parser_includes)
list(REMOVE_ITEM parser_includes "${CMAKE_CURRENT_SOURCE_DIR}/src")
set_property(TARGET "${parser_target}" PROPERTY INCLUDE_DIRECTORIES "${parser_includes}")
endif()
endforeach()

# Initialize cpp-library's default CEL_INSTALL before the same-namespace runtime.
CPMAddPackage("gh:stlab/cel-runtime@1.1.2#a819042cfa3fab8ede82052518f2b7f5175af5ad")
CPMAddPackage("gh:stlab/cel-runtime@1.1.3#fc9fa3be8b0af9782a3491acacd6ba1f2e528a5b")
target_link_libraries(parser PUBLIC cel::runtime)

# Exercise parity-driver helpers in ordinary unit tests without the driver's main().
Expand All @@ -40,15 +50,6 @@ if(TARGET parity_driver_test)
target_compile_definitions(parity_driver_test PRIVATE CEL_PARITY_NO_MAIN)
endif()

if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING)
# Give white-box tests access to implementation headers without exporting them.
foreach(test tests lookup_test type_test expression_test parity_driver_test cursor_copy_fail lexer_copy_fail)
target_include_directories(${test} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src")
endforeach()

set_tests_properties(tests PROPERTIES TIMEOUT 180)
endif()

# Compare C++ and Rust results on shared fixtures; Python and Cargo are test-only.
option(CEL_PARSER_ENABLE_PARITY "Require the local public Rust reference differential gate" OFF)
set(CEL_PARSER_REFERENCE_SOURCE "" CACHE PATH "Local cel-rs checkout for test-only parity")
Expand All @@ -72,7 +73,6 @@ if(CEL_PARSER_ENABLE_PARITY)
--source "${CEL_PARSER_REFERENCE_SOURCE}" --build "${reference_build}"
VERBATIM)
add_executable(parity_driver tools/parity/driver.cpp)
target_include_directories(parity_driver PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_link_libraries(parity_driver PRIVATE cel::parser)
cpp_library_copy_runtime_dlls(parity_driver)

Expand Down
8 changes: 7 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"binaryDir": "${sourceDir}/build/default",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -22,6 +23,7 @@
"binaryDir": "${sourceDir}/build/test",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Debug",
"BUILD_TESTING": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -36,6 +38,7 @@
"binaryDir": "${sourceDir}/build/docs",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"BUILD_DOCS": "ON",
Expand All @@ -51,6 +54,7 @@
"binaryDir": "${sourceDir}/build/clang-tidy",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Debug",
"BUILD_TESTING": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -66,6 +70,7 @@
"binaryDir": "${sourceDir}/build/init",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand All @@ -77,10 +82,11 @@
{
"name": "install",
"displayName": "Install Configuration",
"description": "Release build for installation with CPM_USE_LOCAL_PACKAGES enabled for testing installed packages",
"description": "Release build for installation, preferring locally installed dependencies before fetching",
"binaryDir": "${sourceDir}/build/install",
"generator": "Ninja",
"cacheVariables": {
"CEL_INSTALL": "ON",
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
Expand Down
2 changes: 1 addition & 1 deletion docs/builtin-census.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Scope callbacks and descriptor emitters execute during compilation.

Each row names exact arguments/results. `D` means `f64`; `B` means `bool`.
Every row is implemented with public checked runtime emission. The test anchors
name cases in `tests/lookup_test.cpp`.
name in-source cases in `src/lookup.cpp`.
Source syntax/precedence is also covered by `retained precedence` in
`tests/expression_test.cpp`; `core lookup does not` checks absent library names.
See the [expression grammar](expression-grammar.md) for every emission edge.
Expand Down
16 changes: 9 additions & 7 deletions docs/evidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pinned to the original baseline.
The runtime source upstream is
[stlab/cel-runtime](https://github.com/stlab/cel-runtime).
The previous P4 baseline used release `v1.0.1` at revision
`a8e753b040664172fd3f526f9cf46029858ff788`. The parser pins release `v1.1.2`
at revision `a819042cfa3fab8ede82052518f2b7f5175af5ad` because its
`a8e753b040664172fd3f526f9cf46029858ff788`. The parser pins release `v1.1.3`
at revision `fc9fa3be8b0af9782a3491acacd6ba1f2e528a5b` because its
record-registration API uses the runtime's record adapters. The parser consumes
the public target from CPM and exports the matching minimum package version; it
neither copies runtime implementation nor includes private headers. Rebuild the
Expand Down Expand Up @@ -93,10 +93,11 @@ Production code depends on the C++20 standard library, committed Unicode
property data, and the `cel-runtime` package through `cel::runtime`.
There is no Unicode shared-library dependency.

Build infrastructure uses `stlab/cpp-library` release `v6.1.0` at
`13ff79ac9fbbf575bbab0ab3dee0c752b4501fcc` under BSL-1.0. Its pinned scaffold
Build infrastructure uses `stlab/cpp-library` release `v6.2.0` at
`4f60491f7550cb058af855346decc71ce0d5365e` under BSL-1.0. Its pinned scaffold
provides CMake presets, doctest 2.5.3 (MIT), generated negative-compilation tests,
CTest, standalone public-header checks, exports, license installation, CI,
CTest, guarded in-source tests, static per-file test support,
standalone public-header checks, exports, license installation, source-build CI,
and strict Doxygen configuration.
Doxygen-awesome-css 2.5.0 (MIT) supplies the documentation theme. CPM.cmake
0.43.2 is MIT-licensed. Doxygen, Ninja, Clang tools, and Python are
Expand All @@ -119,10 +120,11 @@ Regenerate and format the tables from the repository root:

```sh
python3 tools/generate_unicode.py
clang-format -i src/unicode_data.hpp
clang-format -i src/parser.cpp
```

Confirm that `git diff -- src/unicode_data.hpp` is empty. Consumers don't need
The generator replaces only the marked Unicode data block in `src/parser.cpp`.
Confirm that `git diff -- src/parser.cpp` is empty. Consumers don't need
Python or network access to use the committed tables.

## Expression compilation and remaining verification
Expand Down
9 changes: 7 additions & 2 deletions docs/expression-grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ implicit ambient captures, or general block expressions.

## Verification disposition

The following cases in `tests/expression_test.cpp` cover the implementation:
The following cases cover the implementation. Public-interface tests remain in
`tests/expression_test.cpp`. Cases using private token or scope interfaces live
behind `CPP_LIBRARY_TESTING()` in `src/compiler.cpp`: `numeric values require`,
`decimal integer-form f64`, `postfix brackets remain`, `all six range forms`,
`independent closure scope`, and `text and token methods`.

| Case-name prefix | Production and boundary coverage |
| --- | --- |
Expand All @@ -99,7 +103,8 @@ The following cases in `tests/expression_test.cpp` cover the implementation:
| `text and token methods` | Both full methods, inline host preservation, producer diagnostics, visible/invisible malformed groups, exact spans |
| `recursive input` | Bounded nesting, long arithmetic/unary/cast/member/lazy/list chains |

`tests/type_test.cpp` additionally verifies exact span-output prefix parsing.
In-source tests in `src/type.cpp` additionally verify exact span-output prefix
parsing. Lexer and token-cursor tests live in `src/parser.cpp`.

The differential fixtures cover retained production families with identical
sources. Narrower scalar/parameter availability, canonical record carriers,
Expand Down
Loading
Loading