forked from grain-lang/grain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compiler): Allow newline in or-patterns (grain-lang#1323)
- Loading branch information
Showing
3 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
compiler/test/__snapshots__/pattern_matching.e17bcd61.0.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
pattern matching › or_match_4 | ||
(module | ||
(type $none_=>_i32 (func (result i32))) | ||
(type $none_=>_none (func)) | ||
(import \"_grainEnv\" \"mem\" (memory $0 0)) | ||
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref)) | ||
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32)) | ||
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) | ||
(global $GRAIN$TABLE_SIZE i32 (i32.const 0)) | ||
(elem $elem (global.get $relocBase_0)) | ||
(export \"memory\" (memory $0)) | ||
(export \"_gmain\" (func $_gmain)) | ||
(export \"_start\" (func $_start)) | ||
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) | ||
(func $_gmain (result i32) | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(local $6 i32) | ||
(local $7 i32) | ||
(return | ||
(block $cleanup_locals.15 (result i32) | ||
(local.set $0 | ||
(block $compile_block.14 (result i32) | ||
(block $compile_store.2 | ||
(local.set $6 | ||
(i32.or | ||
(i32.shl | ||
(i32.eq | ||
(i32.const -2) | ||
(i32.const 2147483646) | ||
) | ||
(i32.const 31) | ||
) | ||
(i32.const 2147483646) | ||
) | ||
) | ||
(block $do_backpatches.1 | ||
) | ||
) | ||
(block $compile_store.10 | ||
(local.set $7 | ||
(if (result i32) | ||
(i32.shr_u | ||
(local.get $6) | ||
(i32.const 31) | ||
) | ||
(block $compile_block.3 (result i32) | ||
(i32.const 1) | ||
) | ||
(block $compile_block.8 (result i32) | ||
(block $compile_store.5 | ||
(local.set $7 | ||
(i32.or | ||
(i32.shl | ||
(i32.eq | ||
(i32.const -2) | ||
(i32.const -2) | ||
) | ||
(i32.const 31) | ||
) | ||
(i32.const 2147483646) | ||
) | ||
) | ||
(block $do_backpatches.4 | ||
) | ||
) | ||
(if (result i32) | ||
(i32.shr_u | ||
(local.get $7) | ||
(i32.const 31) | ||
) | ||
(block $compile_block.6 (result i32) | ||
(i32.const 1) | ||
) | ||
(block $compile_block.7 | ||
(unreachable) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(block $do_backpatches.9 | ||
) | ||
) | ||
(block $switch.11_outer (result i32) | ||
(block $switch.11_branch_0 (result i32) | ||
(drop | ||
(block $switch.11_branch_1 (result i32) | ||
(drop | ||
(block $switch.11_default (result i32) | ||
(br_table $switch.11_branch_1 $switch.11_default $switch.11_default | ||
(i32.const 0) | ||
(i32.shr_s | ||
(local.get $7) | ||
(i32.const 1) | ||
) | ||
) | ||
) | ||
) | ||
(br $switch.11_outer | ||
(block $compile_block.13 (result i32) | ||
(unreachable) | ||
) | ||
) | ||
) | ||
) | ||
(br $switch.11_outer | ||
(block $compile_block.12 (result i32) | ||
(i32.const 7) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(func $_start | ||
(drop | ||
(call $_gmain) | ||
) | ||
) | ||
;; custom section \"cmi\", size 242 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters