summaryrefslogtreecommitdiff
path: root/src/wast-parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r--src/wast-parser.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc
index bc021daa..75f03e73 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -172,6 +172,7 @@ bool IsPlainInstr(TokenType token_type) {
case TokenType::AtomicRmwCmpxchg:
case TokenType::AtomicWake:
case TokenType::AtomicWait:
+ case TokenType::Ternary:
return true;
default:
return false;
@@ -1490,6 +1491,13 @@ Result WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) {
break;
}
+ case TokenType::Ternary: {
+ Token token = Consume();
+ ErrorUnlessOpcodeEnabled(token);
+ out_expr->reset(new TernaryExpr(token.opcode(), loc));
+ break;
+ }
+
default:
assert(
!"ParsePlainInstr should only be called when IsPlainInstr() is true");