diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-06-24 06:07:52 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-06-24 06:07:52 +0200 |
commit | 509d79a8d6decea32ad85fcf42b42bb1bbb8decf (patch) | |
tree | 62a3b9f7ec494a6f11a0473e3db0ef6ed80bb974 /src | |
parent | daa5602d2563d9c8f0b9c7685be70525e58ef682 (diff) |
Warn for unexpected runes
Diffstat (limited to 'src')
-rw-r--r-- | src/lexer.c | 2 | ||||
-rw-r--r-- | src/types.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lexer.c b/src/lexer.c index a613585..21f33e5 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -124,7 +124,7 @@ lexstring(const uchar *code, size_t codesz) default: fallback: if (!rune_is_xids(ch)) - continue; + err("lexer: Unexpected rune U+%04" PRIXRUNE, ch); data.kinds[data.len] = LEXIDENT; data.strs[data.len].p = spnbeg; diff --git a/src/types.h b/src/types.h index 5727e62..ef4ea4a 100644 --- a/src/types.h +++ b/src/types.h @@ -1,12 +1,13 @@ #ifndef ORYX_TYPES_H #define ORYX_TYPES_H -#include <stdint.h> +#include <inttypes.h> typedef uint32_t idx_t; typedef uint32_t rune; typedef unsigned char uchar; #define RUNE_C(x) UINT32_C(x) +#define PRIXRUNE PRIX32 #endif /* !ORYX_TYPES_H */ |