Skip to content

Commit ba89b2d

Browse files
committed
Change ~ function to use
Avoid overlap with bitwise NOT
1 parent 3a24612 commit ba89b2d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

test/desugaring.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_mod = Module(:TestMod)
1111
# end
1212
# (x, y)
1313
# end
14-
# """) ~ @ast_ [K"block"
14+
# """) @ast_ [K"block"
1515
# [K"block"
1616
# [K"="
1717
# "y"::K"Identifier"

test/quoting.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ begin
1111
end
1212
end
1313
""")
14-
@test ex ~ @ast_ [K"block"
14+
@test ex @ast_ [K"block"
1515
[K"call"
1616
"f"::K"Identifier"
1717
11::K"Value"
@@ -107,7 +107,7 @@ let
107107
end
108108
end
109109
""")
110-
@test ex ~ @ast_ [K"block"
110+
@test ex @ast_ [K"block"
111111
[K"="
112112
"x"::K"Identifier"
113113
1::K"Integer"

test/utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ macro ast_(tree)
4444
end
4545
end
4646

47-
function ~(ex1, ex2)
47+
function (ex1, ex2)
4848
if kind(ex1) != kind(ex2) || is_leaf(ex1) != is_leaf(ex2)
4949
return false
5050
end
5151
if is_leaf(ex1)
5252
if numchildren(ex1) != numchildren(ex2)
5353
return false
5454
end
55-
return all(c1 ~ c2 for (c1,c2) in zip(children(ex1), children(ex2)))
55+
return all(c1 c2 for (c1,c2) in zip(children(ex1), children(ex2)))
5656
else
5757
return get(ex1, :value, nothing) == get(ex2, :value, nothing) &&
5858
get(ex1, :name_val, nothing) == get(ex2, :name_val, nothing)
@@ -92,7 +92,7 @@ end
9292
format_as_ast_macro(ex)
9393
9494
Format AST `ex` as a Juila source code call to the `@ast_` macro for generating
95-
test case comparisons with the `~` function.
95+
test case comparisons with the `` function.
9696
"""
9797
format_as_ast_macro(ex) = format_as_ast_macro(stdout, ex)
9898

0 commit comments

Comments
 (0)