frontend: Allow names to have hyphens ('-')
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user