mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
Tweak wuffs_base__token bitmask assignments
This commit is contained in:
1 parent
16b0c4652a
commit
a9d1488674
4 files changed
+247
-147
No files matched your search
@@ -16,51 +16,23 @@
|
||||
|
||||
// ---------------- Tokens
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VALUE__MASK 0xFFFFFFFFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MAJOR__MASK 0xFFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MINOR__MASK 0xFFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__MASK 0x7FFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__MASK 0x1FFFFF
|
||||
#define WUFFS_BASE__TOKEN__LENGTH__MASK 0xFFFF
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VALUE__SHIFT 16
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MAJOR__SHIFT 40
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT 16
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__SHIFT 37
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__SHIFT 16
|
||||
#define WUFFS_BASE__TOKEN__LENGTH__SHIFT 0
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBC__FILLER 0
|
||||
#define WUFFS_BASE__TOKEN__VBC__STRUCTURE 1
|
||||
#define WUFFS_BASE__TOKEN__VBC__NUMBER 2
|
||||
#define WUFFS_BASE__TOKEN__VBC__STRING 3
|
||||
#define WUFFS_BASE__TOKEN__VBC__UNICODE_CODE_POINT 4
|
||||
#define WUFFS_BASE__TOKEN__VBC__BYTES 5
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__PUSH 0x00001
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__POP 0x00002
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_NONE 0x00010
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_LIST 0x00020
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_DICT 0x00040
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_NONE 0x01000
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_LIST 0x02000
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_DICT 0x04000
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL 0x00001
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__UNDEFINED 0x00011
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__NULL 0x00021
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__FALSE 0x00041
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__TRUE 0x00081
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER 0x00002
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__FLOATING_POINT 0x00004
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRING__INCOMPLETE 0x00001
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRING__ALL_ASCII 0x00002
|
||||
|
||||
typedef struct {
|
||||
// Bits 63 .. 40 (24 bits) is the major value.
|
||||
// Bits 39 .. 16 (24 bits) is the minor value.
|
||||
// Bits 15 .. 0 (16 bits) is the length.
|
||||
// The repr is divided as:
|
||||
// - Bits 63 .. 40 (24 bits) is the major value.
|
||||
// - Bits 39 .. 16 (24 bits) is the minor value.
|
||||
// - Bits 15 .. 0 (16 bits) is the length.
|
||||
//
|
||||
// The major value is a [Base38](doc/note/base38-and-fourcc.md) value. If
|
||||
// zero (special cased for Wuffs' built-in "base" package) then the minor
|
||||
// value is further sub-divided:
|
||||
// - Bits 39 .. 37 ( 3 bits) is the value_base_category.
|
||||
// - Bits 36 .. 16 (21 bits) is the value_base_detail.
|
||||
//
|
||||
// In particular, at 21 bits, the value_base_detail can hold every valid
|
||||
// Unicode code point.
|
||||
//
|
||||
// If the major value is non-zero then the minor value has whatever arbitrary
|
||||
// meaning the tokenizer's package assigns to it.
|
||||
uint64_t repr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -81,6 +53,83 @@ wuffs_base__make_token(uint64_t repr) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VALUE__MASK 0xFFFFFFFFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MAJOR__MASK 0xFFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MINOR__MASK 0xFFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__MASK 0x7FFFFFF
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__MASK 0x1FFFFF
|
||||
#define WUFFS_BASE__TOKEN__LENGTH__MASK 0xFFFF
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VALUE__SHIFT 16
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MAJOR__SHIFT 40
|
||||
#define WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT 16
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__SHIFT 37
|
||||
#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__SHIFT 16
|
||||
#define WUFFS_BASE__TOKEN__LENGTH__SHIFT 0
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBC__FILLER 0
|
||||
#define WUFFS_BASE__TOKEN__VBC__STRING 1
|
||||
#define WUFFS_BASE__TOKEN__VBC__BYTES 2
|
||||
#define WUFFS_BASE__TOKEN__VBC__STRUCTURE 3
|
||||
#define WUFFS_BASE__TOKEN__VBC__NUMBER 4
|
||||
#define WUFFS_BASE__TOKEN__VBC__UNICODE_CODE_POINT 5
|
||||
|
||||
// Bits 0x2, 0x4 and 0x8 are reserved for flags that are common between
|
||||
// VBD_FILLER, VBD_STRING and VBD_BYTES.
|
||||
#define WUFFS_BASE__TOKEN__VBD__FILLER__INCOMPLETE 0x00001
|
||||
#define WUFFS_BASE__TOKEN__VBD__FILLER__END_OF_CONSECUTIVE_COMMENTS 0x00010
|
||||
#define WUFFS_BASE__TOKEN__VBD__FILLER__COMMENT_LINE 0x00020
|
||||
#define WUFFS_BASE__TOKEN__VBD__FILLER__COMMENT_BLOCK 0x00040
|
||||
|
||||
// Bits 0x2, 0x4 and 0x8 are reserved for flags that are common between
|
||||
// VBD_FILLER, VBD_STRING and VBD_BYTES.
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRING__INCOMPLETE 0x00001
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRING__ALL_ASCII 0x00010
|
||||
|
||||
// Bits 0x2, 0x4 and 0x8 are reserved for flags that are common between
|
||||
// VBD_FILLER, VBD_STRING and VBD_BYTES.
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__INCOMPLETE 0x00001
|
||||
// "D_DST_S_SRC" means that it takes S source bytes (possibly padded) to
|
||||
// produce D destination bytes. For example,
|
||||
// WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_4_SRC_BACKSLASH_X means that the source
|
||||
// looks like "\\x23\\x67\\xAB", where 12 src bytes encode 3 dst bytes.
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_1_SRC_RAW 0x00010
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_2_SRC_HEX 0x00020
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_4_SRC_BACKSLASH_X 0x00040
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_6_SRC_BACKSLASH_U 0x00080
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__3_DST_4_SRC_BASE_64_STD 0x00100
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__3_DST_4_SRC_BASE_64_URL 0x00200
|
||||
#define WUFFS_BASE__TOKEN__VBD__BYTES__4_DST_5_SRC_ASCII_85 0x00400
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__PUSH 0x00001
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__POP 0x00002
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_NONE 0x00010
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_LIST 0x00020
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_DICT 0x00040
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_NONE 0x01000
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_LIST 0x02000
|
||||
#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_DICT 0x04000
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL 0x00001
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__UNDEFINED 0x00101
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__NULL 0x00201
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__FALSE 0x00401
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__TRUE 0x00801
|
||||
// For a source string of "123" or "0x9A", it is valid for a tokenizer to
|
||||
// return any one of:
|
||||
// - WUFFS_BASE__TOKEN__VBD__NUMBER__FLOATING_POINT.
|
||||
// - WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_SIGNED.
|
||||
// - WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_UNSIGNED.
|
||||
//
|
||||
// For a source string of "+123" or "-0x9A", only the first two are valid.
|
||||
//
|
||||
// For a source string of "123.", only the first one is valid.
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__FLOATING_POINT 0x00002
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_SIGNED 0x00004
|
||||
#define WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_UNSIGNED 0x00008
|
||||
|
||||
#define WUFFS_BASE__TOKEN__VBD__UNICODE_CODE_POINT__MAX_INCL 0x10FFFF
|
||||
|
||||
static inline uint64_t //
|
||||
wuffs_base__token__value(const wuffs_base__token* t) {
|
||||
return (t->repr >> WUFFS_BASE__TOKEN__VALUE__SHIFT) &
|
||||
|
||||
@@ -284,11 +284,13 @@ const baseTokenPrivateH = "" +
|
||||
""
|
||||
|
||||
const baseTokenPublicH = "" +
|
||||
"// ---------------- Tokens\n\n#define WUFFS_BASE__TOKEN__VALUE__MASK 0xFFFFFFFFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_MAJOR__MASK 0xFFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_MINOR__MASK 0xFFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__MASK 0x7FFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__MASK 0x1FFFFF\n#define WUFFS_BASE__TOKEN__LENGTH__MASK 0xFFFF\n\n#define WUFFS_BASE__TOKEN__VALUE__SHIFT 16\n#define WUFFS_BASE__TOKEN__VALUE_MAJOR__SHIFT 40\n#define WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT 16\n#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__SHIFT 37\n#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__SHIFT 16\n#define WUFFS_BASE__TOKEN__LENGTH__SHIFT 0\n\n#define WUFFS_BASE__TOKEN__VBC__FILLER 0\n#define WUFFS_BASE__TOKEN__VBC__STRUCTURE 1\n#define WUFFS_BASE__TOKEN__VBC__NUMBER 2\n#define WUFFS_BASE__TOKEN__VBC__STRING 3\n#define WUFFS_BASE__TOKEN__VBC__UNICODE_CODE_POINT 4\n#define WUFFS_BASE__TOKEN__VBC__BYTES 5\n\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__PUSH 0x00001\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__POP 0x" +
|
||||
"00002\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_NONE 0x00010\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_LIST 0x00020\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_DICT 0x00040\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_NONE 0x01000\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_LIST 0x02000\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_DICT 0x04000\n\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL 0x00001\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__UNDEFINED 0x00011\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__NULL 0x00021\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__FALSE 0x00041\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__TRUE 0x00081\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER 0x00002\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__FLOATING_POINT 0x00004\n\n#define WUFFS_BASE__TOKEN__VBD__STRING__INCOMPLETE 0x00001\n#define WUFFS_BASE__TOKEN__VBD__STRING__ALL_ASCII 0x00002\n\ntypedef struct {\n // Bits 63 .. 40 (24 bits) is the major value.\n // Bits 39 .. 16 (24 bits) is the minor v" +
|
||||
"alue.\n // Bits 15 .. 0 (16 bits) is the length.\n uint64_t repr;\n\n#ifdef __cplusplus\n inline uint64_t value() const;\n inline uint64_t value_major() const;\n inline uint64_t value_minor() const;\n inline uint64_t value_base_category() const;\n inline uint64_t value_base_detail() const;\n inline uint64_t length() const;\n#endif // __cplusplus\n\n} wuffs_base__token;\n\nstatic inline wuffs_base__token //\nwuffs_base__make_token(uint64_t repr) {\n wuffs_base__token ret;\n ret.repr = repr;\n return ret;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_major(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_MAJOR__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_MAJOR__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_minor(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_M" +
|
||||
"INOR__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_MINOR__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_base_category(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_base_detail(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__length(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__LENGTH__SHIFT) &\n WUFFS_BASE__TOKEN__LENGTH__MASK;\n}\n\n#ifdef __cplusplus\n\ninline uint64_t //\nwuffs_base__token::value() const {\n return wuffs_base__token__value(this);\n}\n\ninline uint64_t //\nwuffs_base__token::value_major() const {\n return wuffs_base__token__value_major(this);\n}\n\ninline uint64_t //\nwuffs_base__token::value_minor() const {\n return wuffs_base__token__value_minor(t" +
|
||||
"his);\n}\n\ninline uint64_t //\nwuffs_base__token::value_base_category() const {\n return wuffs_base__token__value_base_category(this);\n}\n\ninline uint64_t //\nwuffs_base__token::value_base_detail() const {\n return wuffs_base__token__value_base_detail(this);\n}\n\ninline uint64_t //\nwuffs_base__token::length() const {\n return wuffs_base__token__length(this);\n}\n\n#endif // __cplusplus\n\n" +
|
||||
"// ---------------- Tokens\n\ntypedef struct {\n // The repr is divided as:\n // - Bits 63 .. 40 (24 bits) is the major value.\n // - Bits 39 .. 16 (24 bits) is the minor value.\n // - Bits 15 .. 0 (16 bits) is the length.\n //\n // The major value is a [Base38](doc/note/base38-and-fourcc.md) value. If\n // zero (special cased for Wuffs' built-in \"base\" package) then the minor\n // value is further sub-divided:\n // - Bits 39 .. 37 ( 3 bits) is the value_base_category.\n // - Bits 36 .. 16 (21 bits) is the value_base_detail.\n //\n // In particular, at 21 bits, the value_base_detail can hold every valid\n // Unicode code point.\n //\n // If the major value is non-zero then the minor value has whatever arbitrary\n // meaning the tokenizer's package assigns to it.\n uint64_t repr;\n\n#ifdef __cplusplus\n inline uint64_t value() const;\n inline uint64_t value_major() const;\n inline uint64_t value_minor() const;\n inline uint64_t value_base_category() const;\n inline uint64_t value_base_detail() const;\n inlin" +
|
||||
"e uint64_t length() const;\n#endif // __cplusplus\n\n} wuffs_base__token;\n\nstatic inline wuffs_base__token //\nwuffs_base__make_token(uint64_t repr) {\n wuffs_base__token ret;\n ret.repr = repr;\n return ret;\n}\n\n#define WUFFS_BASE__TOKEN__VALUE__MASK 0xFFFFFFFFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_MAJOR__MASK 0xFFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_MINOR__MASK 0xFFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__MASK 0x7FFFFFF\n#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__MASK 0x1FFFFF\n#define WUFFS_BASE__TOKEN__LENGTH__MASK 0xFFFF\n\n#define WUFFS_BASE__TOKEN__VALUE__SHIFT 16\n#define WUFFS_BASE__TOKEN__VALUE_MAJOR__SHIFT 40\n#define WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT 16\n#define WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__SHIFT 37\n#define WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__SHIFT 16\n#define WUFFS_BASE__TOKEN__LENGTH__SHIFT 0\n\n#define WUFFS_BASE__TOKEN__VBC__FILLER 0\n#define WUFFS_BASE__TOKEN__VBC__STRING 1\n#define WUFFS_BASE__TOKEN__VBC__BYTES 2\n#define WUFFS_BASE__TOKEN__VBC__STRUCTURE 3\n#define WUFFS_BASE" +
|
||||
"__TOKEN__VBC__NUMBER 4\n#define WUFFS_BASE__TOKEN__VBC__UNICODE_CODE_POINT 5\n\n// Bits 0x2, 0x4 and 0x8 are reserved for flags that are common between\n// VBD_FILLER, VBD_STRING and VBD_BYTES.\n#define WUFFS_BASE__TOKEN__VBD__FILLER__INCOMPLETE 0x00001\n#define WUFFS_BASE__TOKEN__VBD__FILLER__END_OF_CONSECUTIVE_COMMENTS 0x00010\n#define WUFFS_BASE__TOKEN__VBD__FILLER__COMMENT_LINE 0x00020\n#define WUFFS_BASE__TOKEN__VBD__FILLER__COMMENT_BLOCK 0x00040\n\n// Bits 0x2, 0x4 and 0x8 are reserved for flags that are common between\n// VBD_FILLER, VBD_STRING and VBD_BYTES.\n#define WUFFS_BASE__TOKEN__VBD__STRING__INCOMPLETE 0x00001\n#define WUFFS_BASE__TOKEN__VBD__STRING__ALL_ASCII 0x00010\n\n// Bits 0x2, 0x4 and 0x8 are reserved for flags that are common between\n// VBD_FILLER, VBD_STRING and VBD_BYTES.\n#define WUFFS_BASE__TOKEN__VBD__BYTES__INCOMPLETE 0x00001\n// \"D_DST_S_SRC\" means that it takes S source bytes (possibly padded) to\n// produce D destination bytes. For example,\n// WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_4_SRC_BACKSLASH" +
|
||||
"_X means that the source\n// looks like \"\\\\x23\\\\x67\\\\xAB\", where 12 src bytes encode 3 dst bytes.\n#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_1_SRC_RAW 0x00010\n#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_2_SRC_HEX 0x00020\n#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_4_SRC_BACKSLASH_X 0x00040\n#define WUFFS_BASE__TOKEN__VBD__BYTES__1_DST_6_SRC_BACKSLASH_U 0x00080\n#define WUFFS_BASE__TOKEN__VBD__BYTES__3_DST_4_SRC_BASE_64_STD 0x00100\n#define WUFFS_BASE__TOKEN__VBD__BYTES__3_DST_4_SRC_BASE_64_URL 0x00200\n#define WUFFS_BASE__TOKEN__VBD__BYTES__4_DST_5_SRC_ASCII_85 0x00400\n\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__PUSH 0x00001\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__POP 0x00002\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_NONE 0x00010\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_LIST 0x00020\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__FROM_DICT 0x00040\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_NONE 0x01000\n#define WUFFS_BASE__TOKEN__VBD__STRUCTURE__TO_LIST 0x02000\n#define WUFFS_BASE__TOKEN__VBD__STRU" +
|
||||
"CTURE__TO_DICT 0x04000\n\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL 0x00001\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__UNDEFINED 0x00101\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__NULL 0x00201\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__FALSE 0x00401\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__LITERAL__TRUE 0x00801\n// For a source string of \"123\" or \"0x9A\", it is valid for a tokenizer to\n// return any one of:\n// - WUFFS_BASE__TOKEN__VBD__NUMBER__FLOATING_POINT.\n// - WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_SIGNED.\n// - WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_UNSIGNED.\n//\n// For a source string of \"+123\" or \"-0x9A\", only the first two are valid.\n//\n// For a source string of \"123.\", only the first one is valid.\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__FLOATING_POINT 0x00002\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_SIGNED 0x00004\n#define WUFFS_BASE__TOKEN__VBD__NUMBER__INTEGER_UNSIGNED 0x00008\n\n#define WUFFS_BASE__TOKEN__VBD__UNICODE_CODE_POINT__MAX_INCL 0x10FFFF\n\nstatic inline uint64_t " +
|
||||
" //\nwuffs_base__token__value(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_major(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_MAJOR__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_MAJOR__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_minor(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_MINOR__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_MINOR__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_base_category(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_BASE_CATEGORY__MASK;\n}\n\nstatic inline uint64_t //\nwuffs_base__token__value_base_detail(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__SHIFT) &\n WUFFS_BASE__TOKEN__VALUE_BASE_DETAIL__MASK;\n}\n\nstatic inline uint64_t " +
|
||||
" //\nwuffs_base__token__length(const wuffs_base__token* t) {\n return (t->repr >> WUFFS_BASE__TOKEN__LENGTH__SHIFT) &\n WUFFS_BASE__TOKEN__LENGTH__MASK;\n}\n\n#ifdef __cplusplus\n\ninline uint64_t //\nwuffs_base__token::value() const {\n return wuffs_base__token__value(this);\n}\n\ninline uint64_t //\nwuffs_base__token::value_major() const {\n return wuffs_base__token__value_major(this);\n}\n\ninline uint64_t //\nwuffs_base__token::value_minor() const {\n return wuffs_base__token__value_minor(this);\n}\n\ninline uint64_t //\nwuffs_base__token::value_base_category() const {\n return wuffs_base__token__value_base_category(this);\n}\n\ninline uint64_t //\nwuffs_base__token::value_base_detail() const {\n return wuffs_base__token__value_base_detail(this);\n}\n\ninline uint64_t //\nwuffs_base__token::length() const {\n return wuffs_base__token__length(this);\n}\n\n#endif // __cplusplus\n\n" +
|
||||
"" +
|
||||
"// --------\n\ntypedef WUFFS_BASE__SLICE(wuffs_base__token) wuffs_base__slice_token;\n\nstatic inline wuffs_base__slice_token //\nwuffs_base__make_slice_token(wuffs_base__token* ptr, size_t len) {\n wuffs_base__slice_token ret;\n ret.ptr = ptr;\n ret.len = len;\n return ret;\n}\n\n" +
|
||||
"" +
|
||||
|
||||
Reference in new issue
Block a user