Skip to content

pst operators: explicit decimal lessThan, lessThanOrEqual, ...#2243

Merged
victornicolet merged 1 commit intomainfrom
victornicolet/pst-decimal-comparison-ops
Mar 23, 2026
Merged

pst operators: explicit decimal lessThan, lessThanOrEqual, ...#2243
victornicolet merged 1 commit intomainfrom
victornicolet/pst-decimal-comparison-ops

Conversation

@victornicolet
Copy link
Contributor

Description of changes

Adds operators for the decimal lessThan, lessThanOrEqual, greaterThan and greaterThanOrEqual methods. Previously, all operations were translated to the Less, LessEq, Greater, GreaterEq (comparisons over the other types) but Cedar represents comparisons over decimals separately.

With this we can follow up on cedar-policy/cedar-spec#913 to test AST roundtrip with PST (AST -> PST -> AST).

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A change "invisible" to users (e.g., documentation, changes to "internal" crates like cedar-policy-core, cedar-validator, etc.)

I confirm that this PR (choose one, and delete the other options):

  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar language specification.
  • Requires updates, and I have made / will make these updates myself. (Please include in your description a timeline or link to the relevant PR in cedar-docs. PRs should be targeted at a staging-X.Y branch, not main.)
  • I'm not sure how my change impacts the documentation. (Post your PR anyways, and we'll discuss in the comments.)

Signed-off-by: Victor Nicolet <victornl@amazon.com>
@github-actions
Copy link

Coverage Report

Head Commit: f801282ddfaddc644ff965b71a3964328318762d

Base Commit: bd3ee598a1b681433bc0b1630741defd2aaebc89

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 100.00%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/pst/expr.rs 🟢 8/8 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 86.77%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟡 3985/5348 74.51% --
cedar-policy-cli 🟡 1120/1565 71.57% --
cedar-policy-core 🟢 23696/27065 87.55% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6752/7273 92.84% --
cedar-wasm 🔴 0/28 0.00% --

@victornicolet victornicolet marked this pull request as ready for review March 20, 2026 19:04
@victornicolet victornicolet merged commit 549861a into main Mar 23, 2026
26 checks passed
@victornicolet victornicolet deleted the victornicolet/pst-decimal-comparison-ops branch March 23, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants