From 22c049078d4bc80d29ed241d18fedd32e92cf6d0 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 25 Mar 2026 19:51:07 -0400 Subject: [PATCH] frontend: Allow names to have hyphens ('-') Signed-off-by: Ian Moffett --- frontend/lexer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/lexer.c b/frontend/lexer.c index 63bcffe..2cadfbf 100644 --- a/frontend/lexer.c +++ b/frontend/lexer.c @@ -167,7 +167,7 @@ lexer_scan_name(struct quip_state *state, int lc, struct token *tokres) return -1; } - if (!isalpha(lc) && lc != '_') { + if (!isalpha(lc) && lc != '_' && lc != '-') { return -1; } @@ -180,7 +180,7 @@ lexer_scan_name(struct quip_state *state, int lc, struct token *tokres) buf[bufsz++] = lc; for (;;) { c = lexer_consume(state, false); - if (!isalnum(c) && c != '_') { + if (!isalnum(c) && c != '_' && c != '-') { buf[bufsz] = '\0'; lexer_putback(state, c); break;