Skip to content

Commit efa6b83

Browse files
authored
Releases v3.2.0 (#35)
1 parent 743ce64 commit efa6b83

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [3.2.0] - 2025-08-31
11+
12+
### Added
13+
14+
#### Strict Equality Operators
15+
16+
- **New Operators**: Added `===` (strict equality) and `!==` (strict inequality) operators
17+
- **Type-Safe Comparisons**: Strict operators compare both value and type, unlike loose equality
18+
- **Round-Trip Preservation**: Operators maintain their exact form during parse/decompile cycles
19+
- **Complete Pipeline Support**: Full lexer, parser, evaluator, and visitor implementation
20+
- **Comprehensive Testing**: 23 tests covering all aspects of strict equality functionality
21+
22+
#### Examples
23+
24+
```elixir
25+
# Strict equality - same type and value required
26+
Predicator.evaluate("5 === 5", %{}) # {:ok, true}
27+
Predicator.evaluate("5 === '5'", %{}) # {:ok, false} - different types
28+
29+
# Strict inequality - true when type or value differs
30+
Predicator.evaluate("5 !== '5'", %{}) # {:ok, true} - different types
31+
Predicator.evaluate("1 !== true", %{}) # {:ok, true} - different types
32+
33+
# Operator distinction preserved
34+
Predicator.parse("x = y") |> elem(1) |> Predicator.decompile() # "x = y"
35+
Predicator.parse("x == y") |> elem(1) |> Predicator.decompile() # "x == y"
36+
Predicator.parse("x === y") |> elem(1) |> Predicator.decompile() # "x === y"
37+
```
38+
39+
#### Technical Implementation
40+
41+
- **Lexer**: Added `:strict_equal` and `:strict_ne` token types with proper precedence
42+
- **Parser**: Extended comparison grammar to support strict operators
43+
- **Evaluator**: Added `STRICT_EQ` and `STRICT_NE` instruction handlers
44+
- **StringVisitor**: Added decompilation support for round-trip accuracy
45+
- **Type Safety**: Works with all data types including `:undefined` values
46+
1047
## [3.1.0] - 2025-08-30
1148

1249
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Add `predicator` to your list of dependencies in `mix.exs`:
3232
```elixir
3333
def deps do
3434
[
35-
{:predicator, "~> 3.1"}
35+
{:predicator, "~> 3.2"}
3636
]
3737
end
3838
```

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Predicator.MixProject do
22
use Mix.Project
33

44
@app :predicator
5-
@version "3.1.0"
5+
@version "3.2.0"
66
@description "A secure, non-evaling condition (boolean predicate) engine for end users"
77
@source_url "https://github.com/riddler/predicator-ex"
88
@deps [

0 commit comments

Comments
 (0)