summaryrefslogtreecommitdiff
path: root/identifiers.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-04-23 15:58:51 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-04-23 15:58:51 -0400
commit9db4ea5189f6f1a8b264c9948090c822f5e008b1 (patch)
treeba181369ebff8160bf8b3c8dba4236c02bc6e1e5 /identifiers.c
parentdf03769e7bad52137bfe685035e2e4ece2bcd044 (diff)
made EXPR_IDENT a string before typing
Diffstat (limited to 'identifiers.c')
-rw-r--r--identifiers.c5
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);