summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/binary-reader-ir.cc11
-rw-r--r--src/binary-reader-logging.cc22
-rw-r--r--src/binary-reader-logging.h2
-rw-r--r--src/binary-reader-nop.h6
-rw-r--r--src/binary-reader.cc26
-rw-r--r--src/binary-reader.h11
-rw-r--r--src/binary-writer.cc12
-rw-r--r--src/lexer-keywords.txt1
-rw-r--r--src/prebuilt/lexer-keywords.cc2083
-rw-r--r--src/shared-validator.cc42
-rw-r--r--src/shared-validator.h22
-rw-r--r--src/token.def1
-rw-r--r--src/validator.cc8
-rw-r--r--src/wast-parser.cc37
-rw-r--r--src/wast-parser.h2
-rw-r--r--src/wat-writer.cc21
-rw-r--r--test/parse/module/struct-and-func.txt7
-rw-r--r--test/parse/module/struct-field-name.txt5
-rw-r--r--test/parse/module/struct-mut-field.txt3
-rw-r--r--test/parse/module/struct.txt2
20 files changed, 1255 insertions, 1069 deletions
diff --git a/src/binary-reader-ir.cc b/src/binary-reader-ir.cc
index f1e3d32b..c480aa2d 100644
--- a/src/binary-reader-ir.cc
+++ b/src/binary-reader-ir.cc
@@ -57,7 +57,7 @@ class BinaryReaderIR : public BinaryReaderNop {
Type* param_types,
Index result_count,
Type* result_types) override;
- Result OnStructType(Index index) override;
+ Result OnStructType(Index index, Index field_count, TypeMut* fields) override;
Result OnImportCount(Index count) override;
Result OnImportFunc(Index import_index,
@@ -406,9 +406,16 @@ Result BinaryReaderIR::OnFuncType(Index index,
return Result::Ok;
}
-Result BinaryReaderIR::OnStructType(Index index) {
+Result BinaryReaderIR::OnStructType(Index index,
+ Index field_count,
+ TypeMut* fields) {
auto field = MakeUnique<TypeModuleField>(GetLocation());
auto struct_type = MakeUnique<StructType>();
+ struct_type->fields.resize(field_count);
+ for (Index i = 0; i < field_count; ++i) {
+ struct_type->fields[i].type = fields[i].type;
+ struct_type->fields[i].mutable_ = fields[i].mutable_;
+ }
field->type = std::move(struct_type);
module_->AppendField(std::move(field));
return Result::Ok;
diff --git a/src/binary-reader-logging.cc b/src/binary-reader-logging.cc
index dfb535e3..1d1187a6 100644
--- a/src/binary-reader-logging.cc
+++ b/src/binary-reader-logging.cc
@@ -143,9 +143,25 @@ Result BinaryReaderLogging::OnFuncType(Index index,
result_types);
}
-Result BinaryReaderLogging::OnStructType(Index index) {
- LOGF("OnStructType(index: %" PRIindex ")\n", index);
- return reader_->OnStructType(index);
+Result BinaryReaderLogging::OnStructType(Index index,
+ Index field_count,
+ TypeMut* fields) {
+ LOGF("OnStructType(index: %" PRIindex ", fields: ", index);
+ LOGF_NOINDENT("[");
+ for (Index i = 0; i < field_count; ++i) {
+ if (fields[i].mutable_) {
+ LOGF_NOINDENT("(mut ");
+ }
+ LogType(fields[i].type);
+ if (fields[i].mutable_) {
+ LOGF_NOINDENT(")");
+ }
+ if (i != field_count - 1) {
+ LOGF_NOINDENT(", ");
+ }
+ }
+ LOGF_NOINDENT("])\n");
+ return reader_->OnStructType(index, field_count, fields);
}
Result BinaryReaderLogging::OnImport(Index index,
diff --git a/src/binary-reader-logging.h b/src/binary-reader-logging.h
index 214d8bae..d92fa97e 100644
--- a/src/binary-reader-logging.h
+++ b/src/binary-reader-logging.h
@@ -47,7 +47,7 @@ class BinaryReaderLogging : public BinaryReaderDelegate {
Type* param_types,
Index result_count,
Type* result_types) override;
- Result OnStructType(Index index) override;
+ Result OnStructType(Index index, Index field_count, TypeMut* fields) override;
Result EndTypeSection() override;
Result BeginImportSection(Offset size) override;
diff --git a/src/binary-reader-nop.h b/src/binary-reader-nop.h
index e9b1eb22..8e4bb84e 100644
--- a/src/binary-reader-nop.h
+++ b/src/binary-reader-nop.h
@@ -51,7 +51,11 @@ class BinaryReaderNop : public BinaryReaderDelegate {
Type* result_types) override {
return Result::Ok;
}
- Result OnStructType(Index index) override { return Result::Ok; }
+ Result OnStructType(Index index,
+ Index field_count,
+ TypeMut* fields) override {
+ return Result::Ok;
+ }
Result EndTypeSection() override { return Result::Ok; }
/* Import section */
diff --git a/src/binary-reader.cc b/src/binary-reader.cc
index 3eabc698..73667a4e 100644
--- a/src/binary-reader.cc
+++ b/src/binary-reader.cc
@@ -149,6 +149,7 @@ class BinaryReader {
BinaryReaderDelegate* delegate_ = nullptr;
TypeVector param_types_;
TypeVector result_types_;
+ TypeMutVector fields_;
std::vector<Index> target_depths_;
const ReadBinaryOptions& options_;
BinarySection last_known_section_ = BinarySection::Invalid;
@@ -1935,12 +1936,31 @@ Result BinaryReader::ReadTypeSection(Offset section_size) {
break;
}
- case Type::Struct:
- // TODO
+ case Type::Struct: {
ERROR_UNLESS(options_.features.gc_enabled(),
"invalid type form: struct not allowed");
- CALLBACK(OnStructType, i);
+ Index num_fields;
+ CHECK_RESULT(ReadCount(&num_fields, "field count"));
+
+ fields_.resize(num_fields);
+ for (Index j = 0; j < num_fields; ++j) {
+ Type field_type;
+ CHECK_RESULT(ReadType(&field_type, "field type"));
+ ERROR_UNLESS(IsConcreteType(field_type),
+ "expected valid field type (got " PRItypecode ")",
+ WABT_PRINTF_TYPE_CODE(field_type));
+
+ uint8_t mutable_ = 0;
+ CHECK_RESULT(ReadU8(&mutable_, "field mutability"));
+ ERROR_UNLESS(mutable_ <= 1, "field mutability must be 0 or 1");
+
+ fields_[j].type = field_type;
+ fields_[j].mutable_ = mutable_;
+ }
+
+ CALLBACK(OnStructType, i, fields_.size(), fields_.data());
break;
+ }
default:
PrintError("unexpected type form (got " PRItypecode ")",
diff --git a/src/binary-reader.h b/src/binary-reader.h
index 23c25827..ce1ef4e7 100644
--- a/src/binary-reader.h
+++ b/src/binary-reader.h
@@ -51,6 +51,13 @@ struct ReadBinaryOptions {
bool fail_on_custom_section_error = true;
};
+// TODO: Move somewhere else?
+struct TypeMut {
+ Type type;
+ bool mutable_;
+};
+using TypeMutVector = std::vector<TypeMut>;
+
class BinaryReaderDelegate {
public:
struct State {
@@ -87,7 +94,9 @@ class BinaryReaderDelegate {
Type* param_types,
Index result_count,
Type* result_types) = 0;
- virtual Result OnStructType(Index index) = 0; // TODO
+ virtual Result OnStructType(Index index,
+ Index field_count,
+ TypeMut* fields) = 0;
virtual Result EndTypeSection() = 0;
/* Import section */
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index 3f45863a..405d8343 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -902,11 +902,19 @@ Result BinaryWriter::WriteModule() {
break;
}
- case TypeEntryKind::Struct:
+ case TypeEntryKind::Struct: {
+ const StructType* struct_type = cast<StructType>(type);
WriteHeader("struct type", i);
WriteType(stream_, Type::Struct);
- // TODO
+ Index num_fields = struct_type->fields.size();
+ WriteU32Leb128(stream_, num_fields, "num fields");
+ for (size_t j = 0; j < num_fields; ++j) {
+ const Field& field = struct_type->fields[j];
+ WriteType(stream_, field.type);
+ stream_->WriteU8(field.mutable_, "field mutability");
+ }
break;
+ }
}
}
EndSection();
diff --git a/src/lexer-keywords.txt b/src/lexer-keywords.txt
index 237888d5..1749f926 100644
--- a/src/lexer-keywords.txt
+++ b/src/lexer-keywords.txt
@@ -143,6 +143,7 @@ f64x2.splat, TokenType::Unary, Opcode::F64X2Splat
f64x2.sqrt, TokenType::Unary, Opcode::F64X2Sqrt
f64x2.sub, TokenType::Binary, Opcode::F64X2Sub
f64x2, TokenType::F64X2
+field, TokenType::Field
funcref, Type::Funcref
func, TokenType::Func
get, TokenType::Get
diff --git a/src/prebuilt/lexer-keywords.cc b/src/prebuilt/lexer-keywords.cc
index d2427ea9..dd8f74ce 100644
--- a/src/prebuilt/lexer-keywords.cc
+++ b/src/prebuilt/lexer-keywords.cc
@@ -46,7 +46,7 @@ struct TokenInfo {
Opcode opcode;
};
};
-/* maximum key range = 2098, duplicates = 0 */
+/* maximum key range = 2016, duplicates = 0 */
class Perfect_Hash
{
@@ -61,32 +61,32 @@ Perfect_Hash::hash (const char *str, size_t len)
{
static unsigned short asso_values[] =
{
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 16, 87, 2101, 13,
- 1, 135, 0, 381, 146, 217, 59, 531, 32, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 6, 3, 43, 30, 102,
- 17, 7, 0, 369, 631, 5, 15, 0, 21, 6,
- 6, 65, 439, 306, 36, 1, 1, 3, 99, 7,
- 508, 484, 117, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101, 2101,
- 2101, 2101, 2101, 2101, 2101, 2101, 2101
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 31, 114, 2019, 25,
+ 1, 69, 0, 404, 76, 138, 100, 648, 69, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 6, 7, 52, 30, 106,
+ 25, 7, 0, 377, 535, 5, 6, 11, 21, 6,
+ 6, 53, 444, 430, 71, 1, 1, 3, 146, 2,
+ 460, 574, 81, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2019, 2019, 2019, 2019, 2019
};
unsigned int hval = len;
@@ -150,11 +150,11 @@ Perfect_Hash::InWordSet (const char *str, size_t len)
{
enum
{
- TOTAL_KEYWORDS = 536,
+ TOTAL_KEYWORDS = 537,
MIN_WORD_LENGTH = 2,
MAX_WORD_LENGTH = 26,
MIN_HASH_VALUE = 3,
- MAX_HASH_VALUE = 2100
+ MAX_HASH_VALUE = 2018
};
static struct TokenInfo wordlist[] =
@@ -166,14 +166,14 @@ Perfect_Hash::InWordSet (const char *str, size_t len)
#line 75 "src/lexer-keywords.txt"
{"f32", Type::F32},
{""},
-#line 448 "src/lexer-keywords.txt"
+#line 449 "src/lexer-keywords.txt"
{"if", TokenType::If, Opcode::If},
-#line 399 "src/lexer-keywords.txt"
+#line 400 "src/lexer-keywords.txt"
{"i64", Type::I64},
{""},
-#line 270 "src/lexer-keywords.txt"
+#line 271 "src/lexer-keywords.txt"
{"i32", Type::I32},
-#line 464 "src/lexer-keywords.txt"
+#line 465 "src/lexer-keywords.txt"
{"mut", TokenType::Mut},
{""}, {""},
#line 113 "src/lexer-keywords.txt"
@@ -181,14 +181,14 @@ Perfect_Hash::InWordSet (const char *str, size_t len)
#line 63 "src/lexer-keywords.txt"
{"f32.lt", TokenType::Compare, Opcode::F32Lt},
{""}, {""},
-#line 494 "src/lexer-keywords.txt"
+#line 495 "src/lexer-keywords.txt"
{"then", TokenType::Then},
#line 42 "src/lexer-keywords.txt"
{"else", TokenType::Else, Opcode::Else},
{""},
-#line 146 "src/lexer-keywords.txt"
+#line 147 "src/lexer-keywords.txt"
{"funcref", Type::Funcref},
-#line 451 "src/lexer-keywords.txt"
+#line 452 "src/lexer-keywords.txt"
{"item", TokenType::Item},
#line 44 "src/lexer-keywords.txt"
{"event", TokenType::Event},
@@ -199,74 +199,62 @@ Perfect_Hash::InWordSet (const char *str, size_t len)
{"f64.le", TokenType::Compare, Opcode::F64Le},
#line 61 "src/lexer-keywords.txt"
{"f32.le", TokenType::Compare, Opcode::F32Le},
-#line 372 "src/lexer-keywords.txt"
+#line 373 "src/lexer-keywords.txt"
{"i64.lt_s", TokenType::Compare, Opcode::I64LtS},
-#line 244 "src/lexer-keywords.txt"
+#line 245 "src/lexer-keywords.txt"
{"i32.lt_s", TokenType::Compare, Opcode::I32LtS},
#line 115 "src/lexer-keywords.txt"
{"f64.min", TokenType::Binary, Opcode::F64Min},
#line 65 "src/lexer-keywords.txt"
{"f32.min", TokenType::Binary, Opcode::F32Min},
-#line 373 "src/lexer-keywords.txt"
+#line 374 "src/lexer-keywords.txt"
{"i64.lt_u", TokenType::Compare, Opcode::I64LtU},
-#line 245 "src/lexer-keywords.txt"
+#line 246 "src/lexer-keywords.txt"
{"i32.lt_u", TokenType::Compare, Opcode::I32LtU},
-#line 363 "src/lexer-keywords.txt"
+#line 364 "src/lexer-keywords.txt"
{"i64.le_s", TokenType::Compare, Opcode::I64LeS},
-#line 237 "src/lexer-keywords.txt"
+#line 238 "src/lexer-keywords.txt"
{"i32.le_s", TokenType::Compare, Opcode::I32LeS},
-#line 379 "src/lexer-keywords.txt"
+#line 380 "src/lexer-keywords.txt"
{"i64.rem_s", TokenType::Binary, Opcode::I64RemS},
-#line 251 "src/lexer-keywords.txt"
+#line 252 "src/lexer-keywords.txt"
{"i32.rem_s", TokenType::Binary, Opcode::I32RemS},
-#line 364 "src/lexer-keywords.txt"
+#line 365 "src/lexer-keywords.txt"
{"i64.le_u", TokenType::Compare, Opcode::I64LeU},
-#line 238 "src/lexer-keywords.txt"
+#line 239 "src/lexer-keywords.txt"
{"i32.le_u", TokenType::Compare, Opcode::I32LeU},
-#line 380 "src/lexer-keywords.txt"
+#line 381 "src/lexer-keywords.txt"
{"i64.rem_u", TokenType::Binary, Opcode::I64RemU},
-#line 252 "src/lexer-keywords.txt"
+#line 253 "src/lexer-keywords.txt"
{"i32.rem_u", TokenType::Binary, Opcode::I32RemU},
-#line 468 "src/lexer-keywords.txt"
+#line 469 "src/lexer-keywords.txt"
{"nullref", Type::Nullref},
-#line 493 "src/lexer-keywords.txt"
+#line 494 "src/lexer-keywords.txt"
{"table", TokenType::Table},
-#line 43 "src/lexer-keywords.txt"
- {"end", TokenType::End, Opcode::End},
- {""}, {""},
-#line 482 "src/lexer-keywords.txt"
+#line 146 "src/lexer-keywords.txt"
+ {"field", TokenType::Field},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""},
+#line 483 "src/lexer-keywords.txt"
{"select", TokenType::Select, Opcode::Select},
{""},
-#line 463 "src/lexer-keywords.txt"
+#line 464 "src/lexer-keywords.txt"
{"module", TokenType::Module},
- {""},
-#line 477 "src/lexer-keywords.txt"
- {"result", TokenType::Result},
- {""},
-#line 484 "src/lexer-keywords.txt"
- {"start", TokenType::Start},
- {""}, {""},
-#line 481 "src/lexer-keywords.txt"
- {"return", TokenType::Return, Opcode::Return},
- {""},
#line 116 "src/lexer-keywords.txt"
{"f64.mul", TokenType::Binary, Opcode::F64Mul},
#line 66 "src/lexer-keywords.txt"
{"f32.mul", TokenType::Binary, Opcode::F32Mul},
- {""}, {""},
+#line 43 "src/lexer-keywords.txt"
+ {"end", TokenType::End, Opcode::End},
+#line 470 "src/lexer-keywords.txt"
+ {"offset", TokenType::Offset},
#line 485 "src/lexer-keywords.txt"
- {"struct", TokenType::Struct},
-#line 374 "src/lexer-keywords.txt"
+ {"start", TokenType::Start},
+#line 375 "src/lexer-keywords.txt"
{"i64.mul", TokenType::Binary, Opcode::I64Mul},
-#line 246 "src/lexer-keywords.txt"
+#line 247 "src/lexer-keywords.txt"
{"i32.mul", TokenType::Binary, Opcode::I32Mul},
-#line 37 "src/lexer-keywords.txt"
- {"data", TokenType::Data},
-#line 491 "src/lexer-keywords.txt"
- {"table.set", TokenType::TableSet, Opcode::TableSet},
- {""},
-#line 31 "src/lexer-keywords.txt"
- {"br", TokenType::Br, Opcode::Br},
+ {""}, {""}, {""}, {""},
#line 97 "src/lexer-keywords.txt"
{"f64.abs", TokenType::Unary, Opcode::F64Abs},
#line 46 "src/lexer-keywords.txt"
@@ -275,1272 +263,1283 @@ Perfect_Hash::InWordSet (const char *str, size_t len)
{"f64.sub", TokenType::Binary, Opcode::F64Sub},
#line 73 "src/lexer-keywords.txt"
{"f32.sub", TokenType::Binary, Opcode::F32Sub},
-#line 469 "src/lexer-keywords.txt"
- {"offset", TokenType::Offset},
-#line 490 "src/lexer-keywords.txt"
- {"table.init", TokenType::TableInit, Opcode::TableInit},
- {""},
-#line 390 "src/lexer-keywords.txt"
+#line 119 "src/lexer-keywords.txt"
+ {"f64.ne", TokenType::Compare, Opcode::F64Ne},
+#line 69 "src/lexer-keywords.txt"
+ {"f32.ne", TokenType::Compare, Opcode::F32Ne},
+#line 145 "src/lexer-keywords.txt"
+ {"f64x2", TokenType::F64X2},
+#line 391 "src/lexer-keywords.txt"
{"i64.sub", TokenType::Binary, Opcode::I64Sub},
-#line 261 "src/lexer-keywords.txt"
+#line 262 "src/lexer-keywords.txt"
{"i32.sub", TokenType::Binary, Opcode::I32Sub},
- {""},
+#line 376 "src/lexer-keywords.txt"
+ {"i64.ne", TokenType::Compare, Opcode::I64Ne},
+#line 248 "src/lexer-keywords.txt"
+ {"i32.ne", TokenType::Compare, Opcode::I32Ne},
+#line 413 "src/lexer-keywords.txt"
+ {"i64x2", TokenType::I64X2},
+#line 492 "src/lexer-keywords.txt"
+ {"table.set", TokenType::TableSet, Opcode::TableSet},
+#line 37 "src/lexer-keywords.txt"
+ {"data", TokenType::Data},
+ {""}, {""}, {""},
+#line 478 "src/lexer-keywords.txt"
+ {"result", TokenType::Result},
#line 99 "src/lexer-keywords.txt"
{"f64.ceil", TokenType::Unary, Opcode::F64Ceil},
#line 48 "src/lexer-keywords.txt"
{"f32.ceil", TokenType::Unary, Opcode::F32Ceil},
+#line 491 "src/lexer-keywords.txt"
+ {"table.init", TokenType::TableInit, Opcode::TableInit},
{""},
-#line 309 "src/lexer-keywords.txt"
+#line 482 "src/lexer-keywords.txt"
+ {"return", TokenType::Return, Opcode::Return},
+ {""}, {""}, {""}, {""},
+#line 100 "src/lexer-keywords.txt"
+ {"f64.const", TokenType::Const, Opcode::F64Const},
+#line 49 "src/lexer-keywords.txt"
+ {"f32.const", TokenType::Const, Opcode::F32Const},
+#line 310 "src/lexer-keywords.txt"
{"i64.and", TokenType::Binary, Opcode::I64And},
-#line 195 "src/lexer-keywords.txt"
+#line 196 "src/lexer-keywords.txt"
{"i32.and", TokenType::Binary, Opcode::I32And},
-#line 483 "src/lexer-keywords.txt"
- {"shared", TokenType::Shared},
-#line 119 "src/lexer-keywords.txt"
- {"f64.ne", TokenType::Compare, Opcode::F64Ne},
-#line 69 "src/lexer-keywords.txt"
- {"f32.ne", TokenType::Compare, Opcode::F32Ne},
{""},
+#line 349 "src/lexer-keywords.txt"
+ {"i64.const", TokenType::Const, Opcode::I64Const},
+#line 226 "src/lexer-keywords.txt"
+ {"i32.const", TokenType::Const, Opcode::I32Const},
+#line 31 "src/lexer-keywords.txt"
+ {"br", TokenType::Br, Opcode::Br},
+ {""},
+#line 486 "src/lexer-keywords.txt"
+ {"struct", TokenType::Struct},
+ {""}, {""}, {""},
+#line 484 "src/lexer-keywords.txt"
+ {"shared", TokenType::Shared},
+#line 382 "src/lexer-keywords.txt"
+ {"i64.rotl", TokenType::Binary, Opcode::I64Rotl},
+#line 254 "src/lexer-keywords.txt"
+ {"i32.rotl", TokenType::Binary, Opcode::I32Rotl},
#line 98 "src/lexer-keywords.txt"
{"f64.add", TokenType::Binary, Opcode::F64Add},
#line 47 "src/lexer-keywords.txt"
{"f32.add", TokenType::Binary, Opcode::F32Add},
-#line 375 "src/lexer-keywords.txt"
- {"i64.ne", TokenType::Compare, Opcode::I64Ne},
-#line 247 "src/lexer-keywords.txt"
- {"i32.ne", TokenType::Compare, Opcode::I32Ne},
- {""},
-#line 308 "src/lexer-keywords.txt"
+ {""}, {""},
+#line 148 "src/lexer-keywords.txt"
+ {"func", TokenType::Func},
+#line 309 "src/lexer-keywords.txt"
{"i64.add", TokenType::Binary, Opcode::I64Add},
-#line 194 "src/lexer-keywords.txt"
+#line 195 "src/lexer-keywords.txt"
{"i32.add", TokenType::Binary, Opcode::I32Add},
- {""}, {""}, {""}, {""}, {""},
-#line 100 "src/lexer-keywords.txt"
- {"f64.const", TokenType::Const, Opcode::F64Const},
-#line 49 "src/lexer-keywords.txt"
- {"f32.const", TokenType::Const, Opcode::F32Const},
- {""}, {""},
-#line 487 "src/lexer-keywords.txt"
+#line 488 "src/lexer-keywords.txt"
{"table.fill", TokenType::TableFill, Opcode::TableFill},
-#line 348 "src/lexer-keywords.txt"
- {"i64.const", TokenType::Const, Opcode::I64Const},
-#line 225 "src/lexer-keywords.txt"
- {"i32.const", TokenType::Const, Opcode::I32Const},
- {""}, {""}, {""}, {""}, {""},
-#line 147 "src/lexer-keywords.txt"
- {"func", TokenType::Func},
- {""}, {""}, {""}, {""},
-#line 473 "src/lexer-keywords.txt"
- {"ref.host", TokenType::RefHost},
- {""}, {""},
-#line 474 "src/lexer-keywords.txt"
- {"ref.is_null", TokenType::RefIsNull, Opcode::RefIsNull},
#line 27 "src/lexer-keywords.txt"
{"block", TokenType::Block, Opcode::Block},
-#line 381 "src/lexer-keywords.txt"
- {"i64.rotl", TokenType::Binary, Opcode::I64Rotl},
-#line 253 "src/lexer-keywords.txt"
- {"i32.rotl", TokenType::Binary, Opcode::I32Rotl},
-#line 478 "src/lexer-keywords.txt"
+ {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 140 "src/lexer-keywords.txt"
+ {"f64x2.ne", TokenType::Compare, Opcode::F64X2Ne},
+ {""}, {""},
+#line 135 "src/lexer-keywords.txt"
+ {"f64x2.lt", TokenType::Compare, Opcode::F64X2Lt},
+#line 137 "src/lexer-keywords.txt"
+ {"f64x2.min", TokenType::Binary, Opcode::F64X2Min},
+ {""}, {""}, {""}, {""},
+#line 479 "src/lexer-keywords.txt"
{"rethrow", TokenType::Rethrow, Opcode::Rethrow},
{""},
+#line 30 "src/lexer-keywords.txt"
+ {"br_table", TokenType::BrTable, Opcode::BrTable},
+#line 474 "src/lexer-keywords.txt"
+ {"ref.host", TokenType::RefHost},
+ {""}, {""},
+#line 134 "src/lexer-keywords.txt"
+ {"f64x2.le", TokenType::Compare, Opcode::F64X2Le},
+ {""}, {""},
+#line 475 "src/lexer-keywords.txt"
+ {"ref.is_null", TokenType::RefIsNull, Opcode::RefIsNull},
+ {""}, {""},
#line 123 "src/lexer-keywords.txt"
{"f64.store", TokenType::Store, Opcode::F64Store},
#line 72 "src/lexer-keywords.txt"
{"f32.store", TokenType::Store, Opcode::F32Store},
-#line 387 "src/lexer-keywords.txt"
+#line 388 "src/lexer-keywords.txt"
{"i64.store32", TokenType::Store, Opcode::I64Store32},
- {""}, {""},
-#line 389 "src/lexer-keywords.txt"
- {"i64.store", TokenType::Store, Opcode::I64Store},
-#line 260 "src/lexer-keywords.txt"
- {"i32.store", TokenType::Store, Opcode::I32Store},
-#line 350 "src/lexer-keywords.txt"
- {"i64.div_s", TokenType::Binary, Opcode::I64DivS},
-#line 227 "src/lexer-keywords.txt"
- {"i32.div_s", TokenType::Binary, Opcode::I32DivS},
- {""}, {""},
-#line 351 "src/lexer-keywords.txt"
- {"i64.div_u", TokenType::Binary, Opcode::I64DivU},
-#line 228 "src/lexer-keywords.txt"
- {"i32.div_u", TokenType::Binary, Opcode::I32DivU},
-#line 30 "src/lexer-keywords.txt"
- {"br_table", TokenType::BrTable, Opcode::BrTable},
- {""},
-#line 145 "src/lexer-keywords.txt"
- {"f64x2", TokenType::F64X2},
- {""}, {""}, {""},
-#line 450 "src/lexer-keywords.txt"
- {"invoke", TokenType::Invoke},
-#line 412 "src/lexer-keywords.txt"
- {"i64x2", TokenType::I64X2},
- {""},
#line 33 "src/lexer-keywords.txt"
{"call", TokenType::Call, Opcode::Call},
- {""}, {""}, {""},
-#line 382 "src/lexer-keywords.txt"
- {"i64.rotr", TokenType::Binary, Opcode::I64Rotr},
-#line 254 "src/lexer-keywords.txt"
- {"i32.rotr", TokenType::Binary, Opcode::I32Rotr},
{""},
-#line 455 "src/lexer-keywords.txt"
+#line 390 "src/lexer-keywords.txt"
+ {"i64.store", TokenType::Store, Opcode::I64Store},
+#line 261 "src/lexer-keywords.txt"
+ {"i32.store", TokenType::Store, Opcode::I32Store},
+ {""}, {""}, {""},
+#line 456 "src/lexer-keywords.txt"
{"local", TokenType::Local},
+#line 138 "src/lexer-keywords.txt"
+ {"f64x2.mul", TokenType::Binary, Opcode::F64X2Mul},
+ {""}, {""}, {""}, {""},
+#line 405 "src/lexer-keywords.txt"
+ {"i64x2.mul", TokenType::Binary, Opcode::I64X2Mul},
+#line 493 "src/lexer-keywords.txt"
+ {"table.size", TokenType::TableSize, Opcode::TableSize},
+ {""}, {""},
#line 112 "src/lexer-keywords.txt"
{"f64.load", TokenType::Load, Opcode::F64Load},
#line 62 "src/lexer-keywords.txt"
{"f32.load", TokenType::Load, Opcode::F32Load},
+#line 55 "src/lexer-keywords.txt"
+ {"f32.demote_f64", TokenType::Convert, Opcode::F32DemoteF64},
{""},
-#line 22 "src/lexer-keywords.txt"
- {"assert_return", TokenType::AssertReturn},
-#line 24 "src/lexer-keywords.txt"
- {"assert_unlinkable", TokenType::AssertUnlinkable},
-#line 371 "src/lexer-keywords.txt"
+#line 144 "src/lexer-keywords.txt"
+ {"f64x2.sub", TokenType::Binary, Opcode::F64X2Sub},
+#line 372 "src/lexer-keywords.txt"
{"i64.load", TokenType::Load, Opcode::I64Load},
-#line 243 "src/lexer-keywords.txt"
+#line 244 "src/lexer-keywords.txt"
{"i32.load", TokenType::Load, Opcode::I32Load},
-#line 507 "src/lexer-keywords.txt"
- {"v128", Type::V128},
-#line 453 "src/lexer-keywords.txt"
+ {""}, {""},
+#line 412 "src/lexer-keywords.txt"
+ {"i64x2.sub", TokenType::Binary, Opcode::I64X2Sub},
+ {""},
+#line 351 "src/lexer-keywords.txt"
+ {"i64.div_s", TokenType::Binary, Opcode::I64DivS},
+#line 228 "src/lexer-keywords.txt"
+ {"i32.div_s", TokenType::Binary, Opcode::I32DivS},
+ {""},
+#line 454 "src/lexer-keywords.txt"
{"local.set", TokenType::LocalSet, Opcode::LocalSet},
- {""}, {""}, {""}, {""},
-#line 365 "src/lexer-keywords.txt"
+#line 352 "src/lexer-keywords.txt"
+ {"i64.div_u", TokenType::Binary, Opcode::I64DivU},
+#line 229 "src/lexer-keywords.txt"
+ {"i32.div_u", TokenType::Binary, Opcode::I32DivU},
+#line 366 "src/lexer-keywords.txt"
{"i64.load16_s", TokenType::Load, Opcode::I64Load16S},
-#line 239 "src/lexer-keywords.txt"
+#line 240 "src/lexer-keywords.txt"
{"i32.load16_s", TokenType::Load, Opcode::I32Load16S},
-#line 117 "src/lexer-keywords.txt"
- {"f64.nearest", TokenType::Unary, Opcode::F64Nearest},
-#line 67 "src/lexer-keywords.txt"
- {"f32.nearest", TokenType::Unary, Opcode::F32Nearest},
-#line 366 "src/lexer-keywords.txt"
+ {""},
+#line 24 "src/lexer-keywords.txt"
+ {"assert_unlinkable", TokenType::AssertUnlinkable},
+#line 367 "src/lexer-keywords.txt"
{"i64.load16_u", TokenType::Load, Opcode::I64Load16U},
-#line 240 "src/lexer-keywords.txt"
+#line 241 "src/lexer-keywords.txt"
{"i32.load16_u", TokenType::Load, Opcode::I32Load16U},
-#line 475 "src/lexer-keywords.txt"
- {"ref.null", TokenType::RefNull, Opcode::RefNull},
-#line 454 "src/lexer-keywords.txt"
+#line 451 "src/lexer-keywords.txt"
+ {"invoke", TokenType::Invoke},
+#line 127 "src/lexer-keywords.txt"
+ {"f64x2.abs", TokenType::Unary, Opcode::F64X2Abs},
+ {""},
+#line 455 "src/lexer-keywords.txt"
{"local.tee", TokenType::LocalTee, Opcode::LocalTee},
{""}, {""},
-#line 140 "src/lexer-keywords.txt"
- {"f64x2.ne", TokenType::Compare, Opcode::F64X2Ne},
-#line 20 "src/lexer-keywords.txt"
- {"assert_invalid", TokenType::AssertInvalid},
+#line 476 "src/lexer-keywords.txt"
+ {"ref.null", TokenType::RefNull, Opcode::RefNull},
{""},
-#line 135 "src/lexer-keywords.txt"
- {"f64x2.lt", TokenType::Compare, Opcode::F64X2Lt},
-#line 137 "src/lexer-keywords.txt"
- {"f64x2.min", TokenType::Binary, Opcode::F64X2Min},
-#line 388 "src/lexer-keywords.txt"
- {"i64.store8", TokenType::Store, Opcode::I64Store8},
-#line 259 "src/lexer-keywords.txt"
- {"i32.store8", TokenType::Store, Opcode::I32Store8},
+#line 350 "src/lexer-keywords.txt"
+ {"i64.ctz", TokenType::Unary, Opcode::I64Ctz},
+#line 227 "src/lexer-keywords.txt"
+ {"i32.ctz", TokenType::Unary, Opcode::I32Ctz},
{""},
-#line 492 "src/lexer-keywords.txt"
- {"table.size", TokenType::TableSize, Opcode::TableSize},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 134 "src/lexer-keywords.txt"
- {"f64x2.le", TokenType::Compare, Opcode::F64X2Le},
- {""}, {""}, {""}, {""},
-#line 346 "src/lexer-keywords.txt"
+#line 117 "src/lexer-keywords.txt"
+ {"f64.nearest", TokenType::Unary, Opcode::F64Nearest},
+#line 67 "src/lexer-keywords.txt"
+ {"f32.nearest", TokenType::Unary, Opcode::F32Nearest},
+ {""},
+#line 347 "src/lexer-keywords.txt"
{"i64.atomic.wait", TokenType::AtomicWait, Opcode::I64AtomicWait},
-#line 223 "src/lexer-keywords.txt"
+#line 224 "src/lexer-keywords.txt"
{"i32.atomic.wait", TokenType::AtomicWait, Opcode::I32AtomicWait},
- {""}, {""}, {""}, {""}, {""},
-#line 38 "src/lexer-keywords.txt"
- {"declare", TokenType::Declare},
- {""},
-#line 369 "src/lexer-keywords.txt"
- {"i64.load8_s", TokenType::Load, Opcode::I64Load8S},
-#line 241 "src/lexer-keywords.txt"
- {"i32.load8_s", TokenType::Load, Opcode::I32Load8S},
- {""},
-#line 138 "src/lexer-keywords.txt"
- {"f64x2.mul", TokenType::Binary, Opcode::F64X2Mul},
-#line 370 "src/lexer-keywords.txt"
- {"i64.load8_u", TokenType::Load, Opcode::I64Load8U},
-#line 242 "src/lexer-keywords.txt"
- {"i32.load8_u", TokenType::Load, Opcode::I32Load8U},
{""}, {""},
-#line 404 "src/lexer-keywords.txt"
- {"i64x2.mul", TokenType::Binary, Opcode::I64X2Mul},
-#line 106 "src/lexer-keywords.txt"
- {"f64.div", TokenType::Binary, Opcode::F64Div},
-#line 56 "src/lexer-keywords.txt"
- {"f32.div", TokenType::Binary, Opcode::F32Div},
- {""}, {""}, {""},
-#line 343 "src/lexer-keywords.txt"
+#line 383 "src/lexer-keywords.txt"
+ {"i64.rotr", TokenType::Binary, Opcode::I64Rotr},
+#line 255 "src/lexer-keywords.txt"
+ {"i32.rotr", TokenType::Binary, Opcode::I32Rotr},
+ {""},
+#line 344 "src/lexer-keywords.txt"
{"i64.atomic.store32", TokenType::AtomicStore, Opcode::I64AtomicStore32},
+#line 20 "src/lexer-keywords.txt"
+ {"assert_invalid", TokenType::AssertInvalid},
{""},
-#line 144 "src/lexer-keywords.txt"
- {"f64x2.sub", TokenType::Binary, Opcode::F64X2Sub},
-#line 345 "src/lexer-keywords.txt"
+#line 346 "src/lexer-keywords.txt"
{"i64.atomic.store", TokenType::AtomicStore, Opcode::I64AtomicStore},
-#line 222 "src/lexer-keywords.txt"
+#line 223 "src/lexer-keywords.txt"
{"i32.atomic.store", TokenType::AtomicStore, Opcode::I32AtomicStore},
{""}, {""},
-#line 411 "src/lexer-keywords.txt"
- {"i64x2.sub", TokenType::Binary, Opcode::I64X2Sub},
- {""}, {""}, {""}, {""}, {""},
-#line 127 "src/lexer-keywords.txt"
- {"f64x2.abs", TokenType::Unary, Opcode::F64X2Abs},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 348 "src/lexer-keywords.txt"
+ {"i64.clz", TokenType::Unary, Opcode::I64Clz},
+#line 225 "src/lexer-keywords.txt"
+ {"i32.clz", TokenType::Unary, Opcode::I32Clz},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 368 "src/lexer-keywords.txt"
+ {"i64.load32_s", TokenType::Load, Opcode::I64Load32S},
{""}, {""}, {""},
-#line 480 "src/lexer-keywords.txt"
- {"return_call", TokenType::ReturnCall, Opcode::ReturnCall},
- {""}, {""},
-#line 332 "src/lexer-keywords.txt"
- {"i64.atomic.rmw8.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8SubU},
-#line 210 "src/lexer-keywords.txt"
- {"i32.atomic.rmw8.sub_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8SubU},
-#line 55 "src/lexer-keywords.txt"
- {"f32.demote_f64", TokenType::Convert, Opcode::F32DemoteF64},
+#line 369 "src/lexer-keywords.txt"
+ {"i64.load32_u", TokenType::Load, Opcode::I64Load32U},
+ {""},
#line 128 "src/lexer-keywords.txt"
{"f64x2.add", TokenType::Binary, Opcode::F64X2Add},
- {""}, {""}, {""},
-#line 21 "src/lexer-keywords.txt"
- {"assert_malformed", TokenType::AssertMalformed},
-#line 400 "src/lexer-keywords.txt"
+ {""},
+#line 22 "src/lexer-keywords.txt"
+ {"assert_return", TokenType::AssertReturn},
+ {""}, {""},
+#line 401 "src/lexer-keywords.txt"
{"i64x2.add", TokenType::Binary, Opcode::I64X2Add},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 389 "src/lexer-keywords.txt"
+ {"i64.store8", TokenType::Store, Opcode::I64Store8},
+#line 260 "src/lexer-keywords.txt"
+ {"i32.store8", TokenType::Store, Opcode::I32Store8},
{""},
-#line 125 "src/lexer-keywords.txt"
- {"f64.trunc", TokenType::Unary, Opcode::F64Trunc},
-#line 74 "src/lexer-keywords.txt"
- {"f32.trunc", TokenType::Unary, Opcode::F32Trunc},
+#line 508 "src/lexer-keywords.txt"
+ {"v128", Type::V128},
{""},
-#line 349 "src/lexer-keywords.txt"
- {"i64.ctz", TokenType::Unary, Opcode::I64Ctz},
-#line 226 "src/lexer-keywords.txt"
- {"i32.ctz", TokenType::Unary, Opcode::I32Ctz},
- {""}, {""},
-#line 504 "src/lexer-keywords.txt"
- {"v128.not", TokenType::Unary, Opcode::V128Not},
-#line 553 "src/lexer-keywords.txt"
- {"set_local", TokenType::LocalSet, Opcode::LocalSet},
-#line 329 "src/lexer-keywords.txt"
- {"i64.atomic.rmw8.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AndU},
-#line 207 "src/lexer-keywords.txt"
- {"i32.atomic.rmw8.and_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AndU},
-#line 499 "src/lexer-keywords.txt"
- {"v128.andnot", TokenType::Binary, Opcode::V128Andnot},
+#line 38 "src/lexer-keywords.txt"
+ {"declare", TokenType::Declare},
+#line 370 "src/lexer-keywords.txt"
+ {"i64.load8_s", TokenType::Load, Opcode::I64Load8S},
+#line 242 "src/lexer-keywords.txt"
+ {"i32.load8_s", TokenType::Load, Opcode::I32Load8S},
{""}, {""},
+#line 371 "src/lexer-keywords.txt"
+ {"i64.load8_u", TokenType::Load, Opcode::I64Load8U},
+#line 243 "src/lexer-keywords.txt"
+ {"i32.load8_u", TokenType::Load, Opcode::I32Load8U},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""},
#line 554 "src/lexer-keywords.txt"
+ {"set_local", TokenType::LocalSet, Opcode::LocalSet},
+ {""}, {""}, {""}, {""}, {""},
+#line 555 "src/lexer-keywords.txt"
{"tee_local", TokenType::LocalTee, Opcode::LocalTee},
{""}, {""},
-#line 500 "src/lexer-keywords.txt"
- {"v128.and", TokenType::Binary, Opcode::V128And},
-#line 335 "src/lexer-keywords.txt"
- {"i64.atomic.rmw.add", TokenType::AtomicRmw, Opcode::I64AtomicRmwAdd},
-#line 213 "src/lexer-keywords.txt"
- {"i32.atomic.rmw.add", TokenType::AtomicRmw, Opcode::I32AtomicRmwAdd},
-#line 328 "src/lexer-keywords.txt"
- {"i64.atomic.rmw8.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AddU},
-#line 206 "src/lexer-keywords.txt"
- {"i32.atomic.rmw8.add_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AddU},
-#line 32 "src/lexer-keywords.txt"
- {"call_indirect", TokenType::CallIndirect, Opcode::CallIndirect},
-#line 347 "src/lexer-keywords.txt"
- {"i64.clz", TokenType::Unary, Opcode::I64Clz},
-#line 224 "src/lexer-keywords.txt"
- {"i32.clz", TokenType::Unary, Opcode::I32Clz},
- {""}, {""}, {""},
-#line 313 "src/lexer-keywords.txt"
- {"i64.atomic.load", TokenType::AtomicLoad, Opcode::I64AtomicLoad},
-#line 198 "src/lexer-keywords.txt"
- {"i32.atomic.load", TokenType::AtomicLoad, Opcode::I32AtomicLoad},
-#line 367 "src/lexer-keywords.txt"
- {"i64.load32_s", TokenType::Load, Opcode::I64Load32S},
- {""}, {""},
-#line 325 "src/lexer-keywords.txt"
- {"i64.atomic.rmw32.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32SubU},
-#line 368 "src/lexer-keywords.txt"
- {"i64.load32_u", TokenType::Load, Opcode::I64Load32U},
-#line 338 "src/lexer-keywords.txt"
- {"i64.atomic.rmw.or", TokenType::AtomicRmw, Opcode::I64AtomicRmwOr},
-#line 216 "src/lexer-keywords.txt"
- {"i32.atomic.rmw.or", TokenType::AtomicRmw, Opcode::I32AtomicRmwOr},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 506 "src/lexer-keywords.txt"
- {"v128.store", TokenType::Store, Opcode::V128Store},
- {""}, {""}, {""}, {""}, {""},
-#line 391 "src/lexer-keywords.txt"
+#line 522 "src/lexer-keywords.txt"
+ {"f32.demote/f64", TokenType::Convert, Opcode::F32DemoteF64},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 392 "src/lexer-keywords.txt"
{"i64.trunc_f32_s", TokenType::Convert, Opcode::I64TruncF32S},
-#line 262 "src/lexer-keywords.txt"
+#line 263 "src/lexer-keywords.txt"
{"i32.trunc_f32_s", TokenType::Convert, Opcode::I32TruncF32S},
-#line 392 "src/lexer-keywords.txt"
+#line 393 "src/lexer-keywords.txt"
{"i64.trunc_f32_u", TokenType::Convert, Opcode::I64TruncF32U},
-#line 263 "src/lexer-keywords.txt"
+#line 264 "src/lexer-keywords.txt"
{"i32.trunc_f32_u", TokenType::Convert, Opcode::I32TruncF32U},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 393 "src/lexer-keywords.txt"
+ {""}, {""},
+#line 394 "src/lexer-keywords.txt"
{"i64.trunc_f64_s", TokenType::Convert, Opcode::I64TruncF64S},
-#line 264 "src/lexer-keywords.txt"
+#line 265 "src/lexer-keywords.txt"
{"i32.trunc_f64_s", TokenType::Convert, Opcode::I32TruncF64S},
-#line 394 "src/lexer-keywords.txt"
+#line 395 "src/lexer-keywords.txt"
{"i64.trunc_f64_u", TokenType::Convert, Opcode::I64TruncF64U},
-#line 265 "src/lexer-keywords.txt"
+#line 266 "src/lexer-keywords.txt"
{"i32.trunc_f64_u", TokenType::Convert, Opcode::I32TruncF64U},
- {""}, {""}, {""}, {""},
-#line 505 "src/lexer-keywords.txt"
- {"v128.or", TokenType::Binary, Opcode::V128Or},
+#line 481 "src/lexer-keywords.txt"
+ {"return_call", TokenType::ReturnCall, Opcode::ReturnCall},
+#line 314 "src/lexer-keywords.txt"
+ {"i64.atomic.load", TokenType::AtomicLoad, Opcode::I64AtomicLoad},
+#line 199 "src/lexer-keywords.txt"
+ {"i32.atomic.load", TokenType::AtomicLoad, Opcode::I32AtomicLoad},
+#line 333 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw8.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8SubU},
+#line 211 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw8.sub_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8SubU},
+#line 387 "src/lexer-keywords.txt"
+ {"i64.store16", TokenType::Store, Opcode::I64Store16},
+#line 259 "src/lexer-keywords.txt"
+ {"i32.store16", TokenType::Store, Opcode::I32Store16},
+#line 32 "src/lexer-keywords.txt"
+ {"call_indirect", TokenType::CallIndirect, Opcode::CallIndirect},
+#line 125 "src/lexer-keywords.txt"
+ {"f64.trunc", TokenType::Unary, Opcode::F64Trunc},
+#line 74 "src/lexer-keywords.txt"
+ {"f32.trunc", TokenType::Unary, Opcode::F32Trunc},
+ {""}, {""}, {""}, {""}, {""},
+#line 106 "src/lexer-keywords.txt"
+ {"f64.div", TokenType::Binary, Opcode::F64Div},
+#line 56 "src/lexer-keywords.txt"
+ {"f32.div", TokenType::Binary, Opcode::F32Div},
{""}, {""},
-#line 521 "src/lexer-keywords.txt"
- {"f32.demote/f64", TokenType::Convert, Opcode::F32DemoteF64},
+#line 21 "src/lexer-keywords.txt"
+ {"assert_malformed", TokenType::AssertMalformed},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""},
+#line 330 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw8.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AndU},
+#line 208 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw8.and_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AndU},
{""}, {""},
+#line 505 "src/lexer-keywords.txt"
+ {"v128.not", TokenType::Unary, Opcode::V128Not},
+ {""}, {""}, {""}, {""}, {""}, {""},
#line 336 "src/lexer-keywords.txt"
- {"i64.atomic.rmw.and", TokenType::AtomicRmw, Opcode::I64AtomicRmwAnd},
+ {"i64.atomic.rmw.add", TokenType::AtomicRmw, Opcode::I64AtomicRmwAdd},
#line 214 "src/lexer-keywords.txt"
- {"i32.atomic.rmw.and", TokenType::AtomicRmw, Opcode::I32AtomicRmwAnd},
-#line 322 "src/lexer-keywords.txt"
- {"i64.atomic.rmw32.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AndU},
- {""}, {""}, {""},
-#line 312 "src/lexer-keywords.txt"
- {"i64.atomic.load8_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad8U},
-#line 197 "src/lexer-keywords.txt"
- {"i32.atomic.load8_u", TokenType::AtomicLoad, Opcode::I32AtomicLoad8U},
+ {"i32.atomic.rmw.add", TokenType::AtomicRmw, Opcode::I32AtomicRmwAdd},
{""}, {""}, {""}, {""},
-#line 466 "src/lexer-keywords.txt"
- {"nan:canonical", TokenType::NanCanonical},
-#line 321 "src/lexer-keywords.txt"
- {"i64.atomic.rmw32.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AddU},
- {""}, {""},
-#line 122 "src/lexer-keywords.txt"
- {"f64.sqrt", TokenType::Unary, Opcode::F64Sqrt},
-#line 71 "src/lexer-keywords.txt"
- {"f32.sqrt", TokenType::Unary, Opcode::F32Sqrt},
-#line 339 "src/lexer-keywords.txt"
- {"i64.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I64AtomicRmwSub},
-#line 217 "src/lexer-keywords.txt"
- {"i32.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I32AtomicRmwSub},
- {""}, {""},
-#line 503 "src/lexer-keywords.txt"
- {"v128.load", TokenType::Load, Opcode::V128Load},
- {""}, {""}, {""}, {""}, {""}, {""},
#line 101 "src/lexer-keywords.txt"
{"f64.convert_i32_s", TokenType::Convert, Opcode::F64ConvertI32S},
#line 50 "src/lexer-keywords.txt"
{"f32.convert_i32_s", TokenType::Convert, Opcode::F32ConvertI32S},
- {""},
-#line 479 "src/lexer-keywords.txt"
- {"return_call_indirect", TokenType::ReturnCallIndirect, Opcode::ReturnCallIndirect},
-#line 501 "src/lexer-keywords.txt"
- {"v128.bitselect", TokenType::Ternary, Opcode::V128BitSelect},
- {""},
-#line 502 "src/lexer-keywords.txt"
- {"v128.const", TokenType::Const, Opcode::V128Const},
- {""},
-#line 148 "src/lexer-keywords.txt"
- {"get", TokenType::Get},
- {""}, {""},
+#line 329 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw8.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AddU},
+#line 207 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw8.add_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AddU},
+ {""}, {""}, {""},
#line 103 "src/lexer-keywords.txt"
{"f64.convert_i64_s", TokenType::Convert, Opcode::F64ConvertI64S},
#line 52 "src/lexer-keywords.txt"
{"f32.convert_i64_s", TokenType::Convert, Opcode::F32ConvertI64S},
+#line 339 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw.or", TokenType::AtomicRmw, Opcode::I64AtomicRmwOr},
+#line 217 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw.or", TokenType::AtomicRmw, Opcode::I32AtomicRmwOr},
+#line 326 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw32.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32SubU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 500 "src/lexer-keywords.txt"
+ {"v128.andnot", TokenType::Binary, Opcode::V128Andnot},
+#line 343 "src/lexer-keywords.txt"
+ {"i64.atomic.store16", TokenType::AtomicStore, Opcode::I64AtomicStore16},
+#line 221 "src/lexer-keywords.txt"
+ {"i32.atomic.store16", TokenType::AtomicStore, Opcode::I32AtomicStore16},
{""},
-#line 129 "src/lexer-keywords.txt"
- {"f64x2.div", TokenType::Binary, Opcode::F64X2Div},
- {""}, {""},
-#line 471 "src/lexer-keywords.txt"
- {"quote", TokenType::Quote},
+#line 467 "src/lexer-keywords.txt"
+ {"nan:canonical", TokenType::NanCanonical},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 501 "src/lexer-keywords.txt"
+ {"v128.and", TokenType::Binary, Opcode::V128And},
+ {""}, {""}, {""}, {""},
+#line 149 "src/lexer-keywords.txt"
+ {"get", TokenType::Get},
+#line 337 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw.and", TokenType::AtomicRmw, Opcode::I64AtomicRmwAnd},
+#line 215 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw.and", TokenType::AtomicRmw, Opcode::I32AtomicRmwAnd},
{""}, {""}, {""},
-#line 96 "src/lexer-keywords.txt"
- {"f32x4", TokenType::F32X4},
- {""}, {""},
-#line 324 "src/lexer-keywords.txt"
- {"i64.atomic.rmw32.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32OrU},
- {""},
-#line 300 "src/lexer-keywords.txt"
- {"i32x4", TokenType::I32X4},
- {""},
-#line 544 "src/lexer-keywords.txt"
+#line 313 "src/lexer-keywords.txt"
+ {"i64.atomic.load8_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad8U},
+#line 198 "src/lexer-keywords.txt"
+ {"i32.atomic.load8_u", TokenType::AtomicLoad, Opcode::I32AtomicLoad8U},
+ {""}, {""}, {""}, {""},
+#line 545 "src/lexer-keywords.txt"
{"i64.trunc_s/f32", TokenType::Convert, Opcode::I64TruncF32S},
-#line 532 "src/lexer-keywords.txt"
+#line 533 "src/lexer-keywords.txt"
{"i32.trunc_s/f32", TokenType::Convert, Opcode::I32TruncF32S},
-#line 548 "src/lexer-keywords.txt"
+#line 549 "src/lexer-keywords.txt"
{"i64.trunc_u/f32", TokenType::Convert, Opcode::I64TruncF32U},
-#line 536 "src/lexer-keywords.txt"
+#line 537 "src/lexer-keywords.txt"
{"i32.trunc_u/f32", TokenType::Convert, Opcode::I32TruncF32U},
- {""}, {""}, {""}, {""},
-#line 323 "src/lexer-keywords.txt"
- {"i64.atomic.rmw32.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw32CmpxchgU},
- {""},
-#line 545 "src/lexer-keywords.txt"
+ {""}, {""},
+#line 546 "src/lexer-keywords.txt"
{"i64.trunc_s/f64", TokenType::Convert, Opcode::I64TruncF64S},
-#line 533 "src/lexer-keywords.txt"
+#line 534 "src/lexer-keywords.txt"
{"i32.trunc_s/f64", TokenType::Convert, Opcode::I32TruncF64S},
-#line 549 "src/lexer-keywords.txt"
+#line 550 "src/lexer-keywords.txt"
{"i64.trunc_u/f64", TokenType::Convert, Opcode::I64TruncF64U},
-#line 537 "src/lexer-keywords.txt"
+#line 538 "src/lexer-keywords.txt"
{"i32.trunc_u/f64", TokenType::Convert, Opcode::I32TruncF64U},
+#line 507 "src/lexer-keywords.txt"
+ {"v128.store", TokenType::Store, Opcode::V128Store},
+ {""}, {""}, {""},
+#line 323 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw32.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AndU},
+ {""},
+#line 96 "src/lexer-keywords.txt"
+ {"f32x4", TokenType::F32X4},
+ {""}, {""}, {""}, {""},
+#line 301 "src/lexer-keywords.txt"
+ {"i32x4", TokenType::I32X4},
{""}, {""},
#line 28 "src/lexer-keywords.txt"
{"br_if", TokenType::BrIf, Opcode::BrIf},
+#line 396 "src/lexer-keywords.txt"
+ {"i64.trunc_sat_f32_s", TokenType::Convert, Opcode::I64TruncSatF32S},
+#line 267 "src/lexer-keywords.txt"
+ {"i32.trunc_sat_f32_s", TokenType::Convert, Opcode::I32TruncSatF32S},
+#line 480 "src/lexer-keywords.txt"
+ {"return_call_indirect", TokenType::ReturnCallIndirect, Opcode::ReturnCallIndirect},
+ {""},
+#line 397 "src/lexer-keywords.txt"
+ {"i64.trunc_sat_f32_u", TokenType::Convert, Opcode::I64TruncSatF32U},
+#line 268 "src/lexer-keywords.txt"
+ {"i32.trunc_sat_f32_u", TokenType::Convert, Opcode::I32TruncSatF32U},
+ {""},
+#line 312 "src/lexer-keywords.txt"
+ {"i64.atomic.load32_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad32U},
+#line 322 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw32.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AddU},
+ {""},
+#line 319 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16SubU},
+#line 204 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16SubU},
+#line 129 "src/lexer-keywords.txt"
+ {"f64x2.div", TokenType::Binary, Opcode::F64X2Div},
+ {""}, {""}, {""},
+#line 340 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I64AtomicRmwSub},
+#line 218 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw.sub", TokenType::AtomicRmw, Opcode::I32AtomicRmwSub},
+ {""},
+#line 503 "src/lexer-keywords.txt"
+ {"v128.const", TokenType::Const, Opcode::V128Const},
{""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 386 "src/lexer-keywords.txt"
- {"i64.store16", TokenType::Store, Opcode::I64Store16},
-#line 258 "src/lexer-keywords.txt"
- {"i32.store16", TokenType::Store, Opcode::I32Store16},
- {""}, {""}, {""}, {""}, {""}, {""},
+#line 504 "src/lexer-keywords.txt"
+ {"v128.load", TokenType::Load, Opcode::V128Load},
+ {""},
+#line 502 "src/lexer-keywords.txt"
+ {"v128.bitselect", TokenType::Ternary, Opcode::V128BitSelect},
+ {""}, {""},
+#line 311 "src/lexer-keywords.txt"
+ {"i64.atomic.load16_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad16U},
+#line 197 "src/lexer-keywords.txt"
+ {"i32.atomic.load16_u", TokenType::AtomicLoad, Opcode::I32AtomicLoad16U},
+ {""}, {""}, {""},
+#line 498 "src/lexer-keywords.txt"
+ {"type", TokenType::Type},
+#line 489 "src/lexer-keywords.txt"
+ {"table.get", TokenType::TableGet, Opcode::TableGet},
+#line 450 "src/lexer-keywords.txt"
+ {"import", TokenType::Import},
+ {""},
+#line 45 "src/lexer-keywords.txt"
+ {"export", TokenType::Export},
+ {""}, {""},
+#line 506 "src/lexer-keywords.txt"
+ {"v128.or", TokenType::Binary, Opcode::V128Or},
#line 91 "src/lexer-keywords.txt"
{"f32x4.ne", TokenType::Compare, Opcode::F32X4Ne},
- {""}, {""},
+ {""},
+#line 324 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw32.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw32CmpxchgU},
#line 86 "src/lexer-keywords.txt"
{"f32x4.lt", TokenType::Compare, Opcode::F32X4Lt},
#line 88 "src/lexer-keywords.txt"
{"f32x4.min", TokenType::Binary, Opcode::F32X4Min},
-#line 293 "src/lexer-keywords.txt"
+#line 294 "src/lexer-keywords.txt"
{"i32x4.ne", TokenType::Compare, Opcode::I32X4Ne},
{""},
-#line 289 "src/lexer-keywords.txt"
- {"i32x4.min_s", TokenType::Binary, Opcode::I32X4MinS},
-#line 488 "src/lexer-keywords.txt"
- {"table.get", TokenType::TableGet, Opcode::TableGet},
- {""}, {""},
#line 290 "src/lexer-keywords.txt"
- {"i32x4.min_u", TokenType::Binary, Opcode::I32X4MinU},
+ {"i32x4.min_s", TokenType::Binary, Opcode::I32X4MinS},
{""},
-#line 318 "src/lexer-keywords.txt"
- {"i64.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16SubU},
-#line 203 "src/lexer-keywords.txt"
- {"i32.atomic.rmw16.sub_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16SubU},
+#line 325 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw32.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32OrU},
+ {""},
+#line 291 "src/lexer-keywords.txt"
+ {"i32x4.min_u", TokenType::Binary, Opcode::I32X4MinU},
+ {""}, {""}, {""},
#line 85 "src/lexer-keywords.txt"
{"f32x4.le", TokenType::Compare, Opcode::F32X4Le},
-#line 285 "src/lexer-keywords.txt"
+#line 286 "src/lexer-keywords.txt"
{"i32x4.lt_s", TokenType::Compare, Opcode::I32X4LtS},
{""},
-#line 286 "src/lexer-keywords.txt"
+#line 287 "src/lexer-keywords.txt"
{"i32x4.lt_u", TokenType::Compare, Opcode::I32X4LtU},
- {""}, {""}, {""},
-#line 281 "src/lexer-keywords.txt"
- {"i32x4.le_s", TokenType::Compare, Opcode::I32X4LeS},
+#line 316 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AndU},
+#line 201 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AndU},
{""},
#line 282 "src/lexer-keywords.txt"
+ {"i32x4.le_s", TokenType::Compare, Opcode::I32X4LeS},
+#line 133 "src/lexer-keywords.txt"
+ {"f64x2.gt", TokenType::Compare, Opcode::F64X2Gt},
+#line 283 "src/lexer-keywords.txt"
{"i32x4.le_u", TokenType::Compare, Opcode::I32X4LeU},
-#line 497 "src/lexer-keywords.txt"
- {"type", TokenType::Type},
{""},
-#line 449 "src/lexer-keywords.txt"
- {"import", TokenType::Import},
- {""},
-#line 45 "src/lexer-keywords.txt"
- {"export", TokenType::Export},
- {""}, {""},
-#line 89 "src/lexer-keywords.txt"
- {"f32x4.mul", TokenType::Binary, Opcode::F32X4Mul},
- {""}, {""}, {""}, {""},
-#line 291 "src/lexer-keywords.txt"
- {"i32x4.mul", TokenType::Binary, Opcode::I32X4Mul},
- {""}, {""},
#line 102 "src/lexer-keywords.txt"
{"f64.convert_i32_u", TokenType::Convert, Opcode::F64ConvertI32U},
#line 51 "src/lexer-keywords.txt"
{"f32.convert_i32_u", TokenType::Convert, Opcode::F32ConvertI32U},
{""}, {""}, {""},
-#line 95 "src/lexer-keywords.txt"
- {"f32x4.sub", TokenType::Binary, Opcode::F32X4Sub},
- {""}, {""}, {""}, {""},
-#line 299 "src/lexer-keywords.txt"
- {"i32x4.sub", TokenType::Binary, Opcode::I32X4Sub},
+#line 472 "src/lexer-keywords.txt"
+ {"quote", TokenType::Quote},
+#line 89 "src/lexer-keywords.txt"
+ {"f32x4.mul", TokenType::Binary, Opcode::F32X4Mul},
#line 104 "src/lexer-keywords.txt"
{"f64.convert_i64_u", TokenType::Convert, Opcode::F64ConvertI64U},
#line 53 "src/lexer-keywords.txt"
{"f32.convert_i64_u", TokenType::Convert, Opcode::F32ConvertI64U},
- {""}, {""}, {""},
-#line 76 "src/lexer-keywords.txt"
- {"f32x4.abs", TokenType::Unary, Opcode::F32X4Abs},
+#line 132 "src/lexer-keywords.txt"
+ {"f64x2.ge", TokenType::Compare, Opcode::F64X2Ge},
{""},
+#line 292 "src/lexer-keywords.txt"
+ {"i32x4.mul", TokenType::Binary, Opcode::I32X4Mul},
#line 315 "src/lexer-keywords.txt"
- {"i64.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AndU},
-#line 200 "src/lexer-keywords.txt"
- {"i32.atomic.rmw16.and_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AndU},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 470 "src/lexer-keywords.txt"
- {"param", TokenType::Param},
- {""},
-#line 476 "src/lexer-keywords.txt"
- {"register", TokenType::Register},
-#line 314 "src/lexer-keywords.txt"
{"i64.atomic.rmw16.add_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AddU},
-#line 199 "src/lexer-keywords.txt"
+#line 200 "src/lexer-keywords.txt"
{"i32.atomic.rmw16.add_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AddU},
{""}, {""}, {""}, {""},
-#line 77 "src/lexer-keywords.txt"
- {"f32x4.add", TokenType::Binary, Opcode::F32X4Add},
- {""},
-#line 395 "src/lexer-keywords.txt"
- {"i64.trunc_sat_f32_s", TokenType::Convert, Opcode::I64TruncSatF32S},
-#line 266 "src/lexer-keywords.txt"
- {"i32.trunc_sat_f32_s", TokenType::Convert, Opcode::I32TruncSatF32S},
-#line 143 "src/lexer-keywords.txt"
- {"f64x2.sqrt", TokenType::Unary, Opcode::F64X2Sqrt},
-#line 272 "src/lexer-keywords.txt"
- {"i32x4.add", TokenType::Binary, Opcode::I32X4Add},
-#line 396 "src/lexer-keywords.txt"
- {"i64.trunc_sat_f32_u", TokenType::Convert, Opcode::I64TruncSatF32U},
-#line 267 "src/lexer-keywords.txt"
- {"i32.trunc_sat_f32_u", TokenType::Convert, Opcode::I32TruncSatF32U},
- {""}, {""}, {""},
-#line 151 "src/lexer-keywords.txt"
+#line 152 "src/lexer-keywords.txt"
{"global", TokenType::Global},
-#line 342 "src/lexer-keywords.txt"
- {"i64.atomic.store16", TokenType::AtomicStore, Opcode::I64AtomicStore16},
-#line 220 "src/lexer-keywords.txt"
- {"i32.atomic.store16", TokenType::AtomicStore, Opcode::I32AtomicStore16},
- {""}, {""}, {""},
-#line 310 "src/lexer-keywords.txt"
- {"i64.atomic.load16_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad16U},
-#line 196 "src/lexer-keywords.txt"
- {"i32.atomic.load16_u", TokenType::AtomicLoad, Opcode::I32AtomicLoad16U},
-#line 150 "src/lexer-keywords.txt"
- {"global.set", TokenType::GlobalSet, Opcode::GlobalSet},
- {""},
-#line 376 "src/lexer-keywords.txt"
- {"i64.or", TokenType::Binary, Opcode::I64Or},
-#line 248 "src/lexer-keywords.txt"
- {"i32.or", TokenType::Binary, Opcode::I32Or},
- {""},
-#line 39 "src/lexer-keywords.txt"
- {"drop", TokenType::Drop, Opcode::Drop},
- {""}, {""}, {""},
-#line 456 "src/lexer-keywords.txt"
- {"loop", TokenType::Loop, Opcode::Loop},
-#line 133 "src/lexer-keywords.txt"
- {"f64x2.gt", TokenType::Compare, Opcode::F64X2Gt},
- {""},
-#line 452 "src/lexer-keywords.txt"
- {"local.get", TokenType::LocalGet, Opcode::LocalGet},
-#line 18 "src/lexer-keywords.txt"
- {"anyref", Type::Anyref},
-#line 489 "src/lexer-keywords.txt"
- {"table.grow", TokenType::TableGrow, Opcode::TableGrow},
-#line 317 "src/lexer-keywords.txt"
- {"i64.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16OrU},
-#line 202 "src/lexer-keywords.txt"
- {"i32.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16OrU},
-#line 460 "src/lexer-keywords.txt"
- {"memory.init", TokenType::MemoryInit, Opcode::MemoryInit},
- {""}, {""}, {""}, {""},
-#line 132 "src/lexer-keywords.txt"
- {"f64x2.ge", TokenType::Compare, Opcode::F64X2Ge},
- {""},
-#line 461 "src/lexer-keywords.txt"
- {"memory.size", TokenType::MemorySize, Opcode::MemorySize},
- {""}, {""},
-#line 316 "src/lexer-keywords.txt"
- {"i64.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw16CmpxchgU},
-#line 201 "src/lexer-keywords.txt"
- {"i32.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw16CmpxchgU},
- {""}, {""}, {""},
-#line 353 "src/lexer-keywords.txt"
- {"i64.eqz", TokenType::Convert, Opcode::I64Eqz},
-#line 230 "src/lexer-keywords.txt"
- {"i32.eqz", TokenType::Convert, Opcode::I32Eqz},
+#line 95 "src/lexer-keywords.txt"
+ {"f32x4.sub", TokenType::Binary, Opcode::F32X4Sub},
{""}, {""},
-#line 273 "src/lexer-keywords.txt"
- {"i32x4.all_true", TokenType::Unary, Opcode::I32X4AllTrue},
-#line 495 "src/lexer-keywords.txt"
- {"throw", TokenType::Throw, Opcode::Throw},
-#line 311 "src/lexer-keywords.txt"
- {"i64.atomic.load32_u", TokenType::AtomicLoad, Opcode::I64AtomicLoad32U},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""},
-#line 458 "src/lexer-keywords.txt"
- {"memory.fill", TokenType::MemoryFill, Opcode::MemoryFill},
- {""}, {""}, {""}, {""}, {""},
-#line 523 "src/lexer-keywords.txt"
+#line 122 "src/lexer-keywords.txt"
+ {"f64.sqrt", TokenType::Unary, Opcode::F64Sqrt},
+#line 71 "src/lexer-keywords.txt"
+ {"f32.sqrt", TokenType::Unary, Opcode::F32Sqrt},
+#line 300 "src/lexer-keywords.txt"
+ {"i32x4.sub", TokenType::Binary, Opcode::I32X4Sub},
+#line 524 "src/lexer-keywords.txt"
{"f64.convert_s/i32", TokenType::Convert, Opcode::F64ConvertI32S},
-#line 517 "src/lexer-keywords.txt"
+#line 518 "src/lexer-keywords.txt"
{"f32.convert_s/i32", TokenType::Convert, Opcode::F32ConvertI32S},
-#line 525 "src/lexer-keywords.txt"
+#line 526 "src/lexer-keywords.txt"
{"f64.convert_u/i32", TokenType::Convert, Opcode::F64ConvertI32U},
-#line 519 "src/lexer-keywords.txt"
+#line 520 "src/lexer-keywords.txt"
{"f32.convert_u/i32", TokenType::Convert, Opcode::F32ConvertI32U},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""},
-#line 108 "src/lexer-keywords.txt"
- {"f64.floor", TokenType::Unary, Opcode::F64Floor},
-#line 58 "src/lexer-keywords.txt"
- {"f32.floor", TokenType::Unary, Opcode::F32Floor},
- {""}, {""}, {""}, {""},
-#line 356 "src/lexer-keywords.txt"
- {"i64.extend8_s", TokenType::Unary, Opcode::I64Extend8S},
-#line 232 "src/lexer-keywords.txt"
- {"i32.extend8_s", TokenType::Unary, Opcode::I32Extend8S},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 107 "src/lexer-keywords.txt"
- {"f64.eq", TokenType::Compare, Opcode::F64Eq},
-#line 57 "src/lexer-keywords.txt"
- {"f32.eq", TokenType::Compare, Opcode::F32Eq},
{""}, {""}, {""},
-#line 352 "src/lexer-keywords.txt"
- {"i64.eq", TokenType::Compare, Opcode::I64Eq},
-#line 229 "src/lexer-keywords.txt"
- {"i32.eq", TokenType::Compare, Opcode::I32Eq},
-#line 142 "src/lexer-keywords.txt"
- {"f64x2.splat", TokenType::Unary, Opcode::F64X2Splat},
-#line 472 "src/lexer-keywords.txt"
- {"ref.func", TokenType::RefFunc, Opcode::RefFunc},
-#line 80 "src/lexer-keywords.txt"
- {"f32x4.div", TokenType::Binary, Opcode::F32X4Div},
- {""}, {""},
-#line 410 "src/lexer-keywords.txt"
- {"i64x2.splat", TokenType::Unary, Opcode::I64X2Splat},
- {""}, {""},
-#line 413 "src/lexer-keywords.txt"
- {"i64.xor", TokenType::Binary, Opcode::I64Xor},
-#line 307 "src/lexer-keywords.txt"
- {"i32.xor", TokenType::Binary, Opcode::I32Xor},
+#line 457 "src/lexer-keywords.txt"
+ {"loop", TokenType::Loop, Opcode::Loop},
+ {""}, {""}, {""},
+#line 39 "src/lexer-keywords.txt"
+ {"drop", TokenType::Drop, Opcode::Drop},
{""}, {""},
-#line 530 "src/lexer-keywords.txt"
- {"get_local", TokenType::LocalGet, Opcode::LocalGet},
+#line 76 "src/lexer-keywords.txt"
+ {"f32x4.abs", TokenType::Unary, Opcode::F32X4Abs},
+ {""},
+#line 151 "src/lexer-keywords.txt"
+ {"global.set", TokenType::GlobalSet, Opcode::GlobalSet},
+#line 471 "src/lexer-keywords.txt"
+ {"param", TokenType::Param},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 496 "src/lexer-keywords.txt"
+ {"throw", TokenType::Throw, Opcode::Throw},
{""},
+#line 317 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw16CmpxchgU},
+#line 202 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw16.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw16CmpxchgU},
#line 110 "src/lexer-keywords.txt"
{"f64.gt", TokenType::Compare, Opcode::F64Gt},
#line 60 "src/lexer-keywords.txt"
{"f32.gt", TokenType::Compare, Opcode::F32Gt},
- {""},
-#line 120 "src/lexer-keywords.txt"
- {"f64.promote_f32", TokenType::Convert, Opcode::F64PromoteF32},
-#line 29 "src/lexer-keywords.txt"
- {"br_on_exn", TokenType::BrOnExn, Opcode::BrOnExn},
-#line 541 "src/lexer-keywords.txt"
- {"i64.extend_s/i32", TokenType::Convert, Opcode::I64ExtendI32S},
- {""},
-#line 542 "src/lexer-keywords.txt"
- {"i64.extend_u/i32", TokenType::Convert, Opcode::I64ExtendI32U},
- {""}, {""}, {""}, {""},
+ {""}, {""}, {""},
+#line 318 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16OrU},
+#line 203 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw16.or_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16OrU},
+ {""}, {""}, {""}, {""}, {""},
#line 109 "src/lexer-keywords.txt"
{"f64.ge", TokenType::Compare, Opcode::F64Ge},
#line 59 "src/lexer-keywords.txt"
{"f32.ge", TokenType::Compare, Opcode::F32Ge},
-#line 361 "src/lexer-keywords.txt"
+#line 362 "src/lexer-keywords.txt"
{"i64.gt_s", TokenType::Compare, Opcode::I64GtS},
-#line 235 "src/lexer-keywords.txt"
+#line 236 "src/lexer-keywords.txt"
{"i32.gt_s", TokenType::Compare, Opcode::I32GtS},
- {""}, {""},
-#line 362 "src/lexer-keywords.txt"
+#line 453 "src/lexer-keywords.txt"
+ {"local.get", TokenType::LocalGet, Opcode::LocalGet},
+ {""},
+#line 363 "src/lexer-keywords.txt"
{"i64.gt_u", TokenType::Compare, Opcode::I64GtU},
-#line 236 "src/lexer-keywords.txt"
+#line 237 "src/lexer-keywords.txt"
{"i32.gt_u", TokenType::Compare, Opcode::I32GtU},
-#line 359 "src/lexer-keywords.txt"
+#line 360 "src/lexer-keywords.txt"
{"i64.ge_s", TokenType::Compare, Opcode::I64GeS},
-#line 233 "src/lexer-keywords.txt"
+#line 234 "src/lexer-keywords.txt"
{"i32.ge_s", TokenType::Compare, Opcode::I32GeS},
{""}, {""},
-#line 360 "src/lexer-keywords.txt"
+#line 361 "src/lexer-keywords.txt"
{"i64.ge_u", TokenType::Compare, Opcode::I64GeU},
-#line 234 "src/lexer-keywords.txt"
+#line 235 "src/lexer-keywords.txt"
{"i32.ge_u", TokenType::Compare, Opcode::I32GeU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 330 "src/lexer-keywords.txt"
- {"i64.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw8CmpxchgU},
-#line 208 "src/lexer-keywords.txt"
- {"i32.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw8CmpxchgU},
-#line 355 "src/lexer-keywords.txt"
+ {""}, {""},
+#line 356 "src/lexer-keywords.txt"
{"i64.extend32_s", TokenType::Unary, Opcode::I64Extend32S},
-#line 383 "src/lexer-keywords.txt"
- {"i64.shl", TokenType::Binary, Opcode::I64Shl},
-#line 255 "src/lexer-keywords.txt"
- {"i32.shl", TokenType::Binary, Opcode::I32Shl},
+#line 77 "src/lexer-keywords.txt"
+ {"f32x4.add", TokenType::Binary, Opcode::F32X4Add},
+ {""}, {""},
+#line 490 "src/lexer-keywords.txt"
+ {"table.grow", TokenType::TableGrow, Opcode::TableGrow},
+ {""},
+#line 273 "src/lexer-keywords.txt"
+ {"i32x4.add", TokenType::Binary, Opcode::I32X4Add},
+#line 358 "src/lexer-keywords.txt"
+ {"i64.extend_i32_s", TokenType::Convert, Opcode::I64ExtendI32S},
+#line 142 "src/lexer-keywords.txt"
+ {"f64x2.splat", TokenType::Unary, Opcode::F64X2Splat},
{""}, {""},
+#line 359 "src/lexer-keywords.txt"
+ {"i64.extend_i32_u", TokenType::Convert, Opcode::I64ExtendI32U},
+#line 29 "src/lexer-keywords.txt"
+ {"br_on_exn", TokenType::BrOnExn, Opcode::BrOnExn},
+#line 411 "src/lexer-keywords.txt"
+ {"i64x2.splat", TokenType::Unary, Opcode::I64X2Splat},
+ {""}, {""}, {""}, {""}, {""},
#line 384 "src/lexer-keywords.txt"
- {"i64.shr_s", TokenType::Binary, Opcode::I64ShrS},
+ {"i64.shl", TokenType::Binary, Opcode::I64Shl},
#line 256 "src/lexer-keywords.txt"
- {"i32.shr_s", TokenType::Binary, Opcode::I32ShrS},
+ {"i32.shl", TokenType::Binary, Opcode::I32Shl},
+ {""}, {""}, {""}, {""}, {""},
+#line 377 "src/lexer-keywords.txt"
+ {"i64.or", TokenType::Binary, Opcode::I64Or},
+#line 249 "src/lexer-keywords.txt"
+ {"i32.or", TokenType::Binary, Opcode::I32Or},
+ {""},
#line 357 "src/lexer-keywords.txt"
- {"i64.extend_i32_s", TokenType::Convert, Opcode::I64ExtendI32S},
+ {"i64.extend8_s", TokenType::Unary, Opcode::I64Extend8S},
+#line 233 "src/lexer-keywords.txt"
+ {"i32.extend8_s", TokenType::Unary, Opcode::I32Extend8S},
+#line 355 "src/lexer-keywords.txt"
+ {"i64.extend16_s", TokenType::Unary, Opcode::I64Extend16S},
+#line 232 "src/lexer-keywords.txt"
+ {"i32.extend16_s", TokenType::Unary, Opcode::I32Extend16S},
+#line 354 "src/lexer-keywords.txt"
+ {"i64.eqz", TokenType::Convert, Opcode::I64Eqz},
+#line 231 "src/lexer-keywords.txt"
+ {"i32.eqz", TokenType::Convert, Opcode::I32Eqz},
+ {""},
+#line 477 "src/lexer-keywords.txt"
+ {"register", TokenType::Register},
+ {""}, {""}, {""}, {""}, {""},
+#line 143 "src/lexer-keywords.txt"
+ {"f64x2.sqrt", TokenType::Unary, Opcode::F64X2Sqrt},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 542 "src/lexer-keywords.txt"
+ {"i64.extend_s/i32", TokenType::Convert, Opcode::I64ExtendI32S},
{""},
+#line 543 "src/lexer-keywords.txt"
+ {"i64.extend_u/i32", TokenType::Convert, Opcode::I64ExtendI32U},
+ {""}, {""}, {""},
#line 385 "src/lexer-keywords.txt"
- {"i64.shr_u", TokenType::Binary, Opcode::I64ShrU},
+ {"i64.shr_s", TokenType::Binary, Opcode::I64ShrS},
#line 257 "src/lexer-keywords.txt"
+ {"i32.shr_s", TokenType::Binary, Opcode::I32ShrS},
+ {""},
+#line 18 "src/lexer-keywords.txt"
+ {"anyref", Type::Anyref},
+#line 386 "src/lexer-keywords.txt"
+ {"i64.shr_u", TokenType::Binary, Opcode::I64ShrU},
+#line 258 "src/lexer-keywords.txt"
{"i32.shr_u", TokenType::Binary, Opcode::I32ShrU},
-#line 358 "src/lexer-keywords.txt"
- {"i64.extend_i32_u", TokenType::Convert, Opcode::I64ExtendI32U},
-#line 331 "src/lexer-keywords.txt"
- {"i64.atomic.rmw8.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8OrU},
-#line 209 "src/lexer-keywords.txt"
- {"i32.atomic.rmw8.or_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8OrU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 354 "src/lexer-keywords.txt"
- {"i64.extend16_s", TokenType::Unary, Opcode::I64Extend16S},
-#line 231 "src/lexer-keywords.txt"
- {"i32.extend16_s", TokenType::Unary, Opcode::I32Extend16S},
- {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""},
+#line 274 "src/lexer-keywords.txt"
+ {"i32x4.all_true", TokenType::Unary, Opcode::I32X4AllTrue},
+ {""}, {""}, {""},
+#line 461 "src/lexer-keywords.txt"
+ {"memory.init", TokenType::MemoryInit, Opcode::MemoryInit},
+ {""}, {""}, {""},
+#line 531 "src/lexer-keywords.txt"
+ {"get_local", TokenType::LocalGet, Opcode::LocalGet},
+ {""}, {""},
+#line 462 "src/lexer-keywords.txt"
+ {"memory.size", TokenType::MemorySize, Opcode::MemorySize},
+ {""}, {""},
+#line 34 "src/lexer-keywords.txt"
+ {"catch", TokenType::Catch, Opcode::Catch},
+ {""}, {""},
+#line 108 "src/lexer-keywords.txt"
+ {"f64.floor", TokenType::Unary, Opcode::F64Floor},
+#line 58 "src/lexer-keywords.txt"
+ {"f32.floor", TokenType::Unary, Opcode::F32Floor},
+ {""}, {""}, {""}, {""}, {""},
+#line 439 "src/lexer-keywords.txt"
+ {"i8x16.ne", TokenType::Compare, Opcode::I8X16Ne},
+ {""},
+#line 434 "src/lexer-keywords.txt"
+ {"i8x16.min_s", TokenType::Binary, Opcode::I8X16MinS},
+ {""}, {""}, {""},
+#line 435 "src/lexer-keywords.txt"
+ {"i8x16.min_u", TokenType::Binary, Opcode::I8X16MinU},
+ {""}, {""}, {""}, {""},
+#line 430 "src/lexer-keywords.txt"
+ {"i8x16.lt_s", TokenType::Compare, Opcode::I8X16LtS},
+ {""},
+#line 431 "src/lexer-keywords.txt"
+ {"i8x16.lt_u", TokenType::Compare, Opcode::I8X16LtU},
+#line 459 "src/lexer-keywords.txt"
+ {"memory.fill", TokenType::MemoryFill, Opcode::MemoryFill},
+#line 473 "src/lexer-keywords.txt"
+ {"ref.func", TokenType::RefFunc, Opcode::RefFunc},
+ {""},
+#line 428 "src/lexer-keywords.txt"
+ {"i8x16.le_s", TokenType::Compare, Opcode::I8X16LeS},
+ {""},
+#line 429 "src/lexer-keywords.txt"
+ {"i8x16.le_u", TokenType::Compare, Opcode::I8X16LeU},
+ {""}, {""},
+#line 448 "src/lexer-keywords.txt"
+ {"i8x16", TokenType::I8X16},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 408 "src/lexer-keywords.txt"
+ {"i64x2.shl", TokenType::Binary, Opcode::I64X2Shl},
+ {""}, {""}, {""},
+#line 306 "src/lexer-keywords.txt"
+ {"i32x4.widen_low_i16x8_s", TokenType::Unary, Opcode::I32X4WidenLowI16X8S},
+ {""},
+#line 307 "src/lexer-keywords.txt"
+ {"i32x4.widen_low_i16x8_u", TokenType::Unary, Opcode::I32X4WidenLowI16X8U},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 447 "src/lexer-keywords.txt"
+ {"i8x16.sub", TokenType::Binary, Opcode::I8X16Sub},
+ {""}, {""}, {""},
+#line 120 "src/lexer-keywords.txt"
+ {"f64.promote_f32", TokenType::Convert, Opcode::F64PromoteF32},
+ {""}, {""},
+#line 19 "src/lexer-keywords.txt"
+ {"assert_exhaustion", TokenType::AssertExhaustion},
+ {""},
#line 70 "src/lexer-keywords.txt"
{"f32.reinterpret_i32", TokenType::Convert, Opcode::F32ReinterpretI32},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 527 "src/lexer-keywords.txt"
- {"f64.promote/f32", TokenType::Convert, Opcode::F64PromoteF32},
+ {""}, {""}, {""},
#line 121 "src/lexer-keywords.txt"
{"f64.reinterpret_i64", TokenType::Convert, Opcode::F64ReinterpretI64},
+ {""}, {""}, {""},
+#line 553 "src/lexer-keywords.txt"
+ {"set_global", TokenType::GlobalSet, Opcode::GlobalSet},
+#line 409 "src/lexer-keywords.txt"
+ {"i64x2.shr_s", TokenType::Binary, Opcode::I64X2ShrS},
+ {""}, {""}, {""},
+#line 410 "src/lexer-keywords.txt"
+ {"i64x2.shr_u", TokenType::Binary, Opcode::I64X2ShrU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""},
+#line 331 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw8CmpxchgU},
+#line 209 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw8.cmpxchg_u", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw8CmpxchgU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 398 "src/lexer-keywords.txt"
+ {"i64.trunc_sat_f64_s", TokenType::Convert, Opcode::I64TruncSatF64S},
+#line 269 "src/lexer-keywords.txt"
+ {"i32.trunc_sat_f64_s", TokenType::Convert, Opcode::I32TruncSatF64S},
+ {""}, {""},
+#line 399 "src/lexer-keywords.txt"
+ {"i64.trunc_sat_f64_u", TokenType::Convert, Opcode::I64TruncSatF64U},
+#line 270 "src/lexer-keywords.txt"
+ {"i32.trunc_sat_f64_u", TokenType::Convert, Opcode::I32TruncSatF64U},
+#line 80 "src/lexer-keywords.txt"
+ {"f32x4.div", TokenType::Binary, Opcode::F32X4Div},
+ {""}, {""},
+#line 417 "src/lexer-keywords.txt"
+ {"i8x16.add", TokenType::Binary, Opcode::I8X16Add},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 403 "src/lexer-keywords.txt"
+ {"i64x2.load32x2_s", TokenType::Load, Opcode::I64X2Load32X2S},
+#line 414 "src/lexer-keywords.txt"
+ {"i64.xor", TokenType::Binary, Opcode::I64Xor},
+#line 308 "src/lexer-keywords.txt"
+ {"i32.xor", TokenType::Binary, Opcode::I32Xor},
{""},
-#line 180 "src/lexer-keywords.txt"
+#line 404 "src/lexer-keywords.txt"
+ {"i64x2.load32x2_u", TokenType::Load, Opcode::I64X2Load32X2U},
+#line 332 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw8.or_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8OrU},
+#line 210 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw8.or_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8OrU},
+ {""},
+#line 181 "src/lexer-keywords.txt"
{"i16x8.ne", TokenType::Compare, Opcode::I16X8Ne},
{""},
-#line 174 "src/lexer-keywords.txt"
+#line 175 "src/lexer-keywords.txt"
{"i16x8.min_s", TokenType::Binary, Opcode::I16X8MinS},
{""}, {""}, {""},
-#line 175 "src/lexer-keywords.txt"
+#line 176 "src/lexer-keywords.txt"
{"i16x8.min_u", TokenType::Binary, Opcode::I16X8MinU},
- {""},
-#line 305 "src/lexer-keywords.txt"
- {"i32x4.widen_low_i16x8_s", TokenType::Unary, Opcode::I32X4WidenLowI16X8S},
- {""},
-#line 306 "src/lexer-keywords.txt"
- {"i32x4.widen_low_i16x8_u", TokenType::Unary, Opcode::I32X4WidenLowI16X8U},
-#line 170 "src/lexer-keywords.txt"
+ {""}, {""}, {""}, {""},
+#line 171 "src/lexer-keywords.txt"
{"i16x8.lt_s", TokenType::Compare, Opcode::I16X8LtS},
{""},
-#line 171 "src/lexer-keywords.txt"
+#line 172 "src/lexer-keywords.txt"
{"i16x8.lt_u", TokenType::Compare, Opcode::I16X8LtU},
{""}, {""}, {""},
-#line 166 "src/lexer-keywords.txt"
- {"i16x8.le_s", TokenType::Compare, Opcode::I16X8LeS},
-#line 34 "src/lexer-keywords.txt"
- {"catch", TokenType::Catch, Opcode::Catch},
#line 167 "src/lexer-keywords.txt"
+ {"i16x8.le_s", TokenType::Compare, Opcode::I16X8LeS},
+ {""},
+#line 168 "src/lexer-keywords.txt"
{"i16x8.le_u", TokenType::Compare, Opcode::I16X8LeU},
-#line 189 "src/lexer-keywords.txt"
- {"i16x8", TokenType::I16X8},
- {""}, {""}, {""}, {""}, {""},
-#line 94 "src/lexer-keywords.txt"
- {"f32x4.sqrt", TokenType::Unary, Opcode::F32X4Sqrt},
- {""}, {""}, {""}, {""}, {""},
-#line 176 "src/lexer-keywords.txt"
- {"i16x8.mul", TokenType::Binary, Opcode::I16X8Mul},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 445 "src/lexer-keywords.txt"
+ {"i8x16.sub_saturate_s", TokenType::Binary, Opcode::I8X16SubSaturateS},
{""},
-#line 397 "src/lexer-keywords.txt"
- {"i64.trunc_sat_f64_s", TokenType::Convert, Opcode::I64TruncSatF64S},
-#line 268 "src/lexer-keywords.txt"
- {"i32.trunc_sat_f64_s", TokenType::Convert, Opcode::I32TruncSatF64S},
- {""}, {""},
-#line 398 "src/lexer-keywords.txt"
- {"i64.trunc_sat_f64_u", TokenType::Convert, Opcode::I64TruncSatF64U},
-#line 269 "src/lexer-keywords.txt"
- {"i32.trunc_sat_f64_u", TokenType::Convert, Opcode::I32TruncSatF64U},
- {""}, {""},
-#line 19 "src/lexer-keywords.txt"
- {"assert_exhaustion", TokenType::AssertExhaustion},
- {""}, {""},
-#line 188 "src/lexer-keywords.txt"
- {"i16x8.sub", TokenType::Binary, Opcode::I16X8Sub},
+#line 446 "src/lexer-keywords.txt"
+ {"i8x16.sub_saturate_u", TokenType::Binary, Opcode::I8X16SubSaturateU},
{""}, {""},
-#line 438 "src/lexer-keywords.txt"
- {"i8x16.ne", TokenType::Compare, Opcode::I8X16Ne},
- {""},
-#line 433 "src/lexer-keywords.txt"
- {"i8x16.min_s", TokenType::Binary, Opcode::I8X16MinS},
+#line 528 "src/lexer-keywords.txt"
+ {"f64.promote/f32", TokenType::Convert, Opcode::F64PromoteF32},
+#line 177 "src/lexer-keywords.txt"
+ {"i16x8.mul", TokenType::Binary, Opcode::I16X8Mul},
+#line 118 "src/lexer-keywords.txt"
+ {"f64.neg", TokenType::Unary, Opcode::F64Neg},
+#line 68 "src/lexer-keywords.txt"
+ {"f32.neg", TokenType::Unary, Opcode::F32Neg},
#line 84 "src/lexer-keywords.txt"
{"f32x4.gt", TokenType::Compare, Opcode::F32X4Gt},
-#line 130 "src/lexer-keywords.txt"
- {"f64x2.eq", TokenType::Compare, Opcode::F64X2Eq},
- {""},
-#line 434 "src/lexer-keywords.txt"
- {"i8x16.min_u", TokenType::Binary, Opcode::I8X16MinU},
- {""}, {""}, {""}, {""},
-#line 429 "src/lexer-keywords.txt"
- {"i8x16.lt_s", TokenType::Compare, Opcode::I8X16LtS},
- {""},
-#line 430 "src/lexer-keywords.txt"
- {"i8x16.lt_u", TokenType::Compare, Opcode::I8X16LtU},
+#line 523 "src/lexer-keywords.txt"
+ {"f32.reinterpret/i32", TokenType::Convert, Opcode::F32ReinterpretI32},
+ {""}, {""}, {""},
+#line 529 "src/lexer-keywords.txt"
+ {"f64.reinterpret/i64", TokenType::Convert, Opcode::F64ReinterpretI64},
+ {""}, {""},
+#line 418 "src/lexer-keywords.txt"
+ {"i8x16.all_true", TokenType::Unary, Opcode::I8X16AllTrue},
{""},
+#line 189 "src/lexer-keywords.txt"
+ {"i16x8.sub", TokenType::Binary, Opcode::I16X8Sub},
+#line 190 "src/lexer-keywords.txt"
+ {"i16x8", TokenType::I16X8},
#line 83 "src/lexer-keywords.txt"
{"f32x4.ge", TokenType::Compare, Opcode::F32X4Ge},
-#line 279 "src/lexer-keywords.txt"
- {"i32x4.gt_s", TokenType::Compare, Opcode::I32X4GtS},
-#line 427 "src/lexer-keywords.txt"
- {"i8x16.le_s", TokenType::Compare, Opcode::I8X16LeS},
#line 280 "src/lexer-keywords.txt"
+ {"i32x4.gt_s", TokenType::Compare, Opcode::I32X4GtS},
+ {""},
+#line 281 "src/lexer-keywords.txt"
{"i32x4.gt_u", TokenType::Compare, Opcode::I32X4GtU},
-#line 428 "src/lexer-keywords.txt"
- {"i8x16.le_u", TokenType::Compare, Opcode::I8X16LeU},
- {""}, {""},
-#line 277 "src/lexer-keywords.txt"
- {"i32x4.ge_s", TokenType::Compare, Opcode::I32X4GeS},
-#line 522 "src/lexer-keywords.txt"
- {"f32.reinterpret/i32", TokenType::Convert, Opcode::F32ReinterpretI32},
+ {""}, {""}, {""},
#line 278 "src/lexer-keywords.txt"
- {"i32x4.ge_u", TokenType::Compare, Opcode::I32X4GeU},
- {""}, {""},
-#line 155 "src/lexer-keywords.txt"
- {"i16x8.add", TokenType::Binary, Opcode::I16X8Add},
-#line 334 "src/lexer-keywords.txt"
- {"i64.atomic.rmw8.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XorU},
-#line 212 "src/lexer-keywords.txt"
- {"i32.atomic.rmw8.xor_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XorU},
+ {"i32x4.ge_s", TokenType::Compare, Opcode::I32X4GeS},
{""},
-#line 528 "src/lexer-keywords.txt"
- {"f64.reinterpret/i64", TokenType::Convert, Opcode::F64ReinterpretI64},
- {""}, {""}, {""},
-#line 344 "src/lexer-keywords.txt"
- {"i64.atomic.store8", TokenType::AtomicStore, Opcode::I64AtomicStore8},
-#line 221 "src/lexer-keywords.txt"
- {"i32.atomic.store8", TokenType::AtomicStore, Opcode::I32AtomicStore8},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 118 "src/lexer-keywords.txt"
- {"f64.neg", TokenType::Unary, Opcode::F64Neg},
-#line 68 "src/lexer-keywords.txt"
- {"f32.neg", TokenType::Unary, Opcode::F32Neg},
-#line 446 "src/lexer-keywords.txt"
- {"i8x16.sub", TokenType::Binary, Opcode::I8X16Sub},
+#line 279 "src/lexer-keywords.txt"
+ {"i32x4.ge_u", TokenType::Compare, Opcode::I32X4GeU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 499 "src/lexer-keywords.txt"
+ {"unreachable", TokenType::Unreachable, Opcode::Unreachable},
{""}, {""}, {""},
-#line 552 "src/lexer-keywords.txt"
- {"set_global", TokenType::GlobalSet, Opcode::GlobalSet},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 524 "src/lexer-keywords.txt"
+#line 525 "src/lexer-keywords.txt"
{"f64.convert_s/i64", TokenType::Convert, Opcode::F64ConvertI64S},
-#line 518 "src/lexer-keywords.txt"
+#line 519 "src/lexer-keywords.txt"
{"f32.convert_s/i64", TokenType::Convert, Opcode::F32ConvertI64S},
-#line 526 "src/lexer-keywords.txt"
+#line 527 "src/lexer-keywords.txt"
{"f64.convert_u/i64", TokenType::Convert, Opcode::F64ConvertI64U},
-#line 520 "src/lexer-keywords.txt"
+#line 521 "src/lexer-keywords.txt"
{"f32.convert_u/i64", TokenType::Convert, Opcode::F32ConvertI64U},
-#line 408 "src/lexer-keywords.txt"
- {"i64x2.shr_s", TokenType::Binary, Opcode::I64X2ShrS},
- {""},
-#line 407 "src/lexer-keywords.txt"
- {"i64x2.shl", TokenType::Binary, Opcode::I64X2Shl},
-#line 508 "src/lexer-keywords.txt"
- {"v128.xor", TokenType::Binary, Opcode::V128Xor},
-#line 409 "src/lexer-keywords.txt"
- {"i64x2.shr_u", TokenType::Binary, Opcode::I64X2ShrU},
+ {""}, {""},
+#line 512 "src/lexer-keywords.txt"
+ {"v64x2.load_splat", TokenType::Load, Opcode::V64X2LoadSplat},
+#line 328 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw32.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XorU},
+ {""}, {""},
+#line 107 "src/lexer-keywords.txt"
+ {"f64.eq", TokenType::Compare, Opcode::F64Eq},
+#line 57 "src/lexer-keywords.txt"
+ {"f32.eq", TokenType::Compare, Opcode::F32Eq},
+ {""}, {""},
+#line 131 "src/lexer-keywords.txt"
+ {"f64x2.extract_lane", TokenType::SimdLaneOp, Opcode::F64X2ExtractLane},
+#line 353 "src/lexer-keywords.txt"
+ {"i64.eq", TokenType::Compare, Opcode::I64Eq},
+#line 230 "src/lexer-keywords.txt"
+ {"i32.eq", TokenType::Compare, Opcode::I32Eq},
+ {""}, {""},
+#line 402 "src/lexer-keywords.txt"
+ {"i64x2.extract_lane", TokenType::SimdLaneOp, Opcode::I64X2ExtractLane},
+#line 139 "src/lexer-keywords.txt"
+ {"f64x2.neg", TokenType::Unary, Opcode::F64X2Neg},
+ {""}, {""}, {""}, {""},
+#line 406 "src/lexer-keywords.txt"
+ {"i64x2.neg", TokenType::Unary, Opcode::I64X2Neg},
+#line 415 "src/lexer-keywords.txt"
+ {"i8x16.add_saturate_s", TokenType::Binary, Opcode::I8X16AddSaturateS},
{""},
-#line 516 "src/lexer-keywords.txt"
- {"anyfunc", Type::Funcref},
-#line 546 "src/lexer-keywords.txt"
+#line 416 "src/lexer-keywords.txt"
+ {"i8x16.add_saturate_u", TokenType::Binary, Opcode::I8X16AddSaturateU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 466 "src/lexer-keywords.txt"
+ {"nan:arithmetic", TokenType::NanArithmetic},
+ {""}, {""},
+#line 156 "src/lexer-keywords.txt"
+ {"i16x8.add", TokenType::Binary, Opcode::I16X8Add},
+#line 468 "src/lexer-keywords.txt"
+ {"nop", TokenType::Nop, Opcode::Nop},
+#line 547 "src/lexer-keywords.txt"
{"i64.trunc_s:sat/f32", TokenType::Convert, Opcode::I64TruncSatF32S},
-#line 534 "src/lexer-keywords.txt"
+#line 535 "src/lexer-keywords.txt"
{"i32.trunc_s:sat/f32", TokenType::Convert, Opcode::I32TruncSatF32S},
-#line 550 "src/lexer-keywords.txt"
+#line 551 "src/lexer-keywords.txt"
{"i64.trunc_u:sat/f32", TokenType::Convert, Opcode::I64TruncSatF32U},
-#line 538 "src/lexer-keywords.txt"
+#line 539 "src/lexer-keywords.txt"
{"i32.trunc_u:sat/f32", TokenType::Convert, Opcode::I32TruncSatF32U},
{""},
-#line 416 "src/lexer-keywords.txt"
- {"i8x16.add", TokenType::Binary, Opcode::I8X16Add},
- {""},
-#line 156 "src/lexer-keywords.txt"
- {"i16x8.all_true", TokenType::Unary, Opcode::I16X8AllTrue},
- {""},
-#line 547 "src/lexer-keywords.txt"
+#line 548 "src/lexer-keywords.txt"
{"i64.trunc_s:sat/f64", TokenType::Convert, Opcode::I64TruncSatF64S},
-#line 535 "src/lexer-keywords.txt"
+#line 536 "src/lexer-keywords.txt"
{"i32.trunc_s:sat/f64", TokenType::Convert, Opcode::I32TruncSatF64S},
-#line 551 "src/lexer-keywords.txt"
+#line 552 "src/lexer-keywords.txt"
{"i64.trunc_u:sat/f64", TokenType::Convert, Opcode::I64TruncSatF64U},
-#line 539 "src/lexer-keywords.txt"
+#line 540 "src/lexer-keywords.txt"
{"i32.trunc_u:sat/f64", TokenType::Convert, Opcode::I32TruncSatF64U},
+#line 150 "src/lexer-keywords.txt"
+ {"global.get", TokenType::GlobalGet, Opcode::GlobalGet},
+ {""}, {""}, {""}, {""},
+#line 515 "src/lexer-keywords.txt"
+ {"v8x16.swizzle", TokenType::Binary, Opcode::V8X16Swizzle},
+ {""}, {""},
+#line 93 "src/lexer-keywords.txt"
+ {"f32x4.splat", TokenType::Unary, Opcode::F32X4Splat},
+ {""},
+#line 327 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw32.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XchgU},
+ {""}, {""},
+#line 299 "src/lexer-keywords.txt"
+ {"i32x4.splat", TokenType::Unary, Opcode::I32X4Splat},
{""}, {""}, {""},
-#line 186 "src/lexer-keywords.txt"
+#line 509 "src/lexer-keywords.txt"
+ {"v128.xor", TokenType::Binary, Opcode::V128Xor},
+ {""}, {""}, {""}, {""}, {""},
+#line 141 "src/lexer-keywords.txt"
+ {"f64x2.replace_lane", TokenType::SimdLaneOp, Opcode::F64X2ReplaceLane},
+ {""}, {""}, {""}, {""},
+#line 407 "src/lexer-keywords.txt"
+ {"i64x2.replace_lane", TokenType::SimdLaneOp, Opcode::I64X2ReplaceLane},
+ {""}, {""},
+#line 321 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XorU},
+#line 206 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XorU},
+#line 187 "src/lexer-keywords.txt"
{"i16x8.sub_saturate_s", TokenType::Binary, Opcode::I16X8SubSaturateS},
{""},
-#line 187 "src/lexer-keywords.txt"
+#line 188 "src/lexer-keywords.txt"
{"i16x8.sub_saturate_u", TokenType::Binary, Opcode::I16X8SubSaturateU},
-#line 327 "src/lexer-keywords.txt"
- {"i64.atomic.rmw32.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XorU},
-#line 511 "src/lexer-keywords.txt"
- {"v64x2.load_splat", TokenType::Load, Opcode::V64X2LoadSplat},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 94 "src/lexer-keywords.txt"
+ {"f32x4.sqrt", TokenType::Unary, Opcode::F32X4Sqrt},
{""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 93 "src/lexer-keywords.txt"
- {"f32x4.splat", TokenType::Unary, Opcode::F32X4Splat},
- {""}, {""}, {""}, {""},
-#line 298 "src/lexer-keywords.txt"
- {"i32x4.splat", TokenType::Unary, Opcode::I32X4Splat},
+#line 157 "src/lexer-keywords.txt"
+ {"i16x8.all_true", TokenType::Unary, Opcode::I16X8AllTrue},
+#line 345 "src/lexer-keywords.txt"
+ {"i64.atomic.store8", TokenType::AtomicStore, Opcode::I64AtomicStore8},
+#line 222 "src/lexer-keywords.txt"
+ {"i32.atomic.store8", TokenType::AtomicStore, Opcode::I32AtomicStore8},
{""}, {""}, {""},
-#line 447 "src/lexer-keywords.txt"
- {"i8x16", TokenType::I8X16},
+#line 335 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw8.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XorU},
+#line 213 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw8.xor_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XorU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 288 "src/lexer-keywords.txt"
+ {"i32x4.max_s", TokenType::Binary, Opcode::I32X4MaxS},
+ {""}, {""},
+#line 130 "src/lexer-keywords.txt"
+ {"f64x2.eq", TokenType::Compare, Opcode::F64X2Eq},
+#line 289 "src/lexer-keywords.txt"
+ {"i32x4.max_u", TokenType::Binary, Opcode::I32X4MaxU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 114 "src/lexer-keywords.txt"
+ {"f64.max", TokenType::Binary, Opcode::F64Max},
+#line 64 "src/lexer-keywords.txt"
+ {"f32.max", TokenType::Binary, Opcode::F32Max},
{""}, {""}, {""}, {""}, {""},
-#line 467 "src/lexer-keywords.txt"
- {"nop", TokenType::Nop, Opcode::Nop},
-#line 149 "src/lexer-keywords.txt"
- {"global.get", TokenType::GlobalGet, Opcode::GlobalGet},
+#line 320 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XchgU},
+#line 205 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XchgU},
+ {""}, {""}, {""},
+#line 517 "src/lexer-keywords.txt"
+ {"anyfunc", Type::Funcref},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""},
-#line 417 "src/lexer-keywords.txt"
- {"i8x16.all_true", TokenType::Unary, Opcode::I8X16AllTrue},
-#line 498 "src/lexer-keywords.txt"
- {"unreachable", TokenType::Unreachable, Opcode::Unreachable},
-#line 326 "src/lexer-keywords.txt"
- {"i64.atomic.rmw32.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XchgU},
- {""},
-#line 153 "src/lexer-keywords.txt"
+#line 154 "src/lexer-keywords.txt"
{"i16x8.add_saturate_s", TokenType::Binary, Opcode::I16X8AddSaturateS},
{""},
-#line 154 "src/lexer-keywords.txt"
+#line 155 "src/lexer-keywords.txt"
{"i16x8.add_saturate_u", TokenType::Binary, Opcode::I16X8AddSaturateU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 296 "src/lexer-keywords.txt"
+ {"i32x4.shl", TokenType::Binary, Opcode::I32X4Shl},
+#line 426 "src/lexer-keywords.txt"
+ {"i8x16.gt_s", TokenType::Compare, Opcode::I8X16GtS},
+ {""},
+#line 427 "src/lexer-keywords.txt"
+ {"i8x16.gt_u", TokenType::Compare, Opcode::I8X16GtU},
+#line 23 "src/lexer-keywords.txt"
+ {"assert_trap", TokenType::AssertTrap},
{""}, {""},
-#line 444 "src/lexer-keywords.txt"
- {"i8x16.sub_saturate_s", TokenType::Binary, Opcode::I8X16SubSaturateS},
+#line 424 "src/lexer-keywords.txt"
+ {"i8x16.ge_s", TokenType::Compare, Opcode::I8X16GeS},
{""},
-#line 445 "src/lexer-keywords.txt"
- {"i8x16.sub_saturate_u", TokenType::Binary, Opcode::I8X16SubSaturateU},
-#line 139 "src/lexer-keywords.txt"
- {"f64x2.neg", TokenType::Unary, Opcode::F64X2Neg},
- {""}, {""}, {""}, {""},
-#line 405 "src/lexer-keywords.txt"
- {"i64x2.neg", TokenType::Unary, Opcode::I64X2Neg},
+#line 425 "src/lexer-keywords.txt"
+ {"i8x16.ge_u", TokenType::Compare, Opcode::I8X16GeU},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""},
-#line 141 "src/lexer-keywords.txt"
- {"f64x2.replace_lane", TokenType::SimdLaneOp, Opcode::F64X2ReplaceLane},
- {""}, {""},
-#line 377 "src/lexer-keywords.txt"
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 378 "src/lexer-keywords.txt"
{"i64.popcnt", TokenType::Unary, Opcode::I64Popcnt},
-#line 249 "src/lexer-keywords.txt"
+#line 250 "src/lexer-keywords.txt"
{"i32.popcnt", TokenType::Unary, Opcode::I32Popcnt},
-#line 406 "src/lexer-keywords.txt"
- {"i64x2.replace_lane", TokenType::SimdLaneOp, Opcode::I64X2ReplaceLane},
+ {""}, {""}, {""}, {""},
+#line 297 "src/lexer-keywords.txt"
+ {"i32x4.shr_s", TokenType::Binary, Opcode::I32X4ShrS},
+ {""}, {""}, {""},
+#line 298 "src/lexer-keywords.txt"
+ {"i32x4.shr_u", TokenType::Binary, Opcode::I32X4ShrU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""},
-#line 459 "src/lexer-keywords.txt"
+#line 460 "src/lexer-keywords.txt"
{"memory.grow", TokenType::MemoryGrow, Opcode::MemoryGrow},
- {""}, {""},
-#line 465 "src/lexer-keywords.txt"
- {"nan:arithmetic", TokenType::NanArithmetic},
- {""},
-#line 402 "src/lexer-keywords.txt"
- {"i64x2.load32x2_s", TokenType::Load, Opcode::I64X2Load32X2S},
- {""}, {""},
-#line 414 "src/lexer-keywords.txt"
- {"i8x16.add_saturate_s", TokenType::Binary, Opcode::I8X16AddSaturateS},
-#line 403 "src/lexer-keywords.txt"
- {"i64x2.load32x2_u", TokenType::Load, Opcode::I64X2Load32X2U},
-#line 415 "src/lexer-keywords.txt"
- {"i8x16.add_saturate_u", TokenType::Binary, Opcode::I8X16AddSaturateU},
{""}, {""}, {""}, {""}, {""},
-#line 131 "src/lexer-keywords.txt"
- {"f64x2.extract_lane", TokenType::SimdLaneOp, Opcode::F64X2ExtractLane},
+#line 136 "src/lexer-keywords.txt"
+ {"f64x2.max", TokenType::Binary, Opcode::F64X2Max},
{""}, {""}, {""}, {""},
-#line 401 "src/lexer-keywords.txt"
- {"i64x2.extract_lane", TokenType::SimdLaneOp, Opcode::I64X2ExtractLane},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 496 "src/lexer-keywords.txt"
- {"try", TokenType::Try, Opcode::Try},
-#line 287 "src/lexer-keywords.txt"
- {"i32x4.max_s", TokenType::Binary, Opcode::I32X4MaxS},
+#line 251 "src/lexer-keywords.txt"
+ {"i32.reinterpret_f32", TokenType::Convert, Opcode::I32ReinterpretF32},
{""}, {""}, {""},
-#line 288 "src/lexer-keywords.txt"
- {"i32x4.max_u", TokenType::Binary, Opcode::I32X4MaxU},
-#line 23 "src/lexer-keywords.txt"
- {"assert_trap", TokenType::AssertTrap},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 462 "src/lexer-keywords.txt"
- {"memory", TokenType::Memory},
+#line 379 "src/lexer-keywords.txt"
+ {"i64.reinterpret_f64", TokenType::Convert, Opcode::I64ReinterpretF64},
+ {""}, {""}, {""},
+#line 530 "src/lexer-keywords.txt"
+ {"get_global", TokenType::GlobalGet, Opcode::GlobalGet},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 274 "src/lexer-keywords.txt"
- {"i32x4.any_true", TokenType::Unary, Opcode::I32X4AnyTrue},
{""}, {""}, {""},
-#line 320 "src/lexer-keywords.txt"
- {"i64.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XorU},
-#line 205 "src/lexer-keywords.txt"
- {"i32.atomic.rmw16.xor_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XorU},
- {""},
-#line 26 "src/lexer-keywords.txt"
- {"binary", TokenType::Bin},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 514 "src/lexer-keywords.txt"
- {"v8x16.swizzle", TokenType::Binary, Opcode::V8X16Swizzle},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 81 "src/lexer-keywords.txt"
- {"f32x4.eq", TokenType::Compare, Opcode::F32X4Eq},
- {""}, {""}, {""}, {""},
-#line 275 "src/lexer-keywords.txt"
- {"i32x4.eq", TokenType::Compare, Opcode::I32X4Eq},
+#line 444 "src/lexer-keywords.txt"
+ {"i8x16.splat", TokenType::Unary, Opcode::I8X16Splat},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 319 "src/lexer-keywords.txt"
- {"i64.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XchgU},
-#line 204 "src/lexer-keywords.txt"
- {"i32.atomic.rmw16.xchg_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XchgU},
+ {""}, {""}, {""}, {""},
+#line 272 "src/lexer-keywords.txt"
+ {"i32.wrap_i64", TokenType::Convert, Opcode::I32WrapI64},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 114 "src/lexer-keywords.txt"
- {"f64.max", TokenType::Binary, Opcode::F64Max},
-#line 64 "src/lexer-keywords.txt"
- {"f32.max", TokenType::Binary, Opcode::F32Max},
+#line 284 "src/lexer-keywords.txt"
+ {"i32x4.load16x4_s", TokenType::Load, Opcode::I32X4Load16X4S},
+ {""}, {""}, {""},
+#line 285 "src/lexer-keywords.txt"
+ {"i32x4.load16x4_u", TokenType::Load, Opcode::I32X4Load16X4U},
{""},
-#line 250 "src/lexer-keywords.txt"
- {"i32.reinterpret_f32", TokenType::Convert, Opcode::I32ReinterpretF32},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 378 "src/lexer-keywords.txt"
- {"i64.reinterpret_f64", TokenType::Convert, Opcode::I64ReinterpretF64},
-#line 296 "src/lexer-keywords.txt"
- {"i32x4.shr_s", TokenType::Binary, Opcode::I32X4ShrS},
-#line 164 "src/lexer-keywords.txt"
- {"i16x8.gt_s", TokenType::Compare, Opcode::I16X8GtS},
-#line 295 "src/lexer-keywords.txt"
- {"i32x4.shl", TokenType::Binary, Opcode::I32X4Shl},
+#line 497 "src/lexer-keywords.txt"
+ {"try", TokenType::Try, Opcode::Try},
+ {""}, {""},
#line 165 "src/lexer-keywords.txt"
+ {"i16x8.gt_s", TokenType::Compare, Opcode::I16X8GtS},
+ {""},
+#line 166 "src/lexer-keywords.txt"
{"i16x8.gt_u", TokenType::Compare, Opcode::I16X8GtU},
-#line 297 "src/lexer-keywords.txt"
- {"i32x4.shr_u", TokenType::Binary, Opcode::I32X4ShrU},
- {""}, {""},
-#line 162 "src/lexer-keywords.txt"
- {"i16x8.ge_s", TokenType::Compare, Opcode::I16X8GeS},
+#line 302 "src/lexer-keywords.txt"
+ {"i32x4.trunc_sat_f32x4_s", TokenType::Unary, Opcode::I32X4TruncSatF32X4S},
{""},
+#line 303 "src/lexer-keywords.txt"
+ {"i32x4.trunc_sat_f32x4_u", TokenType::Unary, Opcode::I32X4TruncSatF32X4U},
#line 163 "src/lexer-keywords.txt"
+ {"i16x8.ge_s", TokenType::Compare, Opcode::I16X8GeS},
+ {""},
+#line 164 "src/lexer-keywords.txt"
{"i16x8.ge_u", TokenType::Compare, Opcode::I16X8GeU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""},
+ {""},
+#line 432 "src/lexer-keywords.txt"
+ {"i8x16.max_s", TokenType::Binary, Opcode::I8X16MaxS},
+ {""},
+#line 463 "src/lexer-keywords.txt"
+ {"memory", TokenType::Memory},
+ {""},
+#line 433 "src/lexer-keywords.txt"
+ {"i8x16.max_u", TokenType::Binary, Opcode::I8X16MaxU},
+ {""}, {""}, {""}, {""},
#line 40 "src/lexer-keywords.txt"
{"elem.drop", TokenType::ElemDrop, Opcode::ElemDrop},
- {""}, {""}, {""},
+ {""},
+#line 275 "src/lexer-keywords.txt"
+ {"i32x4.any_true", TokenType::Unary, Opcode::I32X4AnyTrue},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
#line 36 "src/lexer-keywords.txt"
{"data.drop", TokenType::DataDrop, Opcode::DataDrop},
-#line 510 "src/lexer-keywords.txt"
+ {""}, {""}, {""}, {""},
+#line 26 "src/lexer-keywords.txt"
+ {"binary", TokenType::Bin},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 511 "src/lexer-keywords.txt"
{"v32x4.load_splat", TokenType::Load, Opcode::V32X4LoadSplat},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 301 "src/lexer-keywords.txt"
- {"i32x4.trunc_sat_f32x4_s", TokenType::Unary, Opcode::I32X4TruncSatF32X4S},
- {""},
-#line 302 "src/lexer-keywords.txt"
- {"i32x4.trunc_sat_f32x4_u", TokenType::Unary, Opcode::I32X4TruncSatF32X4U},
-#line 425 "src/lexer-keywords.txt"
- {"i8x16.gt_s", TokenType::Compare, Opcode::I8X16GtS},
- {""},
-#line 426 "src/lexer-keywords.txt"
- {"i8x16.gt_u", TokenType::Compare, Opcode::I8X16GtU},
- {""}, {""}, {""},
-#line 423 "src/lexer-keywords.txt"
- {"i8x16.ge_s", TokenType::Compare, Opcode::I8X16GeS},
{""},
-#line 424 "src/lexer-keywords.txt"
- {"i8x16.ge_u", TokenType::Compare, Opcode::I8X16GeU},
- {""}, {""}, {""}, {""}, {""},
-#line 486 "src/lexer-keywords.txt"
- {"table.copy", TokenType::TableCopy, Opcode::TableCopy},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 531 "src/lexer-keywords.txt"
+#line 532 "src/lexer-keywords.txt"
{"i32.reinterpret/f32", TokenType::Convert, Opcode::I32ReinterpretF32},
+ {""}, {""}, {""},
+#line 544 "src/lexer-keywords.txt"
+ {"i64.reinterpret/f64", TokenType::Convert, Opcode::I64ReinterpretF64},
{""},
+#line 82 "src/lexer-keywords.txt"
+ {"f32x4.extract_lane", TokenType::SimdLaneOp, Opcode::F32X4ExtractLane},
+ {""}, {""}, {""}, {""},
+#line 277 "src/lexer-keywords.txt"
+ {"i32x4.extract_lane", TokenType::SimdLaneOp, Opcode::I32X4ExtractLane},
#line 90 "src/lexer-keywords.txt"
{"f32x4.neg", TokenType::Unary, Opcode::F32X4Neg},
{""}, {""}, {""}, {""},
-#line 292 "src/lexer-keywords.txt"
+#line 293 "src/lexer-keywords.txt"
{"i32x4.neg", TokenType::Unary, Opcode::I32X4Neg},
-#line 543 "src/lexer-keywords.txt"
- {"i64.reinterpret/f64", TokenType::Convert, Opcode::I64ReinterpretF64},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 185 "src/lexer-keywords.txt"
+ {""}, {""}, {""},
+#line 441 "src/lexer-keywords.txt"
+ {"i8x16.shl", TokenType::Binary, Opcode::I8X16Shl},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""},
+#line 420 "src/lexer-keywords.txt"
+ {"i8x16.avgr_u", TokenType::Binary, Opcode::I8X16AvgrU},
+ {""},
+#line 541 "src/lexer-keywords.txt"
+ {"i32.wrap/i64", TokenType::Convert, Opcode::I32WrapI64},
+ {""}, {""}, {""},
+#line 186 "src/lexer-keywords.txt"
{"i16x8.splat", TokenType::Unary, Opcode::I16X8Splat},
- {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 487 "src/lexer-keywords.txt"
+ {"table.copy", TokenType::TableCopy, Opcode::TableCopy},
+ {""}, {""}, {""}, {""},
+#line 442 "src/lexer-keywords.txt"
+ {"i8x16.shr_s", TokenType::Binary, Opcode::I8X16ShrS},
+ {""}, {""}, {""},
+#line 443 "src/lexer-keywords.txt"
+ {"i8x16.shr_u", TokenType::Binary, Opcode::I8X16ShrU},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""},
#line 92 "src/lexer-keywords.txt"
{"f32x4.replace_lane", TokenType::SimdLaneOp, Opcode::F32X4ReplaceLane},
{""}, {""}, {""}, {""},
-#line 294 "src/lexer-keywords.txt"
+#line 295 "src/lexer-keywords.txt"
{"i32x4.replace_lane", TokenType::SimdLaneOp, Opcode::I32X4ReplaceLane},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 529 "src/lexer-keywords.txt"
- {"get_global", TokenType::GlobalGet, Opcode::GlobalGet},
- {""}, {""}, {""}, {""},
-#line 271 "src/lexer-keywords.txt"
- {"i32.wrap_i64", TokenType::Convert, Opcode::I32WrapI64},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 82 "src/lexer-keywords.txt"
- {"f32x4.extract_lane", TokenType::SimdLaneOp, Opcode::F32X4ExtractLane},
- {""}, {""}, {""}, {""},
-#line 276 "src/lexer-keywords.txt"
- {"i32x4.extract_lane", TokenType::SimdLaneOp, Opcode::I32X4ExtractLane},
{""}, {""},
-#line 341 "src/lexer-keywords.txt"
+#line 342 "src/lexer-keywords.txt"
{"i64.atomic.rmw.xor", TokenType::AtomicRmw, Opcode::I64AtomicRmwXor},
-#line 219 "src/lexer-keywords.txt"
+#line 220 "src/lexer-keywords.txt"
{"i32.atomic.rmw.xor", TokenType::AtomicRmw, Opcode::I32AtomicRmwXor},
- {""},
-#line 283 "src/lexer-keywords.txt"
- {"i32x4.load16x4_s", TokenType::Load, Opcode::I32X4Load16X4S},
- {""}, {""},
-#line 443 "src/lexer-keywords.txt"
- {"i8x16.splat", TokenType::Unary, Opcode::I8X16Splat},
-#line 284 "src/lexer-keywords.txt"
- {"i32x4.load16x4_u", TokenType::Load, Opcode::I32X4Load16X4U},
- {""}, {""}, {""},
-#line 136 "src/lexer-keywords.txt"
- {"f64x2.max", TokenType::Binary, Opcode::F64X2Max},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 158 "src/lexer-keywords.txt"
- {"i16x8.avgr_u", TokenType::Binary, Opcode::I16X8AvgrU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""},
-#line 35 "src/lexer-keywords.txt"
- {"current_memory", TokenType::MemorySize, Opcode::MemorySize},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""},
-#line 172 "src/lexer-keywords.txt"
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 173 "src/lexer-keywords.txt"
{"i16x8.max_s", TokenType::Binary, Opcode::I16X8MaxS},
{""}, {""}, {""},
-#line 173 "src/lexer-keywords.txt"
+#line 174 "src/lexer-keywords.txt"
{"i16x8.max_u", TokenType::Binary, Opcode::I16X8MaxU},
- {""}, {""}, {""}, {""},
-#line 540 "src/lexer-keywords.txt"
- {"i32.wrap/i64", TokenType::Convert, Opcode::I32WrapI64},
- {""}, {""}, {""},
-#line 419 "src/lexer-keywords.txt"
- {"i8x16.avgr_u", TokenType::Binary, Opcode::I8X16AvgrU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 25 "src/lexer-keywords.txt"
- {"atomic.notify", TokenType::AtomicNotify, Opcode::AtomicNotify},
-#line 157 "src/lexer-keywords.txt"
- {"i16x8.any_true", TokenType::Unary, Opcode::I16X8AnyTrue},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 431 "src/lexer-keywords.txt"
- {"i8x16.max_s", TokenType::Binary, Opcode::I8X16MaxS},
- {""}, {""}, {""},
-#line 432 "src/lexer-keywords.txt"
- {"i8x16.max_u", TokenType::Binary, Opcode::I8X16MaxU},
+ {""},
+#line 78 "src/lexer-keywords.txt"
+ {"f32x4.convert_i32x4_s", TokenType::Unary, Opcode::F32X4ConvertI32X4S},
+ {""},
+#line 79 "src/lexer-keywords.txt"
+ {"f32x4.convert_i32x4_u", TokenType::Unary, Opcode::F32X4ConvertI32X4U},
+ {""}, {""},
+#line 81 "src/lexer-keywords.txt"
+ {"f32x4.eq", TokenType::Compare, Opcode::F32X4Eq},
{""}, {""}, {""}, {""},
-#line 159 "src/lexer-keywords.txt"
- {"i16x8.eq", TokenType::Compare, Opcode::I16X8Eq},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 276 "src/lexer-keywords.txt"
+ {"i32x4.eq", TokenType::Compare, Opcode::I32X4Eq},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""},
-#line 418 "src/lexer-keywords.txt"
- {"i8x16.any_true", TokenType::Unary, Opcode::I8X16AnyTrue},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 420 "src/lexer-keywords.txt"
- {"i8x16.eq", TokenType::Compare, Opcode::I8X16Eq},
- {""}, {""}, {""}, {""},
-#line 177 "src/lexer-keywords.txt"
- {"i16x8.narrow_i32x4_s", TokenType::Binary, Opcode::I16X8NarrowI32X4S},
+ {""}, {""}, {""},
#line 183 "src/lexer-keywords.txt"
- {"i16x8.shr_s", TokenType::Binary, Opcode::I16X8ShrS},
-#line 178 "src/lexer-keywords.txt"
- {"i16x8.narrow_i32x4_u", TokenType::Binary, Opcode::I16X8NarrowI32X4U},
-#line 182 "src/lexer-keywords.txt"
{"i16x8.shl", TokenType::Binary, Opcode::I16X8Shl},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""},
+#line 159 "src/lexer-keywords.txt"
+ {"i16x8.avgr_u", TokenType::Binary, Opcode::I16X8AvgrU},
+ {""}, {""},
+#line 514 "src/lexer-keywords.txt"
+ {"v8x16.shuffle", TokenType::SimdShuffleOp, Opcode::V8X16Shuffle},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 419 "src/lexer-keywords.txt"
+ {"i8x16.any_true", TokenType::Unary, Opcode::I8X16AnyTrue},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""},
#line 184 "src/lexer-keywords.txt"
+ {"i16x8.shr_s", TokenType::Binary, Opcode::I16X8ShrS},
+ {""}, {""}, {""},
+#line 185 "src/lexer-keywords.txt"
{"i16x8.shr_u", TokenType::Binary, Opcode::I16X8ShrU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""},
-#line 105 "src/lexer-keywords.txt"
- {"f64.copysign", TokenType::Binary, Opcode::F64Copysign},
-#line 54 "src/lexer-keywords.txt"
- {"f32.copysign", TokenType::Binary, Opcode::F32Copysign},
- {""}, {""}, {""}, {""}, {""},
-#line 509 "src/lexer-keywords.txt"
- {"v16x8.load_splat", TokenType::Load, Opcode::V16X8LoadSplat},
+#line 513 "src/lexer-keywords.txt"
+ {"v8x16.load_splat", TokenType::Load, Opcode::V8X16LoadSplat},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""},
-#line 78 "src/lexer-keywords.txt"
- {"f32x4.convert_i32x4_s", TokenType::Unary, Opcode::F32X4ConvertI32X4S},
- {""},
-#line 79 "src/lexer-keywords.txt"
- {"f32x4.convert_i32x4_u", TokenType::Unary, Opcode::F32X4ConvertI32X4U},
- {""}, {""}, {""},
-#line 441 "src/lexer-keywords.txt"
- {"i8x16.shr_s", TokenType::Binary, Opcode::I8X16ShrS},
+#line 422 "src/lexer-keywords.txt"
+ {"i8x16.extract_lane_s", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneS},
{""},
-#line 440 "src/lexer-keywords.txt"
- {"i8x16.shl", TokenType::Binary, Opcode::I8X16Shl},
+#line 423 "src/lexer-keywords.txt"
+ {"i8x16.extract_lane_u", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneU},
{""},
-#line 442 "src/lexer-keywords.txt"
- {"i8x16.shr_u", TokenType::Binary, Opcode::I8X16ShrU},
+#line 438 "src/lexer-keywords.txt"
+ {"i8x16.neg", TokenType::Unary, Opcode::I8X16Neg},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""},
-#line 333 "src/lexer-keywords.txt"
- {"i64.atomic.rmw8.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XchgU},
-#line 211 "src/lexer-keywords.txt"
- {"i32.atomic.rmw8.xchg_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XchgU},
-#line 192 "src/lexer-keywords.txt"
+#line 87 "src/lexer-keywords.txt"
+ {"f32x4.max", TokenType::Binary, Opcode::F32X4Max},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""},
+#line 440 "src/lexer-keywords.txt"
+ {"i8x16.replace_lane", TokenType::SimdLaneOp, Opcode::I8X16ReplaceLane},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 25 "src/lexer-keywords.txt"
+ {"atomic.notify", TokenType::AtomicNotify, Opcode::AtomicNotify},
+#line 193 "src/lexer-keywords.txt"
{"i16x8.widen_low_i8x16_s", TokenType::Unary, Opcode::I16X8WidenLowI8X16S},
{""},
-#line 193 "src/lexer-keywords.txt"
+#line 194 "src/lexer-keywords.txt"
{"i16x8.widen_low_i8x16_u", TokenType::Unary, Opcode::I16X8WidenLowI8X16U},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""},
-#line 512 "src/lexer-keywords.txt"
- {"v8x16.load_splat", TokenType::Load, Opcode::V8X16LoadSplat},
- {""}, {""}, {""},
-#line 179 "src/lexer-keywords.txt"
- {"i16x8.neg", TokenType::Unary, Opcode::I16X8Neg},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""},
-#line 87 "src/lexer-keywords.txt"
- {"f32x4.max", TokenType::Binary, Opcode::F32X4Max},
+#line 334 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw8.xchg_u", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XchgU},
+#line 212 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw8.xchg_u", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XchgU},
+ {""}, {""}, {""}, {""}, {""},
+#line 35 "src/lexer-keywords.txt"
+ {"current_memory", TokenType::MemorySize, Opcode::MemorySize},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 158 "src/lexer-keywords.txt"
+ {"i16x8.any_true", TokenType::Unary, Opcode::I16X8AnyTrue},
{""}, {""},
-#line 168 "src/lexer-keywords.txt"
- {"i16x8.load8x8_s", TokenType::Load, Opcode::I16X8Load8X8S},
- {""},
-#line 169 "src/lexer-keywords.txt"
- {"i16x8.load8x8_u", TokenType::Load, Opcode::I16X8Load8X8U},
-#line 181 "src/lexer-keywords.txt"
- {"i16x8.replace_lane", TokenType::SimdLaneOp, Opcode::I16X8ReplaceLane},
+#line 105 "src/lexer-keywords.txt"
+ {"f64.copysign", TokenType::Binary, Opcode::F64Copysign},
+#line 54 "src/lexer-keywords.txt"
+ {"f32.copysign", TokenType::Binary, Opcode::F32Copysign},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 421 "src/lexer-keywords.txt"
+ {"i8x16.eq", TokenType::Compare, Opcode::I8X16Eq},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 510 "src/lexer-keywords.txt"
+ {"v16x8.load_splat", TokenType::Load, Opcode::V16X8LoadSplat},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""},
-#line 152 "src/lexer-keywords.txt"
- {"grow_memory", TokenType::MemoryGrow, Opcode::MemoryGrow},
{""}, {""}, {""}, {""}, {""},
-#line 437 "src/lexer-keywords.txt"
- {"i8x16.neg", TokenType::Unary, Opcode::I8X16Neg},
- {""},
-#line 160 "src/lexer-keywords.txt"
+#line 161 "src/lexer-keywords.txt"
{"i16x8.extract_lane_s", TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneS},
{""},
-#line 161 "src/lexer-keywords.txt"
+#line 162 "src/lexer-keywords.txt"
{"i16x8.extract_lane_u", TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""},
-#line 513 "src/lexer-keywords.txt"
- {"v8x16.shuffle", TokenType::SimdShuffleOp, Opcode::V8X16Shuffle},
- {""}, {""},
-#line 439 "src/lexer-keywords.txt"
- {"i8x16.replace_lane", TokenType::SimdLaneOp, Opcode::I8X16ReplaceLane},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""},
+#line 180 "src/lexer-keywords.txt"
+ {"i16x8.neg", TokenType::Unary, Opcode::I16X8Neg},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""},
-#line 421 "src/lexer-keywords.txt"
- {"i8x16.extract_lane_s", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneS},
+#line 178 "src/lexer-keywords.txt"
+ {"i16x8.narrow_i32x4_s", TokenType::Binary, Opcode::I16X8NarrowI32X4S},
{""},
-#line 422 "src/lexer-keywords.txt"
- {"i8x16.extract_lane_u", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneU},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 179 "src/lexer-keywords.txt"
+ {"i16x8.narrow_i32x4_u", TokenType::Binary, Opcode::I16X8NarrowI32X4U},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 169 "src/lexer-keywords.txt"
+ {"i16x8.load8x8_s", TokenType::Load, Opcode::I16X8Load8X8S},
+ {""},
+#line 170 "src/lexer-keywords.txt"
+ {"i16x8.load8x8_u", TokenType::Load, Opcode::I16X8Load8X8U},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""},
-#line 337 "src/lexer-keywords.txt"
- {"i64.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmwCmpxchg},
-#line 215 "src/lexer-keywords.txt"
- {"i32.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmwCmpxchg},
- {""}, {""}, {""}, {""}, {""},
-#line 435 "src/lexer-keywords.txt"
+#line 182 "src/lexer-keywords.txt"
+ {"i16x8.replace_lane", TokenType::SimdLaneOp, Opcode::I16X8ReplaceLane},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 436 "src/lexer-keywords.txt"
{"i8x16.narrow_i16x8_s", TokenType::Binary, Opcode::I8X16NarrowI16X8S},
{""},
-#line 436 "src/lexer-keywords.txt"
+#line 437 "src/lexer-keywords.txt"
{"i8x16.narrow_i16x8_u", TokenType::Binary, Opcode::I8X16NarrowI16X8U},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""},
+#line 304 "src/lexer-keywords.txt"
+ {"i32x4.widen_high_i16x8_s", TokenType::Unary, Opcode::I32X4WidenHighI16X8S},
+ {""},
+#line 305 "src/lexer-keywords.txt"
+ {"i32x4.widen_high_i16x8_u", TokenType::Unary, Opcode::I32X4WidenHighI16X8U},
+#line 338 "src/lexer-keywords.txt"
+ {"i64.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmwCmpxchg},
+#line 216 "src/lexer-keywords.txt"
+ {"i32.atomic.rmw.cmpxchg", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmwCmpxchg},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 457 "src/lexer-keywords.txt"
- {"memory.copy", TokenType::MemoryCopy, Opcode::MemoryCopy},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+#line 160 "src/lexer-keywords.txt"
+ {"i16x8.eq", TokenType::Compare, Opcode::I16X8Eq},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""}, {""},
-#line 303 "src/lexer-keywords.txt"
- {"i32x4.widen_high_i16x8_s", TokenType::Unary, Opcode::I32X4WidenHighI16X8S},
- {""},
-#line 304 "src/lexer-keywords.txt"
- {"i32x4.widen_high_i16x8_u", TokenType::Unary, Opcode::I32X4WidenHighI16X8U},
+ {""}, {""}, {""}, {""}, {""},
+#line 153 "src/lexer-keywords.txt"
+ {"grow_memory", TokenType::MemoryGrow, Opcode::MemoryGrow},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
@@ -1570,6 +1569,9 @@ Perfect_Hash::InWordSet (const char *str, size_t len)
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""}, {""}, {""}, {""}, {""},
+#line 458 "src/lexer-keywords.txt"
+ {"memory.copy", TokenType::MemoryCopy, Opcode::MemoryCopy},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
@@ -1577,16 +1579,17 @@ Perfect_Hash::InWordSet (const char *str, size_t len)
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 340 "src/lexer-keywords.txt"
+ {""}, {""}, {""},
+#line 341 "src/lexer-keywords.txt"
{"i64.atomic.rmw.xchg", TokenType::AtomicRmw, Opcode::I64AtomicRmwXchg},
-#line 218 "src/lexer-keywords.txt"
+#line 219 "src/lexer-keywords.txt"
{"i32.atomic.rmw.xchg", TokenType::AtomicRmw, Opcode::I32AtomicRmwXchg},
- {""}, {""}, {""}, {""}, {""}, {""},
-#line 190 "src/lexer-keywords.txt"
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {""}, {""},
+#line 191 "src/lexer-keywords.txt"
{"i16x8.widen_high_i8x16_s", TokenType::Unary, Opcode::I16X8WidenHighI8X16S},
{""},
-#line 191 "src/lexer-keywords.txt"
+#line 192 "src/lexer-keywords.txt"
{"i16x8.widen_high_i8x16_u", TokenType::Unary, Opcode::I16X8WidenHighI8X16U}
};
diff --git a/src/shared-validator.cc b/src/shared-validator.cc
index 5af98356..a82e3b9f 100644
--- a/src/shared-validator.cc
+++ b/src/shared-validator.cc
@@ -54,15 +54,24 @@ Result SharedValidator::OnFuncType(const Location& loc,
result |=
PrintError(loc, "multiple result values not currently supported.");
}
- types_.push_back(FuncType{ToTypeVector(param_count, param_types),
- ToTypeVector(result_count, result_types)});
+ func_types_.emplace(num_types_++,
+ FuncType{ToTypeVector(param_count, param_types),
+ ToTypeVector(result_count, result_types)});
return result;
}
+Result SharedValidator::OnStructType(const Location&,
+ Index field_count,
+ TypeMut* fields) {
+ struct_types_.emplace(num_types_++, StructType{TypeMutVector(
+ &fields[0], &fields[field_count])});
+ return Result::Ok;
+}
+
Result SharedValidator::OnFunction(const Location& loc, Var sig_var) {
Result result = Result::Ok;
FuncType type;
- result |= CheckTypeIndex(sig_var, &type);
+ result |= CheckFuncTypeIndex(sig_var, &type);
funcs_.push_back(type);
return result;
}
@@ -219,7 +228,7 @@ Result SharedValidator::OnGlobalInitExpr_Other(const Location& loc) {
Result SharedValidator::OnEvent(const Location& loc, Var sig_var) {
Result result = Result::Ok;
FuncType type;
- result |= CheckTypeIndex(sig_var, &type);
+ result |= CheckFuncTypeIndex(sig_var, &type);
if (!type.results.empty()) {
result |= PrintError(loc, "Event signature must have 0 results.");
}
@@ -433,8 +442,23 @@ Result SharedValidator::CheckLocalIndex(Var local_var, Type* out_type) {
return Result::Ok;
}
-Result SharedValidator::CheckTypeIndex(Var sig_var, FuncType* out) {
- return CheckIndexWithValue(sig_var, types_, out, "function type");
+Result SharedValidator::CheckFuncTypeIndex(Var sig_var, FuncType* out) {
+ Result result = CheckIndex(sig_var, num_types_, "function type");
+ if (Failed(result)) {
+ *out = FuncType{};
+ return Result::Error;
+ }
+
+ auto iter = func_types_.find(sig_var.index());
+ if (iter == func_types_.end()) {
+ return PrintError(sig_var.loc, "type %d is not a function",
+ sig_var.index());
+ }
+
+ if (out) {
+ *out = iter->second;
+ }
+ return Result::Ok;
}
Result SharedValidator::CheckFuncIndex(Var func_var, FuncType* out) {
@@ -476,7 +500,7 @@ Result SharedValidator::CheckBlockSignature(const Location& loc,
if (sig_type.IsIndex()) {
Index sig_index = sig_type.GetIndex();
FuncType func_type;
- result |= CheckTypeIndex(Var(sig_index, loc), &func_type);
+ result |= CheckFuncTypeIndex(Var(sig_index, loc), &func_type);
if (!func_type.params.empty() && !options_.features.multi_value_enabled()) {
result |= PrintError(loc, "%s params not currently supported.",
@@ -709,7 +733,7 @@ Result SharedValidator::OnCallIndirect(const Location& loc,
Result result = Result::Ok;
expr_loc_ = &loc;
FuncType func_type;
- result |= CheckTypeIndex(sig_var, &func_type);
+ result |= CheckFuncTypeIndex(sig_var, &func_type);
result |= CheckTableIndex(table_var);
result |= typechecker_.OnCallIndirect(func_type.params, func_type.results);
return result;
@@ -962,7 +986,7 @@ Result SharedValidator::OnReturnCallIndirect(const Location& loc,
expr_loc_ = &loc;
result |= CheckTableIndex(table_var);
FuncType func_type;
- result |= CheckTypeIndex(sig_var, &func_type);
+ result |= CheckFuncTypeIndex(sig_var, &func_type);
result |=
typechecker_.OnReturnCallIndirect(func_type.params, func_type.results);
return result;
diff --git a/src/shared-validator.h b/src/shared-validator.h
index 4ecaeabc..abd4196e 100644
--- a/src/shared-validator.h
+++ b/src/shared-validator.h
@@ -17,6 +17,7 @@
#ifndef WABT_SHARED_VALIDATOR_H_
#define WABT_SHARED_VALIDATOR_H_
+#include <map>
#include <set>
#include <string>
#include <vector>
@@ -28,6 +29,8 @@
#include "src/opcode.h"
#include "src/type-checker.h"
+#include "src/binary-reader.h" // For TypeMut.
+
namespace wabt {
struct ValidateOptions {
@@ -63,6 +66,7 @@ class SharedValidator {
const Type* param_types,
Index result_count,
const Type* result_types);
+ Result OnStructType(const Location&, Index field_count, TypeMut* fields);
Result OnFunction(const Location&, Var sig_var);
Result OnTable(const Location&, Type elem_type, const Limits&);
@@ -169,10 +173,21 @@ class SharedValidator {
private:
struct FuncType {
+ FuncType() = default;
+ FuncType(const TypeVector& params, const TypeVector& results)
+ : params(params), results(results) {}
+
TypeVector params;
TypeVector results;
};
+ struct StructType {
+ StructType() = default;
+ StructType(const TypeMutVector& fields) : fields(fields) {}
+
+ TypeMutVector fields;
+ };
+
struct TableType {
TableType() = default;
TableType(Type element, Limits limits) : element(element), limits(limits) {}
@@ -231,7 +246,7 @@ class SharedValidator {
const std::vector<T>& values,
T* out,
const char* desc);
- Result CheckTypeIndex(Var sig_var, FuncType* out = nullptr);
+ Result CheckFuncTypeIndex(Var sig_var, FuncType* out = nullptr);
Result CheckFuncIndex(Var func_var, FuncType* out = nullptr);
Result CheckTableIndex(Var table_var, TableType* out = nullptr);
Result CheckMemoryIndex(Var memory_var, MemoryType* out = nullptr);
@@ -257,7 +272,10 @@ class SharedValidator {
// Cached for access by OnTypecheckerError.
const Location* expr_loc_ = nullptr;
- std::vector<FuncType> types_;
+ Index num_types_ = 0;
+ std::map<Index, FuncType> func_types_;
+ std::map<Index, StructType> struct_types_;
+
std::vector<FuncType> funcs_; // Includes imported and defined.
std::vector<TableType> tables_; // Includes imported and defined.
std::vector<MemoryType> memories_; // Includes imported and defined.
diff --git a/src/token.def b/src/token.def
index 9658bae0..fe55a786 100644
--- a/src/token.def
+++ b/src/token.def
@@ -34,6 +34,7 @@ WABT_TOKEN(Elem, "elem")
WABT_TOKEN(Eof, "EOF")
WABT_TOKEN(Event, "event")
WABT_TOKEN(Export, "export")
+WABT_TOKEN(Field, "field")
WABT_TOKEN(Func, "func")
WABT_TOKEN(Get, "get")
WABT_TOKEN(Global, "global")
diff --git a/src/validator.cc b/src/validator.cc
index e1d099a4..d9eb415f 100644
--- a/src/validator.cc
+++ b/src/validator.cc
@@ -597,7 +597,13 @@ Result Validator::CheckModule() {
}
case TypeEntryKind::Struct: {
- // TODO
+ StructType* struct_type = cast<StructType>(f->type.get());
+ TypeMutVector type_muts;
+ for (auto&& field : struct_type->fields) {
+ type_muts.push_back(TypeMut{field.type, field.mutable_});
+ }
+ result_ |= validator_.OnStructType(field.loc, type_muts.size(),
+ type_muts.data());
break;
}
}
diff --git a/src/wast-parser.cc b/src/wast-parser.cc
index 71d37ffe..c253ef2a 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -1205,6 +1205,7 @@ Result WastParser::ParseTypeModuleField(Module* module) {
return Result::Error;
}
auto struct_type = MakeUnique<StructType>(name);
+ CHECK_RESULT(ParseFieldList(&struct_type->fields));
EXPECT(Rpar);
EXPECT(Rpar);
field->type = std::move(struct_type);
@@ -1216,6 +1217,42 @@ Result WastParser::ParseTypeModuleField(Module* module) {
return Result::Ok;
}
+Result WastParser::ParseField(Field* field) {
+ WABT_TRACE(ParseField);
+ auto parse_mut_valuetype = [&]() -> Result {
+ // TODO: Share with ParseGlobalType?
+ if (MatchLpar(TokenType::Mut)) {
+ field->mutable_ = true;
+ CHECK_RESULT(ParseValueType(&field->type));
+ EXPECT(Rpar);
+ } else {
+ field->mutable_ = false;
+ CHECK_RESULT(ParseValueType(&field->type));
+ }
+ return Result::Ok;
+ };
+
+ if (MatchLpar(TokenType::Field)) {
+ ParseBindVarOpt(&field->name);
+ CHECK_RESULT(parse_mut_valuetype());
+ EXPECT(Rpar);
+ } else {
+ CHECK_RESULT(parse_mut_valuetype());
+ }
+
+ return Result::Ok;
+}
+
+Result WastParser::ParseFieldList(std::vector<Field>* fields) {
+ WABT_TRACE(ParseFieldList);
+ while (PeekMatch(TokenType::ValueType) || PeekMatch(TokenType::Lpar)) {
+ Field field;
+ CHECK_RESULT(ParseField(&field));
+ fields->push_back(field);
+ }
+ return Result::Ok;
+}
+
Result WastParser::ParseGlobalModuleField(Module* module) {
WABT_TRACE(ParseGlobalModuleField);
EXPECT(Lpar);
diff --git a/src/wast-parser.h b/src/wast-parser.h
index 723bf435..7ddaf3b8 100644
--- a/src/wast-parser.h
+++ b/src/wast-parser.h
@@ -181,6 +181,8 @@ class WastParser {
Result ParseExprList(ExprList*);
Result ParseExpr(ExprList*);
Result ParseGlobalType(Global*);
+ Result ParseField(Field*);
+ Result ParseFieldList(std::vector<Field>*);
template <typename T>
Result ParsePlainInstrVar(Location, std::unique_ptr<Expr>*);
diff --git a/src/wat-writer.cc b/src/wat-writer.cc
index 639e7194..eff63c9f 100644
--- a/src/wat-writer.cc
+++ b/src/wat-writer.cc
@@ -1373,15 +1373,30 @@ void WatWriter::WriteTypeEntry(const TypeEntry& type) {
WriteOpenSpace("func");
WriteFuncSigSpace(cast<FuncType>(&type)->sig);
WriteCloseSpace();
- WriteCloseNewline();
break;
- case TypeEntryKind::Struct:
+ case TypeEntryKind::Struct: {
+ auto* struct_type = cast<StructType>(&type);
WriteOpenSpace("struct");
+ Index field_index = 0;
+ for (auto&& field : struct_type->fields) {
+ // TODO: Write shorthand if there is no name.
+ WriteOpenSpace("field");
+ WriteNameOrIndex(field.name, field_index++, NextChar::Space);
+ if (field.mutable_) {
+ WriteOpenSpace("mut");
+ }
+ WriteType(field.type, NextChar::Space);
+ if (field.mutable_) {
+ WriteCloseSpace();
+ }
+ WriteCloseSpace();
+ }
WriteCloseSpace();
- WriteCloseNewline();
break;
+ }
}
+ WriteCloseNewline();
}
void WatWriter::WriteStartFunction(const Var& start) {
diff --git a/test/parse/module/struct-and-func.txt b/test/parse/module/struct-and-func.txt
new file mode 100644
index 00000000..93a524e1
--- /dev/null
+++ b/test/parse/module/struct-and-func.txt
@@ -0,0 +1,7 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-gc
+(type (struct i32 i32))
+(type (func (result i32)))
+
+(func (result i32)
+ i32.const 0)
diff --git a/test/parse/module/struct-field-name.txt b/test/parse/module/struct-field-name.txt
new file mode 100644
index 00000000..ea42514e
--- /dev/null
+++ b/test/parse/module/struct-field-name.txt
@@ -0,0 +1,5 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-gc
+(type
+ (struct (field $a f32)
+ (field $b (mut f64))))
diff --git a/test/parse/module/struct-mut-field.txt b/test/parse/module/struct-mut-field.txt
new file mode 100644
index 00000000..8189179a
--- /dev/null
+++ b/test/parse/module/struct-mut-field.txt
@@ -0,0 +1,3 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-gc
+(type (struct (mut f32) (field (mut f64))))
diff --git a/test/parse/module/struct.txt b/test/parse/module/struct.txt
index e199a0ce..825e9d67 100644
--- a/test/parse/module/struct.txt
+++ b/test/parse/module/struct.txt
@@ -1,3 +1,3 @@
;;; TOOL: wat2wasm
;;; ARGS: --enable-gc
-(type (struct))
+(type (struct i32 (field i64)))