frontend: Allow names to have hyphens ('-')

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-03-25 19:51:07 -04:00
parent 08f07e474e
commit 22c049078d

View File

@@ -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;