Skip to content

Commit

Permalink
Fixy
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-y committed Sep 24, 2024
1 parent 81e7cb3 commit 20f8bab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/parser/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export const infixOps: OpMap = new Map([
["::", 0],
[";", 4],
["??", 3],
["not", 0],
["and", 0],
["or", 0],
["xor", 0],
Expand Down
14 changes: 10 additions & 4 deletions std/operators.voyd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub def_wasm_operator('>', gt_s, i32, bool)
pub def_wasm_operator('<=', le_s, i32, bool)
pub def_wasm_operator('>=', ge_s, i32, bool)
pub def_wasm_operator('==', eq, i32, bool)
pub def_wasm_operator('!=', ne, i32, bool)
pub def_wasm_operator('and', 'and', i32, i32)
pub def_wasm_operator('or', 'or', i32, i32)
pub def_wasm_operator('xor', 'xor', i32, i32)
Expand All @@ -30,6 +31,7 @@ pub def_wasm_operator('>', gt_s, i64, bool)
pub def_wasm_operator('<=', le_s, i64, bool)
pub def_wasm_operator('>=', ge_s, i64, bool)
pub def_wasm_operator('==', eq, i64, bool)
pub def_wasm_operator('!=', ne, i64, bool)
pub def_wasm_operator('and', 'and', i64, i64)
pub def_wasm_operator('or', 'or', i64, i64)
pub def_wasm_operator('xor', 'xor', i64, i64)
Expand All @@ -47,7 +49,7 @@ pub def_wasm_operator('>', gt, f32, bool)
pub def_wasm_operator('<=', le, f32, bool)
pub def_wasm_operator('>=', ge, f32, bool)
pub def_wasm_operator('==', eq, f32, bool)
pub def_wasm_operator('not', ne, f32, bool)
pub def_wasm_operator('!=', ne, f32, bool)
pub def_wasm_operator('+', add, f32, f32)
pub def_wasm_operator('-', sub, f32, f32)
pub def_wasm_operator('*', mul, f32, f32)
Expand All @@ -67,7 +69,7 @@ pub def_wasm_operator('>', gt, f64, bool)
pub def_wasm_operator('<=', le, f64, bool)
pub def_wasm_operator('>=', ge, f64, bool)
pub def_wasm_operator('==', eq, f64, bool)
pub def_wasm_operator('not', ne, f64, bool)
pub def_wasm_operator('!=', ne, f64, bool)
pub def_wasm_operator('+', add, f64, f64)
pub def_wasm_operator('-', sub, f64, f64)
pub def_wasm_operator('*', mul, f64, f64)
Expand All @@ -92,7 +94,6 @@ pub def_wasm_operator(rotate_r, rotr, i32, i32)
pub def_wasm_operator(count_leading_zeros, clz, i32, i32)
pub def_wasm_operator(count_trailing_zeros, ctz, i32, i32)
pub def_wasm_operator(pop_count, popcnt, i32, i32)
pub def_wasm_operator(select, select, i32, i32)
pub def_wasm_operator(lt_u, lt_u, i32, bool)
pub def_wasm_operator(gt_u, gt_u, i32, bool)
pub def_wasm_operator(lte_u, le_u, i32, bool)
Expand All @@ -108,7 +109,6 @@ pub def_wasm_operator(rotate_r, rotr, i64, i64)
pub def_wasm_operator(count_leading_zeros, clz, i64, i64)
pub def_wasm_operator(count_trailing_zeros, ctz, i64, i64)
pub def_wasm_operator(pop_count, popcnt, i64, i64)
pub def_wasm_operator(select, select, i64, i64)
pub def_wasm_operator(lt_u, lt_u, i64, bool)
pub def_wasm_operator(gt_u, gt_u, i64, bool)
pub def_wasm_operator(lte_u, le_u, i64, bool)
Expand All @@ -131,3 +131,9 @@ pub fn 'or'(left: bool, right: bool) -> bool
func: 'or'
namespace: i32
args: [left, right]

pub fn not(value: bool) -> bool
binaryen
func: eqz
namespace: i32
args: [value]

0 comments on commit 20f8bab

Please sign in to comment.