From 9db4ea5189f6f1a8b264c9948090c822f5e008b1 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Thu, 23 Apr 2020 15:58:51 -0400 Subject: made EXPR_IDENT a string before typing --- identifiers.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'identifiers.c') diff --git a/identifiers.c b/identifiers.c index 2daa112..0f5d59a 100644 --- a/identifiers.c +++ b/identifiers.c @@ -55,6 +55,11 @@ static inline bool ident_eq_str(Identifier i, const char *s) { return ident_str_eq_str(i->str, s); } +static inline bool ident_eq_string(Identifier i, String s) { + if (i->len != s.len) return false; + if (memcmp(i->str, s.str, s.len) != 0) return false; + return true; +} static inline Identifier ident_insert_with_len(Identifiers *ids, char *s, size_t len) { IdentSlot *slot = (IdentSlot *)str_hash_table_insert_(&ids->table, s, len); -- cgit v1.2.3