Skip to content

Commit

Permalink
now block instructions can accept input
Browse files Browse the repository at this point in the history
  • Loading branch information
butterunderflow committed Oct 13, 2024
1 parent 24d3070 commit 7ad2fab
Show file tree
Hide file tree
Showing 6 changed files with 910 additions and 943 deletions.
7 changes: 4 additions & 3 deletions grammar/WatParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@ blockInstr
| IF bindVar? block (ELSE bindVar? instrList)? END bindVar?
;

// treat blockType as an alias to function type
blockType
: LPAR RESULT valType RPAR
: funcType
;

block
: blockType? instrList
: blockType instrList
;

foldedInstr
Expand All @@ -221,7 +222,7 @@ expr
| BLOCK bindVar? block
| LOOP bindVar? block
// | IF bindVar? ifBlock
| IF bindVar? blockType? foldedInstr* LPAR THEN instrList (LPAR ELSE instrList RPAR)?
| IF bindVar? blockType foldedInstr* LPAR THEN instrList (LPAR ELSE instrList RPAR)?
;

callExprType
Expand Down
Loading

0 comments on commit 7ad2fab

Please sign in to comment.