Skip to content

Commit

Permalink
fix lhs rhs cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger-luo committed Apr 30, 2021
1 parent a1f3f66 commit 68f4599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ end

function cmp_exp(lhs, rhs)
@switch (lhs, rhs) begin
@case (Neg(a::Token{:float64}), b::Token{:float64})
@case (Neg(a::Token{:float64}), b::Token{:float64}) || (b::Token{:float64}, Neg(a::Token{:float64}))
startswith(b.str, '-') && a.str == b.str[2:end]
@case _
cmp_ast(lhs, rhs)
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ using Test

@testset "cmp_exp" begin
@test cmp_exp(Neg(qasm_f64(0.2)), qasm_f64(-0.2))
@test cmp_exp(qasm_f64(-0.2), Neg(qasm_f64(0.2)))
end

@testset "conversion" begin
Expand Down

2 comments on commit 68f4599

@Roger-luo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Released via Ion CLI
@JuliaRegistrator register

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/35753

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.1.2 -m "<description of version>" 68f459908fb587267813029c94138d794d26940b
git push origin v2.1.2

Please sign in to comment.