Skip to content

Commit

Permalink
Fix precedence of equality operators for custom operators (#238) (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
blitz-1306 authored Dec 6, 2023
1 parent c6d19ce commit d35f0de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/compile/inference/file_level_definitions.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ CustomizableOperator =
/ '%'
/ '=='
/ '!='
/ '<'
/ '<='
/ '>'
/ '>=';
/ '>='
/ '<'
/ '>';

UsingEntry =
name: (IdentifierPath) operator: (__ AS __ CustomizableOperator)? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ is /*3*/ int24/*;*/;`,
],
[
"using-for custamizable operators",
`using {op.RedLib.toScore, op.RedLib.exp, op.addRed as +, op.mulRed as *, op.unsubRed as -} for Red global;`,
`using {op.RedLib.toScore, op.RedLib.exp, op.addRed as +, op.mulRed as *, op.unsubRed as -, op.lteRed as <=, op.gteRed as >=} for Red global;`,
[
{
kind: "usingForDirective",
Expand All @@ -572,6 +572,14 @@ is /*3*/ int24/*;*/;`,
{
operator: "-",
name: "op.unsubRed"
},
{
operator: "<=",
name: "op.lteRed"
},
{
operator: ">=",
name: "op.gteRed"
}
]
}
Expand Down

0 comments on commit d35f0de

Please sign in to comment.