Skip to content

Commit b81d414

Browse files
fix select grammar (#98)
1 parent 557d749 commit b81d414

File tree

7 files changed

+2509
-2478
lines changed

7 files changed

+2509
-2478
lines changed

benchmarks/wasm/select.wat

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
(module
2+
(type (;0;) (func (param i32)))
3+
(type (;1;) (func))
4+
(import "console" "assert" (func (;0;) (type 0)))
5+
(func (;1;) (type 1)
6+
i32.const 11
7+
i32.const 22
8+
i32.const 1
9+
select
10+
i32.const 11
11+
i32.eq
12+
call 0
13+
i64.const 33
14+
i64.const 44
15+
i32.const 0
16+
select
17+
i64.const 44
18+
i64.eq
19+
call 0
20+
f32.const 0x1.6p+2 (;=5.5;)
21+
f32.const 0x1.ap+2 (;=6.5;)
22+
i32.const 1
23+
select
24+
f32.const 0x1.6p+2 (;=5.5;)
25+
f32.eq
26+
call 0
27+
f64.const 0x1.dp+2 (;=7.25;)
28+
f64.const 0x1.08p+3 (;=8.25;)
29+
i32.const 0
30+
select
31+
f64.const 0x1.08p+3 (;=8.25;)
32+
f64.eq
33+
call 0)
34+
(export "real_main" (func 1)))

grammar/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Download ANTLR from https://www.antlr.org/download.html
2-
ANTLR4 = antlr-4.12.0-complete.jar
2+
ANTLR4 = antlr-4.13.0-complete.jar
33

44
llvm:
55
java -jar $(ANTLR4) LLVMLexer.g4

grammar/WatLexer.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ RETURN: 'return' ;
7070
IF: 'if' ;
7171
THEN: 'then' ;
7272
ELSE: 'else' ;
73-
SELECT: '.select' ;
73+
SELECT: 'select' ;
7474
CALL: 'call' ;
7575
CALL_INDIRECT: 'call_indirect' ;
7676
RETURN_CALL: 'return_call' ;

grammar/WatParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ store
204204
;
205205

206206
selectInstr
207-
: numType SELECT
207+
: SELECT
208208
;
209209

210210
callIndirectInstr

src/main/java/wasm/WatLexer.java

Lines changed: 1259 additions & 1259 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)