/* * Copyright 2016 WebAssembly Community Group participants * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "src/wast-lexer.h" #include #include #include "config.h" #include "src/lexer-source.h" #include "src/wast-parser.h" /*!max:re2c */ #define INITIAL_LEXER_BUFFER_SIZE (64 * 1024) #define ERROR(...) parser->Error(GetLocation(), __VA_ARGS__) #define BEGIN(c) cond = (c) #define FILL(n) \ do { \ if (Failed(Fill((n)))) { \ RETURN(Eof); \ } \ } while (0) #define MAYBE_MALFORMED_UTF8(desc) \ if (!(eof_ && limit_ - cursor_ <= YYMAXFILL)) { \ ERROR("malformed utf-8%s", desc); \ } \ continue #define yytext (next_pos_) #define yyleng (cursor_ - next_pos_) /* p must be a pointer somewhere in the lexer buffer */ #define FILE_OFFSET(p) ((p) - (buffer_) + buffer_file_offset_) #define COLUMN(p) (FILE_OFFSET(p) - line_file_offset_ + 1) #define COMMENT_NESTING (comment_nesting_) #define NEWLINE \ do { \ line_++; \ line_file_offset_ = FILE_OFFSET(cursor_); \ } while (0) #define RETURN(token) return Token(GetLocation(), TokenType::token); #define RETURN_LITERAL(token, literal) \ return Token(GetLocation(), TokenType::token, \ MakeLiteral(LiteralType::literal)) #define RETURN_TYPE(token, type) \ return Token(GetLocation(), TokenType::token, Type::type) #define RETURN_OPCODE0(token) \ return Token(GetLocation(), TokenType::token, Opcode::token) #define RETURN_OPCODE(token, opcode) \ return Token(GetLocation(), TokenType::token, Opcode::opcode) #define RETURN_TEXT(token) \ return Token(GetLocation(), TokenType::token, GetText()) #define RETURN_TEXT_AT(token, at) \ return Token(GetLocation(), TokenType::token, GetText(at)) namespace wabt { WastLexer::WastLexer(std::unique_ptr source, string_view filename) : source_(std::move(source)), filename_(filename), line_(1), comment_nesting_(0), buffer_file_offset_(0), line_file_offset_(0), eof_(false), buffer_(nullptr), buffer_size_(0), marker_(nullptr), next_pos_(nullptr), cursor_(nullptr), limit_(nullptr) {} WastLexer::~WastLexer() { delete[] buffer_; } // static std::unique_ptr WastLexer::CreateBufferLexer(string_view filename, const void* data, size_t size) { return MakeUnique(MakeUnique(data, size), filename); } Location WastLexer::GetLocation() { return Location(filename_, line_, COLUMN(next_pos_), COLUMN(cursor_)); } Literal WastLexer::MakeLiteral(LiteralType type) { return Literal(type, GetText()); } std::string WastLexer::GetText(size_t offset) { return std::string(yytext + offset, yyleng - offset); } Result WastLexer::Fill(size_t need) { if (eof_) { return Result::Error; } size_t free = next_pos_ - buffer_; assert(static_cast(cursor_ - buffer_) >= free); // Our buffer is too small, need to realloc. if (free < need) { char* old_buffer = buffer_; size_t old_buffer_size = buffer_size_; size_t new_buffer_size = old_buffer_size ? old_buffer_size * 2 : INITIAL_LEXER_BUFFER_SIZE; // Make sure there is enough space for the bytes requested (need) and an // additional YYMAXFILL bytes which is needed for the re2c lexer // implementation when the eof is reached. while ((new_buffer_size - old_buffer_size) + free < need + YYMAXFILL) new_buffer_size *= 2; char* new_buffer = new char[new_buffer_size]; if (limit_ > next_pos_) { memmove(new_buffer, next_pos_, limit_ - next_pos_); } buffer_ = new_buffer; buffer_size_ = new_buffer_size; next_pos_ = new_buffer + (next_pos_ - old_buffer) - free; marker_ = new_buffer + (marker_ - old_buffer) - free; cursor_ = new_buffer + (cursor_ - old_buffer) - free; limit_ = new_buffer + (limit_ - old_buffer) - free; buffer_file_offset_ += free; free += new_buffer_size - old_buffer_size; delete[] old_buffer; } else { // Shift everything down to make more room in the buffer. if (limit_ > next_pos_) { memmove(buffer_, next_pos_, limit_ - next_pos_); } next_pos_ -= free; marker_ -= free; cursor_ -= free; limit_ -= free; buffer_file_offset_ += free; } // Read the new data into the buffer. limit_ += source_->Fill(limit_, free); // If at the end of file, need to fill YYMAXFILL more characters with "fake // characters", that are not a lexeme nor a lexeme suffix. see // http://re2c.org/examples/example_03.html. if (limit_ < buffer_ + buffer_size_ - YYMAXFILL) { eof_ = true; // Fill with 0xff, since that is an invalid utf-8 byte. memset(limit_, 0xff, YYMAXFILL); limit_ += YYMAXFILL; } return Result::Ok; } Token WastLexer::GetToken(WastParser* parser) { /*!types:re2c*/ YYCONDTYPE cond = YYCOND_i; // i is the initial state. for (;;) { next_pos_ = cursor_; /*!re2c re2c:condprefix = YYCOND_; re2c:condenumprefix = YYCOND_; re2c:define:YYCTYPE = "unsigned char"; re2c:define:YYCURSOR = cursor_; re2c:define:YYMARKER = marker_; re2c:define:YYLIMIT = limit_; re2c:define:YYFILL = "FILL"; re2c:define:YYGETCONDITION = "cond"; re2c:define:YYGETCONDITION:naked = 1; re2c:define:YYSETCONDITION = "BEGIN"; digit = [0-9]; hexdigit = [0-9a-fA-F]; num = digit ("_"? digit)*; hexnum = hexdigit ("_"? hexdigit)*; letter = [a-zA-Z]; symbol = [+\-*\\/^~=<>!?@#$%&|:`.']; character = [^"\\\x00-\x1f] | "\\" [nrt\\'"] | "\\" hexdigit hexdigit; sign = [+-]; nat = num | "0x" hexnum; int = sign nat; frac = num; hexfrac = hexnum; hexfloat = sign? "0x" hexnum "." hexfrac? | sign? "0x" hexnum ("." hexfrac?)? [pP] sign? num; infinity = sign? "inf"; nan = sign? "nan" | sign? "nan:0x" hexnum; float = sign? num "." frac? | sign? num ("." frac?)? [eE] sign? num; text = '"' character* '"'; name = "$" (letter | digit | "_" | symbol)+; // Should be ([\x21-\x7e] \ [()"; ])+ , but re2c doesn't like this... reserved = [\x21\x23-\x27\x2a-\x3a\x3c-\x7e]+; "(" { RETURN(Lpar); } ")" { RETURN(Rpar); } nat { RETURN_LITERAL(Nat, Int); } int { RETURN_LITERAL(Int, Int); } float { RETURN_LITERAL(Float, Float); } hexfloat { RETURN_LITERAL(Float, Hexfloat); } infinity { RETURN_LITERAL(Float, Infinity); } nan { RETURN_LITERAL(Float, Nan); } text { RETURN_TEXT(Text); } '"' => BAD_TEXT { continue; } character { continue; } "\n" => i { ERROR("newline in string"); NEWLINE; continue; } "\\". { ERROR("bad escape \"%.*s\"", static_cast(yyleng), yytext); continue; } '"' => i { RETURN_TEXT(Text); } [^] { ERROR("illegal character in string"); continue; } * { MAYBE_MALFORMED_UTF8(" in string"); } "i32" { RETURN_TYPE(ValueType, I32); } "i64" { RETURN_TYPE(ValueType, I64); } "f32" { RETURN_TYPE(ValueType, F32); } "f64" { RETURN_TYPE(ValueType, F64); } "v128" { RETURN_TYPE(ValueType, V128); } "funcref" { RETURN_TYPE(ValueType, Funcref); } "anyref" { RETURN_TYPE(ValueType, Anyref); } "mut" { RETURN(Mut); } "nop" { RETURN_OPCODE0(Nop); } "block" { RETURN_OPCODE0(Block); } "if" { RETURN_OPCODE0(If); } "then" { RETURN(Then); } "else" { RETURN_OPCODE0(Else); } "loop" { RETURN_OPCODE0(Loop); } "br" { RETURN_OPCODE0(Br); } "br_if" { RETURN_OPCODE0(BrIf); } "br_table" { RETURN_OPCODE0(BrTable); } "call" { RETURN_OPCODE0(Call); } "call_indirect" { RETURN_OPCODE0(CallIndirect); } "drop" { RETURN_OPCODE0(Drop); } "end" { RETURN_OPCODE0(End); } "return" { RETURN_OPCODE0(Return); } "local.get" { RETURN_OPCODE0(LocalGet); } "local.set" { RETURN_OPCODE0(LocalSet); } "local.tee" { RETURN_OPCODE0(LocalTee); } "global.get" { RETURN_OPCODE0(GlobalGet); } "global.set" { RETURN_OPCODE0(GlobalSet); } "i32.load" { RETURN_OPCODE(Load, I32Load); } "i64.load" { RETURN_OPCODE(Load, I64Load); } "f32.load" { RETURN_OPCODE(Load, F32Load); } "f64.load" { RETURN_OPCODE(Load, F64Load); } "i32.store" { RETURN_OPCODE(Store, I32Store); } "i64.store" { RETURN_OPCODE(Store, I64Store); } "f32.store" { RETURN_OPCODE(Store, F32Store); } "f64.store" { RETURN_OPCODE(Store, F64Store); } "i32.load8_s" { RETURN_OPCODE(Load, I32Load8S); } "i64.load8_s" { RETURN_OPCODE(Load, I64Load8S); } "i32.load8_u" { RETURN_OPCODE(Load, I32Load8U); } "i64.load8_u" { RETURN_OPCODE(Load, I64Load8U); } "i32.load16_s" { RETURN_OPCODE(Load, I32Load16S); } "i64.load16_s" { RETURN_OPCODE(Load, I64Load16S); } "i32.load16_u" { RETURN_OPCODE(Load, I32Load16U); } "i64.load16_u" { RETURN_OPCODE(Load, I64Load16U); } "i64.load32_s" { RETURN_OPCODE(Load, I64Load32S); } "i64.load32_u" { RETURN_OPCODE(Load, I64Load32U); } "i32.store8" { RETURN_OPCODE(Store, I32Store8); } "i64.store8" { RETURN_OPCODE(Store, I64Store8); } "i32.store16" { RETURN_OPCODE(Store, I32Store16); } "i64.store16" { RETURN_OPCODE(Store, I64Store16); } "i64.store32" { RETURN_OPCODE(Store, I64Store32); } "offset=" nat { RETURN_TEXT_AT(OffsetEqNat, 7); } "align=" nat { RETURN_TEXT_AT(AlignEqNat, 6); } "i32.const" { RETURN_OPCODE(Const, I32Const); } "i64.const" { RETURN_OPCODE(Const, I64Const); } "f32.const" { RETURN_OPCODE(Const, F32Const); } "f64.const" { RETURN_OPCODE(Const, F64Const); } "i32.eqz" { RETURN_OPCODE(Convert, I32Eqz); } "i64.eqz" { RETURN_OPCODE(Convert, I64Eqz); } "i32.clz" { RETURN_OPCODE(Unary, I32Clz); } "i64.clz" { RETURN_OPCODE(Unary, I64Clz); } "i32.ctz" { RETURN_OPCODE(Unary, I32Ctz); } "i64.ctz" { RETURN_OPCODE(Unary, I64Ctz); } "i32.popcnt" { RETURN_OPCODE(Unary, I32Popcnt); } "i64.popcnt" { RETURN_OPCODE(Unary, I64Popcnt); } "f32.neg" { RETURN_OPCODE(Unary, F32Neg); } "f64.neg" { RETURN_OPCODE(Unary, F64Neg); } "f32.abs" { RETURN_OPCODE(Unary, F32Abs); } "f64.abs" { RETURN_OPCODE(Unary, F64Abs); } "f32.sqrt" { RETURN_OPCODE(Unary, F32Sqrt); } "f64.sqrt" { RETURN_OPCODE(Unary, F64Sqrt); } "f32.ceil" { RETURN_OPCODE(Unary, F32Ceil); } "f64.ceil" { RETURN_OPCODE(Unary, F64Ceil); } "f32.floor" { RETURN_OPCODE(Unary, F32Floor); } "f64.floor" { RETURN_OPCODE(Unary, F64Floor); } "f32.trunc" { RETURN_OPCODE(Unary, F32Trunc); } "f64.trunc" { RETURN_OPCODE(Unary, F64Trunc); } "f32.nearest" { RETURN_OPCODE(Unary, F32Nearest); } "f64.nearest" { RETURN_OPCODE(Unary, F64Nearest); } "i32.extend8_s" { RETURN_OPCODE(Unary, I32Extend8S); } "i32.extend16_s" { RETURN_OPCODE(Unary, I32Extend16S); } "i64.extend8_s" { RETURN_OPCODE(Unary, I64Extend8S); } "i64.extend16_s" { RETURN_OPCODE(Unary, I64Extend16S); } "i64.extend32_s" { RETURN_OPCODE(Unary, I64Extend32S); } "i32.add" { RETURN_OPCODE(Binary, I32Add); } "i64.add" { RETURN_OPCODE(Binary, I64Add); } "i32.sub" { RETURN_OPCODE(Binary, I32Sub); } "i64.sub" { RETURN_OPCODE(Binary, I64Sub); } "i32.mul" { RETURN_OPCODE(Binary, I32Mul); } "i64.mul" { RETURN_OPCODE(Binary, I64Mul); } "i32.div_s" { RETURN_OPCODE(Binary, I32DivS); } "i64.div_s" { RETURN_OPCODE(Binary, I64DivS); } "i32.div_u" { RETURN_OPCODE(Binary, I32DivU); } "i64.div_u" { RETURN_OPCODE(Binary, I64DivU); } "i32.rem_s" { RETURN_OPCODE(Binary, I32RemS); } "i64.rem_s" { RETURN_OPCODE(Binary, I64RemS); } "i32.rem_u" { RETURN_OPCODE(Binary, I32RemU); } "i64.rem_u" { RETURN_OPCODE(Binary, I64RemU); } "i32.and" { RETURN_OPCODE(Binary, I32And); } "i64.and" { RETURN_OPCODE(Binary, I64And); } "i32.or" { RETURN_OPCODE(Binary, I32Or); } "i64.or" { RETURN_OPCODE(Binary, I64Or); } "i32.xor" { RETURN_OPCODE(Binary, I32Xor); } "i64.xor" { RETURN_OPCODE(Binary, I64Xor); } "i32.shl" { RETURN_OPCODE(Binary, I32Shl); } "i64.shl" { RETURN_OPCODE(Binary, I64Shl); } "i32.shr_s" { RETURN_OPCODE(Binary, I32ShrS); } "i64.shr_s" { RETURN_OPCODE(Binary, I64ShrS); } "i32.shr_u" { RETURN_OPCODE(Binary, I32ShrU); } "i64.shr_u" { RETURN_OPCODE(Binary, I64ShrU); } "i32.rotl" { RETURN_OPCODE(Binary, I32Rotl); } "i64.rotl" { RETURN_OPCODE(Binary, I64Rotl); } "i32.rotr" { RETURN_OPCODE(Binary, I32Rotr); } "i64.rotr" { RETURN_OPCODE(Binary, I64Rotr); } "f32.add" { RETURN_OPCODE(Binary, F32Add); } "f64.add" { RETURN_OPCODE(Binary, F64Add); } "f32.sub" { RETURN_OPCODE(Binary, F32Sub); } "f64.sub" { RETURN_OPCODE(Binary, F64Sub); } "f32.mul" { RETURN_OPCODE(Binary, F32Mul); } "f64.mul" { RETURN_OPCODE(Binary, F64Mul); } "f32.div" { RETURN_OPCODE(Binary, F32Div); } "f64.div" { RETURN_OPCODE(Binary, F64Div); } "f32.min" { RETURN_OPCODE(Binary, F32Min); } "f64.min" { RETURN_OPCODE(Binary, F64Min); } "f32.max" { RETURN_OPCODE(Binary, F32Max); } "f64.max" { RETURN_OPCODE(Binary, F64Max); } "f32.copysign" { RETURN_OPCODE(Binary, F32Copysign); } "f64.copysign" { RETURN_OPCODE(Binary, F64Copysign); } "i32.eq" { RETURN_OPCODE(Compare, I32Eq); } "i64.eq" { RETURN_OPCODE(Compare, I64Eq); } "i32.ne" { RETURN_OPCODE(Compare, I32Ne); } "i64.ne" { RETURN_OPCODE(Compare, I64Ne); } "i32.lt_s" { RETURN_OPCODE(Compare, I32LtS); } "i64.lt_s" { RETURN_OPCODE(Compare, I64LtS); } "i32.lt_u" { RETURN_OPCODE(Compare, I32LtU); } "i64.lt_u" { RETURN_OPCODE(Compare, I64LtU); } "i32.le_s" { RETURN_OPCODE(Compare, I32LeS); } "i64.le_s" { RETURN_OPCODE(Compare, I64LeS); } "i32.le_u" { RETURN_OPCODE(Compare, I32LeU); } "i64.le_u" { RETURN_OPCODE(Compare, I64LeU); } "i32.gt_s" { RETURN_OPCODE(Compare, I32GtS); } "i64.gt_s" { RETURN_OPCODE(Compare, I64GtS); } "i32.gt_u" { RETURN_OPCODE(Compare, I32GtU); } "i64.gt_u" { RETURN_OPCODE(Compare, I64GtU); } "i32.ge_s" { RETURN_OPCODE(Compare, I32GeS); } "i64.ge_s" { RETURN_OPCODE(Compare, I64GeS); } "i32.ge_u" { RETURN_OPCODE(Compare, I32GeU); } "i64.ge_u" { RETURN_OPCODE(Compare, I64GeU); } "f32.eq" { RETURN_OPCODE(Compare, F32Eq); } "f64.eq" { RETURN_OPCODE(Compare, F64Eq); } "f32.ne" { RETURN_OPCODE(Compare, F32Ne); } "f64.ne" { RETURN_OPCODE(Compare, F64Ne); } "f32.lt" { RETURN_OPCODE(Compare, F32Lt); } "f64.lt" { RETURN_OPCODE(Compare, F64Lt); } "f32.le" { RETURN_OPCODE(Compare, F32Le); } "f64.le" { RETURN_OPCODE(Compare, F64Le); } "f32.gt" { RETURN_OPCODE(Compare, F32Gt); } "f64.gt" { RETURN_OPCODE(Compare, F64Gt); } "f32.ge" { RETURN_OPCODE(Compare, F32Ge); } "f64.ge" { RETURN_OPCODE(Compare, F64Ge); } "i64.extend_i32_s" { RETURN_OPCODE(Convert, I64ExtendI32S); } "i64.extend_i32_u" { RETURN_OPCODE(Convert, I64ExtendI32U); } "i32.wrap_i64" { RETURN_OPCODE(Convert, I32WrapI64); } "i32.trunc_f32_s" { RETURN_OPCODE(Convert, I32TruncF32S); } "i64.trunc_f32_s" { RETURN_OPCODE(Convert, I64TruncF32S); } "i32.trunc_f64_s" { RETURN_OPCODE(Convert, I32TruncF64S); } "i64.trunc_f64_s" { RETURN_OPCODE(Convert, I64TruncF64S); } "i32.trunc_f32_u" { RETURN_OPCODE(Convert, I32TruncF32U); } "i64.trunc_f32_u" { RETURN_OPCODE(Convert, I64TruncF32U); } "i32.trunc_f64_u" { RETURN_OPCODE(Convert, I32TruncF64U); } "i64.trunc_f64_u" { RETURN_OPCODE(Convert, I64TruncF64U); } "i32.trunc_sat_f32_s" { RETURN_OPCODE(Convert, I32TruncSatF32S); } "i64.trunc_sat_f32_s" { RETURN_OPCODE(Convert, I64TruncSatF32S); } "i32.trunc_sat_f64_s" { RETURN_OPCODE(Convert, I32TruncSatF64S); } "i64.trunc_sat_f64_s" { RETURN_OPCODE(Convert, I64TruncSatF64S); } "i32.trunc_sat_f32_u" { RETURN_OPCODE(Convert, I32TruncSatF32U); } "i64.trunc_sat_f32_u" { RETURN_OPCODE(Convert, I64TruncSatF32U); } "i32.trunc_sat_f64_u" { RETURN_OPCODE(Convert, I32TruncSatF64U); } "i64.trunc_sat_f64_u" { RETURN_OPCODE(Convert, I64TruncSatF64U); } "f32.convert_i32_s" { RETURN_OPCODE(Convert, F32ConvertI32S); } "f64.convert_i32_s" { RETURN_OPCODE(Convert, F64ConvertI32S); } "f32.convert_i64_s" { RETURN_OPCODE(Convert, F32ConvertI64S); } "f64.convert_i64_s" { RETURN_OPCODE(Convert, F64ConvertI64S); } "f32.convert_i32_u" { RETURN_OPCODE(Convert, F32ConvertI32U); } "f64.convert_i32_u" { RETURN_OPCODE(Convert, F64ConvertI32U); } "f32.convert_i64_u" { RETURN_OPCODE(Convert, F32ConvertI64U); } "f64.convert_i64_u" { RETURN_OPCODE(Convert, F64ConvertI64U); } "f64.promote_f32" { RETURN_OPCODE(Convert, F64PromoteF32); } "f32.demote_f64" { RETURN_OPCODE(Convert, F32DemoteF64); } "f32.reinterpret_i32" { RETURN_OPCODE(Convert, F32ReinterpretI32); } "i32.reinterpret_f32" { RETURN_OPCODE(Convert, I32ReinterpretF32); } "f64.reinterpret_i64" { RETURN_OPCODE(Convert, F64ReinterpretI64); } "i64.reinterpret_f64" { RETURN_OPCODE(Convert, I64ReinterpretF64); } "select" { RETURN_OPCODE0(Select); } "unreachable" { RETURN_OPCODE0(Unreachable); } "memory.size" { RETURN_OPCODE0(MemorySize); } "memory.grow" { RETURN_OPCODE0(MemoryGrow); } "memory.init" { RETURN_OPCODE0(MemoryInit); } "data.drop" { RETURN_OPCODE0(DataDrop); } "memory.copy" { RETURN_OPCODE0(MemoryCopy); } "memory.fill" { RETURN_OPCODE0(MemoryFill); } "current_memory" { RETURN_OPCODE0(MemorySize); } "grow_memory" { RETURN_OPCODE0(MemoryGrow); } "table.init" { RETURN_OPCODE0(TableInit); } "elem.drop" { RETURN_OPCODE0(ElemDrop); } "table.copy" { RETURN_OPCODE0(TableCopy); } "table.get" { RETURN_OPCODE0(TableGet); } "table.set" { RETURN_OPCODE0(TableSet); } "table.grow" { RETURN_OPCODE0(TableGrow); } "table.size" { RETURN_OPCODE0(TableSize); } "ref.null" { RETURN_OPCODE0(RefNull); } "ref.is_null" { RETURN_OPCODE0(RefIsNull); } "i32.atomic.wait" { RETURN_OPCODE(AtomicWait, I32AtomicWait); } "i64.atomic.wait" { RETURN_OPCODE(AtomicWait, I64AtomicWait); } "atomic.notify" { RETURN_OPCODE0(AtomicNotify); } "i32.atomic.load" { RETURN_OPCODE(AtomicLoad, I32AtomicLoad); } "i64.atomic.load" { RETURN_OPCODE(AtomicLoad, I64AtomicLoad); } "i32.atomic.load8_u" { RETURN_OPCODE(AtomicLoad, I32AtomicLoad8U); } "i32.atomic.load16_u" { RETURN_OPCODE(AtomicLoad, I32AtomicLoad16U); } "i64.atomic.load8_u" { RETURN_OPCODE(AtomicLoad, I64AtomicLoad8U); } "i64.atomic.load16_u" { RETURN_OPCODE(AtomicLoad, I64AtomicLoad16U); } "i64.atomic.load32_u" { RETURN_OPCODE(AtomicLoad, I64AtomicLoad32U); } "i32.atomic.store" { RETURN_OPCODE(AtomicStore, I32AtomicStore); } "i64.atomic.store" { RETURN_OPCODE(AtomicStore, I64AtomicStore); } "i32.atomic.store8" { RETURN_OPCODE(AtomicStore, I32AtomicStore8); } "i32.atomic.store16" { RETURN_OPCODE(AtomicStore, I32AtomicStore16); } "i64.atomic.store8" { RETURN_OPCODE(AtomicStore, I64AtomicStore8); } "i64.atomic.store16" { RETURN_OPCODE(AtomicStore, I64AtomicStore16); } "i64.atomic.store32" { RETURN_OPCODE(AtomicStore, I64AtomicStore32); } "i32.atomic.rmw.add" { RETURN_OPCODE(AtomicRmw, I32AtomicRmwAdd); } "i64.atomic.rmw.add" { RETURN_OPCODE(AtomicRmw, I64AtomicRmwAdd); } "i32.atomic.rmw8.add_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw8AddU); } "i32.atomic.rmw16.add_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw16AddU); } "i64.atomic.rmw8.add_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw8AddU); } "i64.atomic.rmw16.add_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw16AddU); } "i64.atomic.rmw32.add_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw32AddU); } "i32.atomic.rmw.sub" { RETURN_OPCODE(AtomicRmw, I32AtomicRmwSub); } "i64.atomic.rmw.sub" { RETURN_OPCODE(AtomicRmw, I64AtomicRmwSub); } "i32.atomic.rmw8.sub_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw8SubU); } "i32.atomic.rmw16.sub_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw16SubU); } "i64.atomic.rmw8.sub_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw8SubU); } "i64.atomic.rmw16.sub_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw16SubU); } "i64.atomic.rmw32.sub_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw32SubU); } "i32.atomic.rmw.and" { RETURN_OPCODE(AtomicRmw, I32AtomicRmwAnd); } "i64.atomic.rmw.and" { RETURN_OPCODE(AtomicRmw, I64AtomicRmwAnd); } "i32.atomic.rmw8.and_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw8AndU); } "i32.atomic.rmw16.and_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw16AndU); } "i64.atomic.rmw8.and_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw8AndU); } "i64.atomic.rmw16.and_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw16AndU); } "i64.atomic.rmw32.and_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw32AndU); } "i32.atomic.rmw.or" { RETURN_OPCODE(AtomicRmw, I32AtomicRmwOr); } "i64.atomic.rmw.or" { RETURN_OPCODE(AtomicRmw, I64AtomicRmwOr); } "i32.atomic.rmw8.or_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw8OrU); } "i32.atomic.rmw16.or_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw16OrU); } "i64.atomic.rmw8.or_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw8OrU); } "i64.atomic.rmw16.or_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw16OrU); } "i64.atomic.rmw32.or_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw32OrU); } "i32.atomic.rmw.xor" { RETURN_OPCODE(AtomicRmw, I32AtomicRmwXor); } "i64.atomic.rmw.xor" { RETURN_OPCODE(AtomicRmw, I64AtomicRmwXor); } "i32.atomic.rmw8.xor_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw8XorU); } "i32.atomic.rmw16.xor_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw16XorU); } "i64.atomic.rmw8.xor_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw8XorU); } "i64.atomic.rmw16.xor_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw16XorU); } "i64.atomic.rmw32.xor_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw32XorU); } "i32.atomic.rmw.xchg" { RETURN_OPCODE(AtomicRmw, I32AtomicRmwXchg); } "i64.atomic.rmw.xchg" { RETURN_OPCODE(AtomicRmw, I64AtomicRmwXchg); } "i32.atomic.rmw8.xchg_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw8XchgU); } "i32.atomic.rmw16.xchg_u" { RETURN_OPCODE(AtomicRmw, I32AtomicRmw16XchgU); } "i64.atomic.rmw8.xchg_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw8XchgU); } "i64.atomic.rmw16.xchg_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw16XchgU); } "i64.atomic.rmw32.xchg_u" { RETURN_OPCODE(AtomicRmw, I64AtomicRmw32XchgU); } "i32.atomic.rmw.cmpxchg" { RETURN_OPCODE(AtomicRmwCmpxchg, I32AtomicRmwCmpxchg); } "i64.atomic.rmw.cmpxchg" { RETURN_OPCODE(AtomicRmwCmpxchg, I64AtomicRmwCmpxchg); } "i32.atomic.rmw8.cmpxchg_u" { RETURN_OPCODE(AtomicRmwCmpxchg, I32AtomicRmw8CmpxchgU); } "i32.atomic.rmw16.cmpxchg_u" { RETURN_OPCODE(AtomicRmwCmpxchg, I32AtomicRmw16CmpxchgU); } "i64.atomic.rmw8.cmpxchg_u" { RETURN_OPCODE(AtomicRmwCmpxchg, I64AtomicRmw8CmpxchgU); } "i64.atomic.rmw16.cmpxchg_u" { RETURN_OPCODE(AtomicRmwCmpxchg, I64AtomicRmw16CmpxchgU); } "i64.atomic.rmw32.cmpxchg_u" { RETURN_OPCODE(AtomicRmwCmpxchg, I64AtomicRmw32CmpxchgU); } "v128.const" { RETURN_OPCODE(Const, V128Const); } "v128.load" { RETURN_OPCODE(Load, V128Load); } "v128.store" { RETURN_OPCODE(Store, V128Store); } "i8x16.splat" { RETURN_OPCODE(Unary, I8X16Splat); } "i16x8.splat" { RETURN_OPCODE(Unary, I16X8Splat); } "i32x4.splat" { RETURN_OPCODE(Unary, I32X4Splat); } "i64x2.splat" { RETURN_OPCODE(Unary, I64X2Splat); } "f32x4.splat" { RETURN_OPCODE(Unary, F32X4Splat); } "f64x2.splat" { RETURN_OPCODE(Unary, F64X2Splat); } "i8x16.extract_lane_s" { RETURN_OPCODE(SimdLaneOp, I8X16ExtractLaneS); } "i8x16.extract_lane_u" { RETURN_OPCODE(SimdLaneOp, I8X16ExtractLaneU); } "i16x8.extract_lane_s" { RETURN_OPCODE(SimdLaneOp, I16X8ExtractLaneS); } "i16x8.extract_lane_u" { RETURN_OPCODE(SimdLaneOp, I16X8ExtractLaneU); } "i32x4.extract_lane" { RETURN_OPCODE(SimdLaneOp, I32X4ExtractLane); } "i64x2.extract_lane" { RETURN_OPCODE(SimdLaneOp, I64X2ExtractLane); } "f32x4.extract_lane" { RETURN_OPCODE(SimdLaneOp, F32X4ExtractLane); } "f64x2.extract_lane" { RETURN_OPCODE(SimdLaneOp, F64X2ExtractLane); } "i8x16.replace_lane" { RETURN_OPCODE(SimdLaneOp, I8X16ReplaceLane); } "i16x8.replace_lane" { RETURN_OPCODE(SimdLaneOp, I16X8ReplaceLane); } "i32x4.replace_lane" { RETURN_OPCODE(SimdLaneOp, I32X4ReplaceLane); } "i64x2.replace_lane" { RETURN_OPCODE(SimdLaneOp, I64X2ReplaceLane); } "f32x4.replace_lane" { RETURN_OPCODE(SimdLaneOp, F32X4ReplaceLane); } "f64x2.replace_lane" { RETURN_OPCODE(SimdLaneOp, F64X2ReplaceLane); } "v8x16.shuffle" { RETURN_OPCODE(SimdShuffleOp, V8X16Shuffle); } "i8x16.add" { RETURN_OPCODE(Binary, I8X16Add); } "i16x8.add" { RETURN_OPCODE(Binary, I16X8Add); } "i32x4.add" { RETURN_OPCODE(Binary, I32X4Add); } "i64x2.add" { RETURN_OPCODE(Binary, I64X2Add); } "i8x16.sub" { RETURN_OPCODE(Binary, I8X16Sub); } "i16x8.sub" { RETURN_OPCODE(Binary, I16X8Sub); } "i32x4.sub" { RETURN_OPCODE(Binary, I32X4Sub); } "i64x2.sub" { RETURN_OPCODE(Binary, I64X2Sub); } "i8x16.mul" { RETURN_OPCODE(Binary, I8X16Mul); } "i16x8.mul" { RETURN_OPCODE(Binary, I16X8Mul); } "i32x4.mul" { RETURN_OPCODE(Binary, I32X4Mul); } "i8x16.neg" { RETURN_OPCODE(Unary, I8X16Neg); } "i16x8.neg" { RETURN_OPCODE(Unary, I16X8Neg); } "i32x4.neg" { RETURN_OPCODE(Unary, I32X4Neg); } "i64x2.neg" { RETURN_OPCODE(Unary, I64X2Neg); } "i8x16.add_saturate_s" { RETURN_OPCODE(Binary, I8X16AddSaturateS); } "i8x16.add_saturate_u" { RETURN_OPCODE(Binary, I8X16AddSaturateU); } "i16x8.add_saturate_s" { RETURN_OPCODE(Binary, I16X8AddSaturateS); } "i16x8.add_saturate_u" { RETURN_OPCODE(Binary, I16X8AddSaturateU); } "i8x16.sub_saturate_s" { RETURN_OPCODE(Binary, I8X16SubSaturateS); } "i8x16.sub_saturate_u" { RETURN_OPCODE(Binary, I8X16SubSaturateU); } "i16x8.sub_saturate_s" { RETURN_OPCODE(Binary, I16X8SubSaturateS); } "i16x8.sub_saturate_u" { RETURN_OPCODE(Binary, I16X8SubSaturateU); } "i8x16.shl" { RETURN_OPCODE(Binary, I8X16Shl); } "i16x8.shl" { RETURN_OPCODE(Binary, I16X8Shl); } "i32x4.shl" { RETURN_OPCODE(Binary, I32X4Shl); } "i64x2.shl" { RETURN_OPCODE(Binary, I64X2Shl); } "i8x16.shr_s" { RETURN_OPCODE(Binary, I8X16ShrS); } "i8x16.shr_u" { RETURN_OPCODE(Binary, I8X16ShrU); } "i16x8.shr_s" { RETURN_OPCODE(Binary, I16X8ShrS); } "i16x8.shr_u" { RETURN_OPCODE(Binary, I16X8ShrU); } "i32x4.shr_s" { RETURN_OPCODE(Binary, I32X4ShrS); } "i32x4.shr_u" { RETURN_OPCODE(Binary, I32X4ShrU); } "i64x2.shr_s" { RETURN_OPCODE(Binary, I64X2ShrS); } "i64x2.shr_u" { RETURN_OPCODE(Binary, I64X2ShrU); } "v128.and" { RETURN_OPCODE(Binary, V128And); } "v128.or" { RETURN_OPCODE(Binary, V128Or); } "v128.xor" { RETURN_OPCODE(Binary, V128Xor); } "v128.not" { RETURN_OPCODE(Unary, V128Not); } "v128.bitselect" { RETURN_OPCODE(Ternary, V128BitSelect); } "i8x16.any_true" { RETURN_OPCODE(Unary, I8X16AnyTrue); } "i16x8.any_true" { RETURN_OPCODE(Unary, I16X8AnyTrue); } "i32x4.any_true" { RETURN_OPCODE(Unary, I32X4AnyTrue); } "i64x2.any_true" { RETURN_OPCODE(Unary, I64X2AnyTrue); } "i8x16.all_true" { RETURN_OPCODE(Unary, I8X16AllTrue); } "i16x8.all_true" { RETURN_OPCODE(Unary, I16X8AllTrue); } "i32x4.all_true" { RETURN_OPCODE(Unary, I32X4AllTrue); } "i64x2.all_true" { RETURN_OPCODE(Unary, I64X2AllTrue); } "i8x16.eq" { RETURN_OPCODE(Compare, I8X16Eq); } "i16x8.eq" { RETURN_OPCODE(Compare, I16X8Eq); } "i32x4.eq" { RETURN_OPCODE(Compare, I32X4Eq); } "f32x4.eq" { RETURN_OPCODE(Compare, F32X4Eq); } "f64x2.eq" { RETURN_OPCODE(Compare, F64X2Eq); } "i8x16.ne" { RETURN_OPCODE(Compare, I8X16Ne); } "i16x8.ne" { RETURN_OPCODE(Compare, I16X8Ne); } "i32x4.ne" { RETURN_OPCODE(Compare, I32X4Ne); } "f32x4.ne" { RETURN_OPCODE(Compare, F32X4Ne); } "f64x2.ne" { RETURN_OPCODE(Compare, F64X2Ne); } "i8x16.lt_s" { RETURN_OPCODE(Compare, I8X16LtS); } "i8x16.lt_u" { RETURN_OPCODE(Compare, I8X16LtU); } "i16x8.lt_s" { RETURN_OPCODE(Compare, I16X8LtS); } "i16x8.lt_u" { RETURN_OPCODE(Compare, I16X8LtU); } "i32x4.lt_s" { RETURN_OPCODE(Compare, I32X4LtS); } "i32x4.lt_u" { RETURN_OPCODE(Compare, I32X4LtU); } "f32x4.lt" { RETURN_OPCODE(Compare, F32X4Lt); } "f64x2.lt" { RETURN_OPCODE(Compare, F64X2Lt); } "i8x16.le_s" { RETURN_OPCODE(Compare, I8X16LeS); } "i8x16.le_u" { RETURN_OPCODE(Compare, I8X16LeU); } "i16x8.le_s" { RETURN_OPCODE(Compare, I16X8LeS); } "i16x8.le_u" { RETURN_OPCODE(Compare, I16X8LeU); } "i32x4.le_s" { RETURN_OPCODE(Compare, I32X4LeS); } "i32x4.le_u" { RETURN_OPCODE(Compare, I32X4LeU); } "f32x4.le" { RETURN_OPCODE(Compare, F32X4Le); } "f64x2.le" { RETURN_OPCODE(Compare, F64X2Le); } "i8x16.gt_s" { RETURN_OPCODE(Compare, I8X16GtS); } "i8x16.gt_u" { RETURN_OPCODE(Compare, I8X16GtU); } "i16x8.gt_s" { RETURN_OPCODE(Compare, I16X8GtS); } "i16x8.gt_u" { RETURN_OPCODE(Compare, I16X8GtU); } "i32x4.gt_s" { RETURN_OPCODE(Compare, I32X4GtS); } "i32x4.gt_u" { RETURN_OPCODE(Compare, I32X4GtU); } "f32x4.gt" { RETURN_OPCODE(Compare, F32X4Gt); } "f64x2.gt" { RETURN_OPCODE(Compare, F64X2Gt); } "i8x16.ge_s" { RETURN_OPCODE(Compare, I8X16GeS); } "i8x16.ge_u" { RETURN_OPCODE(Compare, I8X16GeU); } "i16x8.ge_s" { RETURN_OPCODE(Compare, I16X8GeS); } "i16x8.ge_u" { RETURN_OPCODE(Compare, I16X8GeU); } "i32x4.ge_s" { RETURN_OPCODE(Compare, I32X4GeS); } "i32x4.ge_u" { RETURN_OPCODE(Compare, I32X4GeU); } "f32x4.ge" { RETURN_OPCODE(Compare, F32X4Ge); } "f64x2.ge" { RETURN_OPCODE(Compare, F64X2Ge); } "f32x4.neg" { RETURN_OPCODE(Unary, F32X4Neg); } "f64x2.neg" { RETURN_OPCODE(Unary, F64X2Neg); } "f32x4.abs" { RETURN_OPCODE(Unary, F32X4Abs); } "f64x2.abs" { RETURN_OPCODE(Unary, F64X2Abs); } "f32x4.min" { RETURN_OPCODE(Binary, F32X4Min); } "f64x2.min" { RETURN_OPCODE(Binary, F64X2Min); } "f32x4.max" { RETURN_OPCODE(Binary, F32X4Max); } "f64x2.max" { RETURN_OPCODE(Binary, F64X2Max); } "f32x4.add" { RETURN_OPCODE(Binary, F32X4Add); } "f64x2.add" { RETURN_OPCODE(Binary, F64X2Add); } "f32x4.sub" { RETURN_OPCODE(Binary, F32X4Sub); } "f64x2.sub" { RETURN_OPCODE(Binary, F64X2Sub); } "f32x4.div" { RETURN_OPCODE(Binary, F32X4Div); } "f64x2.div" { RETURN_OPCODE(Binary, F64X2Div); } "f32x4.mul" { RETURN_OPCODE(Binary, F32X4Mul); } "f64x2.mul" { RETURN_OPCODE(Binary, F64X2Mul); } "f32x4.sqrt" { RETURN_OPCODE(Unary, F32X4Sqrt); } "f64x2.sqrt" { RETURN_OPCODE(Unary, F64X2Sqrt); } "f32x4.convert_i32x4_s" { RETURN_OPCODE(Unary, F32X4ConvertI32X4S); } "f32x4.convert_i32x4_u" { RETURN_OPCODE(Unary, F32X4ConvertI32X4U); } "f64x2.convert_i64x2_s" { RETURN_OPCODE(Unary, F64X2ConvertI64X2S); } "f64x2.convert_i64x2_u" { RETURN_OPCODE(Unary, F64X2ConvertI64X2U); } "i32x4.trunc_sat_f32x4_s" { RETURN_OPCODE(Unary, I32X4TruncSatF32X4S); } "i32x4.trunc_sat_f32x4_u" { RETURN_OPCODE(Unary, I32X4TruncSatF32X4U); } "i64x2.trunc_sat_f64x2_s" { RETURN_OPCODE(Unary, I64X2TruncSatF64X2S); } "i64x2.trunc_sat_f64x2_u" { RETURN_OPCODE(Unary, I64X2TruncSatF64X2U); } "return_call" { RETURN_OPCODE0(ReturnCall); } "return_call_indirect" { RETURN_OPCODE0(ReturnCallIndirect); } // Deprecated names. "anyfunc" { RETURN_TYPE(ValueType, Funcref); } "get_local" { RETURN_OPCODE0(LocalGet); } "set_local" { RETURN_OPCODE0(LocalSet); } "tee_local" { RETURN_OPCODE0(LocalTee); } "get_global" { RETURN_OPCODE0(GlobalGet); } "set_global" { RETURN_OPCODE0(GlobalSet); } "i64.extend_s/i32" { RETURN_OPCODE(Convert, I64ExtendI32S); } "i64.extend_u/i32" { RETURN_OPCODE(Convert, I64ExtendI32U); } "i32.wrap/i64" { RETURN_OPCODE(Convert, I32WrapI64); } "i32.trunc_s/f32" { RETURN_OPCODE(Convert, I32TruncF32S); } "i64.trunc_s/f32" { RETURN_OPCODE(Convert, I64TruncF32S); } "i32.trunc_s/f64" { RETURN_OPCODE(Convert, I32TruncF64S); } "i64.trunc_s/f64" { RETURN_OPCODE(Convert, I64TruncF64S); } "i32.trunc_u/f32" { RETURN_OPCODE(Convert, I32TruncF32U); } "i64.trunc_u/f32" { RETURN_OPCODE(Convert, I64TruncF32U); } "i32.trunc_u/f64" { RETURN_OPCODE(Convert, I32TruncF64U); } "i64.trunc_u/f64" { RETURN_OPCODE(Convert, I64TruncF64U); } "f32.convert_s/i32" { RETURN_OPCODE(Convert, F32ConvertI32S); } "f64.convert_s/i32" { RETURN_OPCODE(Convert, F64ConvertI32S); } "f32.convert_s/i64" { RETURN_OPCODE(Convert, F32ConvertI64S); } "f64.convert_s/i64" { RETURN_OPCODE(Convert, F64ConvertI64S); } "f32.convert_u/i32" { RETURN_OPCODE(Convert, F32ConvertI32U); } "f64.convert_u/i32" { RETURN_OPCODE(Convert, F64ConvertI32U); } "f32.convert_u/i64" { RETURN_OPCODE(Convert, F32ConvertI64U); } "f64.convert_u/i64" { RETURN_OPCODE(Convert, F64ConvertI64U); } "f64.promote/f32" { RETURN_OPCODE(Convert, F64PromoteF32); } "f32.demote/f64" { RETURN_OPCODE(Convert, F32DemoteF64); } "f32.reinterpret/i32" { RETURN_OPCODE(Convert, F32ReinterpretI32); } "i32.reinterpret/f32" { RETURN_OPCODE(Convert, I32ReinterpretF32); } "f64.reinterpret/i64" { RETURN_OPCODE(Convert, F64ReinterpretI64); } "i64.reinterpret/f64" { RETURN_OPCODE(Convert, I64ReinterpretF64); } "i32.trunc_s:sat/f32" { RETURN_OPCODE(Convert, I32TruncSatF32S); } "i64.trunc_s:sat/f32" { RETURN_OPCODE(Convert, I64TruncSatF32S); } "i32.trunc_s:sat/f64" { RETURN_OPCODE(Convert, I32TruncSatF64S); } "i64.trunc_s:sat/f64" { RETURN_OPCODE(Convert, I64TruncSatF64S); } "i32.trunc_u:sat/f32" { RETURN_OPCODE(Convert, I32TruncSatF32U); } "i64.trunc_u:sat/f32" { RETURN_OPCODE(Convert, I64TruncSatF32U); } "i32.trunc_u:sat/f64" { RETURN_OPCODE(Convert, I32TruncSatF64U); } "i64.trunc_u:sat/f64" { RETURN_OPCODE(Convert, I64TruncSatF64U); } "type" { RETURN(Type); } "func" { RETURN(Func); } "param" { RETURN(Param); } "result" { RETURN(Result); } "local" { RETURN(Local); } "global" { RETURN(Global); } "module" { RETURN(Module); } "binary" { RETURN(Bin); } "quote" { RETURN(Quote); } "table" { RETURN(Table); } "memory" { RETURN(Memory); } "start" { RETURN(Start); } "elem" { RETURN(Elem); } "data" { RETURN(Data); } "offset" { RETURN(Offset); } "import" { RETURN(Import); } "export" { RETURN(Export); } "event" { RETURN(Event); } "passive" { RETURN(Passive); } "register" { RETURN(Register); } "invoke" { RETURN(Invoke); } "get" { RETURN(Get); } "assert_malformed" { RETURN(AssertMalformed); } "assert_invalid" { RETURN(AssertInvalid); } "assert_unlinkable" { RETURN(AssertUnlinkable); } "assert_return" { RETURN(AssertReturn); } "assert_return_canonical_nan" { RETURN(AssertReturnCanonicalNan); } "assert_return_arithmetic_nan" { RETURN(AssertReturnArithmeticNan); } "assert_trap" { RETURN(AssertTrap); } "assert_exhaustion" { RETURN(AssertExhaustion); } "i8x16" { RETURN(I8X16); } "i16x8" { RETURN(I16X8); } "i32x4" { RETURN(I32X4); } "i64x2" { RETURN(I64X2); } "f32x4" { RETURN(F32X4); } "f64x2" { RETURN(F64X2); } "try" { RETURN_OPCODE0(Try); } "catch" { RETURN_OPCODE0(Catch); } "throw" { RETURN_OPCODE0(Throw); } "rethrow" { RETURN_OPCODE0(Rethrow); } "br_on_exn" { RETURN_OPCODE0(BrOnExn); } name { RETURN_TEXT(Var); } "shared" { RETURN(Shared); } ";;" => LINE_COMMENT { continue; } "\n" => i { NEWLINE; continue; } [^\n]+ { continue; } "(;" => BLOCK_COMMENT { COMMENT_NESTING = 1; continue; } "(;" { COMMENT_NESTING++; continue; } ";)" { if (--COMMENT_NESTING == 0) { BEGIN(YYCOND_i); } continue; } "\n" { NEWLINE; continue; } [^] { continue; } * { MAYBE_MALFORMED_UTF8(" in block comment"); } "\n" { NEWLINE; continue; } [ \t\r]+ { continue; } reserved { RETURN_TEXT(Reserved); } [^] { ERROR("unexpected char"); continue; } <*> * { MAYBE_MALFORMED_UTF8(""); } */ } } } // namespace wabt