// These functions all return Result::Ok on success and Result::Error on // failure. // // NOTE: the functions are written for use with wast-lexer, assuming that the // literal has already matched the patterns defined there. As a result, the // only validation that is done is for overflow, not for otherwise bogus input.
/* Size of char buffer required to hold hex representation of a float/double */ #define WABT_MAX_FLOAT_HEX 20 #define WABT_MAX_DOUBLE_HEX 40
Result ParseHexdigit(char c, uint32_t* out);
Result ParseInt8(constchar* s, constchar* end,
uint8_t* out,
ParseIntType parse_type);
Result ParseInt16(constchar* s, constchar* end,
uint16_t* out,
ParseIntType parse_type);
Result ParseInt32(constchar* s, constchar* end,
uint32_t* out,
ParseIntType parse_type);
Result ParseInt64(constchar* s, constchar* end,
uint64_t* out,
ParseIntType parse_type);
Result ParseUint64(constchar* s, constchar* end, uint64_t* out);
Result ParseUint128(constchar* s, constchar* end, v128* out);
Result ParseFloat(LiteralType literal_type, constchar* s, constchar* end,
uint32_t* out_bits);
Result ParseDouble(LiteralType literal_type, constchar* s, constchar* end,
uint64_t* out_bits);
// Same as above but taking a string_view inline Result ParseInt8(std::string_view v,
uint8_t* out,
ParseIntType parse_type) { return ParseInt8(v.data(), v.data() + v.size(), out, parse_type);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.