diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-04-23 15:58:51 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-04-23 15:58:51 -0400 |
commit | 9db4ea5189f6f1a8b264c9948090c822f5e008b1 (patch) | |
tree | ba181369ebff8160bf8b3c8dba4236c02bc6e1e5 /identifiers.c | |
parent | df03769e7bad52137bfe685035e2e4ece2bcd044 (diff) |
made EXPR_IDENT a string before typing
Diffstat (limited to 'identifiers.c')
-rw-r--r-- | identifiers.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |