Skip to content

Commit

Permalink
also support triple equal signs
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoraes committed Dec 4, 2024
1 parent 257b16c commit d275db9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions JexlNet/Grammar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,18 @@ public class Grammar
return JsonNode.DeepEquals(a, b);
})
},
{
"===", new BinaryOperatorGrammar(20, (args) =>
{
if (args.Length != 2)
{
throw new Exception("Unsupported number of arguments for === operator");
}
var a = args[0];
var b = args[1];
return JsonNode.DeepEquals(a, b);
})
},
{
"!=", new BinaryOperatorGrammar(20, (args) =>
{
Expand All @@ -321,6 +333,18 @@ public class Grammar
return !JsonNode.DeepEquals(a, b);
})
},
{
"!==", new BinaryOperatorGrammar(20, (args) =>
{
if (args.Length != 2)
{
throw new Exception("Unsupported number of arguments for !== operator");
}
var a = args[0];
var b = args[1];
return !JsonNode.DeepEquals(a, b);
})
},
{
">", new BinaryOperatorGrammar(20, (args) =>
{
Expand Down

0 comments on commit d275db9

Please sign in to comment.