Skip to content

Commit e101394

Browse files
committed
Rename 'neq' to 'ne'.
This is what the design repo calls it, and it's convenient to have all the comparison operators be the same number of characters (ignoring the _s or _u).
1 parent 13c3f76 commit e101394

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

ml-proto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ var: <int> | $<name>
154154
155155
unop: ctz | clz | popcnt | ...
156156
binop: add | sub | mul | ...
157-
relop: eq | neq | lt | ...
157+
relop: eq | ne | lt | ...
158158
sign: s|u
159159
align: 1|2|4|8|...
160160
cvtop: trunc_s | trunc_u | extend_s | extend_u | ...

ml-proto/src/host/lexer.mll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ rule token = parse
192192
{ BINARY (floatop t Float32Op.CopySign Float64Op.CopySign) }
193193

194194
| (ixx as t)".eq" { COMPARE (intop t Int32Op.Eq Int64Op.Eq) }
195-
| (ixx as t)".neq" { COMPARE (intop t Int32Op.Neq Int64Op.Neq) }
195+
| (ixx as t)".ne" { COMPARE (intop t Int32Op.Ne Int64Op.Ne) }
196196
| (ixx as t)".lt_s" { COMPARE (intop t Int32Op.LtS Int64Op.LtS) }
197197
| (ixx as t)".lt_u" { COMPARE (intop t Int32Op.LtU Int64Op.LtU) }
198198
| (ixx as t)".le_s" { COMPARE (intop t Int32Op.LeS Int64Op.LeS) }
@@ -202,7 +202,7 @@ rule token = parse
202202
| (ixx as t)".ge_s" { COMPARE (intop t Int32Op.GeS Int64Op.GeS) }
203203
| (ixx as t)".ge_u" { COMPARE (intop t Int32Op.GeU Int64Op.GtU) }
204204
| (fxx as t)".eq" { COMPARE (floatop t Float32Op.Eq Float64Op.Eq) }
205-
| (fxx as t)".neq" { COMPARE (floatop t Float32Op.Neq Float64Op.Neq) }
205+
| (fxx as t)".ne" { COMPARE (floatop t Float32Op.Ne Float64Op.Ne) }
206206
| (fxx as t)".lt" { COMPARE (floatop t Float32Op.Lt Float64Op.Lt) }
207207
| (fxx as t)".le" { COMPARE (floatop t Float32Op.Le Float64Op.Le) }
208208
| (fxx as t)".gt" { COMPARE (floatop t Float32Op.Gt Float64Op.Gt) }

ml-proto/src/spec/arithmetic.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ struct
144144
let relop op =
145145
let f = match op with
146146
| Eq -> (=)
147-
| Neq -> (<>)
147+
| Ne -> (<>)
148148
| LtS -> (<)
149149
| LtU -> unsigned lt_big_int
150150
| LeS -> (<=)
@@ -214,7 +214,7 @@ struct
214214
let relop op =
215215
let f = match op with
216216
| Eq -> (=)
217-
| Neq -> (<>)
217+
| Ne -> (<>)
218218
| Lt -> (<)
219219
| Le -> (<=)
220220
| Gt -> (>)

ml-proto/src/spec/ast.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct
3737
type unop = Clz | Ctz | Popcnt
3838
type binop = Add | Sub | Mul | DivS | DivU | RemS | RemU
3939
| And | Or | Xor | Shl | ShrU | ShrS
40-
type relop = Eq | Neq | LtS | LtU | LeS | LeU | GtS | GtU | GeS | GeU
40+
type relop = Eq | Ne | LtS | LtU | LeS | LeU | GtS | GtU | GeS | GeU
4141
type cvt = ExtendSInt32 | ExtendUInt32 | WrapInt64
4242
| TruncSFloat32 | TruncUFloat32 | TruncSFloat64 | TruncUFloat64
4343
| ReinterpretFloat
@@ -47,7 +47,7 @@ module FloatOp () =
4747
struct
4848
type unop = Neg | Abs | Ceil | Floor | Trunc | Nearest | Sqrt
4949
type binop = Add | Sub | Mul | Div | CopySign | Min | Max
50-
type relop = Eq | Neq | Lt | Le | Gt | Ge
50+
type relop = Eq | Ne | Lt | Le | Gt | Ge
5151
type cvt = ConvertSInt32 | ConvertUInt32 | ConvertSInt64 | ConvertUInt64
5252
| PromoteFloat32 | DemoteFloat64
5353
| ReinterpretInt

ml-proto/test/memory.wasm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
(i32.store (get_local 2) (get_local 0))
9393
(set_local 1 (i32.load (get_local 2)))
9494
(if
95-
(i32.neq (get_local 0) (get_local 1))
95+
(i32.ne (get_local 0) (get_local 1))
9696
(return (i32.const 0))
9797
)
9898
(set_local 0 (i32.sub (get_local 0) (i32.const 1)))
@@ -115,7 +115,7 @@
115115
(f64.store/1 (get_local 0) (get_local 2))
116116
(set_local 1 (f64.load/1 (get_local 0)))
117117
(if
118-
(f64.neq (get_local 2) (get_local 1))
118+
(f64.ne (get_local 2) (get_local 1))
119119
(return (i32.const 0))
120120
)
121121
(set_local 0 (i32.sub (get_local 0) (i32.const 1)))

0 commit comments

Comments
 (0)