aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-24 06:07:52 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-24 06:07:52 +0200
commit509d79a8d6decea32ad85fcf42b42bb1bbb8decf (patch)
tree62a3b9f7ec494a6f11a0473e3db0ef6ed80bb974
parentdaa5602d2563d9c8f0b9c7685be70525e58ef682 (diff)
Warn for unexpected runes
-rw-r--r--src/lexer.c2
-rw-r--r--src/types.h3
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 */